Skip to content

drm/msm: async commit support

Rob Clark dri-devel linux-arm-msm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9drm/msm/dpu: unwind async commit handlingdrivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +3 more+37 -571 reply
2/9drm/msm/dpu: add real wait_for_commit_done()drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c+21 -11 reply
3/9drm/msm/dpu: handle_frame_done() from vblank irqdrivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c+9 -231 reply
4/9drm/msm: add kms->wait_flush()drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +2 more+54 -421 reply
5/9drm/msm: convert kms->complete_commit() to crtc_maskdrivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +4 more+11 -360 replies
6/9drm/msm: add kms->flush_commit()drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +2 more+63 -40 replies
7/9drm/msm: split power control from prepare/complete_commitdrivers/gpu/drm/msm/disp/dpu1/dpu_kms.c drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +2 more+54 -140 replies
8/9drm/msm: async commit supportdrivers/gpu/drm/msm/msm_atomic.c drivers/gpu/drm/msm/msm_drv.c drivers/gpu/drm/msm/msm_drv.h +1 more+207 -10 replies
9/9drm/msm/dpu: async commit supportdrivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h +3 more+34 -450 replies

Reviews trailers per patch

3 of 9 patches have a Reviewed-by or Acked-by.

PatchSean Paul
1/9R-b
2/9R-b
3/9R-b
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/9] drm/msm: async commit support

From: Rob Clark <[email protected]>

Currently the dpu backend attempts to handle async commits. But it is racey and could result in flushing multiple times in a frame, or modifying hw state (such as scanout address or cursor position) after the previous flush, but before vblank, causing underflows (which manifest as brief black flashes).

This patchset removes the previous dpu async commit handling, and reworks the internal kms backend API to decouple flushing. And in the end introduces an hrtimer to flush async updates. The overall approach is:

1) Move flushing various hw state out of encoder/crtc atomic commit (which is anyways an improvement over the current state, where we either flush from crtc or encoder, depending on whether it is a full modeset)

2) Switch to crtc_mask for anything that completes after atomic _commit_tail(), so we do not need to keep the atomic state around. Ie. from drm core's perspective, an async commit completes immediately.

This avoids fighting with drm core about the lifecycle of an atomic state object.

3) Track a bitmask of crtcs w/ pending async flush, and setup an hrtimer with expiration 1ms before vblank, to trigger the flush. For async commits, we push the state down to the double buffered hw registers immediately, and only defer writing the flush registers.

Current patchset only includes the dpu backend support for async commits.. mdp4 and mdp5 should be relatively trivial (less layers of indirection involved). But I won't have access to any mdp4 hw for a few more weeks, so at least that part I might punt on for now.

Rob Clark (9):
drm/msm/dpu: unwind async commit handling drm/msm/dpu: add real wait_for_commit_done() drm/msm/dpu: handle_frame_done() from vblank irq drm/msm: add kms->wait_flush()
drm/msm: convert kms->complete_commit() to crtc_mask drm/msm: add kms->flush_commit()
drm/msm: split power control from prepare/complete_commit drm/msm: async commit support
drm/msm/dpu: async commit support

 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c      |  48 +---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h      |   7 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   |  46 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h   |   8 +-
 .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c  |  39 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c       |  99 +++++----
 drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c      |  48 ++--
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c      |  47 ++--
 drivers/gpu/drm/msm/msm_atomic.c              | 210 +++++++++++++++---
 drivers/gpu/drm/msm/msm_drv.c                 |   1 +
 drivers/gpu/drm/msm/msm_drv.h                 |   4 +
 drivers/gpu/drm/msm/msm_kms.h                 | 108 ++++++++-
 12 files changed, 466 insertions(+), 199 deletions(-)
Signature · 1 line
2.21.0