From a5191f30bc09a009dc24bcfb0ea7ddfb2ef402c4 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 11 Nov 2020 13:19:38 -0500 Subject: [PATCH] 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 Reviewed-by: Boris Brezillon Tested-by: Robin Murphy Part-of: --- 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); }