diff options
author | Jonathan Marek <[email protected]> | 2019-02-20 11:50:47 +0100 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2019-03-05 12:03:05 -0800 |
commit | 4b8df622c4f5bada9afd9e71299fe39329dbe5f0 (patch) | |
tree | 1aeb218f6669f9e74eb5cee4dc47b23e3d63cafb /src/gallium | |
parent | 548893d5f54e8ff14db099012cff3450e81cd7ab (diff) |
freedreno: use renderonly path for buffers allocated with modifiers
Now that freedreno has create_with_modifiers(), this "hack" is needed to
make some cases work. Copied from vc4.
Fixes: 41ddf1d1
Signed-off-by: Jonathan Marek <[email protected]>
(cherry picked from commit e3591b03393402321d24e10b93ec5a827a4b9b6a)
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_resource.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index ce8e4480be1..1879d2c60ed 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -853,7 +853,13 @@ fd_resource_create_with_modifiers(struct pipe_screen *pscreen, enum pipe_format format = tmpl->format; uint32_t size; - if (screen->ro && (tmpl->bind & PIPE_BIND_SCANOUT)) { + /* when using kmsro, scanout buffers are allocated on the display device + * create_with_modifiers() doesn't give us usage flags, so we have to + * assume that all calls with modifiers are scanout-possible + */ + if (screen->ro && + ((tmpl->bind & PIPE_BIND_SCANOUT) || + !(count == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID))) { struct pipe_resource scanout_templat = *tmpl; struct renderonly_scanout *scanout; struct winsys_handle handle; |