History log of /external/drm_hwcomposer/drmdisplaycompositor.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c74c8b9339cb5fd4f00d1be6b857c6e60ba5fc49 23-Jun-2016 Sean Paul <seanpaul@chromium.org> DO NOT MERGE: drm_hwcomposer: Count all layers with content in SquashFrame

SquashFrame previously didn't run if there was only one overlay
layer in the layer stack. This would cause false failures when
the incoming composition was composed of one or more layers with
a precomposition or squash layer.

To fix this, count all layers which are not disabled, and only
skip squashing if there is just one content layer.

BUG=b/29122961
TEST=Tested on smaug with vertical multi-window YouTube

Change-Id: Icb175b7701928136730442a39c4717a780d34cfd
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit fab5ea10b0e81e830c484e19b322a3c11fa9e9e6)
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
b4cf01b8eab70b554b3ddcad10cade7b6f0ffe0f 23-Jun-2016 Sean Paul <seanpaul@chromium.org> DO NOT MERGE: drm_hwcomposer: On error, free active composition

If we drop a frame while compositing, free the active composition.

Assume a frame pipeline of A->B->A. If we drop frame B, it will become
the active composition, which means the fences for A will not be released,
causing us to block A on A --> DEADLOCK.

BUG=b/29122961
TEST=Tested on smaug, no longer hangs

Change-Id: I98817bb361f1d0669395ddac5d96cf4f19d4b26a
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit 137a6a8e9bea5c90a6832e9ed3e630f47041ab15)
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
8cc4e2a2de3c0cf932226a5a6042de5d830fa24a 12-May-2016 Sean Paul <seanpaul@chromium.org> DO NOT MERGE: drm_hwcomposer: Use Planner interface to provision planes

Use the new Planner interface to handle the layer->plane mapping.
This allows us to simplify the Plan() function by offloading the
plane provisioning to the platform specific code.

BUG=b/28117135
TEST=Tested on ryu with a variety of window layouts/workloads

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I75a0c5d87a9096e7a83ecbc848c75fee42ee1131
/external/drm_hwcomposer/drmdisplaycompositor.cpp
8eb85ff7d7704a4783cbb97eec480ae2c93d7f3b 04-May-2016 Sean Paul <seanpaul@chromium.org> DO NOT MERGE: drm_hwcomposer: Don't use Plan() in SquashAll

Simplify the SquashAll() function by generating the composition
without using Plan(). This allows us to specify exactly what we
want on the screen without involving the normal plane provisioning
code.

BUG=b/28117135
TEST=Tested on ryu, squashing still works

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: Ieec9c323941e2a80252b33d14563c4d218d38dfb
/external/drm_hwcomposer/drmdisplaycompositor.cpp
7379ecd4c3ebb25e3ce730e4b2e51d2ad46d3a51 11-May-2016 Sean Paul <seanpaul@chromium.org> DO NOT MERGE: drm_hwcomposer: Move DrmCompositionPlaneType into DrmCompositionPlane

Now that DrmCompositionPlane is classified, move the type into it
as a subclass.

BUG=b/28117135
TEST=Tested on ryu

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I774f477e75b3a2e2916c5d98931730dac46d3877
/external/drm_hwcomposer/drmdisplaycompositor.cpp
9b70717071da6b5c098d2363a350d1f0f2333423 11-May-2016 Sean Paul <seanpaul@chromium.org> DO NOT MERGE: drm_hwcomposer: Use a vector for composition source_layers

Instead of a 1:1 mapping of layer:plane, use a vector to store
source layers for a composition plane. This will allow us to
represent squash compositions more easily by adding all source
layers to the vector.

This should also facilitate hardware which allows multiple fbs per plane.

BUG=b/28117135
TEST=Tested on ryu

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I5d4bfc6e9da022eaab047f948cc874d6a8a25746
/external/drm_hwcomposer/drmdisplaycompositor.cpp
07aa8cc9f7a3905e62f71b0be8e0129c69ef81e0 11-May-2016 Sean Paul <seanpaul@chromium.org> DO NOT MERGE: drm_hwcomposer: Add type to DrmCompositionPlane

Instead of encoding the plane/composition type in source_layer,
move it to its own explicit type. This will allow us to expand
source_layer to include more than one layer.

