[PATCH drm 3/6] drm: add fence context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: agoins <agoins@xxxxxxxxxx>

Adds new struct drm_prime_fence_ctx as field of drm_prime_member, and
initializes it when member is created. Used for keeping track of context id
and seqno of fences to be generated by PRIME.

Signed-off-by: Alex Goins <agoins@xxxxxxxxxx>
---
 drivers/gpu/drm/drm_prime.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index e2e86de..2956a65 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -28,6 +28,7 @@
 
 #include <linux/export.h>
 #include <linux/dma-buf.h>
+#include <linux/reservation.h>
 #include <drm/drmP.h>
 #include <drm/drm_gem.h>
 
@@ -60,8 +61,14 @@
  * use the drm_gem_prime_{import,export} helpers.
  */
 
+struct drm_prime_fence_ctx {
+	uint32_t context;
+	uint32_t seqno;
+};
+
 struct drm_prime_member {
 	struct list_head entry;
+	struct drm_prime_fence_ctx fctx;
 	struct dma_buf *dma_buf;
 	uint32_t handle;
 };
@@ -83,6 +90,11 @@ static int drm_prime_add_buf_handle(struct drm_prime_file_private *prime_fpriv,
 	get_dma_buf(dma_buf);
 	member->dma_buf = dma_buf;
 	member->handle = handle;
+
+	/* Initialize fence context for PRIME flipping */
+	member->fctx.context = fence_context_alloc(1);
+	member->fctx.seqno = 0;
+
 	list_add(&member->entry, &prime_fpriv->head);
 	return 0;
 }
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux