minigbm: msm: Allow for build-time method to disable DRM_FORMAT_MOD_QCOM_COMPRESSED on NV12

Currently when we allocate a NV12 buffer, it ends up being
created with the DRM_FORMAT_MOD_QCOM_COMPRESSED modifier.

Unfortunately the upstream venus driver doesn't actually
understand drm buffer modifiers. So video decoder output
buffers are written to in uncompressed NV12.

Then when the buffer is set to the GPU or display, we end up
treating the uncompressed NV12 data like compressed data.
Which produces garbage output.

This patch adds a build option which disables UBWC compression
on just NV12 buffers.

A follow up patch to the Android.bp (only in the AOSP tree) will
be made to enable this.

Signed-off-by: John Stultz <>
Change-Id: Ib064ff9f3978bd8847355c5fd1cc9346b551efd8
Reviewed-by: Rob Clark <>
diff --git a/msm.c b/msm.c
index a07c1c4..f3be2be 100644
--- a/msm.c
+++ b/msm.c
@@ -164,7 +164,9 @@
 	case DRM_FORMAT_ABGR8888:
 	case DRM_FORMAT_XRGB8888:
 	case DRM_FORMAT_ARGB8888:
 	case DRM_FORMAT_NV12:
 		return 1;
 		return 0;