Mesa (staging/18.2): i965/screen: Allow modifiers on sRGB formats

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 31 08:52:51 UTC 2018


Module: Mesa
Branch: staging/18.2
Commit: 23358db7080cd691e7000ff2c37325b720506cb9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=23358db7080cd691e7000ff2c37325b720506cb9

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Aug 28 15:25:23 2018 -0500

i965/screen: Allow modifiers on sRGB formats

This effectively reverts a26693493570a9d0f0fba1be617e01ee7bfff4db which
was a misguided attempt at protecting intel_query_dma_buf_modifiers from
invalid formats.  Unfortunately, in some internal EGL cases, we can get
an SRGB format validly in this function.  Rejecting such formats caused
us to not allow CCS in some cases where we should have been allowing it.
This regressed the performance of some SynMark tests as well as GfxBench
ALU2, Tessellation and Manhattan 3.0 tests

There's some question of whether or not we really should be using SRGB
"fourcc" formats that aren't actually in drm_foucc.h but there's not
much harm in allowing them through here.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107223
Fixes: a26693493570 "i965/screen: Return false for unsupported..."
Tested-By: Eero Tamminen <eero.t.tamminen at intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
(cherry picked from commit d9cf4308ceea3762c1aab48f9c48e12a72162b5a)

---

 src/mesa/drivers/dri/i965/intel_screen.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index cb357419a7..0dd75cb0b0 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -1275,9 +1275,9 @@ static bool
 intel_image_format_is_supported(const struct gen_device_info *devinfo,
                                 const struct intel_image_format *fmt)
 {
-   if (fmt->fourcc == __DRI_IMAGE_FOURCC_SARGB8888 ||
-       fmt->fourcc == __DRI_IMAGE_FOURCC_SABGR8888)
-      return false;
+   /* Currently, all formats with an intel_image_format are available on all
+    * platforms so there's really nothing to check there.
+    */
 
 #ifndef NDEBUG
    if (fmt->nplanes == 1) {
@@ -1303,6 +1303,14 @@ intel_query_dma_buf_formats(__DRIscreen *_screen, int max,
    int num_formats = 0, i;
 
    for (i = 0; i < ARRAY_SIZE(intel_image_formats); i++) {
+      /* These two formats are valid DRI formats but do not exist in
+       * drm_fourcc.h in the Linux kernel.  We don't want to accidentally
+       * advertise them through the EGL layer.
+       */
+      if (intel_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SARGB8888 ||
+          intel_image_formats[i].fourcc == __DRI_IMAGE_FOURCC_SABGR8888)
+         continue;
+
       if (!intel_image_format_is_supported(&screen->devinfo,
                                            &intel_image_formats[i]))
          continue;




More information about the mesa-commit mailing list