From 48582489e46f50b7afa7f8bcf61ff7058ca91cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Molinari?= Date: Wed, 12 Nov 2025 12:56:26 +0100 Subject: [PATCH] pan/desc: Move funcs closer to callers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous commit makes rt_clear() and rt_clean_pixel_write() calls directly from pan_emit_rt(). Move these function definitions closer. This will also improve diffs of coming commits. Signed-off-by: Loïc Molinari Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/lib/pan_desc.c | 70 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/panfrost/lib/pan_desc.c b/src/panfrost/lib/pan_desc.c index 123684c0edd..acdafe576e5 100644 --- a/src/panfrost/lib/pan_desc.c +++ b/src/panfrost/lib/pan_desc.c @@ -646,41 +646,6 @@ get_rt_formats(enum pipe_format pfmt, uint32_t *writeback, uint32_t *internal, *pswizzle = pan_translate_swizzle_4(swizzle); } -/* forward declaration */ -static bool pan_force_clean_write_on(const struct pan_image *img, unsigned tile_size); - -static struct MALI_RT_CLEAR -rt_clear(const struct pan_fb_color_attachment *rt) -{ - if (!rt || !rt->clear) - return (struct MALI_RT_CLEAR){0}; - - return (struct MALI_RT_CLEAR){ - .color_0 = rt->clear_value[0], - .color_1 = rt->clear_value[1], - .color_2 = rt->clear_value[2], - .color_3 = rt->clear_value[3], - }; -} - -static bool -rt_clean_pixel_write(const struct pan_fb_color_attachment *rt, - unsigned tile_size) -{ - if (rt->clear) - return true; - -#if PAN_ARCH >= 6 - const struct pan_image_plane_ref pref = - pan_image_view_get_color_plane(rt->view); - - if (pan_force_clean_write_on(pref.image, tile_size)) - return true; -#endif - - return false; -} - void GENX(pan_emit_afbc_color_attachment)(const struct pan_fb_info *fb, unsigned rt_idx, @@ -940,6 +905,41 @@ pan_emit_midgard_tiler(const struct pan_fb_info *fb, #endif #if PAN_ARCH >= 5 +/* forward declaration */ +static bool pan_force_clean_write_on(const struct pan_image *img, unsigned tile_size); + +static struct MALI_RT_CLEAR +rt_clear(const struct pan_fb_color_attachment *rt) +{ + if (!rt->clear) + return (struct MALI_RT_CLEAR){0}; + + return (struct MALI_RT_CLEAR){ + .color_0 = rt->clear_value[0], + .color_1 = rt->clear_value[1], + .color_2 = rt->clear_value[2], + .color_3 = rt->clear_value[3], + }; +} + +static bool +rt_clean_pixel_write(const struct pan_fb_color_attachment *rt, + unsigned tile_size) +{ + if (rt->clear) + return true; + +#if PAN_ARCH >= 6 + const struct pan_image_plane_ref pref = + pan_image_view_get_color_plane(rt->view); + + if (pan_force_clean_write_on(pref.image, tile_size)) + return true; +#endif + + return false; +} + static void pan_emit_rt(const struct pan_fb_info *fb, unsigned layer_idx, unsigned idx, unsigned cbuf_offset, struct mali_render_target_packed *out)