diff options
author | Eric Anholt <eric@anholt.net> | 2010-06-04 13:40:48 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-06-04 13:40:48 -0700 |
commit | f0ff214bee64a705d3ef6610e9dc25bc1a46a460 (patch) | |
tree | 027a6eb3559cde84d18c8219d01817b0bb2f4050 | |
parent | b80a728f8a86cbd1efce9611d822ab73b5baeab9 (diff) |
i915: Don't use XRGB8888 on 830 and 845.
The support for XRGB8888 appeared in the 855 and 865, and this format
is reserved on 830/845. This should fix a regression from
b4a6169412819cc3a027c6a118f0537911145a30 that caused hangs in etracer
on 845s.
Bug #26557.
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_context.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_format.c | 14 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 9159f6ec14..c22062c455 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -635,6 +635,7 @@ intelInitContext(struct intel_context *intel, intel->driContext = driContextPriv; intel->driFd = sPriv->fd; + intel->has_xrgb_textures = GL_TRUE; if (IS_GEN6(intel->intelScreen->deviceID)) { intel->gen = 6; intel->needs_ff_sync = GL_TRUE; @@ -656,6 +657,10 @@ intelInitContext(struct intel_context *intel, } } else { intel->gen = 2; + if (intel->intelScreen->deviceID == PCI_CHIP_I830_M || + intel->intelScreen->deviceID == PCI_CHIP_845_G) { + intel->has_xrgb_textures = GL_FALSE; + } } driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache, diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 04d5fc92a2..6329ba6c13 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -145,6 +145,7 @@ struct intel_context GLboolean is_g4x; GLboolean is_945; GLboolean has_luminance_srgb; + GLboolean has_xrgb_textures; int urb_size; diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index b42d6f3155..5f813c0efa 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -49,7 +49,14 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { return MESA_FORMAT_RGB565; } - return do32bpt ? MESA_FORMAT_XRGB8888 : MESA_FORMAT_RGB565; + if (do32bpt) { + if (intel->has_xrgb_textures) + return MESA_FORMAT_XRGB8888; + else + return MESA_FORMAT_ARGB8888; + } else { + return MESA_FORMAT_RGB565; + } case GL_RGBA8: case GL_RGB10_A2: @@ -68,7 +75,10 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return MESA_FORMAT_XRGB8888; + if (intel->has_xrgb_textures) + return MESA_FORMAT_XRGB8888; + else + return MESA_FORMAT_ARGB8888; case GL_RGB5: case GL_RGB4: |