Lines Matching refs:dlm
172 * @dlm: the display list manager
187 struct vsp1_dl_manager *dlm;
541 struct vsp1_dl_manager *dlm = dl->dlm;
546 dl->pre_cmd = vsp1_dl_ext_cmd_get(dlm->cmdpool);
555 static struct vsp1_dl_list *vsp1_dl_list_alloc(struct vsp1_dl_manager *dlm)
565 dl->dlm = dlm;
568 dl->body0 = vsp1_dl_body_get(dlm->pool);
605 * @dlm: The display list manager
611 struct vsp1_dl_list *vsp1_dl_list_get(struct vsp1_dl_manager *dlm)
616 lockdep_assert_not_held(&dlm->lock);
618 spin_lock_irqsave(&dlm->lock, flags);
620 if (!list_empty(&dlm->free)) {
621 dl = list_first_entry(&dlm->free, struct vsp1_dl_list, list);
632 spin_unlock_irqrestore(&dlm->lock, flags);
645 lockdep_assert_held(&dl->dlm->lock);
679 list_add_tail(&dl->list, &dl->dlm->free);
698 spin_lock_irqsave(&dl->dlm->lock, flags);
700 spin_unlock_irqrestore(&dl->dlm->lock, flags);
772 struct vsp1_dl_manager *dlm = dl->dlm;
805 if (!dlm->singleshot || is_last)
814 if (!dlm->singleshot || !is_last)
825 } else if (!dlm->singleshot) {
856 static bool vsp1_dl_list_hw_update_pending(struct vsp1_dl_manager *dlm)
858 struct vsp1_device *vsp1 = dlm->vsp1;
860 if (!dlm->queued)
867 return !!(vsp1_read(vsp1, VI6_CMD(dlm->index)) & VI6_CMD_UPDHDR);
872 struct vsp1_dl_manager *dlm = dl->dlm;
873 struct vsp1_device *vsp1 = dlm->vsp1;
882 vsp1_write(vsp1, VI6_DL_HDR_ADDR(dlm->index), dl->dma);
887 struct vsp1_dl_manager *dlm = dl->dlm;
904 if (vsp1_dl_list_hw_update_pending(dlm)) {
905 WARN_ON(dlm->pending &&
906 (dlm->pending->flags & VSP1_DL_FRAME_END_INTERNAL));
907 __vsp1_dl_list_put(dlm->pending);
908 dlm->pending = dl;
918 __vsp1_dl_list_put(dlm->queued);
919 dlm->queued = dl;
924 struct vsp1_dl_manager *dlm = dl->dlm;
933 dlm->active = dl;
938 struct vsp1_dl_manager *dlm = dl->dlm;
953 spin_lock_irqsave(&dlm->lock, flags);
955 if (dlm->singleshot)
960 spin_unlock_irqrestore(&dlm->lock, flags);
969 * @dlm: the display list manager
988 unsigned int vsp1_dlm_irq_frame_end(struct vsp1_dl_manager *dlm)
990 struct vsp1_device *vsp1 = dlm->vsp1;
994 spin_lock(&dlm->lock);
1000 if (dlm->singleshot) {
1001 __vsp1_dl_list_put(dlm->active);
1002 dlm->active = NULL;
1013 if (vsp1_dl_list_hw_update_pending(dlm))
1021 if (status & VI6_STATUS_FLD_STD(dlm->index))
1030 if (dlm->active && (dlm->active->flags & VSP1_DL_FRAME_END_WRITEBACK)) {
1032 dlm->active->flags &= ~VSP1_DL_FRAME_END_WRITEBACK;
1039 if (dlm->queued) {
1040 if (dlm->queued->flags & VSP1_DL_FRAME_END_INTERNAL)
1042 dlm->queued->flags &= ~VSP1_DL_FRAME_END_INTERNAL;
1044 __vsp1_dl_list_put(dlm->active);
1045 dlm->active = dlm->queued;
1046 dlm->queued = NULL;
1055 if (dlm->pending) {
1056 vsp1_dl_list_hw_enqueue(dlm->pending);
1057 dlm->queued = dlm->pending;
1058 dlm->pending = NULL;
1062 spin_unlock(&dlm->lock);
1086 void vsp1_dlm_reset(struct vsp1_dl_manager *dlm)
1091 spin_lock_irqsave(&dlm->lock, flags);
1093 __vsp1_dl_list_put(dlm->active);
1094 __vsp1_dl_list_put(dlm->queued);
1095 __vsp1_dl_list_put(dlm->pending);
1097 list_count = list_count_nodes(&dlm->free);
1098 spin_unlock_irqrestore(&dlm->lock, flags);
1100 WARN_ON_ONCE(list_count != dlm->list_count);
1102 dlm->active = NULL;
1103 dlm->queued = NULL;
1104 dlm->pending = NULL;
1107 struct vsp1_dl_body *vsp1_dlm_dl_body_get(struct vsp1_dl_manager *dlm)
1109 return vsp1_dl_body_get(dlm->pool);
1116 struct vsp1_dl_manager *dlm;
1120 dlm = devm_kzalloc(vsp1->dev, sizeof(*dlm), GFP_KERNEL);
1121 if (!dlm)
1124 dlm->index = index;
1130 dlm->singleshot = vsp1->info->uapi || vsp1->iif;
1131 dlm->vsp1 = vsp1;
1133 spin_lock_init(&dlm->lock);
1134 INIT_LIST_HEAD(&dlm->free);
1149 dlm->pool = vsp1_dl_body_pool_create(vsp1, prealloc + 1,
1151 if (!dlm->pool)
1157 dl = vsp1_dl_list_alloc(dlm);
1159 vsp1_dlm_destroy(dlm);
1168 list_add_tail(&dl->list, &dlm->free);
1171 dlm->list_count = prealloc;
1174 dlm->cmdpool = vsp1_dl_cmd_pool_create(vsp1,
1176 if (!dlm->cmdpool) {
1177 vsp1_dlm_destroy(dlm);
1182 return dlm;
1185 void vsp1_dlm_destroy(struct vsp1_dl_manager *dlm)
1189 if (!dlm)
1192 list_for_each_entry_safe(dl, next, &dlm->free, list) {
1197 vsp1_dl_body_pool_destroy(dlm->pool);
1198 vsp1_dl_ext_cmd_pool_destroy(dlm->cmdpool);