Commit 0b2c31dd authored by Imre Deak's avatar Imre Deak

drm/i915: Add functions to check for RC CCS CC and MC CCS modifiers

Instead of open-coding the checks add functions for this, simplifying
the handling of CCS modifiers on future platforms.

Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-12-imre.deak@intel.com
parent e359c47b
...@@ -277,6 +277,30 @@ bool intel_fb_is_ccs_modifier(u64 modifier) ...@@ -277,6 +277,30 @@ bool intel_fb_is_ccs_modifier(u64 modifier)
return is_ccs_type_modifier(lookup_modifier(modifier), INTEL_CCS_ANY); return is_ccs_type_modifier(lookup_modifier(modifier), INTEL_CCS_ANY);
} }
/**
* intel_fb_is_rc_ccs_cc_modifier: Check if a modifier is an RC CCS CC modifier type
* @modifier: Modifier to check
*
* Returns:
* Returns %true if @modifier is a render with color clear modifier.
*/
bool intel_fb_is_rc_ccs_cc_modifier(u64 modifier)
{
return is_ccs_type_modifier(lookup_modifier(modifier), INTEL_CCS_RC_CC);
}
/**
* intel_fb_is_mc_ccs_modifier: Check if a modifier is an MC CCS modifier type
* @modifier: Modifier to check
*
* Returns:
* Returns %true if @modifier is a media compression modifier.
*/
bool intel_fb_is_mc_ccs_modifier(u64 modifier)
{
return is_ccs_type_modifier(lookup_modifier(modifier), INTEL_CCS_MC);
}
static bool check_modifier_display_ver_range(const struct intel_modifier_desc *md, static bool check_modifier_display_ver_range(const struct intel_modifier_desc *md,
u8 display_ver_from, u8 display_ver_until) u8 display_ver_from, u8 display_ver_until)
{ {
......
...@@ -28,6 +28,8 @@ enum intel_plane_caps { ...@@ -28,6 +28,8 @@ enum intel_plane_caps {
}; };
bool intel_fb_is_ccs_modifier(u64 modifier); bool intel_fb_is_ccs_modifier(u64 modifier);
bool intel_fb_is_rc_ccs_cc_modifier(u64 modifier);
bool intel_fb_is_mc_ccs_modifier(u64 modifier);
bool intel_fb_is_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane); bool intel_fb_is_ccs_aux_plane(const struct drm_framebuffer *fb, int color_plane);
int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb); int intel_fb_rc_ccs_cc_plane(const struct drm_framebuffer *fb);
......
...@@ -1078,7 +1078,7 @@ skl_program_plane(struct intel_plane *plane, ...@@ -1078,7 +1078,7 @@ skl_program_plane(struct intel_plane *plane,
if (fb->format->is_yuv && icl_is_hdr_plane(dev_priv, plane_id)) if (fb->format->is_yuv && icl_is_hdr_plane(dev_priv, plane_id))
icl_program_input_csc(plane, crtc_state, plane_state); icl_program_input_csc(plane, crtc_state, plane_state);
if (fb->modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC) if (intel_fb_is_rc_ccs_cc_modifier(fb->modifier))
intel_uncore_write64_fw(&dev_priv->uncore, intel_uncore_write64_fw(&dev_priv->uncore,
PLANE_CC_VAL(pipe, plane_id), plane_state->ccval); PLANE_CC_VAL(pipe, plane_id), plane_state->ccval);
...@@ -1911,7 +1911,7 @@ static bool gen12_plane_format_mod_supported(struct drm_plane *_plane, ...@@ -1911,7 +1911,7 @@ static bool gen12_plane_format_mod_supported(struct drm_plane *_plane,
case DRM_FORMAT_P010: case DRM_FORMAT_P010:
case DRM_FORMAT_P012: case DRM_FORMAT_P012:
case DRM_FORMAT_P016: case DRM_FORMAT_P016:
if (modifier == I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS) if (intel_fb_is_mc_ccs_modifier(modifier))
return true; return true;
fallthrough; fallthrough;
case DRM_FORMAT_RGB565: case DRM_FORMAT_RGB565:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment