[Mesa-dev] [PATCH 06/10] gbm_drm: Keep a reference to drm native objects

Ander Conselvan de Oliveira conselvan2 at gmail.com
Fri Apr 4 01:36:24 PDT 2014


From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>

Add bo and bufmgr fields to gbm_drm_bo and gbm_drm_device respectively.
---
 src/gbm/backends/intel/gbm_intel.c | 4 ++++
 src/gbm/main/common_drm.h          | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/src/gbm/backends/intel/gbm_intel.c b/src/gbm/backends/intel/gbm_intel.c
index 2e7ced3..2c5336d 100644
--- a/src/gbm/backends/intel/gbm_intel.c
+++ b/src/gbm/backends/intel/gbm_intel.c
@@ -113,6 +113,8 @@ gbm_intel_bo_create_with_bo(struct gbm_device *gbm,
    ibo->base.base.format = format;
    ibo->base.base.handle.s32 = ibo->bo->handle;
 
+   ibo->base.bo = bo;
+
    return ibo;
 }
 
@@ -249,6 +251,8 @@ gbm_intel_device_create(int fd)
       return NULL;
    }
 
+   igbm->base.bufmgr = igbm->bufmgr;
+
    return &igbm->base.base;
 }
 
diff --git a/src/gbm/main/common_drm.h b/src/gbm/main/common_drm.h
index 9fa0716..c49a6f9 100644
--- a/src/gbm/main/common_drm.h
+++ b/src/gbm/main/common_drm.h
@@ -40,10 +40,16 @@ struct gbm_drm_device {
    struct gbm_device base;
    enum gbm_drm_driver_type type;
    char *driver_name;
+
+   /* Driver dependent buffer manager object */
+   void *bufmgr;
 };
 
 struct gbm_drm_bo {
    struct gbm_bo base;
+
+   /* Driver dependent buffer object */
+   void *bo;
 };
 
 #endif
-- 
1.8.3.2



More information about the mesa-dev mailing list