diff options
Diffstat (limited to 'src/gallium/state_trackers')
18 files changed, 25 insertions, 152 deletions
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c index 07f0554cc0..6edbd9d9b1 100644 --- a/src/gallium/state_trackers/dri/dri_context.c +++ b/src/gallium/state_trackers/dri/dri_context.c @@ -69,14 +69,12 @@ dri_create_context(const __GLcontextModes * visual, driParseConfigFiles(&ctx->optionCache, &screen->optionCache, sPriv->myNum, "dri"); - ctx->pipe = screen->api->create_context(screen->api, screen->pipe_screen); + ctx->pipe = screen->pipe_screen->create_context( screen->pipe_screen, + ctx ); if (ctx->pipe == NULL) goto fail; - /* used in dri_flush_frontbuffer */ - ctx->pipe->priv = ctx; - ctx->st = st_create_context(ctx->pipe, visual, st_share); if (ctx->st == NULL) goto fail; diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 70216177bd..424be49311 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -645,8 +645,11 @@ egl_g3d_create_context(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, } mode = &gconf->native->mode; - gctx->pipe = - gdpy->native->create_context(gdpy->native, (void *) &gctx->base); + + gctx->pipe = gdpy->native->screen->create_context( + gdpy->native->screen, + (void *) &gctx->base); + if (!gctx->pipe) { free(gctx); return NULL; diff --git a/src/gallium/state_trackers/egl/common/native.h b/src/gallium/state_trackers/egl/common/native.h index 72a9cec7ef..4f9758545a 100644 --- a/src/gallium/state_trackers/egl/common/native.h +++ b/src/gallium/state_trackers/egl/common/native.h @@ -167,11 +167,6 @@ struct native_display { EGLNativePixmapType pix, const struct native_config *nconf); - /** - * Create a pipe context. - */ - struct pipe_context *(*create_context)(struct native_display *ndpy, - void *context_private); /** * Create a window surface. Required unless no config has GLX_WINDOW_BIT diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c index 445c28c383..91cefc538d 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.c +++ b/src/gallium/state_trackers/egl/kms/native_kms.c @@ -575,17 +575,6 @@ kms_display_create_pbuffer_surface(struct native_display *ndpy, return &ksurf->base; } -static struct pipe_context * -kms_display_create_context(struct native_display *ndpy, void *context_private) -{ - struct kms_display *kdpy = kms_display(ndpy); - struct pipe_context *pctx; - - pctx = kdpy->api->create_context(kdpy->api, kdpy->base.screen); - if (pctx) - pctx->priv = context_private; - return pctx; -} static boolean kms_display_is_format_supported(struct native_display *ndpy, @@ -814,7 +803,6 @@ kms_create_display(EGLNativeDisplayType dpy, struct drm_api *api) kdpy->base.destroy = kms_display_destroy; kdpy->base.get_configs = kms_display_get_configs; - kdpy->base.create_context = kms_display_create_context; kdpy->base.create_pbuffer_surface = kms_display_create_pbuffer_surface; kdpy->base.modeset = &kms_display_modeset; diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index b2eba7219f..5f2fd41260 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -402,18 +402,6 @@ dri2_display_create_pbuffer_surface(struct native_display *ndpy, return (dri2surf) ? &dri2surf->base : NULL; } -static struct pipe_context * -dri2_display_create_context(struct native_display *ndpy, void *context_private) -{ - struct dri2_display *dri2dpy = dri2_display(ndpy); - struct pipe_context *pctx; - - pctx = dri2dpy->api->create_context(dri2dpy->api, dri2dpy->base.screen); - if (pctx) - pctx->priv = context_private; - return pctx; -} - static int choose_color_format(const __GLcontextModes *mode, enum pipe_format formats[32]) { @@ -697,7 +685,6 @@ x11_create_dri2_display(EGLNativeDisplayType dpy, struct drm_api *api) dri2dpy->base.destroy = dri2_display_destroy; dri2dpy->base.get_configs = dri2_display_get_configs; dri2dpy->base.is_pixmap_supported = dri2_display_is_pixmap_supported; - dri2dpy->base.create_context = dri2_display_create_context; dri2dpy->base.create_window_surface = dri2_display_create_window_surface; dri2dpy->base.create_pixmap_surface = dri2_display_create_pixmap_surface; dri2dpy->base.create_pbuffer_surface = dri2_display_create_pbuffer_surface; diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 7946415ce7..92a62f230e 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -492,16 +492,6 @@ ximage_display_create_pbuffer_surface(struct native_display *ndpy, return (xsurf) ? &xsurf->base : NULL; } -static struct pipe_context * -ximage_display_create_context(struct native_display *ndpy, - void *context_private) -{ - struct pipe_context *pctx = softpipe_create(ndpy->screen); - if (pctx) - pctx->priv = context_private; - return pctx; -} - static enum pipe_format choose_format(const XVisualInfo *vinfo) { @@ -686,7 +676,6 @@ x11_create_ximage_display(EGLNativeDisplayType dpy, boolean use_xshm) xdpy->base.get_configs = ximage_display_get_configs; xdpy->base.is_pixmap_supported = ximage_display_is_pixmap_supported; - xdpy->base.create_context = ximage_display_create_context; xdpy->base.create_window_surface = ximage_display_create_window_surface; xdpy->base.create_pixmap_surface = ximage_display_create_pixmap_surface; xdpy->base.create_pbuffer_surface = ximage_display_create_pbuffer_surface; diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 1783bc504d..fb314f3b52 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -760,7 +760,6 @@ PUBLIC XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) { static GLboolean firstTime = GL_TRUE; - struct pipe_context *_pipe = NULL; struct pipe_context *pipe = NULL; XMesaContext c; GLcontext *mesaCtx; @@ -788,11 +787,12 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) if (screen == NULL) goto fail; - _pipe = driver.create_pipe_context(_screen, (void *) c); - if (_pipe == NULL) + /* Trace screen knows how to properly wrap context creation in the + * wrapped screen, so nothing special to do here: + */ + pipe = screen->context_create(screen, (void *) c); + if (pipe == NULL) goto fail; - pipe = trace_context_create(screen, _pipe); - pipe->priv = c; c->st = st_create_context(pipe, &v->mesa_visual, diff --git a/src/gallium/state_trackers/glx/xlib/xm_winsys.h b/src/gallium/state_trackers/glx/xlib/xm_winsys.h index 0e57605c34..4bd5b5c8d3 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_winsys.h +++ b/src/gallium/state_trackers/glx/xlib/xm_winsys.h @@ -39,13 +39,6 @@ struct xm_driver { struct pipe_screen *(*create_pipe_screen)( void ); - /* The context_private argument needs to go away. Is currently used - * in a round-about way to associate a display-target surface with its - * Xlib window. - */ - struct pipe_context *(*create_pipe_context)( struct pipe_screen *, - void *context_private ); - void (*display_surface)( struct xmesa_buffer *, struct pipe_surface * ); diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index 467e20207a..1146a8b0c3 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -80,8 +80,7 @@ st_device_create_from_st_winsys(const struct st_winsys *st_ws) { struct st_device *st_dev; - if(!st_ws->screen_create || - !st_ws->context_create) + if(!st_ws->screen_create) return NULL; st_dev = CALLOC_STRUCT(st_device); @@ -158,13 +157,7 @@ st_context_create(struct st_device *st_dev) st_device_reference(&st_ctx->st_dev, st_dev); - st_ctx->real_pipe = st_dev->st_ws->context_create(st_dev->real_screen); - if(!st_ctx->real_pipe) { - st_context_destroy(st_ctx); - return NULL; - } - - st_ctx->pipe = trace_context_create(st_dev->screen, st_ctx->real_pipe); + st_ctx->pipe = st_dev->screen->create_context(st_dev->screen, NULL); if(!st_ctx->pipe) { st_context_destroy(st_ctx); return NULL; diff --git a/src/gallium/state_trackers/python/st_device.h b/src/gallium/state_trackers/python/st_device.h index f786e13411..de9e0215d8 100644 --- a/src/gallium/state_trackers/python/st_device.h +++ b/src/gallium/state_trackers/python/st_device.h @@ -50,7 +50,6 @@ struct st_surface struct st_context { struct st_device *st_dev; - struct pipe_context *real_pipe; struct pipe_context *pipe; struct cso_context *cso; diff --git a/src/gallium/state_trackers/python/st_hardpipe_winsys.c b/src/gallium/state_trackers/python/st_hardpipe_winsys.c index 43aaaabf2a..a3110a19d5 100644 --- a/src/gallium/state_trackers/python/st_hardpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_hardpipe_winsys.c @@ -217,21 +217,6 @@ st_hardpipe_screen_create(void) } -static struct pipe_context * -st_hardpipe_context_create(struct pipe_screen *screen) -{ - if(st_hardpipe_load()) { - if(screen == pfnGetGalliumScreenMESA()) - return pfnCreateGalliumContextMESA(); - else - return NULL; - } - else - return st_softpipe_winsys.context_create(screen); -} - - const struct st_winsys st_hardpipe_winsys = { - &st_hardpipe_screen_create, - &st_hardpipe_context_create + &st_hardpipe_screen_create }; diff --git a/src/gallium/state_trackers/python/st_llvmpipe_winsys.c b/src/gallium/state_trackers/python/st_llvmpipe_winsys.c index c5ee1679f0..5d83b5a9e1 100644 --- a/src/gallium/state_trackers/python/st_llvmpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_llvmpipe_winsys.c @@ -135,14 +135,7 @@ no_winsys: } -static struct pipe_context * -st_llvmpipe_context_create(struct pipe_screen *screen) -{ - return llvmpipe_create(screen); -} - const struct st_winsys st_softpipe_winsys = { - &st_llvmpipe_screen_create, - &st_llvmpipe_context_create, + &st_llvmpipe_screen_create }; diff --git a/src/gallium/state_trackers/python/st_softpipe_winsys.c b/src/gallium/state_trackers/python/st_softpipe_winsys.c index dfe3e465f7..81676bc3a4 100644 --- a/src/gallium/state_trackers/python/st_softpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_softpipe_winsys.c @@ -39,6 +39,5 @@ #include "st_winsys.h" const struct st_winsys st_softpipe_winsys = { - &softpipe_create_screen_malloc, - &softpipe_create, + &softpipe_create_screen_malloc }; diff --git a/src/gallium/state_trackers/python/st_winsys.h b/src/gallium/state_trackers/python/st_winsys.h index b8cb612d86..0c7b6a200e 100644 --- a/src/gallium/state_trackers/python/st_winsys.h +++ b/src/gallium/state_trackers/python/st_winsys.h @@ -38,9 +38,6 @@ struct st_winsys { struct pipe_screen * (*screen_create)(void); - - struct pipe_context * - (*context_create)(struct pipe_screen *screen); }; diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c index f2f0264844..0785d2c6b8 100644 --- a/src/gallium/state_trackers/wgl/stw_context.c +++ b/src/gallium/state_trackers/wgl/stw_context.c @@ -34,11 +34,6 @@ #include "state_tracker/st_context.h" #include "state_tracker/st_public.h" -#ifdef DEBUG -#include "trace/tr_screen.h" -#include "trace/tr_context.h" -#endif - #include "stw_icd.h" #include "stw_device.h" #include "stw_winsys.h" @@ -152,7 +147,6 @@ DrvCreateLayerContext( const struct stw_pixelformat_info *pfi; GLvisual visual; struct stw_context *ctx = NULL; - struct pipe_screen *screen = NULL; struct pipe_context *pipe = NULL; if(!stw_dev) @@ -175,28 +169,12 @@ DrvCreateLayerContext( ctx->hdc = hdc; ctx->iPixelFormat = iPixelFormat; - screen = stw_dev->screen; - -#ifdef DEBUG - /* Unwrap screen */ - if(stw_dev->trace_running) - screen = trace_screen(screen)->screen; -#endif - - pipe = stw_dev->stw_winsys->create_context( screen ); + /* priv == hdc, pass to stw_flush_frontbuffer as context_private + */ + pipe = stw_dev->screen->context_create( stw_dev->screen, hdc ); if (pipe == NULL) goto no_pipe; -#ifdef DEBUG - /* Wrap context */ - if(stw_dev->trace_running) - pipe = trace_context_create(stw_dev->screen, pipe); -#endif - - /* pass to stw_flush_frontbuffer as context_private */ - assert(!pipe->priv); - pipe->priv = hdc; - ctx->st = st_create_context( pipe, &visual, NULL ); if (ctx->st == NULL) goto no_st_ctx; diff --git a/src/gallium/state_trackers/wgl/stw_ext_gallium.c b/src/gallium/state_trackers/wgl/stw_ext_gallium.c index fb30ec5dba..8dd63f124a 100644 --- a/src/gallium/state_trackers/wgl/stw_ext_gallium.c +++ b/src/gallium/state_trackers/wgl/stw_ext_gallium.c @@ -48,32 +48,8 @@ wglGetGalliumScreenMESA(void) struct pipe_context * APIENTRY wglCreateGalliumContextMESA(void) { - struct pipe_screen *screen = NULL; - struct pipe_context *pipe = NULL; - if(!stw_dev) return NULL; - screen = stw_dev->screen; - -#ifdef DEBUG - /* Unwrap screen */ - if(stw_dev->trace_running) - screen = trace_screen(screen)->screen; -#endif - - pipe = stw_dev->stw_winsys->create_context( screen ); - if (pipe == NULL) - goto no_pipe; - -#ifdef DEBUG - /* Wrap context */ - if(stw_dev->trace_running) - pipe = trace_context_create(stw_dev->screen, pipe); -#endif - - return pipe; - -no_pipe: - return NULL; + return stw_dev->screen->context_create( stw_dev->screen, NULL ); } diff --git a/src/gallium/state_trackers/wgl/stw_winsys.h b/src/gallium/state_trackers/wgl/stw_winsys.h index 1de6e906d0..270fad56a1 100644 --- a/src/gallium/state_trackers/wgl/stw_winsys.h +++ b/src/gallium/state_trackers/wgl/stw_winsys.h @@ -43,9 +43,6 @@ struct stw_winsys struct pipe_screen * (*create_screen)( void ); - struct pipe_context * - (*create_context)( struct pipe_screen *screen ); - /** * Present the color buffer to the window associated with the device context. */ diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 70af0c5fed..ae66c4baa9 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -1061,7 +1061,10 @@ xorg_exa_init(ScrnInfoPtr pScrn, Bool accel) } exa->scrn = ms->screen; - exa->pipe = ms->api->create_context(ms->api, exa->scrn); + exa->pipe = exa->scrn->context_create(exa->scrn, NULL); + if (exa->pipe == NULL) + goto out_err; + /* Share context with DRI */ ms->ctx = exa->pipe; |