Add DisplayRefreshRatesChangedAtomReporter, which reports the changed
refresh rates of all the active displays managed by drm_hwcomposer.
Change-Id: I03a81c667c44160dc319a899a3bd9a8bc527a382
This adds HDCP state tracking through Client to HwcDisplay
When Client requests HDCP to be enabled for secure layers
Hdcpstate in the corresponding HwcDisplay is set up.
This is parsed to set the Content Protection and HDCP Content Type
properties for the connector in the next commit
Change-Id: I60dd4359ee2f87faba1df83c7faf286b34af43f6
Signed-off-by: Manasi Navare <navaremanasi@google.com>
Add perferto tracing around validate and present paths. Specifically
around code that blocks on the main thread (e.g. commit, fence waits).
These should increase the visibility of what is blocking the
presentation hot path in perfetto traces.
Change-Id: I6db60648c5e1d5f1a666ebc52f5ae5ad57e0e82a
For writeback connectors, no ReadbackBufferFence is returned. Instead
of returning kBadParameter, return kUnsupported so that the
GraphicsCompositionTest.GetReadbackBufferFenceInactive test will pass.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Even though drmhwc does not support per-layer LUTs, the vts test
GraphicsComposerAidlCommandV4Test.SetUnsupportedLayerLuts issues the
setLayerLuts command when the display is in headless mode with
vkms/cuttlefish. Since drmhwc ignores the command, the test fails.
Instead of ignoring the command, return a kUnsupported error which
allows the test to pass.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
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>
At some point, probably when migrating to hwc3 and creating/refactoring
HwcDisplay, we stopped pruning disabled configs before returning them
via GetDisplayConfigs().
Ensure disabled configs are pruned if disabled.
Change-Id: Iae3600d5e9b84cb3bb724949da82d42d5b801acd
Signed-off-by: Gil Dekel <gildekel@google.com>
The `future_config` feature is not currently used, and incoming changes
will most likely dub it obsolete. Removing it and making QueueConfig
always seamless makes more sense.
In addition, try to always queue a seamless config first, adding it to
the next pageflip commit to reduce jank. If seamless is not allowed (no
active mode or the new config is not within the same group_id, fallback
to a full blocking modeset commit.
Change-Id: I64dec41a93ba4f29bee501f7227b6f6961c9eb44
Signed-off-by: Gil Dekel <gildekel@google.com>
A virtual display provided by vkms does not report a physical width and so
does not support DPI. Currently a missing dpi will returning -1, but this
causes the VTS test GetDisplayConfigsIsSubsetOfGetDisplayConfigurations to
fail. Instead, return a kUnsupported error which the test recognizes.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
This commit adds a new ConfigError::kConfigFailed corresponding to the new
exception EX_CONFIG_FAILED.
SetConfig() should return this error if the requested config fails to be
committed.
Bug: b/391891910
Test: m drm_hwcomposer
Change-Id: Ie2ca26ff870324dc9016d32ffeb4382608f4d140
Signed-off-by: Manasi Navare <navaremanasi@google.com>
(cherry picked from commit 23bcfb7bc598f187380179b20695b648be3ff015)
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>
Unset the damage property in DRM when receiving an empty vector from SF.
The previous behavior was to retain the damage on empty vector, but this
is not HAL compliant behavior.
No longer need to #include the hwcomposer2 headers in common code.
Pull the hwc2 specific files into a different filegroup. There is no
need to build these for hwc3. Additionally, no need for hwc2-specific
CPPFLAGS in common or hwc3 code.
Change-Id: Ie194e9dc4b0d8f7b900227bd5d3b73efc692d975
Define a ConfigId type to be used for identifying per-display configs.
Cast this to the appropriate type in each frontend.
Change-Id: I4c242fc1f22811b52e0794378234400f38ea1ca7
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
Instead, reuse generic API SetColorTransformMatrix. The only valid hints
are abitrary and identity. Convert color_transform_hint_ member variable
to a bool.
Change-Id: Iac05c54394bee67637caa3edd3cde4e2097f6e1f
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
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>
When HDR10 is the desired output type for the display mode, request a minimum
bpc of 8 from the connector. This ensures the quality of the HDR content and
allows the caller to retry with SDR if there is insufficient bandwidth.
Change-Id: I897e0b42e0065a61ecfe28c280094b6c375d8a72
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
Set hdrOutputType to SYSTEM for all configs provided by drm_hwcomposer.
Change-Id: I219d70731be058b85117b63eeed769ecc31e614d
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>
Ensure that the display handle to destroy refers to a virtual display
before deleting the display.
Change-Id: I7c284aabdc17cef92051c47d12e4b31ef02ebc9b
Signed-off-by: Drew Davenport <ddavenport@google.com>
Change the Create/Destroy virtual display functions on DrmHwc to remove
HWC2 API stuff. Implement the corresponding functions in the HWC3 and
HWC2 frontends in terms of these functions.
Change-Id: I410da9347ccb2cd008cc94b746c2b5604969b57e
Signed-off-by: Drew Davenport <ddavenport@google.com>
Remove HWC2 CompositionType from midlayers. Define a new
HwcLayer::CompositionType enum to capture all composition types
supported by drm-hwcomposer.
HWC2 and HWC3 frontends do the necessary conversion to/from
HwcLayer::Composition type.
Since the last HWC2 usage has been removed from HwcLayer, remove the
hwc2 #include.
Change-Id: I00d579d699599f0918d114b35080933348aa513b
Signed-off-by: Drew Davenport <ddavenport@google.com>
Rewrite DrmHwc::Dump to return a string, rather than directly
implementing the HWC2 interface.
Rewrite the HWC3 frontend Dump implementation to return this string.
Rewrite the HWC2 frontend Dump implementation to cache the string in the
frontend so that the dump string size/contents can be fetched
separately.
Change-Id: I9c286f047bb67a05ced4f0e9778679c32175084c
Signed-off-by: Drew Davenport <ddavenport@google.com>
Remove the HWC2 GetDisplayName hook from HwcDisplay and replace it with
a function that simply returns the std::string.
Implement the HWC2 and HWC3 frontends in terms of the new
HwcDisplay::GetDisplayName.
Change-Id: I8230294bb7195b6d011ea450fafb80db8c9c5f50
Signed-off-by: Drew Davenport <ddavenport@google.com>
FlatteningController acquires its internal lock first, and then acquires
the global lock in DrmHwcThree::SendRefreshEventToClient.
During normal validate/present, the thread acquires the global lock
first, and will acquire the FlatteningController internal lock in
NewFrame.
Move the "must_validate" flag out of Hwc3Display to remove the need to
acquire the global lock in the SendRefreshEventToClient callback.
Add a std::set to track which displays must be validated, and protect
access to this set with a different mutex to avoid deadlocks.
Change-Id: I62d59252107f9f16a4b8bb43f850115bf327a127
Signed-off-by: Drew Davenport <ddavenport@google.com>
[Why]
Android requires a readback mechanism to validate display output,
especially in automated testing environments. This implementation is
particularly beneficial for writing automated tests with VKMS, as it
provides a reliable way to directly validate the rendered output.
[How]
Implement support for display readback using DRM/KMS writeback
connectors. This patch:
- Adds buffer management for readback operations
- Implements proper fence handling for both input and output operations
- Integrates with DRM atomic interface to configure writeback connectors
- Provides buffer readiness signaling to client applications
The implementation verifies hardware compatibility by finding matching
writeback connectors for displays and handles all resource lifecycle
management including buffer replacement and cleanup. This allows
tests to directly capture and verify the rendered output, ensuring
correctness and stability.
Test: VtsHalGraphicsComposer3_ReadbackTest
Change-Id: I12ec3d696b95bba79cbc560c525f573271a501bb
Signed-off-by: Mark Yacoub <markyacoub@google.com>
Internal ContentType and ContentType.aidl both match the HDMI 1.4 specification exactly.
Change-Id: If345a794a10c967b7fdb513f9056de39c7260678
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
This change adds a damage property to LayerData which is populated
from the damage provided via the layer command.
Change-Id: Ie6c069a1c2c81a8dc588a518f553ff087b0299dd
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
drm-hwc only supports setting power mode on and off. Add a new function
to HwcDisplay to enable/disable the display, and implement the HWC API
in the frontends in terms of this.
Change-Id: I7a3d92140f4b98bbed9000489e06b8011546ce7e
Signed-off-by: Drew Davenport <ddavenport@google.com>
Add a function to enable/disable vsync callbacks to HwcDisplay and
implement the HWC APIs in the frontend by calling into this new
function.
Change-Id: Id4506c870a8488bdd8d25ad025e246a3bcc6619e
Signed-off-by: Drew Davenport <ddavenport@google.com>
GetDisplayType is not used for hwc3, so no frontend work is
required to remove it.
A display can be physical or virtual. A physical display can be internal
or external. Create an enum to cover these three cases (virtual,
internal, external), and add a function GetDisplayType.
Implement related functionality in the respective frontends in terms of
this new function.
Change-Id: I72b0b66d22bc91a7e6d0450469f4c140b2cb91c4
Signed-off-by: Drew Davenport <ddavenport@google.com>
Expose functions on HwcDisplay to get the edid bytes and port, and
implement the HWC API in terms of those in the frontend.
Change-Id: I74131b165332eb39f2d77fcdd687d231f9ad504f
Signed-off-by: Drew Davenport <ddavenport@google.com>