1
0
Fork 0
Commit graph

1126 commits

Author SHA1 Message Date
Andrew Wolfers
e45aaa0bb6 Cleanup includes in utils/ per IWYU style
Change-Id: I94248754ae4d6ce8c4931a5ddfc021f4d7993b5a
2025-11-11 19:14:26 +00:00
Andrew Wolfers
b7eb6f087f Cleanup includes in stats/ per IWYU style
Change-Id: I49b9bc58961ff8efee630f8eedaf6763a6a91cba
2025-11-11 19:14:24 +00:00
Andrew Wolfers
a9ff98d59f Cleanup includes in hwc3/ per IWYU style
Change-Id: I7a700723f495b24cd91524d0dae99177e35e447e
2025-11-11 19:14:12 +00:00
Andrew Wolfers
d2d2b7375b Cleanup includes in bufferinfo/ per IWYU style
Change-Id: Ibdafec5fe32e235427ae5adf897c46a10e6a35c0
2025-11-11 19:03:38 +00:00
Andrew Wolfers
57d43b853f Convert to Android-style logging and cleanup log includes
Change-Id: Ic2673ad6f474bd593fa1c5023e50a4120ba3ce95
2025-11-11 19:01:43 +00:00
Andrew Wolfers
1e0e2ca0a5 Move implementations out of headers
This change moves some non-trivial implementations out of header
files in drm/. This will enable some includes to be converted to
forward declarations in future changes.

Change-Id: I7b1248657e0fa27e3c0c0157abe4f6b918e13a29
2025-11-11 17:01:13 +00: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
Andrew Wolfers
460ef8d0a8 Add explicit mappings from HwcStats enums to atom types
Change-Id: I9496a7a5c3018a3dcea8eddd2bd6b5db80467419
2025-11-06 14:59:13 +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
7a69d5507a Make generic and client backends private static
Rather than global variables with static scope, make them private static
members of their respective classes.

Change-Id: I20f0ad1d63fe14001266058983b0d013058667dc
2025-10-31 12:36:29 -06:00
Drew Davenport
bf7f0dffee Remove obsolete class member
Backend/CompositionPlanner is now owned by DrmDisplayPipeline. This
class member should have been removed as a part of that refactoring but
was missed.

Change-Id: I9d0c58fff1bd9123ecdf602c846d5b224babbb0d
2025-10-31 09:37:53 -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
Drew Davenport
645d83d8eb Log an error for a Backend name conflict
Log an error and early-out if a backend with the same name is registered
multiple times.

Change-Id: Iec27c2987a3bb15702291870230d0bcac4a0704b
2025-10-30 09:27:28 -06:00
Drew Davenport
0e8dc3ebca Move some Backend functions to protected scope
These functions are not part of the Backend public interface, so move
them to protected.

Change-Id: I27dbafdec70f4277d3df952c9b01fd87f35b5943
2025-10-30 09:27:28 -06:00
Drew Davenport
3c2106f064 Allow Backend to create DrmDisplayPipeline
Define a PipelineCreator interface which allows Backends to use
Backend-specific heuristics in creating the DrmDisplayPipeline.

Change-Id: I1f929213ce403267b539635ec9d5853cf1a7f18a
2025-10-30 09:27:28 -06:00
Drew Davenport
0f5244ef78 Create DrmDisplayPipeline through BackendManager
Additionally, move the creation of the Backend into BackendManager so
that it the Backend is created along with the DrmDisplayPipeline

Change-Id: I24dc19cadb324429f229fe7751b60b70ab512265
2025-10-30 09:27:28 -06:00
Drew Davenport
043be2b9e3 Make BackendManager function private
This is only called from BackendManager and doesn't need to be part of
the public interface.

Change-Id: I0ffd375bea40ccf660d779464110c8cab25d0d02
2025-10-30 09:27:28 -06:00
Drew Davenport
786939db2b Make Backend a member of DrmDisplayPipeline
Make Backend a member of DrmDisplayPipeline and move the creation of the
Backend to where the DrmDisplayPipeline is created.

Change-Id: Ib7b799df5a2ba16015b7072b0e5ce89a174932c3
2025-10-30 09:27:28 -06:00
Drew Davenport
b112216f38 Use new BackendManager::CreateBackendForConnector
Remove the old CreateBackendForDisplay and related functions that are
now obsolete.

Change-Id: Ic41c065b65a50e6a68ccc1e40b210e5aed6d009e
2025-10-30 09:27:28 -06:00
Drew Davenport
fbd684e3e0 Add BackendManager::CreateBackendForPipeline
Create a Backend for the given DrmDisplayPipeline using the same logic
in CreateBackendForDisplay.

A subsequent change will use this function and deprecate
CreateBackendForDisplay.

Change-Id: I72365f5c689f6643e2f6da11f76dde1ac68f3e2d
2025-10-30 09:27:28 -06:00
Manasi Navare
caa94f923e drm_hwcomposer: Update Content Protection prop on Uevents
Kernel sends Uevents when Content Protection changes its value
from Desired -> Enabled on HDCP enabling or when it changes
from Enabled->Desired on HDCP termination.

