Merge SQ3A.220605.009

Bug: 236045730
Merged-In: Id84c042e46b2c8af088a63182e36eda910a748e2
Change-Id: Ia8002b4fff23fe47843fb7dbf66f1f5c1fe77e98
diff --git a/METADATA b/METADATA
index ee8d4b3..ea134b3 100644
--- a/METADATA
+++ b/METADATA
@@ -18,10 +18,13 @@
   }
   version: "17.0.4"
   last_upgrade_date { year: 2017 month: 5 day: 22 }
-  # would be NOTICE save for:
-  #   include/drm-uapi/etnaviv_drm.h
-  # and RESTRICTED save for:
-  #   docs/README.VCE
-  #   docs/README.UVD
+  license_note: "would be NOTICE save for:\n"
+  "   include/drm-uapi/etnaviv_drm.h\n"
+  " and RESTRICTED save for:\n"
+  "   docs/README.VCE\n"
+  "   docs/README.UVD"
   license_type: BY_EXCEPTION_ONLY
+  security {
+    tag: "NVD-CPE2.3:cpe:/a:mesa3d:mesa:17.0.4"
+  }
 }
diff --git a/OWNERS b/OWNERS
index 380fa8c..7712dd0 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,3 +1,2 @@
 adelva@google.com
 dimitrysh@google.com
-sadmac@google.com
diff --git a/src/egl/Android.mk b/src/egl/Android.mk
index 322a111..823ba94 100644
--- a/src/egl/Android.mk
+++ b/src/egl/Android.mk
@@ -88,6 +88,11 @@
 LOCAL_REQUIRED_MODULES += gallium_dri
 endif
 
+# TODO(b/223646636): Temporary hack for handles with HDR metadata fds
+ifeq ($(BOARD_GPU_DRIVERS),virgl)
+LOCAL_CFLAGS += -DNUM_FDS_HACK
+endif
+
 LOCAL_MODULE := libGLES_mesa
 LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT
 LOCAL_LICENSE_CONDITIONS := notice
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index fa6949b..c8e0e7b 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -174,7 +174,11 @@
    for (int i = 0; i < handle->numFds; i++)
       fds[i] = handle->data[i];
 
+#ifdef NUM_FDS_HACK
+   return 1;
+#else
    return handle->numFds;
+#endif
 }
 
 #ifdef HAVE_DRM_GRALLOC
diff --git a/src/freedreno/Android.ir3.mk b/src/freedreno/Android.ir3.mk
index 50ad0fa..c46564e 100644
--- a/src/freedreno/Android.ir3.mk
+++ b/src/freedreno/Android.ir3.mk
@@ -96,8 +96,8 @@
 $(intermediates)/ir3/ir3_parser.h: $(ir3_parser_deps) $(BISON) $(BISON_DATA) $(M4)
 	@mkdir -p $(dir $@)
 	@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
-	$(hide) $(BISON) $< --name-prefix=ir3_yy --defines=$@
-	$(hide) M4=$(M4) $(BISON) $< --name-prefix=ir3_yy --defines=$@
+	$(hide) $(BISON) $< --name-prefix=ir3_yy --defines=$@ --output=$@.tab.c
+	$(hide) M4=$(M4) $(BISON) $< --name-prefix=ir3_yy --defines=$@ --output=$@.tab.c
 
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)