From 43703d82658ba273515a1e1c1eac976cadc1d397 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 19 Aug 2022 13:37:57 -0400 Subject: [PATCH] Revert "zink: add all format modifiers when adding for dmabuf export" This reverts commit 247b8f2924b7832d8520e890cff6891217f5a860. this attempted to work around what is likely a bug in nvidia's modifier support, namely their refusal to expose LINEAR as a valid modifier for some bizarre reason cc: mesa-stable Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/zink/zink_resource.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index ad8b908415e..b65bbedf0bd 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -1245,10 +1245,9 @@ add_resource_bind(struct zink_context *ctx, struct zink_resource *res, unsigned res->base.b.bind |= bind; struct zink_resource_object *old_obj = res->obj; if (bind & ZINK_BIND_DMABUF && !res->modifiers_count && screen->info.have_EXT_image_drm_format_modifier) { - res->modifiers_count = screen->modifier_props[res->base.b.format].drmFormatModifierCount; + res->modifiers_count = 1; res->modifiers = malloc(res->modifiers_count * sizeof(uint64_t)); - for (unsigned i = 0; i < screen->modifier_props[res->base.b.format].drmFormatModifierCount; i++) - res->modifiers[i] = screen->modifier_props[res->base.b.format].pDrmFormatModifierProperties[i].drmFormatModifier; + res->modifiers[0] = DRM_FORMAT_MOD_LINEAR; } struct zink_resource_object *new_obj = resource_object_create(screen, &res->base.b, NULL, &res->linear, res->modifiers, res->modifiers_count, NULL); if (!new_obj) {