This patch updates the content protection property value
on Uevents to capture the change in its state by the kernel.

Change-Id: I7003f0e498f1d1ffa3cbe37406c0b44c5813a3d1
Signed-off-by: Manasi Navare <navaremanasi@google.com>
2025-10-30 00:11:39 +00:00
Andrew Wolfers
81071ba3ce Restore cached DrmKmsPlan reuse
This change restores behavior where the DrmKmsPlan cached during
ValidateStagedComposition is reused during Present. That behavior
was disabled in a prior change due to a bug where the client
layer could become stale if it were updated between the validate
and present steps, which is now resolved by this change.

Change-Id: Ibca43dc028ece2f4480e5631078ad51320c10582
2025-10-20 15:00:34 +00:00
Sasha McIntosh
1159f0e373 Fix CTM clearing bug
When all layers are client composited, the GPU may or may not apply the
color transform. If the GPU does apply the CTM, we should clear the HWC
CTM.

Remove duplicate line setting the color matrix.

Change-Id: Ib6a1a48742ee356626ea624b00be5b689323619a
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
2025-10-16 14:58:06 -04:00
Manasi Navare
b23482b05c drm_hwcomposer: Add HDCP state tracking to request it to be enabled
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>
2025-10-14 19:10:56 +00:00
Andrew Wolfers
9df6d57b48 Remove cached DrmKmsPlan resuse
This CL resolves visual artifacts caused when the DrmKmsPlan is
cached from ValidateDisplay and later used during PresentDisplay.
This change restores prior behavior where the plan is created and
cached during validate, but then recreated fresh during present.

Change-Id: Ifea65946d586c9020143a35455405c5e4c5479e1
2025-10-14 10:21:50 -06:00
Lucas Bertou
8eeece3993 drm_hwc: fixing hal version issue.
The version is being updated downstream so ndk_shared points to v5 which
is not yet upstreamed and breaks the build. Pinning to v4 instead.

Change-Id: I68b26aad6a55bbf58d8c3786c6de1661a04d7484
2025-10-14 15:12:24 +00:00
Andrew Wolfers
5b8fc6f028 Update reporting for new DesktopAtoms
Change-Id: I5e0053c65480b26c02377320bb9904ed141504f4
2025-10-08 16:44:41 +00:00
Andrew Wolfers
68ff3baebe Add new metrics to CompositionStats
This change adds fields for counting the total number of layers
and used planes accross compositions.

Change-Id: I7c2593f66f734a4f8ec8ddf7a2f6b5c0c8dc3cc3
2025-10-08 16:44:38 +00:00
Andrew Wolfers
48f056ff82 Track stats per unique composition attributes
This change adds a new CompositionAttributes struct which
tracks information about a given composition as it is
validated and subsequently presented.

Previously CompositionStats were tracked as totals for each
display. This change splits the stats according to the
CompositionAttributes for each presented composition.

This change only affects the reporting behavior of
CompositionStatsTracker. The stats logged by DumpState are
totaled so as to not be affected.

Change-Id: I050cce7f63891971cc807b9c5150d9b5d30f1f0b
2025-10-08 16:44:33 +00:00
Andrew Wolfers
ccbe364628 Move stats accounting from validation to presentation
Some fields of the CompositionStats struct were only being updated
during validation, meaning that they would not be updated if the
validation step is skipped. This change moves the relevant updates
into presentation to correct some values which were not counted.

Change-Id: Ie537c0b5f6c18eaa71ca1fb2318fca3786d6e097
2025-10-07 14:53:49 +00:00
Andrew Wolfers
0c11f2e5db Enforce const in Backend where applicable
Change-Id: Ic55a1859a4407aa772f09cf11e1b03ab705a628e
2025-10-07 14:47:01 +00:00
Andrew Wolfers
09c7c9f875 Consolidate stats collection within HwcDisplay
This change moves all modifications to the total_stats_
property out of the Backend. HwcDisplay becomes responsible
for updating its own stats based on the results of validating
and presenting a composition.

Change-Id: I54ff8c2c8f6ad983ef583e60e2e77cf8b7866e9b
2025-10-07 14:46:53 +00:00
Andrew Wolfers
b393389438 Add cursor result to ValidatedComposition
Change-Id: Ic4ccf3b34021c0b57d10438ea212375159f43bd4
2025-10-07 14:21:22 +00:00
Andrew Wolfers
8ec71d2657 Add FlattenReason to Backend
This change adds a new enum FlattenReason which
describes possible reasons that a given composition
would be flattened. The flatten reason is now
returned with the ValidationComposition.

Change-Id: Ia7ba2ffbdc3512fea9cb19ab6be63a99eaa3f367
2025-10-07 14:21:07 +00:00
Gil Dekel
9a76e062b6 Move EdidWrapper from DrmConnector to HwcDisplay
The EdidWrapper lifecycle was previously managed by DrmConnector,
meaning the EDID parser was initialized when the connector was created.
This approach fails for physical connectors where a display is not
attached at boot, as no EDID blob is available to parse.

