OSDN Git Service

drm_hwcomposer: Split the drm compositor into per-display threads
authorSean Paul <seanpaul@chromium.org>
Wed, 24 Jun 2015 21:38:49 +0000 (14:38 -0700)
committerSean Paul <seanpaul@chromium.org>
Fri, 10 Jul 2015 20:09:10 +0000 (16:09 -0400)
commite86fcfbb5c3f857efbcccb335c9a1a72a7a101cb
tree80a9f44b9720622cb9fab3ec6f133a5bf5fbfe3b
parentd20b3190c28329914ad0c21c508cb3c9bb83ee02
drm_hwcomposer: Split the drm compositor into per-display threads

This patch splits out the current single drm compositor with
per-display compositors, each with their own thread.

The per-display compositors are hidden behind a singleton
drm compositor. This allows us to maintain a whole-world view
of all displays involved in a frame. This becomes useful if
we start switching up crtcs/encoders for the displays.
This also allows us to issue one DrmComposition when the
frame is being assembled.

The single DrmComposition handles the plane allocation (since they
might switch between displays), and contains per-display compositions
which are used to store the layer->plane/crtc information for each
frame. The display compositors use the per-display compositions to
display the frame on their output.

Each display compositor receives a shared pointer to the frame's
DrmComposition on QueueComposition. As a result, both the composition,
and the per-display compositions, live for as long as any one
display is still using it. While this is sub-optimal (since a display
might never update again), this is probably fine for now.

Finally, splitting things up per-display will allow us to inject
non-compositing jobs into the composite queue. An example would be
turning the display off, or setting the mode. This ensures that all
frames in the composite queue are displayed before the mode changes
or the display is disabled.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I8a233ea64710b238f70acbcde1f6d771e297b069
Android.mk
drmcomposition.cpp
drmcomposition.h
drmcompositor.cpp
drmcompositor.h
drmcompositorworker.cpp
drmcompositorworker.h
drmdisplaycomposition.cpp [new file with mode: 0644]
drmdisplaycomposition.h [new file with mode: 0644]
drmdisplaycompositor.cpp [new file with mode: 0644]
drmdisplaycompositor.h [new file with mode: 0644]