etnaviv: pass correct layout to etna_resource_alloc for scanout resources

Since b962776530 (etnaviv: rework compatible render base) the base resource
may be linear and a render compatible resource is allocated as needed. As
scanout surfaces without a modifier are always assumed to be linear, make
sure to pass the correct layout to etna_resource_alloc().

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
This commit is contained in:
Lucas Stach 2020-10-29 18:09:49 +01:00 committed by Marge Bot
parent ec21148311
commit 3862cec314
1 changed files with 3 additions and 2 deletions

View File

@ -352,7 +352,7 @@ etna_resource_create(struct pipe_screen *pscreen,
* and a texture-compatible base buffer in other cases
*
*/
if (templat->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_DEPTH_STENCIL)) {
if (templat->bind & PIPE_BIND_DEPTH_STENCIL) {
if (screen->specs.pixel_pipes > 1 && !screen->specs.single_buffer)
layout |= ETNA_LAYOUT_BIT_MULTI;
if (screen->specs.can_supertile)
@ -362,7 +362,8 @@ etna_resource_create(struct pipe_screen *pscreen,
layout |= ETNA_LAYOUT_BIT_SUPER;
}
if ((templat->bind & PIPE_BIND_LINEAR) || /* linear base requested */
if (/* linear base or scanout without modifier requested */
(templat->bind & (PIPE_BIND_LINEAR | PIPE_BIND_SCANOUT)) ||
templat->target == PIPE_BUFFER || /* buffer always linear */
/* compressed textures don't use tiling, they have their own "tiles" */
util_format_is_compressed(templat->format)) {