From 7f41f5447c8f9113c8956901e1c5fff6081ecd94 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Feb 2010 12:55:59 +0000 Subject: gallium: squash-merge of gallium screen context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Squashed commit of the following: commit 009598122adf5cad42bf9af067eccaf8e89e1233 Author: Christoph Bumiller Date: Mon Feb 8 11:03:26 2010 +0000 nouveau: fix gallium-screen-context branch fallout commit 7b2ffc2019d72e833afea7eebf3e80121187375d Merge: 51e190e c036d13 Author: Keith Whitwell Date: Fri Feb 5 09:55:02 2010 +0000 Merge commit 'origin/master' into gallium-screen-context Conflicts: src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c This branch has got a pretty tortured history now, I expect a squash merge will be appropriate when it is done. commit 51e190e95acf120f72768fafb29e9721e358df1b Author: Keith Whitwell Date: Thu Feb 4 17:58:02 2010 +0000 gallium: fix some build issues commit f524bdaa723fb181637ad30c6ad708aeedabe25b Merge: f906212 3aba0a2 Author: Keith Whitwell Date: Thu Feb 4 17:51:32 2010 +0000 Merge commit 'origin/master' into gallium-screen-context commit f9062126883199eabf045714c717cd35f4b7b313 Author: Keith Whitwell Date: Thu Feb 4 17:17:12 2010 +0000 gallium/docs: small description of screen::create_context commit efcb37bd3d5ed37f06c6105bd2d750b374ec0927 Author: Keith Whitwell Date: Thu Feb 4 16:42:42 2010 +0000 drm/radeon: more dead create_context wrapper removal commit 6badc0dd9e06cf2ec936940bcf12b9ef5324b301 Author: Keith Whitwell Date: Thu Feb 4 16:42:30 2010 +0000 drm/i965: more dead create_context wrapper removal commit cf04ebd5a54b18b2d894cfdab2b0f2fd55626ffc Author: Keith Whitwell Date: Thu Feb 4 16:42:05 2010 +0000 st/python: more dead create_context wrapper removal commit 444f114c3516abf71c430e6e9d0d2ae3b80679d3 Author: Keith Whitwell Date: Thu Feb 4 16:37:58 2010 +0000 idenity: wrapped context creation commit 5a6d09cb9e468d1ee6c8d54b887618819d8d94f2 Author: Keith Whitwell Date: Thu Feb 4 16:28:47 2010 +0000 ws/gdi: remove dead context_create wrapper commit 132b55f4bec39386ac625f09aaa11f609664024c Author: Keith Whitwell Date: Thu Feb 4 16:27:52 2010 +0000 ws/gdi: remove dead context_create wrapper commit 56d2d21a0cdcb197a364049d354c2f15a4fc026a Author: Keith Whitwell Date: Thu Feb 4 16:25:38 2010 +0000 st/xorg: use screen::context_create commit 838c5cfe56b2af6c644909bed3c5e7cdd64c336a Author: Keith Whitwell Date: Thu Feb 4 16:23:20 2010 +0000 glx/xlib: simplify creation of trace-wrapped contexts Trace screen knows how to properly wrap context creation in the wrapped screen, so nothing special to do here. commit c99404c03ebaec4175f08a2f363e43c9085f2635 Author: Keith Whitwell Date: Thu Feb 4 16:18:24 2010 +0000 st/python: no need to special case context creation for trace commit 193a527a682b6877bb1faecd8092df4dfd055a18 Author: Keith Whitwell Date: Thu Feb 4 16:15:30 2010 +0000 drm/radeon: remove dead create_context declaration commit bb984eecc25cf23bc77e1c818b81165ba1a07c9a Author: Keith Whitwell Date: Thu Feb 4 16:14:58 2010 +0000 nv/drm: remove dead create_context ref commit e809313a44287dc4e16c28e9e74ef3b2b5271aa1 Author: Keith Whitwell Date: Thu Feb 4 16:12:51 2010 +0000 st/egl: remove a layer of wrappers around screen::create_context commit 39caa6672a04122f185c22e17aab86d1c40938bf Author: Keith Whitwell Date: Thu Feb 4 16:05:28 2010 +0000 r300g: fill in screen::context_create commit 407f12556d16ba0656774d8a1d9ebda22f82f473 Author: Keith Whitwell Date: Thu Feb 4 16:04:04 2010 +0000 cell: adapt for screen::create_context, untested commit d02b0c6ce321a04c76fdabb09e0e4380ce1c1376 Author: Keith Whitwell Date: Thu Feb 4 15:50:24 2010 +0000 drm/nv: adapt for screen::create_context All contexts now created directly through the screen, so remove equivalent code here. Remove apparently un-needed array of contexts in the winsys. commit 53eec5b1349aa1b6892a75a7bff7e7530957aeae Author: Keith Whitwell Date: Thu Feb 4 15:50:08 2010 +0000 stw: adapt for screen::create_context, untested commit c6a64de3eb381bc9a88e9fbdecbf87d77925aaf5 Author: Keith Whitwell Date: Thu Feb 4 15:49:20 2010 +0000 trace: expose the wrapped context's priv data If we are going to keep this priv idea, really want an accessor function for it so that trace and other drivers can wrap that. commit 75d6104e11d86ec2b0749627ed58e35f856ee6eb Author: Keith Whitwell Date: Thu Feb 4 15:47:55 2010 +0000 nv30: adapt to screen::context_create commit 12f5deb6ed9723e9b5d34577052b8365813ca14e Author: Keith Whitwell Date: Thu Feb 4 15:44:47 2010 +0000 nv40: adapt to screen::context_create commit 14baccaa3b6bbb3b91056126f6521828e786dc62 Author: Keith Whitwell Date: Thu Feb 4 15:35:27 2010 +0000 nv50: adapt to screen::create_context Not build tested. Need to figure out how to build nouveau. commit a0e94505ccd2d7f3e604465a2ac302f1286b73b6 Author: Keith Whitwell Date: Thu Feb 4 15:22:27 2010 +0000 llvmpipe: update for screen::create_context, untested commit 0eae17107c950346030e4f7e0ec232f868d3893d Author: Keith Whitwell Date: Thu Feb 4 15:16:57 2010 +0000 xlib/llvmpipe: remove dead winsys context creation path commit 2f69f9ffaa7e2a01d2483277246ed13051ae4ca3 Author: Keith Whitwell Date: Thu Feb 4 14:58:27 2010 +0000 gallium: convert most code to use screen::create_context I wish I could build all of gallium at once to find breakages. commit d7b57f4061b82322cbcae176125913d9f0dea6c1 Author: Keith Whitwell Date: Thu Feb 4 12:46:21 2010 +0000 glx: permit building with older protocol headers I'd like to be able to build mesa on current distro releases without having to upgrade from the standard dri2proto and glproto headers. With this change I'm able to build on ancient releases such as Ubuntu 9-10... In general, it would be nice to be able to build-test mesa to check for unintended breakages without having to follow the external dependencies of every group working on the codebase. commit 57adedd6fb06c98572ed8d4aef19203df4c4eea2 Merge: da71847 e1906ae Author: Keith Whitwell Date: Thu Feb 4 11:38:15 2010 +0000 Merge commit 'origin/master' into gallium-screen-context Conflicts: src/gallium/drivers/softpipe/sp_video_context.h src/gallium/drivers/trace/tr_context.c src/gallium/state_trackers/wgl/shared/stw_context.c src/gallium/winsys/gdi/gdi_softpipe_winsys.c commit da71847ea6414d7e352c6094f8963bb4eda344dc Author: José Fonseca Date: Sat May 2 08:57:39 2009 +0100 wgl: Use pipe_screen::context_create. commit 2595a188f93fd903600ef5d8517737ee0592035d Author: José Fonseca Date: Sat May 2 08:56:47 2009 +0100 trace: Implement pipe_screen::context_create. commit f3640e4ae37a5260cbfba999d079f827de0a313a Author: José Fonseca Date: Sat May 2 08:56:17 2009 +0100 softpipe: Implement pipe_screen::context_create. commit 347266bddc8bd39c711bacb2193793759d0f3696 Author: José Fonseca Date: Sat May 2 08:55:31 2009 +0100 gallium: New pipe_screen::context_create callback. --- src/gallium/state_trackers/dri/dri_context.c | 6 ++--- src/gallium/state_trackers/egl/common/egl_g3d.c | 7 ++++-- src/gallium/state_trackers/egl/common/native.h | 5 ---- src/gallium/state_trackers/egl/kms/native_kms.c | 12 ---------- src/gallium/state_trackers/egl/x11/native_dri2.c | 13 ---------- src/gallium/state_trackers/egl/x11/native_ximage.c | 11 --------- src/gallium/state_trackers/glx/xlib/xm_api.c | 10 ++++---- src/gallium/state_trackers/glx/xlib/xm_winsys.h | 7 ------ src/gallium/state_trackers/python/st_device.c | 11 ++------- src/gallium/state_trackers/python/st_device.h | 1 - .../state_trackers/python/st_hardpipe_winsys.c | 17 +------------ .../state_trackers/python/st_llvmpipe_winsys.c | 9 +------ .../state_trackers/python/st_softpipe_winsys.c | 3 +-- src/gallium/state_trackers/python/st_winsys.h | 3 --- src/gallium/state_trackers/wgl/stw_context.c | 28 +++------------------- src/gallium/state_trackers/wgl/stw_ext_gallium.c | 26 +------------------- src/gallium/state_trackers/wgl/stw_winsys.h | 3 --- src/gallium/state_trackers/xorg/xorg_exa.c | 5 +++- 18 files changed, 25 insertions(+), 152 deletions(-) (limited to 'src/gallium/state_trackers') 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; -- cgit v1.2.3