aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorLucas Stach <[email protected]>2017-06-09 18:44:46 +0200
committerLucas Stach <[email protected]>2017-07-19 16:26:49 +0200
commitb158ccf1d95157216bfc9252e498e46ba0257366 (patch)
tree8f77d3e0851825156b693a4143e030dd1e9556d9 /src/gallium
parent68ec876a252a0e78d7eb2991bb0397752bbeec25 (diff)
etnaviv: pad scanout buffer size to RS alignment
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 <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_resource.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
index 1cd906d4afa..8e39461ec67 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;