Make Backend a member of DrmDisplayPipeline and move the creation of the
Backend to where the DrmDisplayPipeline is created.
Change-Id: Ib7b799df5a2ba16015b7072b0e5ce89a174932c3
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
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>
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
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>
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>
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
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
This change adds fields for counting the total number of layers
and used planes accross compositions.
Change-Id: I7c2593f66f734a4f8ec8ddf7a2f6b5c0c8dc3cc3
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
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
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
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
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>
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>
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>
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>
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>
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>
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
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
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
When the request CTM is a 3x4 transform, we designate all layers for
client composition and do not set the plane CTM. In the DRM_OR_IGNORE
case, we do not force client composition and end up using the incomplete
transform.
This change ensures that we only set the CTM when the matrix is useable.
Change-Id: Ic7928616208b61fcdef72cc214d652cdf8a47d00
The prefix doesn't provide a lot of value, and unnecessarily lengthens
the commit message subject lines.
Change-Id: I5e234510b2ad9822e95135e56a8a19b4b9329357
When all layers are designated for client composition, do not attempt to
add additional layer to client composition.
Change-Id: I4579c7d5f96cd148ae805e91cb0837284956bff9
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
Make cbks_ const as set in the constructor. Add a new kExitThread state
to indicate that the thread should exit.
This reduces the amount of state that needs to be synchronized across
threads and the amount of member variables that control state flow.
Change-Id: Ic99dd7ab153939bfa2d971985799413b212a999e
There is no need for this to be public since it is called from the
destructor, and any public usage of it was immediately before
destructing the FlatteningController
Change-Id: Ice233feaa9b934e7385ac83769250fea33f9140c
- Move member function implementations to the .cpp file.
- Rename Disable -> DisableFlattening
- Update comments for functions
Change-Id: I71eec96597a0d41f652b897c1862a34138b5be85
Backend can get a const reference to the FlatteningController for
checking if the scene should be flattened or not. Updating of the
FlatteningController is moved to HwcDisplay just before deferring to the
Backend during the Validate.
Change-Id: I9c7cc309bb16ea7b60187476db67fc9df1485275
FlatteningController is owned by HwcDisplay, so use a unique_ptr to
better control and indicate the ownership.
Remove the CreateInstance factory method and use std::make_unique
instead.
Change-Id: I0155c602dcf5a31d27fd2677f9f96ff9696a4022
Use an enum to track the different possible states of the
FlatteningController rather than a collection of bools.
Change-Id: I6136fd8f57a4033a10798f932a952951a01707b7
Annotate the state that is access across multiple threads. Add locks in
appropriate scopes as necessary.
Change-Id: I05ca1054b4836b72c6efb3fd2bf241d4958e3252
Under the previous behavior, NewFrame both updated the internal state
tracking to indicate that the scene is not idle, as well as returning a
bool to indicate whether the scene should be flattened or not.
ShouldFlatten was not being used, and would return `true` during the
interval between the refresh callback being triggered and the next
NewFrame, which would be in response to the refresh callback. Subsequent
calls to ShouldFlatten would return `false` even though the scene
remains idle.
This commit updates NewFrame to only update the internal state. Callers
should call ShouldFlatten to check whether the controller has detected
that the scene should be flattened.
After the callback is triggered, ShouldFlatten returns true. It will
continue to return true after the first NewFrame, which would be in
response to the refresh callback. Subsequent NewFrame calls will reset
the idle detection.
Change-Id: I8b11a55bb6b101bb2ce473a844f5b9795a027956
Pass a timeout to the FlatteningController constructor. Move the
original default timeout from FlatteningController to HwcDisplay.cpp
Change-Id: I6e3f8950badc38a5ccad8ae68e1b11317c850d61
Ensure that the next frame's list of used_planes is correct. The list of
used planes for the new frame is initialized to the previous frame's
list of planes when creating the AtomicRequest. If there is a
composition as a part of this request, the list should be cleared before
creating the new composition, since the list will be re-populated.
Neglecting to clear this left planes on the list when they shouldn't
have been, or the same plane multiple times. This led to some spurious
commit and validation failures on single display configurations, but on
multiple display configurations also resulted in highly visible stuttering.
Change-Id: Ie3fa1fc120fde13ee80f9a144c459526be2822cb
When DRM HWC starts, it resets all the connectors
and CRTCs to avoid the mimatch between drm hwc tracked
state and actual HW state programmed by the firmware
for the splash screen.
This fixes the MST connected boot issue.
Change-Id: I0773541b6bb227a2880d8442cc46411dc4c0127a
Signed-off-by: Manasi Navare <navaremanasi@google.com>