1
0
Fork 0
Commit graph

24 commits

Author SHA1 Message Date
Su Hong Koo
406a14f111 Add atom reporting for modes on hotplugged displays
Add and use DisplayHotplugConnectModeDetectedAtomReporter, which logs
all valid modes of a hotplugged display.

Change-Id: Ie93487ad8e4936195e3d949ce46034c5ec4fda83
2025-11-12 12:31:12 -05:00
Su Hong Koo
680790982c Add atom reporting for refresh rate changes
Add DisplayRefreshRatesChangedAtomReporter, which reports the changed
refresh rates of all the active displays managed by drm_hwcomposer.

Change-Id: I03a81c667c44160dc319a899a3bd9a8bc527a382
2025-11-12 12:31:12 -05:00
Andrew Wolfers
5ee173b752 Rename DrmKmsPlan to LayerToPlaneJoiningPlan
Change-Id: I3824e57e3d890f4c59d48e1c7045cb0b7b649583
2025-11-06 18:32:13 +00:00
Andrew Wolfers
6c2df0cbdd Move CompositionPlanner from backend/ to compositor/
Change-Id: Iebd4a4d0e15c5171aa20fafe3686b7bc8c08a175
2025-11-06 18:32:05 +00:00
Andrew Wolfers
a890ccd62f Add atom reporting for flattening controller state
Change-Id: I09f60c95519d844359d5f1c70b940b47f756da21
2025-11-06 15:30:45 +00:00
Drew Davenport
9a89ceff02 Rename PipelineCreator interface to Backend
With the legacy Backend class renamed to CompositionPlanner, rename the
PipelineCreator interface to Backend. This interface maps most closely
to the concept of the "Backend".

Add some documentation to various Backend related classes.

Change-Id: I5d6a7afcebb9d0015c3d7629bf8c10324c8f07df
2025-10-31 12:37:30 -06:00
Drew Davenport
0afe783d1a Override Planner for GenericPipelineCreator
Allow classes to inherit from GenericPipelineCreator and use it for
creating the DrmDisplayPipeline, but override which CompositionPlanner
is used.

Extract the GetFlattenedComposition function into a static function that
can be called from any backend.

Change-Id: Id75705b969eb6d23fbc6147c496ac3f3e9956abf
2025-10-31 09:37:48 -06:00
Drew Davenport
d04968bf87 Extract GenericPipelineCreator to its own files
Separate GenericPipelineCreator from the GenericCompositionPlanner
class.

Change-Id: I20db30d9473c808e0f2e2516fb2a1f03ebf93e01
2025-10-31 09:35:06 -06:00
Drew Davenport
47fab44195 Extract abstract CompositionPlanner interface
Rename the generic CompositionPlanner implementation to
GenericCompositionPlanner, and abstract the CompositionPlanner
interface.

Change-Id: I39d6fd44956d77669271999dd83fc78eebec742a
2025-10-31 09:34:40 -06:00
Drew Davenport
f119d34769 Rename Backend to CompositionPlanner
With the Backend concept expanding to also include the initial display
configuration and creation of DrmDisplayPipeline, rename the Backend
class to more precisely reflect its purpose.

Change-Id: I8a9a0d49242771e5df6e80cd50f0b2b0670c2de2
2025-10-30 12:07:09 -06:00
Andrew Wolfers
ff954db228 drm_hwcomposer: Add buildflag guards around libsync deps
This change adds the buildflag HAS_LIBSYNC for managing
availability of libsync. This is necessary for the
unittests target for which libsync doesn't provide the
necessary variant.

DrmAtomicStateManager.cpp is the only file which depends
on libsync. Guards have been added using the HAS_LIBSYNC
flag, such that any method which would depend on libsync
is now stubbed when it is unavailable.

Change-Id: I101083074a9fad98e1c40c27b55f2eddf1c53581
2025-10-02 15:06:06 +00:00
Deborah Brouwer
ea5689b295 drm_hwcomposer: CI: Update to Android 16
In preparation for rebuilding all CI containers to use Android 16,
update CI/build variables to use Android 16 and Android SDK 36.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-08-19 14:52:08 -07:00
Deborah Brouwer
91403abf73 drm_hwcomposer: Add Meson dependency on base
Since libbase is now part of hwcomposer.drm_defaults, meson builds also
need the `base` dependency to avoid linking errors.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-08-19 12:23:31 -07:00
Drew Davenport
129d12f38a drm_hwcomposer: Report composition stats as vendor atoms
The IStats service provides an interface for reporting metrics from
vendor processes through the IStats::reportVendorAtom interface.

