1
0
Fork 0
Commit graph

35 commits

Author SHA1 Message Date
Andrew Wolfers
a9ff98d59f Cleanup includes in hwc3/ per IWYU style
Change-Id: I7a700723f495b24cd91524d0dae99177e35e447e
2025-11-11 19:14:12 +00:00
Andrew Wolfers
9255d0d10b drm_hwcomposer: Migrate to android::drm_hwcomposer namespace
Change-Id: I2859aa8f55532d88231389724956fc77b0625339
2025-09-08 18:53:00 +00:00
Deborah Brouwer
f83c13fd0c drm_hwcomposer: Silence clang-tidy warnings
Currently the clang-tidy CI job is ignoring code guarded by
`__ANDROID_API__ >= 36` so some readability warnings slipped through.

In preparation for updating the ANDROID_SDK_VERSION to 36, silence these
warnings:

  * error: invalid case style for parameter 'maxProfiles'
  * error: all parameters should be named in a function

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-08-19 12:23:31 -07:00
Sasha McIntosh
3ebd9367db drm_hwcomposer: Cleanup ANDROID_API references
Target version is now 35 and set in .gitlab-ci.yml. Remove API check for
version 35 and lower.

Change-Id: I083e5e347749e79f628c839d61fe997ed0c9bef2
2025-07-25 13:41:23 -04:00
Drew Davenport
7e66322389 Revert "drm_hwcomposer: Initialize stats asynchronously"
This reverts commit e5f755f842.

IStats initialization will be revisited in a follow-up commit. Threaded
initialization will no longer be necessary.
2025-06-25 08:06:32 -06:00
Drew Davenport
e5f755f842 drm_hwcomposer: Initialize stats asynchronously
Since stats reporter may need to wait for the IStats service to start
up, initialize the stats reporter and poller on a helper thread to avoid
blocking ComposerClient::Init, which is run early in boot.

Change-Id: I48949809d33f9aff0fab97822da34d76b7ce8dd9
2025-06-19 15:06:48 -06:00
Drew Davenport
3e4b0758a2 drm_hwcomposer: Use atom reporter for HWC3
When initializing the ComposerClient, create a
CompositionStatsAtomReporter and poll the DrmHwc periodically for
stats to send.

By default, the stub reporter is used

Change-Id: I864a3cc8e148b03cc6e693d141d2dcbf6d5c70d3
Signed-off-by: Drew Davenport <ddavenport@google.com>
2025-06-10 06:59:57 +00:00
Drew Davenport
23e05e0b85 drm_hwcomposer: Move common files out of hwc2_device directory
HwcDisplay etc. are shared between frontends and shouldn't live in the
hwc2_device directory.

Change-Id: I4bf3845f6cf7adde5f625a736cc1dffea27e5168
2025-05-23 09:01:32 -06:00
Drew Davenport
ca711e95bf drm_hwcomposer: Remove hwc2_display_t
Add DisplayHandle which is a typedef for int64_t. Use this type instead
of the HWC2 hwc2_display_t type.

Additionally, rename variable names to prefer `display_handle` over
`display_id`, since "DisplayId" is overloaded and carries a different
meaning in the Android framework.

Change-Id: I2a8ecce3b2c19fcd5e945d6c645f83d6a7d27a42
2025-05-23 09:01:26 -06:00
Sasha McIntosh
574a22f721 drm_hwcomposer: Remove SetColorMode HWC2 API
Add generic API for Set/GetColorMode and move HWC2 specific behavior to
hwc2_device.

Remove HwcDisplay::SetColorModeWithIntent, as the only supported intent
is colormetric.

Rename Colormode to ColorMode.

Fix contract between color mode and render intent. All supported color
modes should have a supported render intent (COLORMETRIC at least).

Change-Id: Ic1002b630f925e1ea75cb6ad7822b1384010143e
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
2025-05-22 13:35:33 -04:00
Sasha McIntosh
c469d14a19 drm_hwcomposer: Fixup downstream cherry-picks
Wrap Android16 APIs in an if block to prevent breaking Android15
integration.

s/AidlHdcpLevels/drm::HdcpLevels

Add support for external HDR displays (dropped in previous cleanup).

clang-format-diff-19 nits

Change-Id: I897e0b42e0065a61ecfe28c280094b6c375d8a72
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
2025-05-20 13:36:18 -04:00
Sally Qi
cb9f3a9742 drm_hwcomposer: add getLuts() aidl interface
This is internal for now due to getLuts() AIDL interface not being public yet and will be submitted together with AIDL change.

And the getLuts() interface is to get luts of input buffer handles.

