OSDN Git Service
Haixia Shi [Fri, 16 Oct 2015 17:48:15 +0000 (10:48 -0700)]
drm_hwcomposer: fix missing assignment of premult flag
This was somehow dropped due to the recent squash ground work CL.
BUG=
24791071
TEST=verify bug is fixed
Change-Id: If5f2b61104d47a2d70d3c3b34149c1d62ec82659
Sean Paul [Fri, 16 Oct 2015 13:52:42 +0000 (13:52 +0000)]
Merge "drm_hwcomposer: Use layer alpha to blend planes" into mnc-dr-dev
Haixia Shi [Thu, 15 Oct 2015 23:21:48 +0000 (16:21 -0700)]
drm_hwcomposer: do not queue layers map for virtual display
It is invalid to add a DrmCompositionDisplayLayersMap for the virtual
display because the corresponding physical display resources (such as
crtc, connector, etc.) do not exist.
BUG=
24985282
TEST=verify that no crash occurs
Change-Id: I24a6671e7f94032a38104ae7ed3eb0da79479601
Zach Reizner [Thu, 15 Oct 2015 21:41:41 +0000 (14:41 -0700)]
drm_hwcomposer: add missing break statement
By a stroke of luck, the fall through case had a break statement.
Change-Id: I29cb1206d114f31ec58a603cd9dcb986764d8344
Sean Paul [Thu, 15 Oct 2015 19:17:31 +0000 (15:17 -0400)]
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>
Zach Reizner [Wed, 14 Oct 2015 04:12:48 +0000 (21:12 -0700)]
drm_hwcomposer: reimplement Dump for DrmDisplayCompositor
Also fixes hwc_dump sometimes failing to null terminate its output buffer.
TEST=dumpsys SurfaceFlinger
Change-Id: Ibf93cfd496a07a9375d78a8b239c2c7876aff986
Zachary Reizner [Thu, 15 Oct 2015 18:41:58 +0000 (18:41 +0000)]
Merge "drm_hwcomposer: ground work for squashing" into mnc-dr-dev
Isaac Simha [Wed, 14 Oct 2015 18:40:29 +0000 (11:40 -0700)]
drm_hwcomposer: Do not close duplicate gem handles in nvimporter
When closing gem handles in ReleaseBufferImpl, do not try to close
the same one more than once.
BUG=chrome-os-partner:46443
TEST=Play youtube video, minimize. Observe no "Failed to close
gem handle" messages in logcat.
Change-Id: I06598f304e3bd167a77f105eb2be86595ada8f4d
Signed-off-by: Isaac Simha <isimha@nvidia.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Zach Reizner [Tue, 13 Oct 2015 00:47:13 +0000 (17:47 -0700)]
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
Sean Paul [Wed, 14 Oct 2015 15:26:43 +0000 (15:26 +0000)]
Merge "drm_hwcomposer: Disable planes on frame failure" into mnc-dr-dev
Haixia Shi [Tue, 13 Oct 2015 20:52:55 +0000 (13:52 -0700)]
drm_hwcomposer: name the texture samplers individually and unroll loop
Per GLSL spec: when aggregated into arrays within a shader, samplers can
only be indexed with a "dynamically uniform integra expression", other-
wise results are undefined.
The current fragment shader is not spec compliant because it evaluates
the sampler array in a non-uniform flow control, where the loop may exit
early in a "break" statement depending on the per-pixel alpha value.
BUG=
24718688
BUG=chrome-os-partner:46348
TEST=follow bug report and verify GLWorker composites 5 layers correctly
Change-Id: I3a4c4b5aa847a1b5ec32f58f0e8c0b349289f5f5
Haixia Shi [Wed, 14 Oct 2015 01:31:29 +0000 (01:31 +0000)]
Merge "drm_hwcomposer: fix logic error in premult blending" into mnc-dr-dev
Haixia Shi [Wed, 14 Oct 2015 01:27:10 +0000 (18:27 -0700)]
drm_hwcomposer: fix logic error in premult blending
In case of premult blending, the tex.rgb is premultiplied with tex.a,
but it still needs to be multiplied by the plane alpha.
BUG=
24914993
TEST=verify the blending artifacts are fixed
Change-Id: I9135f91d52b2d256a71895e13caf2158286de992
Zach Reizner [Wed, 14 Oct 2015 01:19:26 +0000 (18:19 -0700)]
drm_hwcomposer: set the composition map's display field
Change-Id: I67842cdfd0afab67a81448c1b64da47d2f933db3
Sean Paul [Tue, 13 Oct 2015 20:24:49 +0000 (20:24 +0000)]
Merge "drm_hwcomposer: Increase failure time for acquire fences" into mnc-dr-dev
Sean Paul [Tue, 13 Oct 2015 19:47:22 +0000 (15:47 -0400)]
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>
Sean Paul [Tue, 13 Oct 2015 19:44:45 +0000 (15:44 -0400)]
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>
Zach Reizner [Mon, 12 Oct 2015 22:20:33 +0000 (15:20 -0700)]
drm_hwcomposer: improve logging and reliability of some error paths
Change-Id: I4a955c6261a9674009eec2264eb2ef4a161da9c4
Zach Reizner [Fri, 9 Oct 2015 20:02:55 +0000 (13:02 -0700)]
drm_hwcomposer: fix small class consistency issues
This also fixes a typo in an error message.
Change-Id: Ie6c369f5eb2496ac3ebb342dbdcdd70f3a176495
Zach Reizner [Fri, 9 Oct 2015 17:02:54 +0000 (10:02 -0700)]
drm_hwcomposer: small feature/style enhancements for seperate_rects
With C++11, we can condense the double angle brackets.
This commit also includes an integer version of seperate_rects and some
convenience functions for rectangles.
Change-Id: Ide2a6b930cdf30c0f7a58d4199e02c06df492776
Zach Reizner [Fri, 9 Oct 2015 16:54:42 +0000 (09:54 -0700)]
drm_hwcomposer: use in-class member initializers for AutoEGLDisplayImage
Change-Id: Id78a646d264eb3fab833f279f30570ddc89fadb7
Haixia Shi [Fri, 9 Oct 2015 22:48:47 +0000 (15:48 -0700)]
drm_hwcomposer: support the PREMULT blending mode in glworker
BUG=
24791071
TEST=verify notification icon shade is consistent with or without glworker
Change-Id: Ib7db1ece2e1dd327fdc1ffdbd44c360bd63f76b9
Season Li [Thu, 8 Oct 2015 00:47:55 +0000 (17:47 -0700)]
drm_hwcomposer: Fix EGL_BAD_DISPLAY errors
Dont call eglDestroyImageKHR in move construtor
since image_ and display_ are not initialized.
Google Issue: 44452
Change-Id: Ie20be3b021d4562f2cd8a89d2666307afcde1cf2
Haixia Shi [Mon, 5 Oct 2015 21:35:09 +0000 (14:35 -0700)]
drm_hwcomposer: support virtual displays
Virtual display support is mandatory for HWC version 1.4.
As a minimal implementation, we use frambuffer target and let SF take care of
GLES composition. We still need to handle the acquire and release fences for
both the virtual display and all layers in a separate worker thread.
BUG=
24609829
TEST=screen casting to chromecast
Change-Id: Idb962f4b5bb852c9ec9ebcaa1679a653c01737fb
Zachary Reizner [Wed, 7 Oct 2015 22:11:51 +0000 (22:11 +0000)]
Merge "drm_hwcomposer: fill hwc_display_contents retireFenceFd" into mnc-dr-dev
Zach Reizner [Tue, 6 Oct 2015 22:39:09 +0000 (15:39 -0700)]
drm_hwcomposer: fill hwc_display_contents retireFenceFd
This restores the behavior of "drm_hwcomposer: Populate retireFenceFd"
The retire fence is triggered when all releaseFenceFd's of the display's
layers are triggered.
Change-Id: Id06f2df03dcb9638ccbae23f46c42b05551fae6d
Sean Paul [Thu, 1 Oct 2015 17:20:02 +0000 (13:20 -0400)]
drm_hwcomposer: Bump the acquire fence timeout to 83ms
To accomodate peak usage situations.
Change-Id: I46031ce394abf1ec09177089508dd625d7c17aaa
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Sat, 19 Sep 2015 13:14:34 +0000 (09:14 -0400)]
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>
Haixia Shi [Wed, 30 Sep 2015 17:57:54 +0000 (10:57 -0700)]
drm_hwcomposer: fix crash in hwc_set()
For each display context we need to unconditionally call emplace_back()
on layers_indices to ensure that entries in layers_indices correspond to
the correct display.
BUG=
24506167
TEST=still builds and boots ok
Change-Id: I6bc0858471c9ec51615c8ed7d8613529f77cb1ab
Sean Paul [Tue, 29 Sep 2015 04:56:00 +0000 (00:56 -0400)]
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>
Haixia Shi [Fri, 25 Sep 2015 18:49:44 +0000 (11:49 -0700)]
drm_hwcomposer: use GL_TEXTURE_EXTERNAL_OES target for src textures
The GL_TEXTURE_EXTERNAL_OES supports format conversion for YUV external
textures, whereas GL_TEXTURE_2D does not.
Convert crop rects to normalized coordinates.
BUG=chrome-os-partner:45761
TEST=run netflix and observe corruption is fixed during animation transition
Change-Id: Iad9a187faad6b58f1c4b1d19edd0d2a5cbc9a561
Zach Reizner [Fri, 11 Sep 2015 01:30:54 +0000 (18:30 -0700)]
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
Sean Paul [Tue, 22 Sep 2015 17:48:30 +0000 (17:48 +0000)]
Merge "drm_hwcomposer: limit maximum depth of display composition queue" into mnc-dr-dev
Sean Paul [Mon, 21 Sep 2015 14:05:19 +0000 (10:05 -0400)]
drm_hwcomposer: Make gl worker log tag consistent with rest of hwc
For easy logcat grepping.
Change-Id: I79b82f4d359268a6e116f602f2ffb90885cdb3dd
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Mon, 21 Sep 2015 14:04:02 +0000 (10:04 -0400)]
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>
Haixia Shi [Thu, 10 Sep 2015 22:16:47 +0000 (15:16 -0700)]
drm_hwcomposer: correctly handle rotation + cropping
BUG=chrome-os-partner:44741
TEST=ryu, window transition animation (10x slowdown) in all orientations
Change-Id: Ibeb880a60ecf168e9d15e2f16b5f0b5642d85f1c
Haixia Shi [Wed, 9 Sep 2015 19:08:20 +0000 (12:08 -0700)]
drm_hwcomposer: use HWC_FRAMEBUFFER_TARGET if all HWC_OVERLAY layers are skipped
Apparently there are cases (such as during rotation) where SF will put content
in framebuffer target and set HWC_SKIP_LAYER on all other layers. In this case
we need to use the HWC_FRAMEBUFFER_TARGET layer.
BUG=
23936827
TEST=verify on ryu that rotation works
Change-Id: Ice8ee5a023a92fc286dbf837a822fa6f6c0fde6b
Sean Paul [Fri, 4 Sep 2015 05:33:06 +0000 (01:33 -0400)]
drm_hwcomposer: Allow NULL crtcs in display composition
In cases where we have displays which do not have a mode,
the crtc will be NULL. This shouldn't fail the composition
initialization.
Change-Id: I1a6acb72cd3f614b5a7c854ba61be1539efa4bea
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Stéphane Marchesin [Tue, 25 Aug 2015 07:08:10 +0000 (00:08 -0700)]
drm_hwcomposer: Allow layer transforms
They are very much valid now. I think this is just leftover?
BUG=chrome-os-partner:42717
TEST=test rotation, it doesn't lock up
Change-Id: I4cd96ae91c91452ef2be3cb3b07c123ce38ed576
Zach Reizner [Thu, 20 Aug 2015 21:52:12 +0000 (14:52 -0700)]
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
Zach Reizner [Fri, 14 Aug 2015 18:14:38 +0000 (11:14 -0700)]
drm_hwcomposer: add properties to disable overlays or to use HWC_FRAMEBUFFER
To use SurfaceFlinger's GL compositor, use the setprop command:
$ adb shell setprop hwc.drm.use_framebuffer_target 1
A side effect of using the above property is that drm_hwcomposer will only be
compositing one primary plane.
To disable overlays (to force the GL compositor to be used more often):
$ adb shell setprop hwc.drm.use_overlay_planes 0
The default behavior is the opposite of the above properties.
Change-Id: I86afb533c10a8caa15931e8c292f52bb94e5f6c5
Zach Reizner [Thu, 13 Aug 2015 21:53:41 +0000 (14:53 -0700)]
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
Zach Reizner [Thu, 13 Aug 2015 21:32:09 +0000 (14:32 -0700)]
drm_hwcomposer: style fixes
Change-Id: Id04a088a895f8372a32623713589d43d5e0495ef
Zach Reizner [Fri, 7 Aug 2015 23:00:01 +0000 (16:00 -0700)]
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
Zach Reizner [Thu, 30 Jul 2015 15:10:14 +0000 (08:10 -0700)]
drm_hwcomposer: fix buffer leak when using the GL compositor inside DrmDisplayCompositor
Change-Id: Id3a6deea9fc0f97640b34dacb25d36f3793f2d4e
Zach Reizner [Fri, 31 Jul 2015 22:12:49 +0000 (15:12 -0700)]
Revert "Revert "drm_hwcomposer: remove compositor interface""
This reverts commit
1c5e55680d9165d8f9bb2bc6e2c4261574b5d41d.
Zach Reizner [Fri, 31 Jul 2015 22:12:47 +0000 (15:12 -0700)]
Revert "Revert "drm_hwcomposer: remove GLCompositor and the GLWorker thread""
This reverts commit
d078e4cab78f81057cd25355199caba5a147342e.
Zach Reizner [Fri, 31 Jul 2015 22:12:44 +0000 (15:12 -0700)]
Revert "Revert "drm_hwcomposer: have DrmDisplayCompositor do its own OpenGL composition""
This reverts commit
cbe9c01336e23a63259db65d22d63d6a697b8813.
Puneet Kumar [Thu, 30 Jul 2015 03:38:11 +0000 (03:38 +0000)]
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
Sean Paul [Thu, 30 Jul 2015 13:18:30 +0000 (13:18 +0000)]
Merge "Revert "drm_hwcomposer: remove GLCompositor and the GLWorker thread"" into mnc-dr-dev
Puneet Kumar [Thu, 30 Jul 2015 03:36:46 +0000 (03:36 +0000)]
Revert "drm_hwcomposer: remove GLCompositor and the GLWorker thread"
This reverts commit
abebc7a78fe8a4df6495c8e5064719dc92b04004.
For now until we figure out a more stable solution for SF/hwc
Change-Id: I7a505fc67873f943704e8b48db4167b9beca7691
Puneet Kumar [Thu, 30 Jul 2015 03:35:38 +0000 (03:35 +0000)]
Revert "drm_hwcomposer: remove compositor interface"
This reverts commit
7912438911de042dc035cf1ea39daaf4e56bf9f3.
For now until we can get back to a stable SF/compositor.
Change-Id: I2ba7cab4f1cccfe44b3d35fb18c7784125e88fd6
Zach Reizner [Tue, 28 Jul 2015 22:33:07 +0000 (15:33 -0700)]
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
Zach Reizner [Wed, 22 Jul 2015 22:01:37 +0000 (15:01 -0700)]
drm_hwcomposer: remove compositor interface
The compositor interface had only one implementation and one user. The
compositor interface also needs to change to accomodate some changes for
fences to work optimally.
Change-Id: I02d21b0a0e86fa21b3c5f4ad84ff571611643994
Zach Reizner [Tue, 21 Jul 2015 22:06:16 +0000 (15:06 -0700)]
drm_hwcomposer: remove GLCompositor and the GLWorker thread
They are dead code now that DrmDisplayCompositor uses GL directly.
Change-Id: Ie4beeab60440a51bd87486847b5453e20288d1d8
Sean Paul [Wed, 22 Jul 2015 10:45:40 +0000 (10:45 +0000)]
Merge "drm_hwcomposer: Populate retireFenceFd" into mnc-dr-dev
Sean Paul [Thu, 16 Jul 2015 19:59:24 +0000 (15:59 -0400)]
drm_hwcomposer: Populate retireFenceFd
Join all layer releaseFenceFd fences together to get the
retireFenceFd for the display.
Change-Id: I431ee227a62397b1900adb0caaf8b16b319a99cd
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Zach Reizner [Thu, 16 Jul 2015 17:14:26 +0000 (10:14 -0700)]
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
Zach Reizner [Fri, 17 Jul 2015 21:13:28 +0000 (14:13 -0700)]
drm_hwcomposer: make sure all fences are released for DrmDisplayComposition
This change will release the layers passed back to SurfaceFlinger even on an
error in the compositor thread.
Change-Id: I22f622855c8c953a058b4a08d0af1ae427e4cbbd
Zach Reizner [Fri, 17 Jul 2015 21:10:03 +0000 (14:10 -0700)]
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
Zach Reizner [Fri, 17 Jul 2015 00:22:59 +0000 (00:22 +0000)]
Merge "drm_hwcomposer: add transform support to OpenGL compositor" into mnc-dr-dev
Zach Reizner [Thu, 16 Jul 2015 23:53:41 +0000 (16:53 -0700)]
drm_hwcomposer: add transform support to OpenGL compositor
The GL compositor will respect the layer.transform enum. However, using a
non-identity transform with source cropping is untested, and the documentation
is unclear on what the expected results should be anyways.
Change-Id: I10007743d5b17c611671b647e8f404fdbe1ab4a5
Zach Reizner [Thu, 16 Jul 2015 21:45:44 +0000 (21:45 +0000)]
Merge "drm_hwcomposer: style fixes with clang-format" into mnc-dr-dev
Zach Reizner [Thu, 16 Jul 2015 21:45:10 +0000 (21:45 +0000)]
Merge "drm_hwcomposer: make the gl worker compositor not nested" into mnc-dr-dev
Sean Paul [Tue, 14 Jul 2015 19:51:52 +0000 (15:51 -0400)]
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>
Zach Reizner [Thu, 16 Jul 2015 16:45:59 +0000 (09:45 -0700)]
drm_hwcomposer: style fixes with clang-format
Change-Id: I020072a782dde7551ae940d12f3925b8680ba0af
Zach Reizner [Thu, 16 Jul 2015 01:44:37 +0000 (18:44 -0700)]
drm_hwcomposer: make the gl worker compositor not nested
Change-Id: I06b75644408a570044499a9f603a478f3199661f
Sean Paul [Wed, 15 Jul 2015 19:19:40 +0000 (19:19 +0000)]
Merge "drm_hwcomposer: Dump active composition plane/crtc/dimension info" into mnc-dr-dev
Sean Paul [Wed, 15 Jul 2015 16:36:48 +0000 (12:36 -0400)]
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>
Sean Paul [Mon, 13 Jul 2015 16:41:37 +0000 (12:41 -0400)]
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
Stéphane Marchesin [Mon, 13 Jul 2015 23:40:12 +0000 (23:40 +0000)]
Merge "drm_hwcomposer: Print fps as float in dump()" into mnc-dr-dev
Stéphane Marchesin [Mon, 13 Jul 2015 23:39:52 +0000 (23:39 +0000)]
Merge "drm_hwcomposer: Convert v_refresh() to float" into mnc-dr-dev
Sean Paul [Mon, 13 Jul 2015 23:00:14 +0000 (23:00 +0000)]
am
e850fa2e: (-s ours) drm_hwcomposer: Process DPMS requests through compositor
* commit '
e850fa2e39da03695e03c1824a08f8be9b4cfdbf':
drm_hwcomposer: Process DPMS requests through compositor
drm_hwcomposer: Free failed composition in QueueComposition
Sean Paul [Mon, 13 Jul 2015 22:53:58 +0000 (22:53 +0000)]
am
1abf5c3f: (-s ours) drm_hwcomposer: Add composition type to DrmComposition
* commit '
1abf5c3fd61c1698e1ef7f9794cac5e22609a58c':
drm_hwcomposer: Add composition type to DrmComposition
Sean Paul [Mon, 13 Jul 2015 22:42:09 +0000 (22:42 +0000)]
am
e86fcfbb: (-s ours) drm_hwcomposer: Split the drm compositor into per-display threads
* commit '
e86fcfbb5c3f857efbcccb335c9a1a72a7a101cb':
drm_hwcomposer: Split the drm compositor into per-display threads
Stéphane Marchesin [Mon, 13 Jul 2015 19:35:41 +0000 (12:35 -0700)]
drm_hwcomposer: Print fps as float in dump()
This is more accurate than using ints which helps with profiling work.
Change-Id: I9ba8cc8a2b0e9c1fa02bc217444d4001f0e19009
Stéphane Marchesin [Sun, 5 Jul 2015 09:00:08 +0000 (02:00 -0700)]
drm_hwcomposer: Convert v_refresh() to float
We convert v_refresh() to return a float and instead of storing it,
compute it on the fly from the pixel clock + htotal/vtotal. This makes
the synthetic vblank computation much more accurate.
Change-Id: I2a0becf75eaca8ace30d176fdc813f3b57ba23a5
Sean Paul [Thu, 9 Jul 2015 21:51:50 +0000 (17:51 -0400)]
drm_hwcomposer: Use vector for overlay planes
For two reasons:
1- Because we don't need to use deque
2- Because we'll need to erase from the middle in the future,
and deque makes that difficult while iterating
BUG=chrome-os-parter:42311
TEST=Tested on smaug, turned on/off bunch of times, no dup icons
Change-Id: I306bdea15d7165f63afeb3b1e06774e2e9a1785f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 9 Jul 2015 21:22:22 +0000 (17:22 -0400)]
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>
Sean Paul [Thu, 25 Jun 2015 01:46:05 +0000 (18:46 -0700)]
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>
Sean Paul [Fri, 10 Jul 2015 20:43:06 +0000 (16:43 -0400)]
drm_hwcomposer: Free failed composition in QueueComposition
Rather than maintaining ownership of the composition in the
caller, free the DrmComposition in QueueComposition on failure.
Change-Id: Id70e98ae1a8eef400bc29460bfc5a89c4707d617
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 25 Jun 2015 01:43:01 +0000 (18:43 -0700)]
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>
Sean Paul [Wed, 24 Jun 2015 21:38:49 +0000 (14:38 -0700)]
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
Sean Paul [Thu, 25 Jun 2015 01:46:05 +0000 (18:46 -0700)]
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>
Sean Paul [Fri, 10 Jul 2015 20:43:06 +0000 (16:43 -0400)]
drm_hwcomposer: Free failed composition in QueueComposition
Rather than maintaining ownership of the composition in the
caller, free the DrmComposition in QueueComposition on failure.
Change-Id: Id70e98ae1a8eef400bc29460bfc5a89c4707d617
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 25 Jun 2015 01:43:01 +0000 (18:43 -0700)]
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>
Sean Paul [Wed, 24 Jun 2015 21:38:49 +0000 (14:38 -0700)]
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
Zach Reizner [Wed, 8 Jul 2015 23:45:04 +0000 (23:45 +0000)]
Merge "drm_hwcomposer: Add glworker" into mnc-dev
Zach Reizner [Sat, 27 Jun 2015 01:25:38 +0000 (18:25 -0700)]
drm_hwcomposer: Add glworker
The glworker allows signalling the fence synchronously once the GL
work is done. It also helps performance by putting all GL in a
separate thread, which avoids (costly on some GPUs) makecurrent.
Change-Id: Ia4ee137df5c9a4b1afcf6180407371d6ba7f699a
Sean Paul [Wed, 8 Jul 2015 14:43:54 +0000 (10:43 -0400)]
drm_hwcomposer: Add blob property type
The blob property type doesn't use the values_ vector, instead
just storing the blob id directly in value_.
Change-Id: Ibde7c64cb7fe515ece9e9f396866de2da518707f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Stéphane Marchesin [Tue, 23 Jun 2015 23:18:10 +0000 (16:18 -0700)]
drm_hwcomposer: Add tracing for the main functions
This will help the profiling efforts, now that all the low-hanging
fruit is gone.
BUG=none
TEST=run systrace, see tracing
Change-Id: I9a149afdea8b84837c19f8e224ce8a7e2db1dd9a
Stéphane Marchesin [Fri, 19 Jun 2015 21:50:45 +0000 (14:50 -0700)]
drm_hwcomposer: Switch to triple buffering
This increases the performance of the UI (30->40 fps).
BUG=none
TEST=boot to UI, swipe between desktops, measure fps
Change-Id: Ie0ff4b51c3db402a40c9676d3f09d48d85097bce
Sean Paul [Wed, 3 Jun 2015 18:08:27 +0000 (14:08 -0400)]
drm_hwcomposer: Use atomic modeset to set crtc timing
Use the new drm blob ioctl and atomic modeset properties to
do atomic modesetting, as opposed to the old setCrtc call.
This allows us to set timing as soon as the system layer requests
a new active config, as opposed to delaying it until we have
an fb. Aside from reducing complexity, this should help with
event control requests as we'll be able to service them with
hw vblanks instead of synthesized sleeps.
Change-Id: I9c80d44f52f52881a3a25b2ae518973d468bc110
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Zach Reizner [Fri, 12 Jun 2015 00:19:48 +0000 (00:19 +0000)]
Merge "drm_hwcomposer: integrate GLCompositor with hwcomposer" into mnc-dev
Zach Reizner [Wed, 10 Jun 2015 23:03:01 +0000 (16:03 -0700)]
drm_hwcomposer: integrate GLCompositor with hwcomposer
This patch makes it such that HWC will always composite all layers even if
there are too few HW planes. Any layers that do not fit in a plane get
rendered into a screen sized buffer by GLCompositor, the result of which uses
up one of the available HW planes.
Change-Id: Ibd560ae4c536632ac32d965152ceacd92bbba39f
Zach Reizner [Thu, 11 Jun 2015 20:07:09 +0000 (20:07 +0000)]
Merge "drm_hwcomposer: correct alpha channel output on gl framebuffers" into mnc-dev
Sean Paul [Thu, 11 Jun 2015 19:22:04 +0000 (19:22 +0000)]
Merge "drm_hwcomposer: Use HW overlay planes" into mnc-dev
Zach Reizner [Thu, 11 Jun 2015 18:58:52 +0000 (18:58 +0000)]
Merge "drm_hwcomposer: make GLCompositor delete bo with Importer" into mnc-dev
Zach Reizner [Thu, 11 Jun 2015 18:58:41 +0000 (18:58 +0000)]
Merge "drm_hwcomposer: fix misc style issues in gl_compositor.cpp" into mnc-dev
Zach Reizner [Thu, 11 Jun 2015 18:30:20 +0000 (11:30 -0700)]
drm_hwcomposer: correct alpha channel output on gl framebuffers
Change-Id: I1ca8f2f7edb7fbb8691c4ba37c859bf60dcea77a