When a display was subsequently hot-plugged, the system would fall back
to a generic EdidWrapper. This provided incorrect or default display
properties to userspace, causing critical bugs such as:

  * Incorrect DPI calculations, leading to improperly scaled UI in
    Android.
  * Inability to detect HDR capabilities or supported color modes.

This change moves the ownership and lifecycle management of the
EdidWrapper to HwcDisplay. By creating the parser only when a display is
actually connected, we ensure that the correct EDID is always parsed,
making hot-plug functionality work as intended.

Change-Id: I5e056e423bbac2b23a411395b4ce13ccd03c4b64
Signed-off-by: Gil Dekel <gildekel@google.com>
2025-10-06 13:44:31 -04:00
Deborah Brouwer
e54f0897ed CI: Update cuttlefish container tags
Force the cuttlefish container to rebuild, then fetch the new cuttlefish
tarball by rebuilding the android container in which the CI test jobs run.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-10-03 15:52:50 -07:00
Deborah Brouwer
624a1d975f CI: cts-runner: skip testAndroidBaselineProfile2021Support
The testAndroidBaselineProfile2021Support fails because lavapipe does not
support
  "textureCompressionASTC_LDR"
  "textureCompressionETC2"

See: cts/tests/tests/graphics/jni/VP_ANDROID_baseline_cpu_only_2021.json
and mesa/src/gallium/frontends/lavapipe/lvp_device.c

Unless/until lavapipe adds this support, skip this test.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-10-03 15:52:50 -07:00
Deborah Brouwer
75ca83c730 CI: Set a cache directory for mesa
If a shader cache directory is not specified, mesa attempts to make a
cache directory at root. But since cuttlefish root is read-only, this
creates errors which fail the CI jobs.

Specify a shader cache directory for mesa to use that is writable and
will not cause spurious errors in CI.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-10-03 15:49:50 -07:00
Deborah Brouwer
ea1515b7cf CI: Return to using mesa software drivers
When the CI pipeline was converted to Android 16, the mesa software
drivers (llvmpipe and lavapipe) were temporarily removed until mesa's
Android.mk build could be reconciled with the Soong build of mesa.

Keep the Soong blueprints for other devices, but use mesa's make files
to build llvmpipe and lavapipe. Use mesa drivers when running CI jobs.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Reviewed-by: Valentine Burley <valentine.burley@collabora.com>
Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
2025-10-03 15:49:50 -07:00
Deborah Brouwer
2eada4fbe3 CI: Update ci-templates
Update the ci-templates commit sha so that additional fdo_log format
functions can be used when building CI containers.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
2025-10-03 15:49:50 -07:00
Andrew Wolfers
a51a43422d drm_hwcomposer: Use cached validated composition
This change adds caching to save the most recently
validated composition. The cached value is used where
appropriate to avoid recalculating the DrmKmsPlan or
the CompositionTypeMap from ValidateDisplay again in
PresentDisplay. The cached ValidatedComposition
replaces the previously cached DrmKmsPlan, preserving
the lifecycle management requirements.

Change-Id: I59704e26ae1a6950e750d246314b2db6af2f11a0
2025-10-03 18:56:19 +00:00
Andrew Wolfers
99f677a2ea drm_hwcomposer: Manage current_plan_ lifecycle
This change refactors the lifecycle management of
HwcDisplay::current_plan_. The purpose of the current_plan_
is to keep plane bindings in memory between calling
ValidateDisplay() and PresentDisplay(). This ensures that
bound planes will not be stolen by other CRTCs in the
interim, which could cause a validated composition to
become invalid before it can be presented.

The current_plan_ is intended to fulfill the contract
prescribed by the documentation of
Backend::ValidatedComposition::composition_plan, which
requires the plan to not be destructed until the
composition is committed.

Prior to this change, the lifetime of current_plan_ was
extraneous. Rather than being released after
PresentDisplay(), it was being unnecessarily held until
the next ValidateDisplay(). This would have the
unintended effect of holding the plane bindings after
the composition has been committed, which would prevent
other CRTCs from using the shared planes during that time.

This change updates the management of current_plan_,
still satisfying the Backend's contract, but releasing it
once it is appropriate to do so.

Change-Id: I956d3983b43302040f6ff18b5e907e2ed143c2dd
2025-10-03 13:47:00 +00:00
Andrew Wolfers
8940921be7 drm_hwcomposer: Add GetUsablePlanes tests to DrmDisplayPipelineTest
Change-Id: I02391c51ba392795bc39b3d918b5b86e5f4079bd
2025-10-02 15:06:23 +00:00
Andrew Wolfers
a95aa3b1c7 drm_hwcomposer: Add CreatePipeline tests to DrmDisplayPipelineTest
Change-Id: If105c7773e7f4adaa9c0ab7e6f410d9cc09f476e
2025-10-02 15:06:21 +00:00
Andrew Wolfers
086a6f1fc4 drm_hwcomposer: Add drm object fakes for DrmDisplayPipelineTest
Change-Id: I1ffbf45a787bac8ce414ef03701bc544835da3a7
2025-10-02 15:06:19 +00:00