[PATCH v2 05/14] etnaviv: take care of the number of layers

Lucas Stach l.stach at pengutronix.de
Fri May 4 08:01:32 UTC 2018


Am Dienstag, den 01.05.2018, 16:48 +0200 schrieb Christian Gmeiner:
> With the help of the number of layers we can choose the correct
> RS clear format - like the binary blob does.
> 
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>  src/gallium/drivers/etnaviv/etnaviv_rs.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_rs.c
> b/src/gallium/drivers/etnaviv/etnaviv_rs.c
> index 3febd8daef..fbcdb4f57d 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_rs.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_rs.c
> @@ -254,9 +254,10 @@ etna_rs_gen_clear_surface(struct etna_context
> *ctx, struct etna_surface *surf,
>                            uint32_t clear_value)
>  {
>     struct etna_resource *dst = etna_resource(surf->base.texture);
> +   const int layer = translate_rs_layer(surf->base.format);
>     uint32_t format;
>  
> -   switch (util_format_get_blocksize(surf->base.format)) {
> +   switch (util_format_get_blocksize(surf->base.format) / layer) {
>     case 2:
>        format = RS_FORMAT_A4R4G4B4;
>        break;

Doesn't this mean that we need to double the number of tiles or the
stride of the surface somewhere? Wouldn't we end up with only one half
of the surface being cleared otherwise?

Regards,
Lucas


More information about the etnaviv mailing list