Mesa (master): freedreno: Handle DRM_FORMAT_MOD_INVALID in shared code
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 23 19:31:05 UTC 2020
Module: Mesa
Branch: master
Commit: bf92f041fe58e494e2bc04d4ebf3e3b8bf8487ed
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf92f041fe58e494e2bc04d4ebf3e3b8bf8487ed
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>
---
src/gallium/drivers/freedreno/freedreno_resource.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
index 7343dbcc9c6..faafd6fe82d 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -1157,6 +1157,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