BUG=b/28117135
TEST=compiles and runs on smaug

Change-Id: I19b1ed8e395347bbefb0fb6a0ab02d6ac0e5c1c1
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
717a44be8f9f9282e6708b78cb3f2bbc8de7cb3a 11-May-2016 Sean Paul <seanpaul@chromium.org> DO NOT MERGE: drm_hwcomposer: Fix up some printf warnings and a clang-style nit

BUG=None
TEST=Compiles

Change-Id: Ie95aad60b225784c36d411ec16a34ff32ea8acc6
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
6275fb70c2a85245bd0468be315b13eeb8223c04 04-May-2016 Sean Paul <seanpaul@chromium.org> DO NOT MERGE: drm_hwcomposer: Remove unused variable

BUG=None
TEST=Compiles

Change-Id: I8a003dc14828ed0c10fd161b00d1bc1c5069431f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
b02d858190cc779875d02195631483096024d6ca 04-Feb-2016 Rob Herring <robh@kernel.org> DO NOT MERGE: drm_hwcomposer: Convert to upstream DRM atomic interfaces

drm_hwcomposer is currently using preliminary version of the atomic API.
The final version merged upstream is slightly different. Convert it to the
upstream API.

The most significant change is positive return values for
drmModeAtomicAddProperty are not a failure, so we need to test for
negative return values instead of non-zero.

BUG=none
TEST=Tested with 4.4 kernel on virtio-gpu and freedreno

Change-Id: I0b1f4bcd7766a3053a484f55e01c8b2ba56d716d
Signed-off-by: Rob Herring <robh@kernel.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
49d657d512b033addd8926eff7e735d6d36e641b 20-Jan-2016 David Ung <davidu@nvidia.com> drm_hwcomposer: Increase fence timeout upto 5x

Increase the fence wait value each time by a factor of 2.

Bug: chrome-os-partner:48289
Test: Run apps and see no frame drops

Change-Id: I9b7b910e5a8c9d287ea69b13dca0d4c1194ac86c
Signed-off-by: David Ung <davidu@nvidia.com>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
e3141c6fa66806f55fed65c83ed0c2c0201490e0 30-Nov-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Always call PrepareFrame() for compositions

Previously this was not called for compositions which were known to
fail the atomic test. Unfortunately this left the composition in a
state which could not be processed by SquashFrame (only one layer and
source_layer was still set to kSourceSquash).

So call PrepareFrame() on every composition so SquashFrame stays happy.

Change-Id: I976e344ce4970370d9ca4307c2f2c45025199b64
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
6c18b3b67e50e12f77f76108363493162ff36340 25-Nov-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Save the atomic_test result between tests

Previously, we would only test the first frame when the geometry
changed. However, if SF sent us the same composition with different
FBs, we could end up sending invalid frames to the kernel.

This change saves the result of the atomic_test between geometry
changes so we avoid using hw composition for all invalid frames.

Bug: 25866352
Test: Tested on smaug, observed squashes between geometry changes

Change-Id: I3b5d9e83a870481bf2e6869900eafaf0ca66a0d5
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
6afbb6aef0c89b8e737624c4baa1208aaec6f48e 24-Nov-2015 Haixia Shi <hshi@chromium.org> drm_hwcomposer: only check the composition after a geometry change

Do not check the composition with kernel for every frame. We are currently
using synchronous atomic ioctl calls, so all test-only calls are serialized
with the actual commits.

BUG=25866352
TEST=same test procedure as crosbug.com/p/47206

Change-Id: Ia423243c279fc677ff6213115a8f20efa40c235e
/external/drm_hwcomposer/drmdisplaycompositor.cpp
0c7da1e236c3a31a5bc171aac4d5f2a1033f10e1 23-Nov-2015 Haixia Shi <hshi@chromium.org> drm_hwcomposer: set blending mode to kPreMult for GL output

The correct blending mode for the GL output is actually premult, because
regardless of the original layer blending mode, the result RGB components
are always pre-multiplied with alpha already.

This prevents the result of a SquashAll() from getting multiplied by
alpha twice.

BUG=25838542
TEST=verify the blinking is fixed on the status bar icons

