linux/drivers/gpu/drm
Brian Norris fa0d3d71dc drm/atomic: Force bridge self-refresh-exit on CRTC switch
commit e54a442492 upstream.

It's possible to change which CRTC is in use for a given
connector/encoder/bridge while we're in self-refresh without fully
disabling the connector/encoder/bridge along the way. This can confuse
the bridge encoder/bridge, because
(a) it needs to track the SR state (trying to perform "active"
    operations while the panel is still in SR can be Bad(TM)); and
(b) it tracks the SR state via the CRTC state (and after the switch, the
    previous SR state is lost).

Thus, we need to either somehow carry the self-refresh state over to the
new CRTC, or else force an encoder/bridge self-refresh transition during
such a switch.

I choose the latter, so we disable the encoder (and exit PSR) before
attaching it to the new CRTC (where we can continue to assume a clean
(non-self-refresh) state).

This fixes PSR issues seen on Rockchip RK3399 systems with
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c.

Change in v2:

- Drop "->enable" condition; this could possibly be "->active" to
  reflect the intended hardware state, but it also is a little
  over-specific. We want to make a transition through "disabled" any
  time we're exiting PSR at the same time as a CRTC switch.
  (Thanks Liu Ying)

Cc: Liu Ying <victor.liu@oss.nxp.com>
Cc: <stable@vger.kernel.org>
Fixes: 1452c25b0e ("drm: Add helpers to kick off self refresh mode in drivers")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220228122522.v2.2.Ic15a2ef69c540aee8732703103e2cff51fb9c399@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-14 18:32:46 +02:00
..
amd drm/amdgpu/cs: make commands with 0 chunks illegal behaviour. 2022-06-09 10:21:24 +02:00
arc
arm drm: mali-dp: potential dereference of null pointer 2022-06-09 10:21:01 +02:00
armada
aspeed
ast drm/ast: potential dereference of null pointer 2021-12-22 09:30:54 +01:00
atmel-hlcdc
bochs
bridge drm/bridge: analogix_dp: Support PSR-exit to disable transition 2022-06-14 18:32:46 +02:00
etnaviv drm/etnaviv: check for reaped mapping in etnaviv_iommu_unmap_gem 2022-06-09 10:21:24 +02:00
exynos drm/exynos: Always initialize mapping in exynos_drm_register_dma() 2021-09-18 13:40:30 +02:00
fsl-dcu
gma500 gma500: fix an incorrect NULL check on list iterator 2022-06-09 10:21:28 +02:00
hisilicon
i2c
i810
i915 drm/i915/dsi: fix VBT send packet port selection for ICL+ 2022-06-09 10:21:25 +02:00
imx drm: imx: fix compiler warning with gcc-12 2022-06-14 18:32:41 +02:00
ingenic drm/ingenic: Reset pixclock rate when parent clock rate changes 2022-06-09 10:21:00 +02:00
lib
lima drm/lima: fix warning when CONFIG_DEBUG_SG=y & CONFIG_DMA_API_DEBUG=y 2022-01-27 10:54:10 +01:00
mcde drm/mcde: Fix off by 10^3 in calculation 2021-06-16 12:01:44 +02:00
mediatek drm/mediatek: Fix mtk_cec_mask() 2022-06-09 10:21:00 +02:00
meson drm/meson: osd_afbcd: Add an exit callback to struct meson_afbcd_ops 2022-04-08 14:40:11 +02:00
mga
mgag200 mgag200 fix memmapsl configuration in GCTL6 register 2022-04-08 14:39:56 +02:00
msm drm/msm/dpu: handle pm_runtime_get_sync() errors in bind path 2022-06-09 10:21:10 +02:00
mxsfb drm: mxsfb: Fix NULL pointer dereference crash on unload 2021-10-27 09:56:54 +02:00
nouveau drm/nouveau/kms/nv50-: atom: fix an incorrect NULL check on list iterator 2022-06-09 10:21:24 +02:00
omapdrm
panel drm/panel: panel-simple: Fix proper bpc for AM-1280800N3TZQW-T00H 2022-06-09 10:21:05 +02:00
panfrost drm/panfrost: Check for error num after setting mask 2022-04-08 14:40:12 +02:00
pl111 amba: Make the remove callback return void 2022-04-08 14:40:02 +02:00
qxl drm: qxl: ensure surf.data is ininitialized 2021-07-14 16:56:20 +02:00
r128
radeon drm/radeon: fix a possible null pointer dereference 2022-06-14 18:32:44 +02:00
rcar-du drm: rcar-du: Fix CRTC timings when CMM is used 2022-01-27 10:54:14 +01:00
rockchip drm/rockchip: vop: fix possible null-ptr-deref in vop_bind() 2022-06-09 10:21:05 +02:00
savage
scheduler drm/sched: Avoid data corruptions 2021-07-19 09:44:40 +02:00
selftests
shmobile
sis
sti
stm stm: ltdc: fix two incorrect NULL checks on list iterator 2022-06-09 10:21:27 +02:00
sun4i drm/sun4i: mixer: Fix P010 and P210 format numbers 2022-03-16 14:15:57 +01:00
tdfx
tegra drm/tegra: Fix reference leak in tegra_dsi_ganged_probe 2022-04-08 14:40:18 +02:00
tidss
tilcdc tilcdc: tilcdc_external: fix an incorrect NULL check on list iterator 2022-06-09 10:21:28 +02:00
tiny
ttm drm/ttm: Put BO in its memory manager's lru list 2022-01-27 10:53:44 +01:00
tve200
udl drm/udl: fix control-message timeout 2021-11-26 10:39:20 +01:00
v3d drm/v3d: fix wait for TMU write combiner flush 2021-11-18 14:04:02 +01:00
vboxvideo drm/vboxvideo: fix a NULL vs IS_ERR() check 2022-01-27 10:53:49 +01:00
vc4 drm/vc4: txp: Force alpha to be 0xff if it's disabled 2022-06-09 10:21:00 +02:00
vgem
via
virtio drm/virtio: fix NULL pointer dereference in virtio_gpu_conn_get_modes 2022-06-09 10:20:50 +02:00
vkms drm/vkms: fix misuse of WARN_ON 2021-05-11 14:47:26 +02:00
vmwgfx drm/vmwgfx: Initialize drm_mode_fb_cmd2 2022-05-18 10:23:47 +02:00
xen gpu/xen: Fix a use after free in xen_drm_drv_init 2021-04-21 13:00:52 +02:00
xlnx drm: xlnx: zynqmp: release reset to DP controller before accessing DP registers 2021-09-18 13:40:27 +02:00
zte drm/zte: Don't select DRM_KMS_FB_HELPER 2021-07-19 09:44:36 +02:00
drm_agpsupport.c
drm_atomic_helper.c drm/atomic: Force bridge self-refresh-exit on CRTC switch 2022-06-14 18:32:46 +02:00
drm_atomic_state_helper.c
drm_atomic_uapi.c
drm_atomic.c
drm_auth.c drm: protect drm_master pointers in drm_lease.c 2021-09-18 13:40:19 +02:00
drm_blend.c
drm_bridge_connector.c
drm_bridge.c drm/bridge: Fix the stop condition of drm_bridge_chain_pre_enable() 2021-07-14 16:56:15 +02:00
drm_bufs.c
drm_cache.c
drm_client_modeset.c
drm_client.c
drm_color_mgmt.c
drm_connector.c drm/vrr: Set VRR capable prop only if it is attached to connector 2022-03-19 13:44:45 +01:00
drm_context.c
drm_crtc_helper_internal.h
drm_crtc_helper.c
drm_crtc_internal.h
drm_crtc.c
drm_damage_helper.c
drm_debugfs_crc.c
drm_debugfs.c drm: avoid blocking in drm_clients_info's rcu section 2021-09-18 13:40:19 +02:00
drm_dma.c
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/dp: Handle zeroed port counts in drm_dp_read_downstream_info() 2021-07-19 09:44:57 +02:00
drm_dp_mst_topology_internal.h
drm_dp_mst_topology.c drm/dp/mst: fix a possible memory leak in fetch_monitor_name() 2022-05-25 09:17:56 +02:00
drm_drv.c drm: fix null-ptr-deref in drm_dev_init_release() 2022-01-27 10:53:44 +01:00
drm_dsc.c
drm_dumb_buffers.c
drm_edid_load.c
drm_edid.c drm/edid: fix invalid EDID extension block filtering 2022-06-09 10:20:59 +02:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c
drm_fb_helper.c
drm_file.c drm: serialize drm_file.master with a new spinlock 2021-09-18 13:40:19 +02:00
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c
drm_gem_cma_helper.c
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c
drm_gem_ttm_helper.c
drm_gem_vram_helper.c
drm_gem.c
drm_hashtab.c
drm_hdcp.c
drm_internal.h
drm_ioc32.c drm: Copy drm_wait_vblank to user before returning 2021-09-03 10:09:27 +02:00
drm_ioctl.c drm: Return -ENOTTY for non-drm ioctls 2021-07-28 14:35:47 +02:00
drm_irq.c
drm_kms_helper_common.c
drm_lease.c drm: protect drm_master pointers in drm_lease.c 2021-09-18 13:40:19 +02:00
drm_legacy_misc.c
drm_legacy.h
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c
drm_mipi_dsi.c
drm_mm.c
drm_mode_config.c
drm_mode_object.c
drm_modes.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c drm/of: free the iterator object on failure 2021-09-15 09:50:32 +02:00
drm_panel_orientation_quirks.c drm: Add orientation quirk for GPD Win Max 2022-04-13 21:00:54 +02:00
drm_panel.c
drm_pci.c
drm_plane_helper.c drm/plane-helper: fix uninitialized variable reference 2021-11-18 14:04:22 +01:00
drm_plane.c drm/plane: Move range check for format_count earlier 2022-06-09 10:20:52 +02:00
drm_prime.c
drm_print.c
drm_probe_helper.c drm/probe-helper: Check epoch counter in output_poll_execute() 2021-05-14 09:50:23 +02:00
drm_property.c
drm_rect.c
drm_scatter.c
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_syncobj.c drm/syncobj: Deal with signalled fences in drm_syncobj_find_fence. 2021-12-14 11:32:39 +01:00
drm_sysfs.c
drm_trace_points.c
drm_trace.h
drm_vblank_work.c
drm_vblank.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c
Kconfig
Makefile