[PATCH i-g-t 19/37] lib/igt_fb: Expose igt_fb_is_gen12_mc_ccs_modifier()
Juha-Pekka Heikkila
juhapekka.heikkila at gmail.com
Tue Aug 27 16:46:03 UTC 2024
On 3.7.2024 2.27, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> I'm going to need is_gen12_mc_ccs_modifier() outside of
> igt_fb.c. Rename it to igt_fb_is_gen12_mc_ccs_modifier()
> and expose it to everyone.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
> lib/igt_fb.c | 12 ++++++------
> lib/igt_fb.h | 1 +
> 2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index b95dc3278f23..4ef1945e4333 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -587,7 +587,7 @@ void igt_get_fb_tile_size(int fd, uint64_t modifier, int fb_bpp,
> }
> }
>
> -static bool is_gen12_mc_ccs_modifier(uint64_t modifier)
> +bool igt_fb_is_gen12_mc_ccs_modifier(uint64_t modifier)
With comment block added
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> {
> return modifier == I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS ||
> modifier == I915_FORMAT_MOD_4_TILED_DG2_MC_CCS ||
> @@ -603,7 +603,7 @@ bool igt_fb_is_gen12_rc_ccs_cc_modifier(uint64_t modifier)
>
> static bool is_gen12_ccs_modifier(uint64_t modifier)
> {
> - return is_gen12_mc_ccs_modifier(modifier) ||
> + return igt_fb_is_gen12_mc_ccs_modifier(modifier) ||
> igt_fb_is_gen12_rc_ccs_cc_modifier(modifier) ||
> modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS ||
> modifier == I915_FORMAT_MOD_4_TILED_DG2_RC_CCS ||
> @@ -2499,7 +2499,7 @@ static bool ccs_needs_enginecopy(const struct igt_fb *fb)
> if (igt_fb_is_gen12_rc_ccs_cc_modifier(fb->modifier))
> return true;
>
> - if (is_gen12_mc_ccs_modifier(fb->modifier))
> + if (igt_fb_is_gen12_mc_ccs_modifier(fb->modifier))
> return true;
>
> if (igt_fb_is_ccs_modifier(fb->modifier) &&
> @@ -2631,7 +2631,7 @@ igt_fb_create_intel_buf(int fd, struct buf_ops *bops,
> } else
> igt_assert_eq(fb->strides[1] & 127, 0);
>
> - if (is_gen12_mc_ccs_modifier(fb->modifier))
> + if (igt_fb_is_gen12_mc_ccs_modifier(fb->modifier))
> compression = I915_COMPRESSION_MEDIA;
> else
> compression = I915_COMPRESSION_RENDER;
> @@ -2725,7 +2725,7 @@ static bool use_vebox_copy(const struct igt_fb *src_fb,
> const struct igt_fb *dst_fb)
> {
>
> - return is_gen12_mc_ccs_modifier(dst_fb->modifier) ||
> + return igt_fb_is_gen12_mc_ccs_modifier(dst_fb->modifier) ||
> igt_format_is_yuv(src_fb->drm_format) ||
> igt_format_is_yuv(dst_fb->drm_format);
> }
> @@ -2800,7 +2800,7 @@ static struct blt_copy_object *allocate_and_initialize_blt(const struct igt_fb *
> intel_get_pat_idx_uc(fb->fd),
> blt_tile,
> igt_fb_is_ccs_modifier(fb->modifier) ? COMPRESSION_ENABLED : COMPRESSION_DISABLED,
> - is_gen12_mc_ccs_modifier(fb->modifier) ? COMPRESSION_TYPE_MEDIA : COMPRESSION_TYPE_3D);
> + igt_fb_is_gen12_mc_ccs_modifier(fb->modifier) ? COMPRESSION_TYPE_MEDIA : COMPRESSION_TYPE_3D);
>
> blt_set_geom(blt, stride, 0, 0, fb->width, fb->plane_height[plane], 0, 0);
> blt->plane_offset = fb->offsets[plane];
> diff --git a/lib/igt_fb.h b/lib/igt_fb.h
> index 12c9574827f2..eb707cc34560 100644
> --- a/lib/igt_fb.h
> +++ b/lib/igt_fb.h
> @@ -183,6 +183,7 @@ uint64_t igt_fb_tiling_to_mod(uint64_t tiling);
>
> bool igt_fb_is_ccs_modifier(uint64_t modifier);
> bool igt_fb_is_gen12_rc_ccs_cc_modifier(uint64_t modifier);
> +bool igt_fb_is_gen12_mc_ccs_modifier(uint64_t modifier);
> bool igt_fb_is_ccs_plane(const struct igt_fb *fb, int plane);
> bool igt_fb_is_gen12_ccs_cc_plane(const struct igt_fb *fb, int plane);
> int igt_fb_ccs_to_main_plane(const struct igt_fb *fb, int ccs_plane);
More information about the igt-dev
mailing list