drm/i915/display: Prevent DC6 while vblank is enabled for Panel Replay
authorJouni Högander <jouni.hogander@intel.com>
Fri, 20 Sep 2024 06:23:40 +0000 (09:23 +0300)
committerJouni Högander <jouni.hogander@intel.com>
Mon, 23 Sep 2024 04:07:15 +0000 (07:07 +0300)
commitaa451abcffb5a732a5b3421d41c5c6e502b2b8d1
treedf4cbf1d4faf7cbe0cfec6a7d027b8740d8582c3
parent1007610ece094625deb259c3077b18fa9d992d95
drm/i915/display: Prevent DC6 while vblank is enabled for Panel Replay

We need to block DC6 entry in case of Panel Replay as enabling VBI doesn't
prevent DC6 in case of Panel Replay. This causes problems if user-space is
polling for vblank events.

Fix this by setting target DC state as DC_STATE_EN_UPTO_DC5 when both
source and sink are supporting eDP Panel Replay and VBI is enabled.

v4:
  - s/vblank_work/vblank_dc_work/
  - changed type of block_dc_for_vblank to bool
v3:
  - do flush_work for vblank_work on intel_crtc_vblank_off
  - no need to use READ_ONCE in bdw_enable_vblank
  - check crtc->block_dc_for_vblank in bdw_disable_vblank as well
  - move adding block_dc_for_vblank into this patch
v2:
  - use READ_ONCE in intel_display_vblank_work
  - use DC_STATE_DISABLE instead of DC_STATE_EN_UPTO_DC6
  - use intel_crtc->block_dc6_needed

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2296
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240920062340.1333777-3-jouni.hogander@intel.com
drivers/gpu/drm/i915/display/intel_crtc.c
drivers/gpu/drm/i915/display/intel_display_core.h
drivers/gpu/drm/i915/display/intel_display_irq.c
drivers/gpu/drm/i915/display/intel_display_types.h