minigbm/msm: disable UBWC for virtualization

This actually reverts commit 407eb0ebf3ce52fd4b3d79712d1b86d7b021c29b.
However, the rationales have been updated.

BUG=b:229147702
TEST=emerge and deploy and verified graphics working in crostini

Change-Id: I8f491daf14f97a5dbda797207886695a985e44e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3586372
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
Commit-Queue: Chia-I Wu <olv@google.com>
diff --git a/msm.c b/msm.c
index 14ecf2b..5a2a73c 100644
--- a/msm.c
+++ b/msm.c
@@ -207,6 +207,21 @@
 		drv_log("WARNING: waffle detected, disabling UBWC\n");
 		return true;
 	}
+
+	/* Sommelier relies on implicit modifier, which does not pass host modifier to
+	 * zwp_linux_buffer_params_v1_add. Graphics will be broken if UBWC is enabled.
+	 * Sommelier shall be fixed to mirror what arc wayland_service does, and then
+	 * we can re-enable UBWC here.
+	 *
+	 * Inherit the trick from crrev/c/2523246 previously used for gtest. The side
+	 * effect is all VM guests on msm will revert back to use linear modifier.
+	 *
+	 * See b/229147702
+	 */
+	if (!dlsym(RTLD_DEFAULT, "cupsFilePrintf")) {
+		drv_log("WARNING: virtualization detected, disabling UBWC\n");
+		return true;
+	}
 #endif
 	return false;
 }