Lines Matching refs:dlm
185 struct vsp1_dl_manager *dlm; member
534 struct vsp1_dl_manager *dlm = dl->dlm; in vsp1_dl_get_pre_cmd() local
539 dl->pre_cmd = vsp1_dl_ext_cmd_get(dlm->cmdpool); in vsp1_dl_get_pre_cmd()
548 static struct vsp1_dl_list *vsp1_dl_list_alloc(struct vsp1_dl_manager *dlm) in vsp1_dl_list_alloc() argument
558 dl->dlm = dlm; in vsp1_dl_list_alloc()
561 dl->body0 = vsp1_dl_body_get(dlm->pool); in vsp1_dl_list_alloc()
604 struct vsp1_dl_list *vsp1_dl_list_get(struct vsp1_dl_manager *dlm) in vsp1_dl_list_get() argument
609 spin_lock_irqsave(&dlm->lock, flags); in vsp1_dl_list_get()
611 if (!list_empty(&dlm->free)) { in vsp1_dl_list_get()
612 dl = list_first_entry(&dlm->free, struct vsp1_dl_list, list); in vsp1_dl_list_get()
622 spin_unlock_irqrestore(&dlm->lock, flags); in vsp1_dl_list_get()
660 list_add_tail(&dl->list, &dl->dlm->free); in __vsp1_dl_list_put()
679 spin_lock_irqsave(&dl->dlm->lock, flags); in vsp1_dl_list_put()
681 spin_unlock_irqrestore(&dl->dlm->lock, flags); in vsp1_dl_list_put()
753 struct vsp1_dl_manager *dlm = dl->dlm; in vsp1_dl_list_fill_header() local
786 if (!dlm->singleshot || is_last) in vsp1_dl_list_fill_header()
795 if (!dlm->singleshot || !is_last) in vsp1_dl_list_fill_header()
806 } else if (!dlm->singleshot) { in vsp1_dl_list_fill_header()
837 static bool vsp1_dl_list_hw_update_pending(struct vsp1_dl_manager *dlm) in vsp1_dl_list_hw_update_pending() argument
839 struct vsp1_device *vsp1 = dlm->vsp1; in vsp1_dl_list_hw_update_pending()
841 if (!dlm->queued) in vsp1_dl_list_hw_update_pending()
848 return !!(vsp1_read(vsp1, VI6_CMD(dlm->index)) & VI6_CMD_UPDHDR); in vsp1_dl_list_hw_update_pending()
853 struct vsp1_dl_manager *dlm = dl->dlm; in vsp1_dl_list_hw_enqueue() local
854 struct vsp1_device *vsp1 = dlm->vsp1; in vsp1_dl_list_hw_enqueue()
863 vsp1_write(vsp1, VI6_DL_HDR_ADDR(dlm->index), dl->dma); in vsp1_dl_list_hw_enqueue()
868 struct vsp1_dl_manager *dlm = dl->dlm; in vsp1_dl_list_commit_continuous() local
885 if (vsp1_dl_list_hw_update_pending(dlm)) { in vsp1_dl_list_commit_continuous()
886 WARN_ON(dlm->pending && in vsp1_dl_list_commit_continuous()
887 (dlm->pending->flags & VSP1_DL_FRAME_END_INTERNAL)); in vsp1_dl_list_commit_continuous()
888 __vsp1_dl_list_put(dlm->pending); in vsp1_dl_list_commit_continuous()
889 dlm->pending = dl; in vsp1_dl_list_commit_continuous()
899 __vsp1_dl_list_put(dlm->queued); in vsp1_dl_list_commit_continuous()
900 dlm->queued = dl; in vsp1_dl_list_commit_continuous()
905 struct vsp1_dl_manager *dlm = dl->dlm; in vsp1_dl_list_commit_singleshot() local
914 dlm->active = dl; in vsp1_dl_list_commit_singleshot()
919 struct vsp1_dl_manager *dlm = dl->dlm; in vsp1_dl_list_commit() local
934 spin_lock_irqsave(&dlm->lock, flags); in vsp1_dl_list_commit()
936 if (dlm->singleshot) in vsp1_dl_list_commit()
941 spin_unlock_irqrestore(&dlm->lock, flags); in vsp1_dl_list_commit()
969 unsigned int vsp1_dlm_irq_frame_end(struct vsp1_dl_manager *dlm) in vsp1_dlm_irq_frame_end() argument
971 struct vsp1_device *vsp1 = dlm->vsp1; in vsp1_dlm_irq_frame_end()
975 spin_lock(&dlm->lock); in vsp1_dlm_irq_frame_end()
981 if (dlm->singleshot) { in vsp1_dlm_irq_frame_end()
982 __vsp1_dl_list_put(dlm->active); in vsp1_dlm_irq_frame_end()
983 dlm->active = NULL; in vsp1_dlm_irq_frame_end()
994 if (vsp1_dl_list_hw_update_pending(dlm)) in vsp1_dlm_irq_frame_end()
1002 if (status & VI6_STATUS_FLD_STD(dlm->index)) in vsp1_dlm_irq_frame_end()
1011 if (dlm->active && (dlm->active->flags & VSP1_DL_FRAME_END_WRITEBACK)) { in vsp1_dlm_irq_frame_end()
1013 dlm->active->flags &= ~VSP1_DL_FRAME_END_WRITEBACK; in vsp1_dlm_irq_frame_end()
1020 if (dlm->queued) { in vsp1_dlm_irq_frame_end()
1021 if (dlm->queued->flags & VSP1_DL_FRAME_END_INTERNAL) in vsp1_dlm_irq_frame_end()
1023 dlm->queued->flags &= ~VSP1_DL_FRAME_END_INTERNAL; in vsp1_dlm_irq_frame_end()
1025 __vsp1_dl_list_put(dlm->active); in vsp1_dlm_irq_frame_end()
1026 dlm->active = dlm->queued; in vsp1_dlm_irq_frame_end()
1027 dlm->queued = NULL; in vsp1_dlm_irq_frame_end()
1036 if (dlm->pending) { in vsp1_dlm_irq_frame_end()
1037 vsp1_dl_list_hw_enqueue(dlm->pending); in vsp1_dlm_irq_frame_end()
1038 dlm->queued = dlm->pending; in vsp1_dlm_irq_frame_end()
1039 dlm->pending = NULL; in vsp1_dlm_irq_frame_end()
1043 spin_unlock(&dlm->lock); in vsp1_dlm_irq_frame_end()
1067 void vsp1_dlm_reset(struct vsp1_dl_manager *dlm) in vsp1_dlm_reset() argument
1071 spin_lock_irqsave(&dlm->lock, flags); in vsp1_dlm_reset()
1073 __vsp1_dl_list_put(dlm->active); in vsp1_dlm_reset()
1074 __vsp1_dl_list_put(dlm->queued); in vsp1_dlm_reset()
1075 __vsp1_dl_list_put(dlm->pending); in vsp1_dlm_reset()
1077 spin_unlock_irqrestore(&dlm->lock, flags); in vsp1_dlm_reset()
1079 dlm->active = NULL; in vsp1_dlm_reset()
1080 dlm->queued = NULL; in vsp1_dlm_reset()
1081 dlm->pending = NULL; in vsp1_dlm_reset()
1084 struct vsp1_dl_body *vsp1_dlm_dl_body_get(struct vsp1_dl_manager *dlm) in vsp1_dlm_dl_body_get() argument
1086 return vsp1_dl_body_get(dlm->pool); in vsp1_dlm_dl_body_get()
1093 struct vsp1_dl_manager *dlm; in vsp1_dlm_create() local
1097 dlm = devm_kzalloc(vsp1->dev, sizeof(*dlm), GFP_KERNEL); in vsp1_dlm_create()
1098 if (!dlm) in vsp1_dlm_create()
1101 dlm->index = index; in vsp1_dlm_create()
1102 dlm->singleshot = vsp1->info->uapi; in vsp1_dlm_create()
1103 dlm->vsp1 = vsp1; in vsp1_dlm_create()
1105 spin_lock_init(&dlm->lock); in vsp1_dlm_create()
1106 INIT_LIST_HEAD(&dlm->free); in vsp1_dlm_create()
1121 dlm->pool = vsp1_dl_body_pool_create(vsp1, prealloc + 1, in vsp1_dlm_create()
1123 if (!dlm->pool) in vsp1_dlm_create()
1129 dl = vsp1_dl_list_alloc(dlm); in vsp1_dlm_create()
1131 vsp1_dlm_destroy(dlm); in vsp1_dlm_create()
1140 list_add_tail(&dl->list, &dlm->free); in vsp1_dlm_create()
1144 dlm->cmdpool = vsp1_dl_cmd_pool_create(vsp1, in vsp1_dlm_create()
1146 if (!dlm->cmdpool) { in vsp1_dlm_create()
1147 vsp1_dlm_destroy(dlm); in vsp1_dlm_create()
1152 return dlm; in vsp1_dlm_create()
1155 void vsp1_dlm_destroy(struct vsp1_dl_manager *dlm) in vsp1_dlm_destroy() argument
1159 if (!dlm) in vsp1_dlm_destroy()
1162 list_for_each_entry_safe(dl, next, &dlm->free, list) { in vsp1_dlm_destroy()
1167 vsp1_dl_body_pool_destroy(dlm->pool); in vsp1_dlm_destroy()
1168 vsp1_dl_ext_cmd_pool_destroy(dlm->cmdpool); in vsp1_dlm_destroy()