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>
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
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
Account for differences in the Composer3 API between v1 and v2.
Change-Id: Ia8cbef19b5554467af15932afd842601d9d7f7a8
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
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>
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>
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>
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>
Add z_order to LayerProperties and set it along with other properties
Change-Id: Ib98c653e0adbc8da0ef50d64bd734b9014b09caa
Signed-off-by: Drew Davenport <ddavenport@google.com>
Add source_crop to LayerProperties and set it together with other layer
properties.
Change-Id: I2153037b6df3ad2ecf1008d8bafe09d62ef59116
Signed-off-by: Drew Davenport <ddavenport@google.com>
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>
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>
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>
Add dataspace related members to LayerProperties, and set these for
LayerCommand.dataspace.
Change-Id: I86edeaac7005b6fada42431c6d02e0346ae0a2f7
Signed-off-by: Drew Davenport <ddavenport@google.com>
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>
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>
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>