[Mesa-dev] [PATCH 1/3] gallium: remove unused winsys pointers in pipe_screen and pipe_context

Marek Olšák maraeo at gmail.com
Thu Feb 16 17:24:29 PST 2012


A winsys is already a private object of a driver.
---
 src/gallium/drivers/galahad/glhd_context.c     |    1 -
 src/gallium/drivers/galahad/glhd_screen.c      |    2 --
 src/gallium/drivers/i915/i915_context.c        |    1 -
 src/gallium/drivers/i915/i915_screen.c         |    2 --
 src/gallium/drivers/identity/id_context.c      |    1 -
 src/gallium/drivers/identity/id_screen.c       |    2 --
 src/gallium/drivers/llvmpipe/lp_context.c      |    1 -
 src/gallium/drivers/noop/noop_pipe.c           |    2 --
 src/gallium/drivers/r300/r300_context.c        |    1 -
 src/gallium/drivers/r300/r300_screen.c         |    1 -
 src/gallium/drivers/r600/r600_pipe.c           |    2 --
 src/gallium/drivers/rbug/rbug_context.c        |    1 -
 src/gallium/drivers/rbug/rbug_screen.c         |    2 --
 src/gallium/drivers/softpipe/sp_context.c      |    1 -
 src/gallium/drivers/softpipe/sp_screen.c       |    1 -
 src/gallium/drivers/svga/svga_context.c        |    1 -
 src/gallium/drivers/trace/tr_context.c         |    1 -
 src/gallium/drivers/trace/tr_screen.c          |    9 ---------
 src/gallium/include/pipe/p_context.h           |    1 -
 src/gallium/include/pipe/p_screen.h            |    3 ---
 src/gallium/include/state_tracker/drm_driver.h |    1 -
 21 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c
index a4afa81..f710480 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -973,7 +973,6 @@ galahad_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
       return NULL;
    }
 
-   glhd_pipe->base.winsys = NULL;
    glhd_pipe->base.screen = _screen;
    glhd_pipe->base.priv = pipe->priv; /* expose wrapped data */
    glhd_pipe->base.draw = NULL;
diff --git a/src/gallium/drivers/galahad/glhd_screen.c b/src/gallium/drivers/galahad/glhd_screen.c
index 2fe82fe..49702b6 100644
--- a/src/gallium/drivers/galahad/glhd_screen.c
+++ b/src/gallium/drivers/galahad/glhd_screen.c
@@ -311,8 +311,6 @@ galahad_screen_create(struct pipe_screen *screen)
       return screen;
    }
 
-   glhd_screen->base.winsys = NULL;
-
    glhd_screen->base.destroy = galahad_screen_destroy;
    glhd_screen->base.get_name = galahad_screen_get_name;
    glhd_screen->base.get_vendor = galahad_screen_get_vendor;
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c
index 8197629..5e0ced2 100644
--- a/src/gallium/drivers/i915/i915_context.c
+++ b/src/gallium/drivers/i915/i915_context.c
@@ -143,7 +143,6 @@ i915_create_context(struct pipe_screen *screen, void *priv)
       return NULL;
 
    i915->iws = i915_screen(screen)->iws;
-   i915->base.winsys = NULL;
    i915->base.screen = screen;
    i915->base.priv = priv;
 
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index a37241f..61340f3 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -452,8 +452,6 @@ i915_screen_create(struct i915_winsys *iws)
 
    is->iws = iws;
 
-   is->base.winsys = NULL;
-
    is->base.destroy = i915_destroy_screen;
    is->base.flush_frontbuffer = i915_flush_frontbuffer;
 
diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c
index a9043c1..681ef7b 100644
--- a/src/gallium/drivers/identity/id_context.c
+++ b/src/gallium/drivers/identity/id_context.c
@@ -860,7 +860,6 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
       return NULL;
    }
 
-   id_pipe->base.winsys = NULL;
    id_pipe->base.screen = _screen;
    id_pipe->base.priv = pipe->priv; /* expose wrapped data */
    id_pipe->base.draw = NULL;
diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c
index 5675c27..a173235 100644
--- a/src/gallium/drivers/identity/id_screen.c
+++ b/src/gallium/drivers/identity/id_screen.c
@@ -274,8 +274,6 @@ identity_screen_create(struct pipe_screen *screen)
       return NULL;
    }
 
