[Mesa-dev] [PATCH 4/8] i965: Use helper function intel_miptree_get_tile_dimensions() in surface setup

Anuj Phogat anuj.phogat at gmail.com
Mon Aug 17 15:52:04 PDT 2015


On Mon, Aug 17, 2015 at 12:19 PM, Ben Widawsky <ben at bwidawsk.net> wrote:
> On Fri, Aug 14, 2015 at 04:51:55PM -0700, Anuj Phogat wrote:
>> It takes care of using the correct tile width if we later use other tiling
>> patterns (e.g. Yf) for aux miptree.
>>
>> Cc: Ben Widawsky <ben at bwidawsk.net>
>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>> ---
>>  src/mesa/drivers/dri/i965/gen8_surface_state.c | 14 ++++++++++++--
>>  1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c
>> index 6c4d3e1..354d79f 100644
>> --- a/src/mesa/drivers/dri/i965/gen8_surface_state.c
>> +++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c
>> @@ -262,8 +262,13 @@ gen8_emit_texture_surface_state(struct brw_context *brw,
>>     }
>>
>>     if (aux_mt) {
>> +      uint32_t tile_w, tile_h;
>> +      assert(aux_mt->tiling == I915_TILING_Y);
>> +      intel_miptree_get_tile_dimensions(aux_mt->tiling, aux_mt->tr_mode,
>> +                                        aux_mt->cpp, &tile_w, &tile_h);
>>        surf[6] = SET_FIELD(mt->qpitch / 4, GEN8_SURFACE_AUX_QPITCH) |
>> -                SET_FIELD((aux_mt->pitch / 128) - 1, GEN8_SURFACE_AUX_PITCH) |
>> +                SET_FIELD((aux_mt->pitch / tile_w) - 1,
>> +                          GEN8_SURFACE_AUX_PITCH) |
>>                  aux_mode;
>>     } else {
>>        surf[6] = 0;
>> @@ -487,8 +492,13 @@ gen8_update_renderbuffer_surface(struct brw_context *brw,
>>     }
>>
>>     if (aux_mt) {
>> +      uint32_t tile_w, tile_h;
>> +      assert(aux_mt->tiling == I915_TILING_Y);
>> +      intel_miptree_get_tile_dimensions(aux_mt->tiling, aux_mt->tr_mode,
>> +                                        aux_mt->cpp, &tile_w, &tile_h);
>>        surf[6] = SET_FIELD(mt->qpitch / 4, GEN8_SURFACE_AUX_QPITCH) |
>> -                SET_FIELD((aux_mt->pitch / 128) - 1, GEN8_SURFACE_AUX_PITCH) |
>> +                SET_FIELD((aux_mt->pitch / tile_w) - 1,
>> +                          GEN8_SURFACE_AUX_PITCH) |
>>                  aux_mode;
>>
>
> I'm not convinced you can use TileYF/S on the AUX surface. I base it on the
> following statements:
>
> "CCS and hierarchical depth Auxiliary surfaces are TileY with Tiled Resource
> Mode of TRMODE_NONE regardless of the tile mode of the primary surface,"
>
> AND
>
> "MCS (Multisample Control Surface) is a special type of CCS."
>
> I don't mind the abstraction, I think it's a big improvement - can we just make
> sure you can allow YF/S?
You are right about Yf/s not applicable to aux surface. I'll update the commit
message. Mesa is still missing this check while selecting tr_mode and that
caused piglit regressions with Yf. So I thought of making it more generic. Do
you think the patch is still useful?


More information about the mesa-dev mailing list