summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lord <clord@igalia.com>2020-03-05 16:37:53 +0000
committerMarge Bot <eric+marge@anholt.net>2020-03-11 09:10:13 +0000
commitb760ccfedb69c926803a4b8d9e61f800e9fc70ed (patch)
treebfb38fcfd08aa35a3c1ac0fa9a6a4f6f4f325c36
parent61f2e8d9bbde0d4416663fd61c4f63a5a763e96a (diff)
vc4: Fix query_dmabuf_modifiers mis-reporting external_only property
vc4_screen_query_dmabuf_modifiers doesn't consider that the given format may only be supported by lowering, which only happens for external textures. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Eric Anholt <eric@anholt.net> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4063> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4063>
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index 21db4c944ff..faa36c722ae 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -412,6 +412,7 @@ vc4_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
int *count)
{
int m, i;
+ bool tex_will_lower;
uint64_t available_modifiers[] = {
DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
DRM_FORMAT_MOD_LINEAR,
@@ -426,6 +427,7 @@ vc4_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
*count = MIN2(max, num_modifiers);
m = screen->has_tiling_ioctl ? 0 : 1;
+ tex_will_lower = !vc4_tex_format_supported(format);
/* We support both modifiers (tiled and linear) for all sampler
* formats, but if we don't have the DRM_VC4_GET_TILING ioctl
* we shouldn't advertise the tiled formats.
@@ -433,7 +435,7 @@ vc4_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen,
for (i = 0; i < *count; i++) {
modifiers[i] = available_modifiers[m++];
if (external_only)
- external_only[i] = false;
+ external_only[i] = tex_will_lower;
}
}