[Mesa-dev] [PATCH 06/13] i915g: kill idws->pool

Daniel Vetter daniel.vetter at ffwll.ch
Fri Nov 19 14:38:23 PST 2010


The drm winsys only ever handles one gem memory manager. Rip out
the unnecessary complication.
---
 src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c |    2 +-
 src/gallium/winsys/i915/drm/i915_drm_buffer.c      |    9 ++-------
 src/gallium/winsys/i915/drm/i915_drm_winsys.c      |    6 +++---
 src/gallium/winsys/i915/drm/i915_drm_winsys.h      |    4 +---
 4 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
index e50e780..c6daa52 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
@@ -41,7 +41,7 @@ i915_drm_batchbuffer_reset(struct i915_drm_batchbuffer *batch)
 
    if (batch->bo)
       drm_intel_bo_unreference(batch->bo);
-   batch->bo = drm_intel_bo_alloc(idws->pools.gem,
+   batch->bo = drm_intel_bo_alloc(idws->gem_manager,
                                   "gallium3d_batchbuffer",
                                   batch->actual_size,
                                   4096);
diff --git a/src/gallium/winsys/i915/drm/i915_drm_buffer.c b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
index b9fd436..15ec448 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_buffer.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_buffer.c
@@ -12,7 +12,6 @@ i915_drm_buffer_create(struct i915_winsys *iws,
 {
    struct i915_drm_buffer *buf = CALLOC_STRUCT(i915_drm_buffer);
    struct i915_drm_winsys *idws = i915_drm_winsys(iws);
-   drm_intel_bufmgr *pool;
    char *name;
 
    if (!buf)
@@ -24,20 +23,16 @@ i915_drm_buffer_create(struct i915_winsys *iws,
 
    if (type == I915_NEW_TEXTURE) {
       name = "gallium3d_texture";
-      pool = idws->pools.gem;
    } else if (type == I915_NEW_VERTEX) {
       name = "gallium3d_vertex";
-      pool = idws->pools.gem;
    } else if (type == I915_NEW_SCANOUT) {
       name = "gallium3d_scanout";
-      pool = idws->pools.gem;
    } else {
       assert(0);
       name = "gallium3d_unknown";
-      pool = idws->pools.gem;
    }
 
-   buf->bo = drm_intel_bo_alloc(pool, name, size, alignment);
+   buf->bo = drm_intel_bo_alloc(idws->gem_manager, name, size, alignment);
 
    if (!buf->bo)
       goto err;
@@ -63,7 +58,7 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
       return NULL;
 
    buf->magic = 0xDEAD1337;
-   buf->bo = drm_intel_bo_gem_create_from_name(idws->pools.gem, "gallium3d_from_handle", whandle->handle);
+   buf->bo = drm_intel_bo_gem_create_from_name(idws->gem_manager, "gallium3d_from_handle", whandle->handle);
    buf->flinked = TRUE;
    buf->flink = whandle->handle;
 
diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.c b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
index 179a84a..cc0b6a9 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_winsys.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
@@ -40,7 +40,7 @@ i915_drm_winsys_destroy(struct i915_winsys *iws)
 {
    struct i915_drm_winsys *idws = i915_drm_winsys(iws);
 
-   drm_intel_bufmgr_destroy(idws->pools.gem);
+   drm_intel_bufmgr_destroy(idws->gem_manager);
 
    FREE(idws);
 }
@@ -67,8 +67,8 @@ i915_drm_winsys_create(int drmFD)
 
    idws->base.destroy = i915_drm_winsys_destroy;
 
-   idws->pools.gem = drm_intel_bufmgr_gem_init(idws->fd, idws->max_batch_size);
-   drm_intel_bufmgr_gem_enable_reuse(idws->pools.gem);
+   idws->gem_manager = drm_intel_bufmgr_gem_init(idws->fd, idws->max_batch_size);
+   drm_intel_bufmgr_gem_enable_reuse(idws->gem_manager);
 
    idws->dump_cmd = debug_get_bool_option("I915_DUMP_CMD", FALSE);
    idws->send_cmd = !debug_get_bool_option("I915_NO_HW", FALSE);
diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.h b/src/gallium/winsys/i915/drm/i915_drm_winsys.h
index 496c88d..0d74d02 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_winsys.h
+++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.h
@@ -24,9 +24,7 @@ struct i915_drm_winsys
 
    size_t max_batch_size;
 
-   struct {
-      drm_intel_bufmgr *gem;
-   } pools;
+   drm_intel_bufmgr *gem_manager;
 };
 
 static INLINE struct i915_drm_winsys *
-- 
1.7.1



More information about the mesa-dev mailing list