Change-Id: I8af97262cb31e78318d44370f31f5b9890113183
Signed-off-by: Sally Qi <sallyqi@google.com>
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
2025-05-20 13:36:18 -04:00
Huihong Luo
85eb9e0ed0 drm_hwcomposer: Sync with new API to start HDCP
When SurfaceFlinger detects a secure surface, it can call this
api to inform HWC to start HDCP negotiations.

Change-Id: Ifce48821ba32c35567d608064c977ecc08fdd5b7
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
2025-05-20 13:36:17 -04:00
Brian Lindahl
fe82813f55 drm_hwcomposer: Add unsupported stubs for IComposerClient getMaxLayerPictureProfiles
Change-Id: I8623aee6d2f09bf8abeb8ad66de1186346fd5bb6
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
2025-05-20 13:36:17 -04:00
Roman Stratiienko
e501a97f5e drm_hwcomposer: HWC3: Remove HWC2 ComposerResources dependencies
Now that we have our own buffer importer and slots tracker,
ComposerResourcer is no longer needed.

Change-Id: I9b1e15800695b4c5f1a3f2c942ba669526e8a94c
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2025-02-07 00:21:15 +02:00
Drew Davenport
b864ccf845 drm_hwcomposer: Remove HWC2 usage for Present
Add HwcDisplay::PresentStagedComposition to commit the changes that have
been previously validated through ValidateStagedComposition.

Drop usage of legacy HWC2 api in ComposerClient.cpp for DisplayCommand
present commands.

Change-Id: I0b7fcd4b664bf707f468cd40b1fefdfdd963f7f7
Signed-off-by: Drew Davenport <ddavenport@google.com>
2025-01-24 14:12:24 -07:00
Drew Davenport
7f356c8501 drm_hwcomposer: Remove HWC2 usage for Validate
Add HwcDisplay::ValidateStagedComposition to be called after
HwcDisplay::SetDisplayProperties to check whether any
layer composition types need to be updated.

Change-Id: I3a46e97b1c1721ac62de98fb89c73a1ffb0141fe
Signed-off-by: Drew Davenport <ddavenport@google.com>
2025-01-24 14:09:16 -07:00
Drew Davenport
76c17a825d drm_hwcomposer: Stop using HWC2 interface for CTM
Add a new function HwcDisplay::SetColorTransformMatrix to set the
display's CTM. Add a new function to validate the CTM before passing it
into HwcDisplay.

Change-Id: I3258f61c95fc4053aecd9fcc4b7e948e49d4a7f6
Signed-off-by: Drew Davenport <ddavenport@google.com>
2025-01-24 14:04:00 -07:00
Drew Davenport
14022a3de7 drm_hwcomposer: Small refactor of ImportLayerBuffer
Move the fence dup into this helper function as well, making the output
of the function a HwcLayer::Buffer struct.

Change-Id: If18c9aa0b3e20d88bdca82e4ec375cb6f20205dd
Signed-off-by: Drew Davenport <ddavenport@google.com>
2025-01-24 14:04:00 -07:00
Roman Stratiienko
445ef202e5 drm_hwcomposer: hwc3: Fix build with Android-13
Account for differences in the Composer3 API between v1 and v2.

Change-Id: Ia8cbef19b5554467af15932afd842601d9d7f7a8
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2024-11-27 01:16:44 +02:00
Drew Davenport
8891e91acd drm_hwcomposer: Remove unimplemented display brightness code
This is not implemented in HWC3, so remove related code. It can be added
back when support for display brightness is implemented.

Change-Id: If7d0a111b22815e92e76a2506400e172baa1a60c
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-18 10:47:02 -06:00
Drew Davenport
e5fbbbb2bc drm_hwcomposer: Stop using HWC2 for setting layer buffer
Clean up HWC3 implementation around setting layer buffers a bit by
duping the acquire fence rather than relying on const_cast.

Set the layer buffer through LayerProperties instead of through the HWC2
SetLayerBuffer API.

Change-Id: Ifd873423d5536cdb07f4d6d868ef3a9fd641fafe
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-18 10:47:01 -06:00
Roman Stratiienko
71a8f02e98 drm_hwcomposer: Support multiple AIDL versions
As far as I know, there's no way for Soong to support multiple versions
that will change dependencies based on the Android API version.
However, we can still do that if we build with the aospext project,
making it possible for Android-13 and Android-14 to use the latest
drm_hwcomposer.

Change-Id: Ifeee42d3af64ff873b1a149231dc542ee2aee1df
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2024-10-18 00:17:01 +03:00
Drew Davenport
9c6f7e5566 drm_hwcomposer: Only validate layer brightness
Layer brightness is not supported, but an error is returned when a bad
value is set for layer brightness regardless.

Move the related code around to make this clearer and consistent with
other layer commands.

