Module: Mesa
Branch: master
Commit: 979e13869538e79e8b56e18dfb4e7ea8816443f4
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=979e13869538e79e8b56e18dfb4e7ea8816443f4

Author: Simon Ser <[email protected]>
Date:   Fri Apr  9 14:03:53 2021 +0200

radeonsi: stop special-casing YUV formats in si_query_dmabuf_modifiers

Instead of having a special case for YUV formats in
si_query_dmabuf_modifiers, let ac_get_supported_modifiers handle
them. Keep setting external_only = 1 for YUV formats, since we
can only sample from such formats (we can't use them as render
targets).

This shouldn't change si_query_dmabuf_modifiers's behavior, because
for YUV formats ac_get_supported_modifiers will return a single
LINEAR modifier.

Signed-off-by: Simon Ser <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Acked-by: Leo Liu <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10134>

---

 src/gallium/drivers/radeonsi/si_texture.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_texture.c 
b/src/gallium/drivers/radeonsi/si_texture.c
index c54cf2d9f45..50621e0ed8c 100644
--- a/src/gallium/drivers/radeonsi/si_texture.c
+++ b/src/gallium/drivers/radeonsi/si_texture.c
@@ -1341,16 +1341,6 @@ static void si_query_dmabuf_modifiers(struct pipe_screen 
*screen,
 {
    struct si_screen *sscreen = (struct si_screen *)screen;
 
-   if (util_format_is_yuv(format)) {
-      if (max) {
-         *modifiers = DRM_FORMAT_MOD_LINEAR;
-         if (external_only)
-            *external_only = 1;
-      }
-      *count = 1;
-      return;
-   }
-
    unsigned ac_mod_count = max;
    ac_get_supported_modifiers(&sscreen->info, &(struct ac_modifier_options) {
          .dcc = !(sscreen->debug_flags & DBG(NO_DCC)),
@@ -1361,7 +1351,7 @@ static void si_query_dmabuf_modifiers(struct pipe_screen 
*screen,
       }, format, &ac_mod_count,  max ? modifiers : NULL);
    if (max && external_only) {
       for (unsigned i = 0; i < ac_mod_count; ++i)
-         external_only[i] = 0;
+         external_only[i] = util_format_is_yuv(format);
    }
    *count = ac_mod_count;
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to