Change-Id: Ie5bbc53110c342576b81818da6069cba201db609
/external/drm_hwcomposer/drmdisplaycompositor.cpp
4fdafe6d988b5cac91b5448e197891508b5e6e2d 20-Nov-2015 David Riley <davidriley@google.com> Merge "drm_hwcomposer: Check the composition before sending to frame worker" into mnc-dr-dev
d4bd44dba3559738a0124a875a109ca11ec57acd 20-Nov-2015 Sean Paul <seanpaul@google.com> Merge "drm_hwcomposer: Allow for multiple transforms at once" into mnc-dr-dev
04b47ea435834b4373d57dae6485986b9f0918ae 20-Nov-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Allow for multiple transforms at once

Because sometimes one just ain't enough, allow more than
one transform at a time.

Bug: chrome-os-partner:46710
Test: Tested with the CTS Verifier "Camera Orientation" test

Change-Id: Ie5f9bbbc7c89964feafc78150e18512861c85b69
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
647beb27af04c33d415c75149c4c93d767693caf 19-Nov-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Check the composition before sending to frame worker

Before we send a composition to the frame worker and display, run it
through the kernel to test whether it can be put on hardware. If the
kernel rejects the composition, use the squashing code to flatten it
on one layer and send the result to the frame worker.

Bug: 25379136
Test: Tested on smaug, frames were squashed, fun was had

Change-Id: Icac3c034d0eb4c0becbdc0f8ace1de75ab8ae2b8
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
d51c7617d590c806c53ca3fdbc9428c03261dac1 18-Nov-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Split DrmDisplayCompositor::SquashAll()

Split the SquashAll function into SquashAll and SquashFrame. This
will allow us to squash arbitrary compositions without using the
active composition or applying it to the screen.

Bug: 25379136
Test: Tested on smaug

Change-Id: I1767f731e14f36540151556ce07373848b604030
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
c07b21121553f981a1888bb855c987138879c267 17-Nov-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Add test_only mode to CommitFrame

Allow the caller of CommitFrame to run the commit in "test only" mode
which will send the frame to the kernel, but won't actually change any
registers.

Bug: 25379136
Test: Tested on smaug

Change-Id: I831b5f17d433bc60d9f107689feb1d7672c100a9
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
35301f498c372f3ad2bbbc969acda39056131b26 17-Nov-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Create mode blob on modeset queue

Instead of creating the mode blob right before doing the modeset,
create it as soon as the modeset is queued. This will allow us to
use the blob for both atomic test as well as commit.

In addition to keeping the blob around, store the blob's id while
the mode is active so we don't need to look it up when/if the next
modeset comes in.

Bug: 25379136
Test: Tested on smaug

Change-Id: I60e6f83310ea0601388bb31b63d25c6fd7b8fc4d
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
2b4b1eea6b7075efe356af8bb2e948201635c5c2 18-Nov-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: during SquashAll, skip layers with kSourceNone

This complicates returning layers to the active composition on failure. They
will not go back in the correct order and this will confuse all subsequent
attempts to use the active composition.

Change-Id: Iab6fae7b4a88f97206bac08237d574ff1bfd802f
/external/drm_hwcomposer/drmdisplaycompositor.cpp
bff33ac0e677875eb4b462a45ad90429b6484181 16-Nov-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: composite down to a primary plane after a timeout

DrmDisplayCompositor::SquashAll is triggered after a constant timeout in
DrmCompositorWorker::Routine. It will not be triggered more than one time
between genuine hwc_set calls. SquashAll has no effect if there are protected
layers, only one layer, or any errors. On success, SquashAll produces a new
DrmDisplayComposition that owns the layers in the planes of the active
composition and makes that the new active composition. SquashAll has no effect
on SquashState.

Change-Id: I975edb21847dcf2d93245f92a6e53a4e366c6a3b
/external/drm_hwcomposer/drmdisplaycompositor.cpp
db81fce67419d82d828eebec25e57284e90dd93a 28-Oct-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: always put protected layers on hardware planes

Protected layers will not work inside of the GLWorker, so we are forced to put
them into planes directly.

Because we can now receive display contents which can never be properly
composited (e.g. 4 protected layers on hardware with only 3 planes), some
compromises had to be made for the composition planning algorithm. First all
protected layers are given a plane. Then the remaining planes are used by the
remaining layers, pre-composite buffer, and squash buffer. In the case where
there are too few planes for both a pre-composite buffer and squash buffer,
everything gets pushed into the pre-composite buffer and the squash buffer
will not be composited onto the screen. Another major limitation is that any
unprotected layers appearing behind a protected layer will actually appear on
top of that protected layer.

