mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
drm/amd/display: drop redundant colorop type and TF checks
DRM core builds the curve_1d_type enum property with only the supported TF values, so any curve_1d_type that reaches atomic_commit is already guaranteed to be in the supported set. The per-colorop type field is immutable — it cannot change between the loop that finds colorop_state and the if block that uses it, so re-checking colorop->type there is dead code. Remove the redundant checks: - colorop->type == DRM_COLOROP_1D_CURVE in the shaper TF if block - colorop->type == DRM_COLOROP_1D_LUT in the shaper LUT if block - colorop->type == DRM_COLOROP_1D_CURVE in the blend TF if block - colorop->type == DRM_COLOROP_1D_LUT in the blend LUT if block - BIT(colorop_state->curve_1d_type) & supported_blnd_tfs in the blend TF if block (already guaranteed by the loop filter) - BIT(colorop_state->curve_1d_type) & supported_blnd_tfs in the blend LUT if block (nonsensical: a 1D_LUT colorop has no curve_1d_type) No functional change. Assisted-by: Copilot:claude-opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
dac8aa629a
commit
65485e86e3
|
|
@ -1660,7 +1660,7 @@ __set_dm_plane_colorop_shaper(struct drm_plane_state *plane_state,
|
|||
}
|
||||
}
|
||||
|
||||
if (colorop_state && !colorop_state->bypass && colorop->type == DRM_COLOROP_1D_CURVE) {
|
||||
if (colorop_state && !colorop_state->bypass) {
|
||||
drm_dbg(dev, "Shaper TF colorop with ID: %d\n", colorop->base.id);
|
||||
tf->type = TF_TYPE_DISTRIBUTED_POINTS;
|
||||
tf->tf = default_tf = amdgpu_colorop_tf_to_dc_tf(colorop_state->curve_1d_type);
|
||||
|
|
@ -1687,7 +1687,7 @@ __set_dm_plane_colorop_shaper(struct drm_plane_state *plane_state,
|
|||
}
|
||||
}
|
||||
|
||||
if (colorop_state && !colorop_state->bypass && colorop->type == DRM_COLOROP_1D_LUT) {
|
||||
if (colorop_state && !colorop_state->bypass) {
|
||||
drm_dbg(dev, "Shaper LUT colorop with ID: %d\n", colorop->base.id);
|
||||
tf->type = TF_TYPE_DISTRIBUTED_POINTS;
|
||||
tf->tf = default_tf;
|
||||
|
|
@ -1833,8 +1833,7 @@ __set_dm_plane_colorop_blend(struct drm_plane_state *plane_state,
|
|||
}
|
||||
}
|
||||
|
||||
if (colorop_state && !colorop_state->bypass && colorop->type == DRM_COLOROP_1D_CURVE &&
|
||||
(BIT(colorop_state->curve_1d_type) & amdgpu_dm_supported_blnd_tfs)) {
|
||||
if (colorop_state && !colorop_state->bypass) {
|
||||
drm_dbg(dev, "Blend TF colorop with ID: %d\n", colorop->base.id);
|
||||
tf->type = TF_TYPE_DISTRIBUTED_POINTS;
|
||||
tf->tf = default_tf = amdgpu_colorop_tf_to_dc_tf(colorop_state->curve_1d_type);
|
||||
|
|
@ -1859,8 +1858,7 @@ __set_dm_plane_colorop_blend(struct drm_plane_state *plane_state,
|
|||
}
|
||||
}
|
||||
|
||||
if (colorop_state && !colorop_state->bypass && colorop->type == DRM_COLOROP_1D_LUT &&
|
||||
(BIT(colorop_state->curve_1d_type) & amdgpu_dm_supported_blnd_tfs)) {
|
||||
if (colorop_state && !colorop_state->bypass) {
|
||||
drm_dbg(dev, "Blend LUT colorop with ID: %d\n", colorop->base.id);
|
||||
tf->type = TF_TYPE_DISTRIBUTED_POINTS;
|
||||
tf->tf = default_tf;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user