[media] v4l: vsp1: Split display list manager from display list
[deliverable/linux.git] / drivers / media / platform / vsp1 / vsp1_dl.h
index f4116ca59c28d41faf81016421b3a01ea49999ed..caa6a85f68258cd675b7989a55e12e8d098fe28d 100644 (file)
 #include <linux/types.h>
 
 struct vsp1_device;
-struct vsp1_dl;
+struct vsp1_dl_list;
 
-struct vsp1_dl *vsp1_dl_create(struct vsp1_device *vsp1);
-void vsp1_dl_destroy(struct vsp1_dl *dl);
+/**
+ * struct vsp1_dl_manager - Display List manager
+ * @vsp1: the VSP1 device
+ * @lock: protects the active, queued and pending lists
+ * @free: array of all free display lists
+ * @active: list currently being processed (loaded) by hardware
+ * @queued: list queued to the hardware (written to the DL registers)
+ * @pending: list waiting to be queued to the hardware
+ */
+struct vsp1_dl_manager {
+       struct vsp1_device *vsp1;
+
+       spinlock_t lock;
+       struct list_head free;
+       struct vsp1_dl_list *active;
+       struct vsp1_dl_list *queued;
+       struct vsp1_dl_list *pending;
+};
 
-void vsp1_dl_setup(struct vsp1_device *vsp1);
+void vsp1_dlm_setup(struct vsp1_device *vsp1);
 
-void vsp1_dl_reset(struct vsp1_dl *dl);
-void vsp1_dl_begin(struct vsp1_dl *dl);
-void vsp1_dl_add(struct vsp1_dl *dl, u32 reg, u32 data);
-void vsp1_dl_commit(struct vsp1_dl *dl);
+int vsp1_dlm_init(struct vsp1_device *vsp1, struct vsp1_dl_manager *dlm,
+                 unsigned int prealloc);
+void vsp1_dlm_cleanup(struct vsp1_dl_manager *dlm);
+void vsp1_dlm_reset(struct vsp1_dl_manager *dlm);
+void vsp1_dlm_irq_display_start(struct vsp1_dl_manager *dlm);
+void vsp1_dlm_irq_frame_end(struct vsp1_dl_manager *dlm);
 
-void vsp1_dl_irq_display_start(struct vsp1_dl *dl);
-void vsp1_dl_irq_frame_end(struct vsp1_dl *dl);
+struct vsp1_dl_list *vsp1_dl_list_get(struct vsp1_dl_manager *dlm);
+void vsp1_dl_list_put(struct vsp1_dl_list *dl);
+void vsp1_dl_list_write(struct vsp1_dl_list *dl, u32 reg, u32 data);
+void vsp1_dl_list_commit(struct vsp1_dl_list *dl);
 
 #endif /* __VSP1_DL_H__ */
This page took 0.036662 seconds and 5 git commands to generate.