Mesa (master): gallium/hud: use cso_get_pipe_context

Marek Olšák mareko at kemper.freedesktop.org
Sat Nov 25 16:17:08 UTC 2017


Module: Mesa
Branch: master
Commit: 65433c3fd06ad2d080fb40bce139bc814cd76215
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=65433c3fd06ad2d080fb40bce139bc814cd76215

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Nov 18 17:46:51 2017 +0100

gallium/hud: use cso_get_pipe_context

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/gallium/auxiliary/hud/hud_context.c      | 5 +++--
 src/gallium/auxiliary/hud/hud_context.h      | 2 +-
 src/gallium/state_trackers/dri/dri_context.c | 2 +-
 src/gallium/state_trackers/glx/xlib/xm_api.c | 2 +-
 src/gallium/state_trackers/nine/device9.c    | 2 +-
 src/gallium/state_trackers/wgl/stw_context.c | 2 +-
 6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index d54bd63957..92d607fdee 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -1530,8 +1530,9 @@ print_help(struct pipe_screen *screen)
 }
 
 struct hud_context *
-hud_create(struct pipe_context *pipe, struct cso_context *cso)
+hud_create(struct cso_context *cso)
 {
+   struct pipe_context *pipe = cso_get_pipe_context(cso);
    struct pipe_screen *screen = pipe->screen;
    struct hud_context *hud;
    struct pipe_sampler_view view_templ;
@@ -1548,7 +1549,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
       return NULL;
 
    if (strcmp(env, "help") == 0) {
-      print_help(pipe->screen);
+      print_help(screen);
       return NULL;
    }
 
diff --git a/src/gallium/auxiliary/hud/hud_context.h b/src/gallium/auxiliary/hud/hud_context.h
index deb60ef109..97aa709f06 100644
--- a/src/gallium/auxiliary/hud/hud_context.h
+++ b/src/gallium/auxiliary/hud/hud_context.h
@@ -35,7 +35,7 @@ struct pipe_resource;
 struct util_queue_monitoring;
 
 struct hud_context *
-hud_create(struct pipe_context *pipe, struct cso_context *cso);
+hud_create(struct cso_context *cso);
 
 void
 hud_destroy(struct hud_context *hud);
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index d123f9c553..2f69f25525 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -168,7 +168,7 @@ dri_create_context(gl_api api, const struct gl_config * visual,
 
    if (ctx->st->cso_context) {
       ctx->pp = pp_init(ctx->st->pipe, screen->pp_enabled, ctx->st->cso_context);
-      ctx->hud = hud_create(ctx->st->pipe, ctx->st->cso_context);
+      ctx->hud = hud_create(ctx->st->cso_context);
    }
 
    /* Do this last. */
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index 74b59757ec..79bf45d7d7 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -1035,7 +1035,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list,
 
    c->st->st_manager_private = (void *) c;
 
-   c->hud = hud_create(c->st->pipe, c->st->cso_context);
+   c->hud = hud_create(c->st->cso_context);
 
    return c;
 
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 88df38c43f..f1c50d6d20 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -205,7 +205,7 @@ NineDevice9_ctor( struct NineDevice9 *This,
     if (!This->cso_sw) { return E_OUTOFMEMORY; }
 
     /* Create first, it messes up our state. */
-    This->hud = hud_create(This->context.pipe, This->context.cso); /* NULL result is fine */
+    This->hud = hud_create(This->context.cso); /* NULL result is fine */
 
     /* Available memory counter. Updated only for allocations with this device
      * instance. This is the Win 7 behavior.
diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c
index 939ffd5683..2155fbfcff 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -278,7 +278,7 @@ stw_create_context_attribs(HDC hdc, INT iLayerPlane, DHGLRC hShareContext,
    ctx->st->st_manager_private = (void *) ctx;
 
    if (ctx->st->cso_context) {
-      ctx->hud = hud_create(ctx->st->pipe, ctx->st->cso_context);
+      ctx->hud = hud_create(ctx->st->cso_context);
    }
 
    stw_lock_contexts(stw_dev);




More information about the mesa-commit mailing list