[PATCH RFC 031/111] staging: etnaviv: add gem operations structure to etnaviv objects

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

 



From: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>

Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
---
 drivers/staging/etnaviv/etnaviv_gem.c | 4 +++-
 drivers/staging/etnaviv/etnaviv_gem.h | 7 +++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/etnaviv/etnaviv_gem.c b/drivers/staging/etnaviv/etnaviv_gem.c
index 9e3cd61507d1..eface33ad445 100644
--- a/drivers/staging/etnaviv/etnaviv_gem.c
+++ b/drivers/staging/etnaviv/etnaviv_gem.c
@@ -536,7 +536,9 @@ static void etnaviv_free_obj(struct drm_gem_object *obj)
 
 	drm_gem_free_mmap_offset(obj);
 
-	if (obj->import_attach) {
+	if (etnaviv_obj->ops) {
+		etnaviv_obj->ops->release(etnaviv_obj);
+	} else if (obj->import_attach) {
 		if (etnaviv_obj->vaddr)
 			dma_buf_vunmap(obj->import_attach->dmabuf,
 				       etnaviv_obj->vaddr);
diff --git a/drivers/staging/etnaviv/etnaviv_gem.h b/drivers/staging/etnaviv/etnaviv_gem.h
index 97302ca6efaa..676cbd46c600 100644
--- a/drivers/staging/etnaviv/etnaviv_gem.h
+++ b/drivers/staging/etnaviv/etnaviv_gem.h
@@ -21,8 +21,11 @@
 #include <linux/reservation.h>
 #include "etnaviv_drv.h"
 
+struct etnaviv_gem_ops;
+
 struct etnaviv_gem_object {
 	struct drm_gem_object base;
+	const struct etnaviv_gem_ops *ops;
 
 	uint32_t flags;
 
@@ -64,6 +67,10 @@ struct etnaviv_gem_object {
 };
 #define to_etnaviv_bo(x) container_of(x, struct etnaviv_gem_object, base)
 
+struct etnaviv_gem_ops {
+	void (*release)(struct etnaviv_gem_object *);
+};
+
 static inline bool is_active(struct etnaviv_gem_object *etnaviv_obj)
 {
 	return etnaviv_obj->gpu != NULL;
-- 
2.1.4

_______________________________________________
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