diff options
author | Jonathan Marek <[email protected]> | 2019-06-19 17:16:27 -0400 |
---|---|---|
committer | Jonathan Marek <[email protected]> | 2019-07-14 10:34:17 -0400 |
commit | a9e78a44d1edc39df99bbf71e5e1d8d762438ceb (patch) | |
tree | c26c2968c5f387d68704ae37d6969cea9183aac0 /src/gallium/drivers/etnaviv/etnaviv_resource.c | |
parent | 2c393053bf5c1e76bdcf37f620259fc63dd31859 (diff) |
etnaviv: reduce rs alignment requirement for two pixel pipes GPU
The rs alignment doesn't have to be multiplied by # of pixel pipes.
This works on GC2000 which doesn't have the SINGLE_BUFFER feature.
This fixes some cubemaps (NPOT / small mipmap levels) because aligning by 8
breaks the expected alignment of 4 for tiled format. We don't want to mess
with the alignment of tiled formats.
Signed-off-by: Jonathan Marek <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_resource.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_resource.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c index 44da60a22b1..d5abe3adf70 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c @@ -253,8 +253,8 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout, paddingY = 1; } - if (!screen->specs.use_blt && templat->target != PIPE_BUFFER) - etna_adjust_rs_align(screen->specs.pixel_pipes, NULL, &paddingY); + if (!screen->specs.use_blt && templat->target != PIPE_BUFFER && layout == ETNA_LAYOUT_LINEAR) + paddingY = align(paddingY, ETNA_RS_HEIGHT_MASK + 1); if (templat->bind & PIPE_BIND_SCANOUT && screen->ro->kms_fd >= 0) { struct pipe_resource scanout_templat = *templat; @@ -262,8 +262,10 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout, struct winsys_handle handle; /* pad scanout buffer size to be compatible with the RS */ - if (!screen->specs.use_blt && modifier == DRM_FORMAT_MOD_LINEAR) - etna_adjust_rs_align(screen->specs.pixel_pipes, &paddingX, &paddingY); + if (!screen->specs.use_blt && modifier == DRM_FORMAT_MOD_LINEAR) { + paddingX = align(paddingX, ETNA_RS_WIDTH_MASK + 1); + paddingY = align(paddingY, ETNA_RS_HEIGHT_MASK + 1); + } scanout_templat.width0 = align(scanout_templat.width0, paddingX); scanout_templat.height0 = align(scanout_templat.height0, paddingY); @@ -559,8 +561,8 @@ etna_resource_from_handle(struct pipe_screen *pscreen, is_rs_align(screen, tmpl), &paddingX, &paddingY, &rsc->halign); - if (!screen->specs.use_blt) - etna_adjust_rs_align(screen->specs.pixel_pipes, NULL, &paddingY); + if (!screen->specs.use_blt && rsc->layout == ETNA_LAYOUT_LINEAR) + paddingY = align(paddingY, ETNA_RS_HEIGHT_MASK + 1); level->padded_width = align(level->width, paddingX); level->padded_height = align(level->height, paddingY); |