drm: omapdrm: Implement asynchronous commit support
Implement a custom .atomic_commit() handler that supports asynchronous
commits using a work queue. This can be used for userspace-driven
asynchronous commits, as well as for an atomic page flip implementation.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 6448fa8..21c3929 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -23,6 +23,7 @@
#include <linux/module.h>
#include <linux/platform_data/omap_drm.h>
#include <linux/types.h>
+#include <linux/wait.h>
#include <video/omapdss.h>
#include <drm/drmP.h>
@@ -105,6 +106,13 @@
struct list_head irq_list; /* list of omap_drm_irq */
uint32_t vblank_mask; /* irq bits set for userspace vblank */
struct omap_drm_irq error_handler;
+
+ /* atomic commit */
+ struct {
+ wait_queue_head_t wait;
+ u32 pending;
+ spinlock_t lock; /* Protects commit.pending */
+ } commit;
};