From 1760d2bef9f5b248cb2332f6ebf0220eb02bab42 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 9 Apr 2010 10:58:48 -0400 Subject: glx: Set the pbuffer bit for dri2 fbconfigs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They've been implemented for a while, but we never advertised them. All we need to do is set the GLX_PBUFFER_BIT in the drawable type fbconfig field when we're using DRI2. https://bugs.freedesktop.org/show_bug.cgi?id=26581 Signed-off-by: Kristian Høgsberg Reviewed-by: Ian Romanick Signed-off-by: Keith Packard --- glx/glxdri.c | 7 +++---- glx/glxdri2.c | 5 ++++- glx/glxdricommon.c | 13 ++++++++----- glx/glxdricommon.h | 3 ++- glx/glxdriswrast.c | 5 ++++- 5 files changed, 21 insertions(+), 12 deletions(-) (limited to 'glx') diff --git a/glx/glxdri.c b/glx/glxdri.c index 21e44d12d..9810a73a7 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -939,9 +940,6 @@ initializeExtensions(__GLXDRIscreen *screen) } } -extern __GLXconfig * -glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs); - static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { @@ -1131,7 +1129,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen) goto handle_error; } - screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs); + screen->base.fbconfigs = glxConvertConfigs(screen->core, + driConfigs, GLX_WINDOW_BIT); initializeExtensions(screen); diff --git a/glx/glxdri2.c b/glx/glxdri2.c index e791bf6bf..4c9f381c6 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -748,7 +748,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen) initializeExtensions(screen); - screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs); + screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs, + GLX_WINDOW_BIT | + GLX_PIXMAP_BIT | + GLX_PBUFFER_BIT); __glXScreenInit(&screen->base, pScreen); diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c index faaa3b7ae..454aa5587 100644 --- a/glx/glxdricommon.c +++ b/glx/glxdricommon.c @@ -121,7 +121,7 @@ setScalar(__GLXconfig *config, unsigned int attrib, unsigned int value) static __GLXconfig * createModeFromConfig(const __DRIcoreExtension *core, const __DRIconfig *driConfig, - unsigned int visualType) + unsigned int visualType, unsigned int drawableType) { __GLXDRIconfig *config; unsigned int attrib, value; @@ -167,13 +167,14 @@ createModeFromConfig(const __DRIcoreExtension *core, config->config.next = NULL; config->config.xRenderable = GL_TRUE; config->config.visualType = visualType; - config->config.drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; + config->config.drawableType = drawableType; return &config->config; } __GLXconfig * -glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs) +glxConvertConfigs(const __DRIcoreExtension *core, + const __DRIconfig **configs, unsigned int drawableType) { __GLXconfig head, *tail; int i; @@ -183,7 +184,8 @@ glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs) for (i = 0; configs[i]; i++) { tail->next = createModeFromConfig(core, - configs[i], GLX_TRUE_COLOR); + configs[i], GLX_TRUE_COLOR, + drawableType); if (tail->next == NULL) break; @@ -192,7 +194,8 @@ glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs) for (i = 0; configs[i]; i++) { tail->next = createModeFromConfig(core, - configs[i], GLX_DIRECT_COLOR); + configs[i], GLX_DIRECT_COLOR, + drawableType); if (tail->next == NULL) break; diff --git a/glx/glxdricommon.h b/glx/glxdricommon.h index f88964b36..41e2d2770 100644 --- a/glx/glxdricommon.h +++ b/glx/glxdricommon.h @@ -33,7 +33,8 @@ struct __GLXDRIconfig { }; __GLXconfig * -glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs); +glxConvertConfigs(const __DRIcoreExtension *core, + const __DRIconfig **configs, unsigned int drawableType); extern const __DRIsystemTimeExtension systemTimeExtension; diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index c647d83ca..918383cf0 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -506,7 +506,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen) initializeExtensions(screen); - screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs); + screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs, + GLX_WINDOW_BIT | + GLX_PIXMAP_BIT | + GLX_PBUFFER_BIT); __glXScreenInit(&screen->base, pScreen); -- cgit v1.2.3