Skip to content

Commit 96d7e79

Browse files
vsyrjalajnikula
authored andcommitted
drm/i915: Check pipe active state in {planes,vrr}_{enabling,disabling}()
{planes,vrr}_{enabling,disabling}() are supposed to indicate whether the specific hardware feature is supposed to be enabling or disabling. That can only makes sense if the pipe is active overall. So check for that before we go poking at the hardware. I think we're semi-safe currently on due to: - intel_pre_plane_update() doesn't get called when the pipe was not-active prior to the commit, but this is actually a bug. This saves vrr_disabling(), and vrr_enabling() is called from deeper down where we have already checked hw.active. - active_planes mirrors the crtc's hw.active Reviewed-by: Jani Nikula <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit bc53c4d) Signed-off-by: Jani Nikula <[email protected]>
1 parent d21a396 commit 96d7e79

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,12 +906,18 @@ static bool needs_async_flip_vtd_wa(const struct intel_crtc_state *crtc_state)
906906
static bool planes_enabling(const struct intel_crtc_state *old_crtc_state,
907907
const struct intel_crtc_state *new_crtc_state)
908908
{
909+
if (!new_crtc_state->hw.active)
910+
return false;
911+
909912
return is_enabling(active_planes, old_crtc_state, new_crtc_state);
910913
}
911914

912915
static bool planes_disabling(const struct intel_crtc_state *old_crtc_state,
913916
const struct intel_crtc_state *new_crtc_state)
914917
{
918+
if (!old_crtc_state->hw.active)
919+
return false;
920+
915921
return is_disabling(active_planes, old_crtc_state, new_crtc_state);
916922
}
917923

@@ -928,6 +934,9 @@ static bool vrr_params_changed(const struct intel_crtc_state *old_crtc_state,
928934
static bool vrr_enabling(const struct intel_crtc_state *old_crtc_state,
929935
const struct intel_crtc_state *new_crtc_state)
930936
{
937+
if (!new_crtc_state->hw.active)
938+
return false;
939+
931940
return is_enabling(vrr.enable, old_crtc_state, new_crtc_state) ||
932941
(new_crtc_state->vrr.enable &&
933942
(new_crtc_state->update_m_n || new_crtc_state->update_lrr ||
@@ -937,6 +946,9 @@ static bool vrr_enabling(const struct intel_crtc_state *old_crtc_state,
937946
static bool vrr_disabling(const struct intel_crtc_state *old_crtc_state,
938947
const struct intel_crtc_state *new_crtc_state)
939948
{
949+
if (!old_crtc_state->hw.active)
950+
return false;
951+
940952
return is_disabling(vrr.enable, old_crtc_state, new_crtc_state) ||
941953
(old_crtc_state->vrr.enable &&
942954
(new_crtc_state->update_m_n || new_crtc_state->update_lrr ||

0 commit comments

Comments
 (0)