aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2009-02-10 14:30:38 -0800
committerEric Anholt <[email protected]>2009-02-10 18:45:18 -0800
commit5d5ae371eaeca7e33e638af3aee1ae8e162db0a7 (patch)
treef6a80eba6abfade14d4a5586874ebb716b64fb68 /src/mesa/drivers/dri/intel
parenta49ff9f95e1654c7ee05101e68df51211ad81450 (diff)
intel: Add x8r8g8b8 visuals to DRI1 fbconfigs alongside a8r8gb8.
This involved fixing driConcatConfigs to not return const (which had made a mess of a previous patch too).
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c60
1 files changed, 35 insertions, 25 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 4c06170cdf3..a52271158c6 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -465,8 +465,6 @@ intelFillInModes(__DRIscreenPrivate *psp,
__GLcontextModes *m;
unsigned depth_buffer_factor;
unsigned back_buffer_factor;
- GLenum fb_format;
- GLenum fb_type;
int i;
/* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
@@ -501,20 +499,33 @@ intelFillInModes(__DRIscreenPrivate *psp,
back_buffer_factor = (have_back_buffer) ? 3 : 1;
if (pixel_bits == 16) {
- fb_format = GL_RGB;
- fb_type = GL_UNSIGNED_SHORT_5_6_5;
+ configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
+ depth_bits_array, stencil_bits_array,
+ depth_buffer_factor, back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array, 1);
}
else {
- fb_format = GL_BGRA;
- fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
+ __DRIconfig **configs_a8r8g8b8;
+ __DRIconfig **configs_x8r8g8b8;
+
+ configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array, 1);
+ configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array, 1);
+ configs = driConcatConfigs(configs_a8r8g8b8, configs_x8r8g8b8);
}
- configs = driCreateConfigs(fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor,
- msaa_samples_array, 1);
-
if (configs == NULL) {
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
__LINE__);
@@ -686,7 +697,7 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
};
uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1];
int color;
- const __DRIconfig **configs = NULL;
+ __DRIconfig **configs = NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
@@ -747,17 +758,16 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
fb_type[2] = GL_UNSIGNED_INT_8_8_8_8_REV;
for (color = 0; color < ARRAY_SIZE(fb_format); color++) {
- const __DRIconfig **new_configs;
-
- new_configs = (const __DRIconfig **)
- driCreateConfigs(fb_format[color], fb_type[color],
- depth_bits,
- stencil_bits,
- ARRAY_SIZE(depth_bits),
- back_buffer_modes,
- ARRAY_SIZE(back_buffer_modes),
- msaa_samples_array, ARRAY_SIZE(msaa_samples_array));
-
+ __DRIconfig **new_configs;
+
+ new_configs = driCreateConfigs(fb_format[color], fb_type[color],
+ depth_bits,
+ stencil_bits,
+ ARRAY_SIZE(depth_bits),
+ back_buffer_modes,
+ ARRAY_SIZE(back_buffer_modes),
+ msaa_samples_array,
+ ARRAY_SIZE(msaa_samples_array));
if (configs == NULL)
configs = new_configs;
else
@@ -770,7 +780,7 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
return NULL;
}
- return configs;
+ return (const __DRIconfig **)configs;
}
const struct __DriverAPIRec driDriverAPI = {