[Intel-gfx] [PATCH v3 09/11] drm/i915: Add a platform independent way to check for CCS AUX planes

Jani Nikula jani.nikula at linux.intel.com
Tue Oct 19 08:02:45 UTC 2021


>From patch 1:

static bool check_modifier_display_ver(const struct intel_modifier_desc *md,
				       u8 display_ver)
{
	return display_ver >= md->display_ver.from &&
	       display_ver <= md->display_ver.until;
}

On Fri, 15 Oct 2021, Imre Deak <imre.deak at intel.com> wrote:
> +static bool check_modifier_display_ver_range(const struct intel_modifier_desc *md,
> +					     u8 display_ver_from, u8 display_ver_until)
> +{
> +	return check_modifier_display_ver(md, display_ver_from) &&
> +	       check_modifier_display_ver(md, display_ver_until);
> +}
> +

...

> +/**
> + * intel_fb_is_gen12_ccs_aux_plane: Check if a framebuffer color plane is a GEN12 CCS AUX plane
> + * @fb: Framebuffer
> + * @color_plane: color plane index to check
> + *
> + * Returns:
> + * Returns %true if @fb's color plane at index @color_plane is a GEN12 CCS AUX plane.
> + */
> +static bool intel_fb_is_gen12_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane)
>  {
> -	return is_gen12_ccs_modifier(fb->modifier) && is_ccs_plane(fb, plane);
> +	const struct intel_modifier_desc *md = lookup_modifier(fb->modifier);
> +
> +	return check_modifier_display_ver_range(md, 12, 13) &&
> +	       ccs_aux_plane_mask(md, fb->format) & BIT(color_plane);
>  }

check_modifier_display_ver_range(md, 12, 13)

==>

check_modifier_display_ver(md, 12) &&
check_modifier_display_ver(md, 13)

==>

12 >= md->display_ver.from &&
12 <= md->display_ver.until &&
13 >= md->display_ver.from &&
13 <= md->display_ver.until

==>

Always false.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list