Mesa (master): panfrost: Remove panfrost_can_linear

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 13 19:14:23 UTC 2020


Module: Mesa
Branch: master
Commit: a5191f30bc09a009dc24bcfb0ea7ddfb2ef402c4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5191f30bc09a009dc24bcfb0ea7ddfb2ef402c4

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Nov 11 13:19:38 2020 -0500

panfrost: Remove panfrost_can_linear

Always permit falling back to linear, now that linear Z/S is supported
on SFBD.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Tested-by: Robin Murphy <robin.murphy at arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7557>

---

 src/gallium/drivers/panfrost/pan_resource.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 66970426096..b3a1b0dc172 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -417,19 +417,8 @@ panfrost_setup_slices(struct panfrost_resource *pres, size_t *bo_size)
  * level, not all usages are valid for tiling. Finally, if the app is hinting
  * that the contents frequently change, tiling will be a loss.
  *
- * Due to incomplete information on some platforms, we may need to force tiling
- * in some cases.
- *
  * On platforms where it is supported, AFBC is even better. */
 
-static bool
-panfrost_can_linear(struct panfrost_device *dev, const struct panfrost_resource *pres)
-{
-        /* XXX: We should be able to do linear Z/S with the right bits.. */
-        return !((pres->base.bind & PIPE_BIND_DEPTH_STENCIL) &&
-                (dev->quirks & MIDGARD_SFBD));
-}
-
 static bool
 panfrost_should_afbc(struct panfrost_device *dev, const struct panfrost_resource *pres)
 {
@@ -500,11 +489,6 @@ panfrost_should_tile(struct panfrost_device *dev, const struct panfrost_resource
 
         bool can_tile = is_2d && is_sane_bpp && ((pres->base.bind & ~valid_binding) == 0);
 
-        if (!panfrost_can_linear(dev, pres)) {
-                assert(can_tile);
-                return true;
-        }
-
         return can_tile && (pres->base.usage != PIPE_USAGE_STREAM);
 }
 
@@ -536,11 +520,9 @@ panfrost_resource_setup(struct panfrost_device *dev, struct panfrost_resource *p
         pres->checksummed = (pres->base.bind & PIPE_BIND_RENDER_TARGET);
 
         /* We can only switch tiled->linear if the resource isn't already
-         * linear, and if we control the modifier, and if the resource can be
-         * linear. */
+         * linear and if we control the modifier */
         pres->modifier_constant = !((pres->modifier != DRM_FORMAT_MOD_LINEAR)
-                        && (modifier == DRM_FORMAT_MOD_INVALID)
-                        && panfrost_can_linear(dev, pres));
+                        && (modifier == DRM_FORMAT_MOD_INVALID));
 
         panfrost_setup_slices(pres, bo_size);
 }



More information about the mesa-commit mailing list