BUG=chrome-os-partner:43674
TEST=run protected content with lots of other layers

Change-Id: I94620d93f68ca14dc1966422dc89035ab84e3ff4
/external/drm_hwcomposer/drmdisplaycompositor.cpp
aa2f4a5eec7f4117b9487a415739634007254822 02-Nov-2015 Haixia Shi <hshi@chromium.org> drm_hwcomposer: fix spelling of "separate".

It is spelled "separate", not "seperate".

Change-Id: Id92d12aba42989a8a72e4596d425b2a9eea4e5ec
/external/drm_hwcomposer/drmdisplaycompositor.cpp
3979f7d252b4b054417b59a5dac84281eeaa8435 29-Oct-2015 Haixia Shi <hshi@chromium.org> drm_hwcomposer: add ATRACE_CALL.

The DrmDisplayCompositor::CommitFrame() has been moved to a separate
worker thread so it's helpful to add it to systrace.

Change-Id: I82031f56ddc0587266f9a213208134f045f66b9a
/external/drm_hwcomposer/drmdisplaycompositor.cpp
dda2fabb6a8010768e199210b934a6326c891c2d 23-Oct-2015 Haixia Shi <hshi@chromium.org> drm_hwcomposer: move atomic modeset calls into a separate worker

We are currently using synchronous (blocking) atomic modeset calls
which unnecessarily delays GL.

BUG=25126188
TEST=check timestamp of SignalPreCompDone relative to hwc_set

Change-Id: Iba70c1c9591e467c1627516af123a43206da99fd
/external/drm_hwcomposer/drmdisplaycompositor.cpp
5757e82631820372382d3369c54cc3a1ffef812f 17-Oct-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: implement squashing

Change-Id: Ifd4feaa0de303ddfd519d4415ab31d2a72f26022
/external/drm_hwcomposer/drmdisplaycompositor.cpp
f81ba3781d27876ce1b658ee71b474adf956e485 16-Oct-2015 Sean Paul <seanpaul@google.com> Merge "drm_hwcomposer: Use layer alpha to blend planes" into mnc-dr-dev
d75d8d2bf2f53511b1826452c2a8547b6a338cc7 15-Oct-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: add missing break statement

By a stroke of luck, the fall through case had a break statement.

Change-Id: I29cb1206d114f31ec58a603cd9dcb986764d8344
/external/drm_hwcomposer/drmdisplaycompositor.cpp
d8aefb635a854c36b0cf2eb36ecdf9070ddc7151 15-Oct-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Use layer alpha to blend planes

Send the layer alpha to the drm plane's alpha property to
properly blend layers.

BUG=b/24821110
TEST=Tested on smaug with Downloads/About windows, blend properly

Change-Id: If96eb28d65d018863c39bc5a3554daef0264144b
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
fd6dc339551e5aa041daec7abffc3ff8eaeca138 14-Oct-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: reimplement Dump for DrmDisplayCompositor

Also fixes hwc_dump sometimes failing to null terminate its output buffer.

TEST=dumpsys SurfaceFlinger

Change-Id: Ibf93cfd496a07a9375d78a8b239c2c7876aff986
/external/drm_hwcomposer/drmdisplaycompositor.cpp
92f8e6399c0829c6ba6db77d5ea1bbd22f510bb1 13-Oct-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: ground work for squashing

This patch rearranges things to make squashing possible.
The high-level changes:
- A new Plan phase that happens in QueueComposition. This is where the
overlay allocation is moved to. It's also the only safe time that
the composition can try to plan squashing. This is because squashing
depends on the exact ordering of compositions.
- GLWorker now renders regions rather than layers. A region in this case is
a clipping rectange and set of layers that are to be rendered in that
rectangle. This is always what GLWorker did in the end, but now the work
to seperate layers into regions is done externally. This was changed
because the output of SquashState is a list of stable regions that need to
be put through GLWorker

