[Mesa-dev] [PATCH] i965: Don't use BRW_DEPTHFORMAT_D24_UNORM_X8_UINT on Gen4.

Chad Versace chad.versace at linux.intel.com
Wed Dec 21 09:56:21 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/21/2011 05:52 AM, Eric Anholt wrote:
> On Tue, 20 Dec 2011 23:30:29 -0800, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> X8 depth formats weren't supported until Ironlake (Gen 5).
>>
>> Fixes GPU hangs introduced in d84a180417d1eabd680554970f1eaaa93abcd41e.
>> One example test case was "fbo-missing-attachment-blit from".
>>
>> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
>> ---
>>  src/mesa/drivers/dri/i965/brw_misc_state.c |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> I tested this by comparing full piglit runs on GM45 between d84a180417d~1
>> and d84a180417d with this patch applied on top of it.  No changes, no hangs.
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
>> index 8a6ee70..21885a6 100644
>> --- a/src/mesa/drivers/dri/i965/brw_misc_state.c
>> +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
>> @@ -218,7 +218,9 @@ brw_depthbuffer_format(struct brw_context *brw)
>>     case MESA_FORMAT_Z32_FLOAT:
>>        return BRW_DEPTHFORMAT_D32_FLOAT;
>>     case MESA_FORMAT_X8_Z24:
>> -      return BRW_DEPTHFORMAT_D24_UNORM_X8_UINT;
>> +      if (intel->gen >= 5)
>> +	 return BRW_DEPTHFORMAT_D24_UNORM_X8_UINT;
>> +      /* Gen4 doesn't support X8; use S8 instead. */
>>     case MESA_FORMAT_S8_Z24:
>>        return BRW_DEPTHFORMAT_D24_UNORM_S8_UINT;
>>     default:
> 
> Oh, thanks!  I think an explicit else case would be nicer to read than
> an implicit fallthrough, though.

Ditto. Fallthroughs like this are jarring.

While you're digging around in this function, wouldn't this commit
and the one below be candidates for 7.11?

    commit d464a21e2d796e396e7e4c0cfe971b41003e2d2a
    Author: Kenneth Graunke <kenneth at whitecape.org>
    Date:   Wed Dec 7 02:21:37 2011 -0800

        i965: Return BRW_DEPTHBUFFER_D32_FLOAT as the null-depthbuffer format.
        
        Fixes many crashes on Ivybridge due to upload_sf_state calling
        brw_depthbuffer_format without an actual depth buffer.  This was a
        recent regression on master.
        
        +3992 piglits on Ivybridge.
        
        Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
        Reviewed-by: Eric Anholt <eric at anholt.net>


- ----
Chad Versace
chad.versace at linux.intel.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJO8h3EAAoJEAIvNt057x8iNlIP/3VmkpCKr+YWs+j6e7FicM5C
+hAnfICMpKh1HtuXhj7lKxdI88Ex+rqvcSRUrTWBeHfhKc74eRWm4QBLKn7n+PKQ
8ImEHhaOgMXyAYMzcCEMwx0NQbzT8f+DjNtzbqMWBddoTs3DgqylY/t3qNxYcZnS
EgRWqOxwKy0r7+5SpXWO2AuzISn+LOQtn1zsH+2GvjwYexSH6BL9PI8Z1LUQhRgY
Nsg+Bpwp12ar6P9FXzyQdPwLFNfS2AVqTe08lwPLy76uAVcCQ39wch/wjLg7mlER
AlozhmZ+/Mr496A3Zj1KeWG7tZhmG34rM8/vUTm97U3l8fMX8LSWYWcM55vVrsUO
/vrX0OSat+KSxIYdX7TuoiUoOfrOzL8wlFOQim/X1mpV7cPkaz+8BoYqVnoKNgvt
JPqRR9z+FYk4NTywRzMHBgGE3/sDLDTjbFG9RJXGOShL83S64OsHsdhBNTgOKr0g
YBppMlYqatRcCOe/GZBJw63s3b8a6SEuCFSjJSOWdncUnNmwBCLqFW+zFqXf2b22
VxbL0BeoEZuW871vU7U7DlGULMdkuFukF1XgtmKfBvIINO6ikYoUES07226NhvFZ
JYHoe0R8k+FoA7OcWop5LXUjzUjFsfNArm6Kt8B5FHFKUURuqpo14VwWBl+yGQO2
ndGHeaddm/lspUHq+ZFy
=SCC1
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list