[PATCH 4/8] etnaviv: add support for extended PE formats

Christian Gmeiner christian.gmeiner at gmail.com
Sat Oct 21 07:55:58 UTC 2017


Hi Wladimir

2017-10-21 7:27 GMT+02:00 Wladimir J. van der Laan <laanwj at gmail.com>:
> On Fri, Oct 20, 2017 at 10:21:24PM +0200, Christian Gmeiner wrote:
>> Use the extended format if an such a format was passed.
>>
>> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
>> ---
>>  src/gallium/drivers/etnaviv/etnaviv_state.c | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c
>> index 34bcb19069..727d726f76 100644
>> --- a/src/gallium/drivers/etnaviv/etnaviv_state.c
>> +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c
>> @@ -126,13 +126,19 @@ etna_set_framebuffer_state(struct pipe_context *pctx,
>>        struct etna_surface *cbuf = etna_surface(sv->cbufs[0]);
>>        struct etna_resource *res = etna_resource(cbuf->base.texture);
>>        bool color_supertiled = (res->layout & ETNA_LAYOUT_BIT_SUPER) != 0;
>> +      uint32_t fmt = translate_rs_format(cbuf->base.format);
>>
>>        assert(res->layout & ETNA_LAYOUT_BIT_TILE); /* Cannot render to linear surfaces */
>>        etna_update_render_resource(pctx, cbuf->base.texture);
>>
>>        pipe_surface_reference(&cs->cbuf, &cbuf->base);
>> -      cs->PE_COLOR_FORMAT =
>> -         VIVS_PE_COLOR_FORMAT_FORMAT(translate_rs_format(cbuf->base.format)) |
>> +
>> +      if (fmt >= RS_FORMAT_R16F)
>> +          cs->PE_COLOR_FORMAT = VIVS_PE_COLOR_FORMAT_FORMAT_EXT(fmt);
>
> Please set the VIVS_PE_COLOR_FORMAT_FORMAT_FORMAT_MASK bit when using
> VIVS_PE_COLOR_FORMAT_FORMAT_EXT, some hw needs this to know it should
> use the extended format instead of the base format (and in any case the blob does
> it).
>

Will be fixed in v2.

> 0x06112f10, /*   [0142C] PE.COLOR_FORMAT := FORMAT=X4R4G4B4,FORMAT_MASK=1,COMPONENTS=R=1,G=1,B=1,A=1,SUPER_TILED_NEW=1,COMPONENTS_MASK=0,OVERWRITE=1,OVERWRITE_MASK=0,SUPER_TILED=1,SUPER_TILED_MASK=0,FORMAT_EXT=A8R8G8B8,FORMAT_EXT_MASK=0 */
>
> (the blob even uses the FORMAT_EXT and masks FORMAT for every format - on GPUs
> that support the EXT format bits, but there's some backwards compatbility
> handling, even GC7000 still understands the old way)
>

Good to know - thanks

greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info


More information about the etnaviv mailing list