The Plan methods of the Compositions are responsible for updating per-display
SquashState and for allocation regions/layers to squashing, pre-composition, or
hardware overlay. Because of the drastic changes to how composition planning
works, it was necessary to bundle it with the GLWorker change.

This change also includes plenty of other refactorings that were deemed to
be too painful to try and seperate into another change.

Change-Id: Ie7bfe077067e936a0862a07cbe87b525eab8d4f8
/external/drm_hwcomposer/drmdisplaycompositor.cpp
7b1e4bc9186b3920cf67bab4f84af59b93118319 13-Oct-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Disable planes on frame failure

When a frame fails, disable all active planes for the display
and signal the release fences. This avoids the situation where
we might end up frozen b/c someone is waiting for the active
fences to signal.

BUG=chrome-os-partner:46301
TEST=Tested on smaug with a kernel that fails every 1000 frames

Change-Id: I3cd4ad4f22801068465b2c6278e96027b5a7e3c5
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
971be15979d75c681054d1433c898969f267ed53 13-Oct-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Increase failure time for acquire fences

Increase the acquire timeout to effectively 500ms before failing
a frame. Also log every 100ms so we're still able to track long
fence waits.

BUG=chrome-os-partner:46301
TEST=Tested on smaug with cts test, saw timeout messages, but not
failures

Change-Id: I28ec8bbf95f4a70bd3e99ea7a3333166c6080788
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
573554106db499d323bea12ff00363b1816f8c8a 19-Sep-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Process modesets via compositor

This patch queues modeset in the compositor for application on
the next frame. This allows us to perform the modeset atomically
with the first frame that comes in after the mode is changed.

Change-Id: I6bb9edd17bbdd6dbee5c0474f2e43599781cc7a7
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
d106b919a575fb45388ee4a21b41c77e18e7cd27 29-Sep-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Set timeouts for fence waits

Instead of waiting forever for fences, set some reasonable timeouts
so we can move on with life if a fence doesn't signal.

BUG=chrome-os-partner:45868
TEST=Tested on smaug with osmos, recovered from fence timeouts

Change-Id: I7f18d684d483d789f228cbad8d5a3e43ac898a43
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
4a253659cef3d82bfb0b25b3ff4c7b073d7a0460 11-Sep-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: implement the safe handling of layers

This is a sweeping change to discard our usage of struct hwc_layer_t outside
hwcomposer.cpp. That was a dangerous struct that was a source of many of our
errors. Replacing it with safer RAII-style classes reduces the amount and
complexity of our code.

Change-Id: I580cafdf89bd1e7e6583f3073858b8e78e6018ba
/external/drm_hwcomposer/drmdisplaycompositor.cpp
176d9464c7ca1004f8e2b994267ac0d07fd7237e 22-Sep-2015 Sean Paul <seanpaul@google.com> Merge "drm_hwcomposer: limit maximum depth of display composition queue" into mnc-dr-dev
bdc67bffcffaa838836b1111f6dcf07cba5ff134 21-Sep-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Plumb frame number through display composition

Having frame number in the composition is very useful for
debugging transient issues, plumb it through the drm compositor
stack.

Change-Id: Ibc7555c89bea79c580b3201b11db4ced6360efb9
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
8d63e7fde00f5830480cd2225954f70e6b681d8b 20-Aug-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: cache the framebuffers given to the GLWorker

This saves some work in EGL/GL that would normally get repeated every frame.
Because the same framebuffers are generally used every frame, this CL adds a
cache containing all the EGL/GL objects that correspond to the given
GraphicBuffer. The cache initially holds a strong reference while rendering,
but once glFinish is called, only a weak reference is held until rendering
to that same GraphicBuffer starts again. The weak reference is used to check
if that GraphicBuffer has been destroyed, which means the corresponding EGL/GL
resources should be destroyed.

The cache can be disabled with the following command:
$ adb shell setprop hwc.drm.use_framebuffer_cache 0

Change-Id: Iddee1efc5bad67f6c4479e7f402354e229c3b0a2
/external/drm_hwcomposer/drmdisplaycompositor.cpp
098070590ae648ede5f2ef846298de178ccd3637 13-Aug-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: enhance stability using various wrapper classes

This commit contains a lot of churn because it changes code to use automatic
resource lifetimes as much as possible. As more things get changed, this is
essential to maintaining stability.

