linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] drm/msm: async commit support (v2)
@ 2019-08-29 16:45 Rob Clark
  2019-08-29 16:45 ` [PATCH 01/10] drm/msm/dpu: unwind async commit handling Rob Clark
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Rob Clark @ 2019-08-29 16:45 UTC (permalink / raw)
  To: dri-devel
  Cc: Rob Clark, Abhinav Kumar, Alexios Zavras, Allison Randal,
	Boris Brezillon, Bruce Wang, Daniel Vetter, Enrico Weigelt,
	open list:DRM DRIVER FOR MSM ADRENO GPU, Georgi Djakov,
	Greg Kroah-Hartman, Jeykumar Sankaran, Jonathan Marek,
	Jordan Crouse, open list:DRM DRIVER FOR MSM ADRENO GPU,
	open list, Mamta Shukla, Sean Paul, Sravanthi Kollukuduru,
	Thomas Gleixner

From: Rob Clark <robdclark@chromium.org>

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.

v2: couple small cosmetic updates, re-work locking to avoid stalls,
    add some tracepoints

Rob Clark (10):
  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
  drm/msm: add atomic traces

 drivers/gpu/drm/msm/Makefile                  |   1 +
 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              | 233 +++++++++++++++---
 drivers/gpu/drm/msm/msm_atomic_trace.h        | 110 +++++++++
 drivers/gpu/drm/msm/msm_atomic_tracepoints.c  |   3 +
 drivers/gpu/drm/msm/msm_drv.c                 |   1 +
 drivers/gpu/drm/msm/msm_drv.h                 |   4 +
 drivers/gpu/drm/msm/msm_gpu_trace.h           |   2 +-
 drivers/gpu/drm/msm/msm_kms.h                 | 108 +++++++-
 16 files changed, 603 insertions(+), 201 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/msm_atomic_trace.h
 create mode 100644 drivers/gpu/drm/msm/msm_atomic_tracepoints.c

-- 
2.21.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-09-03 20:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 16:45 [PATCH 00/10] drm/msm: async commit support (v2) Rob Clark
2019-08-29 16:45 ` [PATCH 01/10] drm/msm/dpu: unwind async commit handling Rob Clark
2019-08-29 16:45 ` [PATCH 02/10] drm/msm/dpu: add real wait_for_commit_done() Rob Clark
2019-08-29 16:45 ` [PATCH 03/10] drm/msm/dpu: handle_frame_done() from vblank irq Rob Clark
2019-08-29 16:45 ` [PATCH 04/10] drm/msm: add kms->wait_flush() Rob Clark
2019-08-29 16:45 ` [PATCH 05/10] drm/msm: convert kms->complete_commit() to crtc_mask Rob Clark
2019-09-03 20:35   ` Sean Paul
2019-08-29 16:45 ` [PATCH 06/10] drm/msm: add kms->flush_commit() Rob Clark
2019-09-03 20:35   ` Sean Paul
2019-08-29 16:45 ` [PATCH 07/10] drm/msm: split power control from prepare/complete_commit Rob Clark
2019-09-03 20:37   ` Sean Paul
2019-08-29 16:45 ` [PATCH 08/10] drm/msm: async commit support Rob Clark
2019-09-03 20:51   ` Sean Paul
2019-08-29 16:45 ` [PATCH 09/10] drm/msm/dpu: " Rob Clark
2019-09-03 20:53   ` Sean Paul
2019-08-29 16:45 ` [PATCH 10/10] drm/msm: add atomic traces Rob Clark
2019-09-03 20:54   ` Sean Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).