[PATCH 04/11] etnaviv: pad scanout buffer size to RS alignment

Wladimir J. van der Laan laanwj at gmail.com
Tue Jun 27 14:54:51 UTC 2017


On Fri, Jun 23, 2017 at 05:50:21PM +0200, Lucas Stach wrote:
> This fixes failures to import the scanout buffer with screen resolutions
> that don't satisfy teh RS alignment restrictions, like 1680x1050.

Thanks. I remember having this issue on OLPC, but never came up with a good
solution.

Reviewed-by: Wladimir J. van der Laan

> Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> ---
>  src/gallium/drivers/etnaviv/etnaviv_resource.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> index c6e7e98837b6..5cd20fafba49 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> @@ -215,9 +215,18 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout,
>     rsc->ts_bo = 0; /* TS is only created when first bound to surface */
>  
>     if (templat->bind & PIPE_BIND_SCANOUT) {
> +      struct pipe_resource scanout_templat = *templat;
>        struct winsys_handle handle;
> -      rsc->scanout = renderonly_scanout_for_resource(&rsc->base, screen->ro,
> -                                                     &handle);
> +      unsigned padX, padY;
> +
> +      /* pad scanout buffer size to be compatible with the RS */
> +      padX = ETNA_RS_WIDTH_MASK + 1;
> +      padY = (ETNA_RS_HEIGHT_MASK + 1) * screen->specs.pixel_pipes;
> +      scanout_templat.width0 = align(scanout_templat.width0, padX);
> +      scanout_templat.height0 = align(scanout_templat.height0, padY);
> +
> +      rsc->scanout = renderonly_scanout_for_resource(&scanout_templat,
> +                                                     screen->ro, &handle);
>        if (!rsc->scanout)
>           goto free_rsc;
>  
> -- 
> 2.11.0
> 
> _______________________________________________
> etnaviv mailing list
> etnaviv at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv


More information about the etnaviv mailing list