In addition, this change changes how layers are passed through the compositor
API. Before each layer was passed down one at a time. Now they are passed in
all at once. This is simpler for the implementation because it makes errors
more atomic and makes decisions easier for the compositors.

Change-Id: Ic3e6b5d0089fb1631ea256adcce9910ed8f38366
/external/drm_hwcomposer/drmdisplaycompositor.cpp
b44fd10aef978ff4f77258803f86d76244349333 08-Aug-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: duplicate buffer_handles before hwc_set returns

This is needed because SF will sometimes release buffer_handles before GL gets
to using them for composition.

Change-Id: I01db0975cc82d6b59bf4f9521a24071baf89c38a
/external/drm_hwcomposer/drmdisplaycompositor.cpp
46ddd45e334b61e15a86cc333cc35e8cb64fc0b8 30-Jul-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: fix buffer leak when using the GL compositor inside DrmDisplayCompositor

Change-Id: Id3a6deea9fc0f97640b34dacb25d36f3793f2d4e
/external/drm_hwcomposer/drmdisplaycompositor.cpp
713a6788528d4cc4cd477b2f546c8b922beb6dde 01-Aug-2015 Zach Reizner <zachr@google.com> Revert "Revert "drm_hwcomposer: have DrmDisplayCompositor do its own OpenGL composition""

This reverts commit cbe9c01336e23a63259db65d22d63d6a697b8813.
/external/drm_hwcomposer/drmdisplaycompositor.cpp
cbe9c01336e23a63259db65d22d63d6a697b8813 30-Jul-2015 Puneet Kumar <puneetster@google.com> Revert "drm_hwcomposer: have DrmDisplayCompositor do its own OpenGL composition"

This reverts commit 2317bb19d8663efc31e6fcd8cf7fd2a73577253d.

For now until we figure out a more stable SF/hwc

Change-Id: Ia5ca089610a487bf036a1ddd5fb62e504e02ad98
/external/drm_hwcomposer/drmdisplaycompositor.cpp
d410f04ec8db892eb37758ddd230223ccab801bc 29-Jul-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: limit maximum depth of display composition queue

SurfaceFlinger will destroy our layer handles if we don't use them after about
a second. To get around this issue, we block SurfaceFlinger on hwc_set if the
display composition queue is getting too large. This often happens during
the init of the GLWorker or during heavy GPU usage.

Change-Id: Idb4a3a81e0d3a2caf7f94e5515a19ec16a1c67e3
/external/drm_hwcomposer/drmdisplaycompositor.cpp
2317bb19d8663efc31e6fcd8cf7fd2a73577253d 16-Jul-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: have DrmDisplayCompositor do its own OpenGL composition

To accomplish this a few things changed:
- DrmComposition::GetRemainingLayers always returns the number of planes needed
- DrmComposition::AddLayer succeeds even if no DrmPlane was found for it
- DrmDisplayComposition::AddLayer has overload that imports the given buffer
- GLWorkerCompositor has a function to finish its composite before returning

Put together this change makes DrmComposition always accepts all layers given to
it even if it means some of those layers are assigned a NULL DrmPlane. The
DrmDisplayCompositor will scan its given layers for any that are missing planes.
In such a case, a DrmPlane is stolen from the last layer to receive a plane.
Then all layers in the DrmDisplayComposition that have no planes (including the
one stolen from) are composited synchronously using a GLWorkerCompositor and a
new layer is generated from the results. That layer is added to the
DrmDisplayComposition using the new import AddLayer function and the stolen
DrmPlane. DrmDisplayCompostior then continues as usual.

Change-Id: Ia6477c210c8f1307a4e537bec46889110d79ca18
/external/drm_hwcomposer/drmdisplaycompositor.cpp
952f70a71347df3515e43bee15132d0ce6ecea32 17-Jul-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: clang-format style and gcc warning fixes

The warning I fixed was unitialized rotation variable. The check for error
followed by a break satisfied the compiler.

Change-Id: Ia1a1a01da252a10aa245e45d588b3aeb91ebf58a
/external/drm_hwcomposer/drmdisplaycompositor.cpp
5536258d1da49616300efd1a86b8355dadc98e34 16-Jul-2015 Zach Reizner <zachr@google.com> Merge "drm_hwcomposer: style fixes with clang-format" into mnc-dr-dev
1c4c32635df1f45bbcf63c8c1a76207ca90402e5 14-Jul-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Add rotation support for hw planes

