From 5d7b028403824856c2b1ff30c066f5b2fd70a496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 24 Feb 2010 19:51:28 -0500 Subject: [PATCH] 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 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. Signed-off-by: Kristian Høgsberg --- 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(-) diff --git a/glx/glxdri.c b/glx/glxdri.c index 21e44d1..9810a73 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 edd29b0..9e82059 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -753,7 +753,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 faaa3b7..454aa55 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 f88964b..41e2d27 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 c647d83..918383c 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); -- 1.6.5.rc2