i915g: kill idws->pool
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Nov 2010 22:38:23 +0000 (23:38 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Sun, 21 Nov 2010 15:41:19 +0000 (16:41 +0100)
The drm winsys only ever handles one gem memory manager. Rip out
the unnecessary complication.

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
src/gallium/winsys/i915/drm/i915_drm_batchbuffer.c
src/gallium/winsys/i915/drm/i915_drm_buffer.c
src/gallium/winsys/i915/drm/i915_drm_winsys.c
src/gallium/winsys/i915/drm/i915_drm_winsys.h

index e50e7801c0a822c63bb995df2e9ba9f76201bbda..c6daa52a379e0bad756aae8ab2d109f619778853 100644 (file)
@@ -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);
index b9fd436ed29ee85bc4d31935142fa41c096be038..15ec4487457795a72c1ee11ac430c9979fe934c2 100644 (file)
@@ -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;
 
index 179a84a704b6788440b4cae253ed3952709f6bb8..cc0b6a99577220e49e9b0485f290dfc6c7caba50 100644 (file)
@@ -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);
index 496c88de5a98acbc59908c1e41d5f35a9a932cce..0d74d0270c7951b77370f3f3b744ae2d63eb078a 100644 (file)
@@ -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 *