This patch adds support for transformed layers by using the
rotation property on drm planes.

Bug: chrome-os-partner:42093
Test: On smaug using
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:<R>

Change-Id: I86bb8ef2f77b5d046a5fddd57db4b87070b5801f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
b4a9aeff843e2a834335a4db0fef388ae37b423d 16-Jul-2015 Zach Reizner <zachr@google.com> drm_hwcomposer: style fixes with clang-format

Change-Id: I020072a782dde7551ae940d12f3925b8680ba0af
/external/drm_hwcomposer/drmdisplaycompositor.cpp
7f26826567ab53c1ebacdd3d7deb5ce4d566ce84 15-Jul-2015 Sean Paul <seanpaul@google.com> Merge "drm_hwcomposer: Dump active composition plane/crtc/dimension info" into mnc-dr-dev
24323e80e466f0892ea0afe7a18cd1fbd0b62ae1 15-Jul-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Convert src_x,src_y to 16.16 fixed

We convert src_w,src_h, but failed to convert src_x.src_y. This
has the effect of never indexing into fb's properly.

Bug: chrome-os-parter:42311
Test: On smaug, open up the add google account screen, it should
not be shifted

Change-Id: Ic5cf654d93ea6c89c2cbd23c1d847fbc412a7d19
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
fd37dfe3c0027857d66db489657f14955ced5790 13-Jul-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Dump active composition plane/crtc/dimension info

Should help with debugging if we can compare the SF layer info with
what drm_hwc is doing.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I333848b2141dff4c533f6dc22194826fdcf25dff
/external/drm_hwcomposer/drmdisplaycompositor.cpp
5069ca28d6ed969485ffae8a7742519868c33b53 14-Jul-2015 Stéphane Marchesin <marcheu@google.com> Merge "drm_hwcomposer: Print fps as float in dump()" into mnc-dr-dev
839599292e09e70387d87ad7213733da858b37e5 13-Jul-2015 Stéphane Marchesin <marcheu@chromium.org> drm_hwcomposer: Print fps as float in dump()

This is more accurate than using ints which helps with profiling work.

Change-Id: I9ba8cc8a2b0e9c1fa02bc217444d4001f0e19009
/external/drm_hwcomposer/drmdisplaycompositor.cpp
2e46fbd90b1aae158ec0437f564dd610e7392f7a 09-Jul-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Disable unused planes

Right before queuing up a composition, go through the
list of unused planes and add disable markers such
that they don't remain active when the new frame is
posted.

BUG=chrome-os-parter:42311
TEST=Tested on smaug, turned on/off bunch of times, no dup icons

Change-Id: Ic2e5e210873efb6dc41fd43682fe00db33c2a28e
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
db7a17d28ca48f81be3091e99564e47fa0503e9e 25-Jun-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Process DPMS requests through compositor

This patch changes the behavior of DPMS in hwcomposer from
applying asynchronously/immediately, to queuing in the
compositor and being processed in order. This is desirable
for a couple of reasons:
1- It ensures all frames set before set_power_mode are
shown on the screen before it turns off
2- We make sure we don't rmfb a framebuffer that is
currently applied to a disabled crtc.

The second reason above can cause the display to turn back
off once it's on since the fb will dereference to zero in
the kernel and it will disable the pipe without notifying
us.

Change-Id: I2aab9ee0353b12fecced46766ed2dbb64f0aef4b
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
acb2a4494e79f0026f8615acc561257276a71062 25-Jun-2015 Sean Paul <seanpaul@chromium.org> drm_hwcomposer: Add composition type to DrmComposition

This allows us to have different types of compositions. This will
enable injection of non-frame related compositions such as dpms
and mode.

Change-Id: Ia62421c114c0c6bebccef3ce6ae936366b6aafe2
Signed-off-by: Sean Paul <seanpaul@chromium.org>
/external/drm_hwcomposer/drmdisplaycompositor.cpp
98e73c89a683a92f44c99fb8dc85e51bdda243ba 24-Jun-2015 Sean Paul <seanpaul@chromium.org> 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
/external/drm_hwcomposer/drmdisplaycompositor.cpp