The type and ordering of the data in a VendorAtom are determined by a
proto definition which is typically OEM-specific. The code to construct
the VendorAtom is generated from the proto definition.

Add a soong config variable in the DRMHWC config namespace to enable the
atom reporting. Currently there is only one such implementation.
  atom_reporter: Set this to configure OEM-specific atom reporting.

With the config variable omitted, reporting will be disabled and a stub
implementation is used, ensuring no build or runtime dependency or usage
of the IStats service.

Change-Id: I832adbd42412db1ab4c9403c1da60fa075443caa
Signed-off-by: Drew Davenport <ddavenport@google.com>
2025-06-10 06:59:51 +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
98360f9e0c drm_hwcomposer: Add CompositionStats
CompositionStats struct is a copy of HwcDisplay::Stats and is extracted
from HwcDisplay as a prestep for supporting stats reporting beyond
dumpsys.

CompositionStatsProvider interface can be implemented by a class that
will poll all displays and return a display->CompositionStats map for
the cumulative stats for each display.

CompositionStatsTracker is a helper class that tracks the state of the
last queried stats and calculates the delta between the last stats and
the currently pulled stats. A Callback function can be passed into the
Report function which will be called for each display, with the
cumulative and delta stats as arguments.

Change-Id: I4200df5b41a4dbc612160aec038c83336b68bc4b
Signed-off-by: Drew Davenport <ddavenport@google.com>
2025-04-29 14:12:59 -06:00
Sasha McIntosh
f9062b6964 drm_hwcomposer: Set HDR metadata on the connector
Implement a function to set HDR metadata on the connector. Support HDR10
and HLG, which are common HDR types.

Change-Id: Id3dbe8eea2ee6b8ba700af23845a43e2070dd14e
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
2025-01-30 23:09:52 -05:00
Lucas Berthou
4483e4731d drm_hwcomposer: Add libdisplay-info dependency and update tar with library
Updating the Docker configuration to use new aospless tarball that
contains the required static libdisplay_info library for edid parsing.

Change-Id: Iccc893d4dabde36caca3da3e71d8b26193a82404
Signed-off-by: Lucas Berthou <berlu@google.com>
2024-12-19 17:53:04 +00:00
Tim Van Patten
16933c3dcf drm_hwcomposer: Check "Present Not Reliable" property
Check the "Present Not Reliable" property to determine if the capability
PRESENT_FENCE_IS_NOT_RELIABLE should be enabled or not.

The virtio gpu module sends frames to the host as fast as possible and
does not emulate "real display timing". Devices using the virtio gpu
module (for example, the virtual Android device Cuttlefish) should set
the following property to "true" to enable the capability:

    ro.vendor.hwc.drm.present_not_reliable.enabled

For example, in an Android BoardConfig.mk:

    PRODUCT_VENDOR_PROPERTIES += \
        vendor.hwc.drm.present_not_reliable.enabled=true

Signed-off-by: Tim Van Patten <timvp@google.com>
2024-11-18 11:00:09 -07: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
Roman Stratiienko
22fe9617da drm_hwcomposer: Make flattening thread-based instead of vsync-based
Using vsync means consume some CPU time every frame for
IRQ -> Kernel_Thread -> UserSpace_listener thread transitions.

Framework tries to reduce vsync usage to the minimum, by using timelines
instead.

New flattening controller thread wakes-up only once per second.

This commit also removes flattening info from dumpsys. Practice shows
that it is almost useless. Instead debugging can be done using ALOGV
dumps.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2023-01-18 19:25:08 +02:00
Roman Stratiienko
76892784ac drm_hwcomposer: Introduce SharedFd, use standard c++ RAII for UniqueFd
We use too much dup() system calls for present fence propagating.
Also when propagating acquire fence we use additional logic for
skipping such propagation for the validate/test cycle.

Both issues can be solved by introducing SharedFd, which will track
reference count of fd object.

After that the UniqueFd is used very rarely and can be simplified by
wrapping it into std::unique_ptr without caring too much of adding
an extra malloc/free operation.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2023-01-16 20:13:58 +02:00
Roman Stratiienko
380948102b drm_hwcomposer: Add meson.build file
This allows building without an AOSP tree, which significantly reduces
system requirements.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2023-01-04 16:58:14 +02:00