diff options
author | Vasily Khoruzhick <[email protected]> | 2019-12-09 18:23:17 -0800 |
---|---|---|
committer | Vasily Khoruzhick <[email protected]> | 2020-01-10 01:13:47 +0000 |
commit | a533d1d4c607543fc1e3ca427eba50e9602f6fe2 (patch) | |
tree | eed2cb7e5d25e5206b0a3976aca3599db7c334ad | |
parent | 87e0dd68f50748938e4abe0c6961b6704798afa3 (diff) |
lima: use linear layout for shared buffers if modifier is not specified
Use linear layout for shared buffers if modifier is not specified
and use linear layout when importing buffers with invalid modifier.
Fixes: 01a451b04d2d ("lima: handle DRM_FORMAT_MOD_INVALID in resource_from_handle()")
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Erico Nunes <[email protected]>
Signed-off-by: Vasily Khoruzhick <[email protected]>
-rw-r--r-- | src/gallium/drivers/lima/lima_resource.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/lima/lima_resource.c b/src/gallium/drivers/lima/lima_resource.c index 1b589ed5279..db116d06a83 100644 --- a/src/gallium/drivers/lima/lima_resource.c +++ b/src/gallium/drivers/lima/lima_resource.c @@ -193,6 +193,10 @@ _lima_resource_create_with_modifiers(struct pipe_screen *pscreen, if (templat->bind & (PIPE_BIND_LINEAR | PIPE_BIND_SCANOUT)) should_tile = false; + /* If there's no user modifiers and buffer is shared we use linear */ + if (!has_user_modifiers && (templat->bind & PIPE_BIND_SHARED)) + should_tile = false; + if (drm_find_modifier(DRM_FORMAT_MOD_LINEAR, modifiers, count)) should_tile = false; @@ -330,7 +334,10 @@ lima_resource_from_handle(struct pipe_screen *pscreen, res->tiled = true; break; case DRM_FORMAT_MOD_INVALID: - res->tiled = screen->ro == NULL; + /* Modifier wasn't specified and it's shared buffer. We create these + * as linear, so disable tiling. + */ + res->tiled = false; break; default: fprintf(stderr, "Attempted to import unsupported modifier 0x%llx\n", |