-   id_screen->base.winsys = NULL;
-
    id_screen->base.destroy = identity_screen_destroy;
    id_screen->base.get_name = identity_screen_get_name;
    id_screen->base.get_vendor = identity_screen_get_vendor;
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index c19272f..8c0206b 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -171,7 +171,6 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    make_empty_list(&llvmpipe->setup_variants_list);
 
 
-   llvmpipe->pipe.winsys = screen->winsys;
    llvmpipe->pipe.screen = screen;
    llvmpipe->pipe.priv = priv;
 
diff --git a/src/gallium/drivers/noop/noop_pipe.c b/src/gallium/drivers/noop/noop_pipe.c
index ec20e0d..5453def 100644
--- a/src/gallium/drivers/noop/noop_pipe.c
+++ b/src/gallium/drivers/noop/noop_pipe.c
@@ -276,7 +276,6 @@ static struct pipe_context *noop_create_context(struct pipe_screen *screen, void
 
 	if (ctx == NULL)
 		return NULL;
-	ctx->winsys = screen->winsys;
 	ctx->screen = screen;
 	ctx->priv = priv;
 	ctx->destroy = noop_destroy_context;
@@ -380,7 +379,6 @@ struct pipe_screen *noop_screen_create(struct pipe_screen *oscreen)
 	noop_screen->oscreen = oscreen;
 	screen = &noop_screen->pscreen;
 
-	screen->winsys = oscreen->winsys;
 	screen->destroy = noop_destroy_screen;
 	screen->get_name = noop_get_name;
 	screen->get_vendor = noop_get_vendor;
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 7d289ca..158dbc0 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -385,7 +385,6 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     r300->rws = rws;
     r300->screen = r300screen;
 
-    r300->context.winsys = (struct pipe_winsys*)rws;
     r300->context.screen = screen;
     r300->context.priv = priv;
 
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 6b3b6c1..9ac5781 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -526,7 +526,6 @@ struct pipe_screen* r300_screen_create(struct radeon_winsys *rws)
                      UTIL_SLAB_SINGLETHREADED);
 
     r300screen->rws = rws;
-    r300screen->screen.winsys = (struct pipe_winsys*)rws;
     r300screen->screen.destroy = r300_destroy_screen;
     r300screen->screen.get_name = r300_get_name;
     r300screen->screen.get_vendor = r300_get_vendor;
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 5ea8bb8..2369ed4 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -220,7 +220,6 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
 
 	r600_update_num_contexts(rscreen, 1);
 
-	rctx->context.winsys = rscreen->screen.winsys;
 	rctx->context.screen = screen;
 	rctx->context.priv = priv;
 	rctx->context.destroy = r600_destroy_context;
@@ -808,7 +807,6 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
 		return NULL;
 	}
 
-	rscreen->screen.winsys = (struct pipe_winsys*)ws;
 	rscreen->screen.destroy = r600_destroy_screen;
 	rscreen->screen.get_name = r600_get_name;
 	rscreen->screen.get_vendor = r600_get_vendor;
diff --git a/src/gallium/drivers/rbug/rbug_context.c b/src/gallium/drivers/rbug/rbug_context.c
index 96f4ce6..3aa4f85 100644
--- a/src/gallium/drivers/rbug/rbug_context.c
+++ b/src/gallium/drivers/rbug/rbug_context.c
@@ -1174,7 +1174,6 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
    pipe_mutex_init(rb_pipe->list_mutex);
    make_empty_list(&rb_pipe->shaders);
 
-   rb_pipe->base.winsys = NULL;
    rb_pipe->base.screen = _screen;
    rb_pipe->base.priv = pipe->priv; /* expose wrapped data */
    rb_pipe->base.draw = NULL;
diff --git a/src/gallium/drivers/rbug/rbug_screen.c b/src/gallium/drivers/rbug/rbug_screen.c
index fe7cdd8..1b7ca7c 100644
--- a/src/gallium/drivers/rbug/rbug_screen.c
+++ b/src/gallium/drivers/rbug/rbug_screen.c
@@ -286,8 +286,6 @@ rbug_screen_create(struct pipe_screen *screen)
    make_empty_list(&rb_screen->surfaces);
    make_empty_list(&rb_screen->transfers);
 
