This fixes failures to import the scanout buffer with screen resolutions that don't satisfy the RS alignment restrictions, like 1680x1050.
Signed-off-by: Lucas Stach <l.st...@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmei...@gmail.com> Reviewed-by: Philipp Zabel <p.za...@pengutronix.de> Reviewed-by: Wladimir J. van der Laan <laa...@gmail.com> --- src/gallium/drivers/etnaviv/etnaviv_resource.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c index 778165113d54..be63b9c42172 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c @@ -212,9 +212,15 @@ 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); + + /* pad scanout buffer size to be compatible with the RS */ + etna_adjust_rs_align(screen->specs.pixel_pipes, + &scanout_templat.width0, &scanout_templat.height0); + + rsc->scanout = renderonly_scanout_for_resource(&scanout_templat, + screen->ro, &handle); if (!rsc->scanout) goto free_rsc; -- 2.11.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev