Mesa (staging/20.1): freedreno: Handle DRM_FORMAT_MOD_INVALID in shared code

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 23 22:48:29 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 1b7d1e189eb94cecb6e1cf20c40e5c467b784759
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b7d1e189eb94cecb6e1cf20c40e5c467b784759

Author: Kristian H. Kristensen <hoegsberg at google.com>
Date:   Tue Jun 23 10:39:14 2020 -0700

freedreno: Handle DRM_FORMAT_MOD_INVALID in shared code

layout_resource_for_modifier() needs to handle DRM_FORMAT_MOD_INVALID
as well, since src/gallium/frontends/dri/dri2.c uses this to indicate
"no modifier" when it's called through the older non-modifier entry
points.

This is similar to 334788d4 ("freedreno: allow INVALID modifier") but
for the generic implementation.

Fixes: 98910626 ("freedreno/a6xx: Implement layout for DRM_FORMAT_MOD_QCOM_COMPRESSED")
Closes: #3154
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5611>
(cherry picked from commit bf92f041fe58e494e2bc04d4ebf3e3b8bf8487ed)

---

 .pick_status.json                                  | 2 +-
 src/gallium/drivers/freedreno/freedreno_resource.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index f0972e423bd..d7ef027945f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4,7 +4,7 @@
         "description": "freedreno: Handle DRM_FORMAT_MOD_INVALID in shared code",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "9891062642a3f35dc326b305fca2407f9041915c"
     },
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
index 519cfbc1a5b..c9e408fe908 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -1244,6 +1244,12 @@ fd_layout_resource_for_modifier(struct fd_resource *rsc, uint64_t modifier)
 {
 	switch (modifier) {
 	case DRM_FORMAT_MOD_LINEAR:
+		/* The dri gallium frontend will pass DRM_FORMAT_MOD_INVALID to us
+		 * when it's called through any of the non-modifier BO create entry
+		 * points.  Other drivers will determine tiling from the kernel or
+		 * other legacy backchannels, but for freedreno it just means
+		 * LINEAR. */
+	case DRM_FORMAT_MOD_INVALID:
 		return 0;
 	default:
 		return -1;



More information about the mesa-commit mailing list