Skip to content

drm/vc4: Introduce locking and remove !KMS state access

Maxime Ripard dri-devel 1 version Applied

Status from this message: Applied to drm/drm-misc (drm-misc-next).

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/9drm/vc4: crtc: Drop feed_txp from statedrivers/gpu/drm/vc4/vc4_crtc.c drivers/gpu/drm/vc4/vc4_drv.h drivers/gpu/drm/vc4/vc4_hvs.c +2 more+12 -100 replies
2/9drm/vc4: Fix non-blocking commit getting stuck foreverdrivers/gpu/drm/vc4/vc4_crtc.c drivers/gpu/drm/vc4/vc4_drv.h drivers/gpu/drm/vc4/vc4_hvs.c+23 -30 replies
3/9drm/vc4: crtc: Copy assigned channel to the CRTCdrivers/gpu/drm/vc4/vc4_crtc.c drivers/gpu/drm/vc4/vc4_drv.h drivers/gpu/drm/vc4/vc4_hvs.c +1 more+24 -20 replies
4/9drm/vc4: hdmi: Add a spinlock to protect register accessdrivers/gpu/drm/vc4/vc4_hdmi.c drivers/gpu/drm/vc4/vc4_hdmi.h drivers/gpu/drm/vc4/vc4_hdmi_phy.c +1 more+236 -100 replies
5/9drm/vc4: hdmi: Use a mutex to prevent concurrent framework accessdrivers/gpu/drm/vc4/vc4_hdmi.c drivers/gpu/drm/vc4/vc4_hdmi.h+126 -60 replies
6/9drm/vc4: hdmi: Prevent access to crtc->state outside of KMSdrivers/gpu/drm/vc4/vc4_hdmi.c drivers/gpu/drm/vc4/vc4_hdmi.h+32 -120 replies
7/9drm/vc4: hdmi: Check the device state in prepare()drivers/gpu/drm/vc4/vc4_hdmi.c+28 -70 replies
8/9drm/vc4: hdmi: Introduce an output_enabled flagdrivers/gpu/drm/vc4/vc4_hdmi.c drivers/gpu/drm/vc4/vc4_hdmi.h+18 -40 replies
9/9drm/vc4: hdmi: Introduce a scdc_enabled flagdrivers/gpu/drm/vc4/vc4_hdmi.c drivers/gpu/drm/vc4/vc4_hdmi.h+18 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] drm/vc4: Introduce locking and remove !KMS state access

Hi,

This is a follow-up of the series here:
https://lore.kernel.org/all/[email protected]/

and the discussion that occured here:
https://lore.kernel.org/all/[email protected]/

The original series aimed at getting rid of the encoder->crtc pointer usage in the vc4 HDMI driver, some regression was noticed and the following discussion pointed out that we were doing a fair number of KMS state access outside of the mode set path, which is disallowed and unsafe.

We already have a bug that was a result of that access which is fixed in the second patch, but other instabilities might have occured without being reported.

That series thus removes all those accesses, and add some locking in the process.

Sudip, since that series changed very significantly since you last tested it, could you give it a test run on the Codethink farm?

Let me know what you think,
Maxime

Maxime Ripard (9):
drm/vc4: crtc: Drop feed_txp from state
drm/vc4: Fix non-blocking commit getting stuck forever drm/vc4: crtc: Copy assigned channel to the CRTC drm/vc4: hdmi: Add a spinlock to protect register access drm/vc4: hdmi: Use a mutex to prevent concurrent framework access drm/vc4: hdmi: Prevent access to crtc->state outside of KMS drm/vc4: hdmi: Check the device state in prepare() drm/vc4: hdmi: Introduce an output_enabled flag drm/vc4: hdmi: Introduce a scdc_enabled flag

 drivers/gpu/drm/vc4/vc4_crtc.c      |  12 +-
 drivers/gpu/drm/vc4/vc4_drv.h       |  29 +-
 drivers/gpu/drm/vc4/vc4_hdmi.c      | 415 +++++++++++++++++++++++++---
 drivers/gpu/drm/vc4/vc4_hdmi.h      |  37 +++
 drivers/gpu/drm/vc4/vc4_hdmi_phy.c  |  37 +++
 drivers/gpu/drm/vc4/vc4_hdmi_regs.h |   2 +
 drivers/gpu/drm/vc4/vc4_hvs.c       |  26 +-
 drivers/gpu/drm/vc4/vc4_kms.c       |   3 +-
 drivers/gpu/drm/vc4/vc4_txp.c       |   4 +-
 9 files changed, 509 insertions(+), 56 deletions(-)
Signature · 1 line
2.31.1