Change-Id: Iad59dcefb4ff0187d1c3f2c1ff368a58661b0ae0
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-14 14:23:24 -06:00
Drew Davenport
5d679b06bb drm_hwcomposer: Stop using HWC2 for layer z order
Add z_order to LayerProperties and set it along with other properties

Change-Id: Ib98c653e0adbc8da0ef50d64bd734b9014b09caa
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-14 14:23:24 -06:00
Drew Davenport
51c61e4785 drm_hwcomposer: Stop using HWC2 hooks for layer transform
Add a transform member to LayerProperties.

Change-Id: Id81386ce1565941e477534717cefb745de8738ca
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-14 14:23:24 -06:00
Drew Davenport
7ab8c1802e drm_hwcomposer: Stop using HWC2 hooks for source crop
Add source_crop to LayerProperties and set it together with other layer
properties.

Change-Id: I2153037b6df3ad2ecf1008d8bafe09d62ef59116
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-14 14:23:24 -06:00
Drew Davenport
07b96f0756 drm_hwcomposer: Stop using HWC2 hooks for layer plane alpha
Add an alpha member to LayerProperties and set it along with other
LayerCommand properties

Change-Id: Ib4e491718ec7772e6733f96a30dc63dcf0ed0598
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-14 14:23:24 -06:00
Drew Davenport
22d66b4a74 drm_hwcomposer: Stop using HWC2 hooks for displayFrame
Add a display_frame member to LayerProperties, and set the display frame
along with other LayerCommand properties.

Change-Id: Ia3549fb9d1750f3d08896d60c7d962f1c3b085b5
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-14 14:23:24 -06:00
Drew Davenport
1b0d8b747b drm_hwcomposer: Stop using HWC2 hooks for CompositionType
Add a member to LayerProperties for composition_type, and set
composition type along with other layer properties.

If the client requests an unsupported CompositionType, it's expected
that the HWC will detect this and return an error, and not proceed with
further validation of LayerCommand parameters.

Change-Id: Icf6d4becb53267f470226ed63b311ac7704d9e12
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-14 14:23:24 -06:00
Drew Davenport
ac9681ee73 drm_hwcomposer: Don't use hwc2 interface for dataspace
Add dataspace related members to LayerProperties, and set these for
LayerCommand.dataspace.

Change-Id: I86edeaac7005b6fada42431c6d02e0346ae0a2f7
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-14 14:23:24 -06:00
Drew Davenport
a241a774c1 drm_hwcomposer: Clean up SetLayerBlendMode for hwc3
Don't use the existing HWC2 api. Remove related hwc2/hwc3 conversion
helper.

Change-Id: Ie3e53d1854df2e895360bd0c445d398649ab310a
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-10-14 14:23:24 -06:00
Drew Davenport
7f1761b7c7 drm_hwcomposer: Use hwc3 version 3
Add stubs for new APIs. Bump the version number in the manifest
fragment.

Update Docker configuration to use new aospless tarball that contains
the required build dependencies for hwc3 v3.

Change-Id: I521f649c2f820f54bc3c6adcda8e17d5ab3112e1
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-09-13 10:32:43 -06:00
Drew Davenport
5951b111ce drm_hwcomposer: Connect ComposerClient with HwcDisplay
Implements the HWC3 frontend by calling the HWC2 interfaces already
exposed through DrmHwc, HwcDisplay, HwcLayer, and so on.

Convert between hwc2 types and hwc3 types in ComposerClient.

The following changes from !238 were used as a basis for this change,
and squashed together:
(drm_hwcomposer: Connect ComposerClient with HwcDisplay)
(drm_hwcomposer: Implement HWC3 frontend by calling down to HWC2)

The projects [1, 2] were used as a reference for the implementation.

[1]: https://android.googlesource.com/platform/hardware/google/graphics/common/+/refs/heads/main/hwc3/
[2]: https://android.googlesource.com/device/generic/goldfish-opengl/+/refs/heads/master/system/hwc3/

Co-authored-by: Normunds Rieksts <normunds.rieksts@arm.com>
Co-authored-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I98c10175d5c5f01aec1e192863238e16aa1537ec
Signed-off-by: Drew Davenport <ddavenport@chromium.org>
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-08-30 22:15:14 +00:00
Dennis Tsiang
33f0eceb58 drm_hwcomposer: Add hwc3 frontend stub
Adds a stub implementation of the HWC3 interface and service.
This is a barebones implementation of HWC3 interface that should contain
all the necessary code to build a HWC3 module but provides no
functionality.

The project [1] was used as a reference.
[1]: https://android.googlesource.com/platform/hardware/google/graphics/common/+/refs/tags/android-13.0.0_r18/hwc3/

Change-Id: I99754bb72f12183a94b24b7182cb7857173b31d2
Co-authored-by: Roman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Drew Davenport <ddavenport@google.com>
2024-08-30 22:15:14 +00:00