-   rb_screen->base.winsys = NULL;
-
    rb_screen->base.destroy = rbug_screen_destroy;
    rb_screen->base.get_name = rbug_screen_get_name;
    rb_screen->base.get_vendor = rbug_screen_get_vendor;
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 1fb0a79..a79a7a0 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -239,7 +239,6 @@ softpipe_create_context( struct pipe_screen *screen,
    softpipe->dump_fs = debug_get_bool_option( "SOFTPIPE_DUMP_FS", FALSE );
    softpipe->dump_gs = debug_get_bool_option( "SOFTPIPE_DUMP_GS", FALSE );
 
-   softpipe->pipe.winsys = NULL;
    softpipe->pipe.screen = screen;
    softpipe->pipe.destroy = softpipe_destroy;
    softpipe->pipe.priv = priv;
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index 5e50bfb..c983ef5 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -338,7 +338,6 @@ softpipe_create_screen(struct sw_winsys *winsys)
 
    screen->winsys = winsys;
 
-   screen->base.winsys = NULL;
    screen->base.destroy = softpipe_destroy_screen;
 
    screen->base.get_name = softpipe_get_name;
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c
index cbeb424..cc1ac84 100644
--- a/src/gallium/drivers/svga/svga_context.c
+++ b/src/gallium/drivers/svga/svga_context.c
@@ -92,7 +92,6 @@ struct pipe_context *svga_context_create( struct pipe_screen *screen,
    if (svga == NULL)
       goto no_svga;
 
-   svga->pipe.winsys = screen->winsys;
    svga->pipe.screen = screen;
    svga->pipe.priv = priv;
    svga->pipe.destroy = svga_destroy;
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index 240d85c..b582abc 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -1548,7 +1548,6 @@ trace_context_create(struct trace_screen *tr_scr,
    if(!tr_ctx)
       goto error1;
 
-   tr_ctx->base.winsys = NULL;
    tr_ctx->base.priv = pipe->priv; /* expose wrapped priv data */
    tr_ctx->base.screen = &tr_scr->base;
 
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 362b21a..fd5acbe 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -480,7 +480,6 @@ struct pipe_screen *
 trace_screen_create(struct pipe_screen *screen)
 {
    struct trace_screen *tr_scr;
-   struct pipe_winsys *winsys;
 
    if(!screen)
       goto error1;
@@ -494,14 +493,6 @@ trace_screen_create(struct pipe_screen *screen)
    if(!tr_scr)
       goto error2;
 
-#if 0
-   winsys = trace_winsys_create(screen->winsys);
-   if(!winsys)
-      goto error3;
-#else
-   winsys = screen->winsys;
-#endif
-   tr_scr->base.winsys = winsys;
    tr_scr->base.destroy = trace_screen_destroy;
    tr_scr->base.get_name = trace_screen_get_name;
    tr_scr->base.get_vendor = trace_screen_get_vendor;
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 4c58ed0..aaeeb81 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -72,7 +72,6 @@ union pipe_color_union;
  *  - surface functions
  */
 struct pipe_context {
-   struct pipe_winsys *winsys;
    struct pipe_screen *screen;
 
    void *priv;  /**< context private data (for DRI for example) */
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 70d4135..45c441b 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -54,7 +54,6 @@ extern "C" {
 struct winsys_handle;
 /** Opaque type */
 struct pipe_fence_handle;
-struct pipe_winsys;
 struct pipe_resource;
 struct pipe_surface;
 struct pipe_transfer;
@@ -66,8 +65,6 @@ struct pipe_transfer;
  * context.
  */
 struct pipe_screen {
-   struct pipe_winsys *winsys;
-
    void (*destroy)( struct pipe_screen * );
 
 
diff --git a/src/gallium/include/state_tracker/drm_driver.h b/src/gallium/include/state_tracker/drm_driver.h
index 2df2859..f9bd222 100644
--- a/src/gallium/include/state_tracker/drm_driver.h
+++ b/src/gallium/include/state_tracker/drm_driver.h
@@ -5,7 +5,6 @@
 #include "pipe/p_compiler.h"
 
 struct pipe_screen;
-struct pipe_winsys;
 struct pipe_context;
 struct pipe_resource;
 
-- 
1.7.5.4



More information about the mesa-dev mailing list