diff options
author | Eric Anholt <[email protected]> | 2013-09-27 11:39:25 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-10-24 14:04:20 -0700 |
commit | f93533d118b6dab00022cc9bc1448615a25946dc (patch) | |
tree | eac8fb7a9f34ba1f8b14738aef46dfc0184c6dd1 /src/glx | |
parent | 67caf36489e29c93ed1a25541944b191ed50df52 (diff) |
dri: Pass in the dlsym()ed driver extension to screen creation.
This will allow a megadrivers build to reference the actual driver being
loaded from the shared dri_util screen creation code.
v2: Fix indentation, fallback case in EGL (review by Emil).
Reviewed-by: Matt Turner <[email protected]> (v1)
Reviewed-by: Chad Versace <[email protected]> (v1)
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/dri2_glx.c | 23 | ||||
-rw-r--r-- | src/glx/drisw_glx.c | 13 |
2 files changed, 24 insertions, 12 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 7e22906318d..cfa5856484f 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -1223,15 +1223,20 @@ dri2CreateScreen(int screen, struct glx_display * priv) goto handle_error; } - - /* If the server does not support the protocol for - * DRI2GetBuffersWithFormat, don't supply that interface to the driver. - */ - psc->driScreen = - psc->dri2->createNewScreen(screen, psc->fd, - (const __DRIextension **) - &pdp->loader_extensions[0], - &driver_configs, psc); + if (psc->dri2->base.version >= 4) { + psc->driScreen = + psc->dri2->createNewScreen2(screen, psc->fd, + (const __DRIextension **) + &pdp->loader_extensions[0], + extensions, + &driver_configs, psc); + } else { + psc->driScreen = + psc->dri2->createNewScreen(screen, psc->fd, + (const __DRIextension **) + &pdp->loader_extensions[0], + &driver_configs, psc); + } if (psc->driScreen == NULL) { ErrorMessageF("failed to create dri screen\n"); diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index a7d08434877..cb1d650b5c1 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -680,9 +680,16 @@ driswCreateScreen(int screen, struct glx_display *priv) goto handle_error; } - psc->driScreen = - psc->swrast->createNewScreen(screen, loader_extensions, - &driver_configs, psc); + if (psc->swrast->base.version >= 4) { + psc->driScreen = + psc->swrast->createNewScreen2(screen, loader_extensions, + extensions, + &driver_configs, psc); + } else { + psc->driScreen = + psc->swrast->createNewScreen(screen, loader_extensions, + &driver_configs, psc); + } if (psc->driScreen == NULL) { ErrorMessageF("failed to create dri screen\n"); goto handle_error; |