isl: check whether a format is rgb if colorspace is yuv
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 3 Oct 2017 18:10:41 +0000 (19:10 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 6 Oct 2017 10:45:49 +0000 (11:45 +0100)
Suggested by Chad.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/isl/isl.h

index 98de4c0f57f7fc67ba80e3d84a7d7134458e8538..e3acb0ec280a3043b926409742c7da0a34c17ade 100644 (file)
@@ -1512,6 +1512,8 @@ enum isl_format isl_format_srgb_to_linear(enum isl_format fmt);
 static inline bool
 isl_format_is_rgb(enum isl_format fmt)
 {
+   if (isl_format_is_yuv(fmt))
+      return false;
    return isl_format_layouts[fmt].channels.r.bits > 0 &&
           isl_format_layouts[fmt].channels.g.bits > 0 &&
           isl_format_layouts[fmt].channels.b.bits > 0 &&