mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
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: 01a451b04d ("lima: handle DRM_FORMAT_MOD_INVALID in resource_from_handle()")
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
This commit is contained in:
parent
87e0dd68f5
commit
a533d1d4c6
1 changed files with 8 additions and 1 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue