Re: [Mesa-dev] [PATCH 7/8] etnaviv: improve PIPE_BIND_LINEAR handling

2019-04-23 Thread Christian Gmeiner
Am Fr., 12. Apr. 2019 um 19:38 Uhr schrieb Lucas Stach :
>
> We weren't handling this flag at all, which broke some assumptions
> made by the users of the resource_create interface. As we can't render
> to a linear surface and the usefulness of yet another layout transition
> to handle this case seems limited, we only respect the flag when the
> resource isn't used for rendering.
>
> Signed-off-by: Lucas Stach 

Reviewed-by: Christian Gmeiner 

> ---
>  src/gallium/drivers/etnaviv/etnaviv_resource.c | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c 
> b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> index f405b880a6c0..650c8e7eb7f5 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> @@ -369,6 +369,14 @@ etna_resource_create(struct pipe_screen *pscreen,
> if (templat->target == PIPE_TEXTURE_3D)
>layout = ETNA_LAYOUT_LINEAR;
>
> +   /* The render pipe can't handle linear and there is no code to do yet 
> another
> +* layout transformation for this case, so we only respect the linear flag
> +* if the resource isn't meant to be rendered.
> +*/
> +   if ((templat->bind & PIPE_BIND_LINEAR) &&
> +   !(templat->bind & PIPE_BIND_RENDER_TARGET))
> +  layout = ETNA_LAYOUT_LINEAR;
> +
> /* modifier is only used for scanout surfaces, so safe to use LINEAR here 
> */
> return etna_resource_alloc(pscreen, layout, mode, DRM_FORMAT_MOD_LINEAR, 
> templat);
>  }
> --
> 2.20.1
>
> ___
> etnaviv mailing list
> etna...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv



-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 7/8] etnaviv: improve PIPE_BIND_LINEAR handling

2019-04-15 Thread Philipp Zabel
On Fri, 2019-04-12 at 19:38 +0200, Lucas Stach wrote:
> We weren't handling this flag at all, which broke some assumptions
> made by the users of the resource_create interface. As we can't render
> to a linear surface and the usefulness of yet another layout transition
> to handle this case seems limited, we only respect the flag when the
> resource isn't used for rendering.
> 
> Signed-off-by: Lucas Stach 
> ---
>  src/gallium/drivers/etnaviv/etnaviv_resource.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c 
> b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> index f405b880a6c0..650c8e7eb7f5 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> @@ -369,6 +369,14 @@ etna_resource_create(struct pipe_screen *pscreen,
> if (templat->target == PIPE_TEXTURE_3D)
>layout = ETNA_LAYOUT_LINEAR;
>  
> +   /* The render pipe can't handle linear and there is no code to do yet 
> another
> +* layout transformation for this case, so we only respect the linear flag
> +* if the resource isn't meant to be rendered.
> +*/
> +   if ((templat->bind & PIPE_BIND_LINEAR) &&
> +   !(templat->bind & PIPE_BIND_RENDER_TARGET))
> +  layout = ETNA_LAYOUT_LINEAR;
> +
> /* modifier is only used for scanout surfaces, so safe to use LINEAR here 
> */
> return etna_resource_alloc(pscreen, layout, mode, DRM_FORMAT_MOD_LINEAR, 
> templat);
>  }

Reviewed-by: Philipp Zabel 

regards
Philipp
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 7/8] etnaviv: improve PIPE_BIND_LINEAR handling

2019-04-12 Thread Lucas Stach
We weren't handling this flag at all, which broke some assumptions
made by the users of the resource_create interface. As we can't render
to a linear surface and the usefulness of yet another layout transition
to handle this case seems limited, we only respect the flag when the
resource isn't used for rendering.

Signed-off-by: Lucas Stach 
---
 src/gallium/drivers/etnaviv/etnaviv_resource.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c 
b/src/gallium/drivers/etnaviv/etnaviv_resource.c
index f405b880a6c0..650c8e7eb7f5 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
@@ -369,6 +369,14 @@ etna_resource_create(struct pipe_screen *pscreen,
if (templat->target == PIPE_TEXTURE_3D)
   layout = ETNA_LAYOUT_LINEAR;
 
+   /* The render pipe can't handle linear and there is no code to do yet 
another
+* layout transformation for this case, so we only respect the linear flag
+* if the resource isn't meant to be rendered.
+*/
+   if ((templat->bind & PIPE_BIND_LINEAR) &&
+   !(templat->bind & PIPE_BIND_RENDER_TARGET))
+  layout = ETNA_LAYOUT_LINEAR;
+
/* modifier is only used for scanout surfaces, so safe to use LINEAR here */
return etna_resource_alloc(pscreen, layout, mode, DRM_FORMAT_MOD_LINEAR, 
templat);
 }
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev