CalcPixOps determines the cost of GPU-composition over a range
of layers. This change removes cursor-specific logic that was
accounting for behavior that only applies when the cursor is
not GPU-composited. This change restores the standard logic,
so that the cost of GPU-compositing the cursor layer is corrected.
Change-Id: I310fd35e2cd4f4df6d334ae0d989f2298267323a
Currently the seamless modeset test will segfault when attempting to
access the connector for a display running in headless mode.
Skip the seamless test if the display is running in headless mode.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Configuration groups for the Multiple Refresh Rate (MRR) feature support
is currently disabled in DRM HWComposer. This is because it is
insufficient to group modes solely based on their active region size.
The primary reasons for this insufficiency are:
1. drm-hwc clients may assume they can seamlessly switch between
configurations within the same group to support variable refresh
rates.
2. Not all System-on-a-Chip (SoC) architectures support seamless mode
transitions.
3. For SoCs that do support seamless switching, transitions often depend
on other hardware-specific properties like matching blanking periods.
4. A fallback to a non-seamless (blocking) modeset is unacceptable for
internal displays if a seamless transition fails, as this causes
flickering. The current framework does not handle such failures
gracefully.
To Resolve these challenges and re-enable seamless Multiple Refresh-Rate
transitions on internal panels, we add logic to validate all configs
against the preferred initial active config. This validation preforms a
seamless modeset test on each available config against the config that
was set during the display initialization. Configs that fail the
screening are assigned new group IDs.
Caveats:
1. Currently, this is only implemented for internal panels. External
display seamless transition between variable refresh rates is not
support. However this work can be extended to support seamless
transitions on external displays as well.
2. Grouping is only preformed for the preffered/active config at the
time of display init, and is valid only for the duration of the
current full modeset commit. No other groups are not created (since
they cannot be validated), and any new full commits will not honor
the guarantee provided by the check. This work can be extended to
refresh and validate all configs within the same group ID of any
incoming full modeset commit.
Change-Id: Ie2661e74bd3ff704b40c8c7ef50c56e604e5e8df
Signed-off-by: Gil Dekel <gildekel@google.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>
Error codes are never checked and working with errors as booleans
results in somewhat counter-intuitive logic.
Change CommitFrame() and ExecuteAtomicCommit() to return bools instead.
Change-Id: I5e8041fd4ddc99ef06184081a7f6def028bbe356
Signed-off-by: Gil Dekel <gildekel@google.com>
Keep reference to ctm so that we can switch between identity CTM and
requested CTM. When the client composites all layers, all color
transforms are also applied by the client. In these cases we apply an
identity CTM. When we swap to device composition, we need to re-apply
the CTM.
Additional code cleanup.
Change-Id: I8862b37ad6f5f785aba78f9172b321ad159c2e89
SurfaceFlinger should now be handling this race condition more robustly
and it is find to return BAD_DISPLAY in this case. Additionally, there
is no other thread which might be holding a resource resulting in a
deadlock or race during teardown.
Change-Id: I45740febccf2efae2fa470fdbdbe050daadb053b
Ensure that the thread has stopped and has stopped executing before
destructing the FlatteningController.
Change-Id: I32c631cbbfffc99dbd6c6b65bf1e86b670eca171
This is a prerequisit to allow for multi-display commit at once.
It also removes the cognitive complexity of CommitFrame through addition
of helpers for all drm properties to be set.
Change-Id: Ifad7e574c9ea6ced09c677923868ce29656f33f3
Signed-off-by: Lucas Berthou <berlu@google.com>
When the number of requested layers exceeds the available planes,
Backend::GetExtraClientRange chooses which layers to demote to
client (GPU) composition. The existing implementation prioritizes
minimizing the number of pixel operations which will be sent to
the GPU. Since the cursor layer tends to be one of the smaller
layers, it is often chosen. However, the cursor layer is generally
a poor choice for client composition because its position
frequently changes, causing the scene geometry to refresh. This
change updates the extended client range determination logic to
exclude the cursor layer from consideration.
Note: this behavior only applies to the cursor when it is being
device composited. When the cursor is being composited to the
HW cursor plane, it isn't competing for the same pool of planes,
so it was already a non-issue in that case.
Change-Id: I5cc2ac0f4ac2329c923b5c5060b78e80c32503f7
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 change resolves inaccuracies in the calculations of
per-layer pixel operation counts, i.e. "pixops". The display
frame of a layer attributes special meaning to a value of
nullopt, indicating that the frame occupies the whole display.
Correctly calculating the pixops for such a layer requires
checking the dimensions of the display mode. Additionally,
a layer being committed to the hardware cursor plane ignores
its display frame, instead using the dimensions of its buffer,
and therefore the pixops calculation needs to match.
Change-Id: I68cd2c3b42b9a556828a74eda715a106b958624b
Signed-off-by: Andrew Wolfers <aswolfers@google.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)
Now that all of the custom formatting functions are replaced with helper
functions from ci-templates, the custom formatting functions can be
removed.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Replace the custom formatting functions from setup-test-env.sh with the
new formatting functions available from ci-templates.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Replace the custom formatting functions from setup-test-env.sh with the
new formatting functions available from ci-templates.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
In preparation for introducing $FDO_CI_BASH_HELPERS, which adds an ERR
trap that is triggered even in subshells, simplify the VTS failure check
to avoid triggering the trap when no failures are found.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Replace the custom formatting functions from setup-test-env.sh with the
new formatting functions available from ci-templates.
Gitlab logs will still be formatted with collapsible sections, but now
drm-hwcomposer does not need to maintain its own custom versions of
these functions.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Update the ci-templates commit sha so that the new fdo_log format
functions can be used when building CI containers.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
IStats service is started by system_server which is not running during
VTS tests. In this case, the IStats service is declared, but not
started, which may result in a hang when calling AServiceManager_waitForService.
Acquire the IStats client lazily when reporting atoms, and log an error
upon failure to do so. If IStats is declared, we should expect that the
service will be available under normal operation.
Another benefit of this approach is that acquiring the IStats service is
no longer blocking service initialization.
Change-Id: Ib7a38930b1a3cbcaa629e576f601d7a05980e257
Cursor composition was previously developed under the mistaken assumption
that the z-pos property of the cursor plane was immutable. The DrmKmsPlan
would always place the cursor plane at the lowest z-position, but the
immutability made that aspect moot.
This change updates plan creation to instead place the cursor plane at the
highest z-position, which fixes cursor positioning on hardware where the
cursor plane z-pos is mutable.
Change-Id: Idfd390e0eb3de8ff6125722cda9f5ce73e983a02
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
Currently the CI pipeline is pushing the drm-hwcomposer binaries into
the vendor partition. Instead put the drm-hwcomposer binary into a new
apex package and run it in cuttlefish.
This approach aligns better with developer workflow.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Currently cuttlefish is building the ranchu apex package. Instead
configure it to build the drm-hwcomposer apex package. This will make
it possible to hot-swap the apex package later in the CI pipeline.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Currently custom repos are fetched by commit sha. Instead fetch them by
release tag or branch name to be clear that the commit is not arbitrary.
Also update the mesa repository to the lastest release.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
When building the cuttlefish tarball, the entire cvd-host_package is
copied instead of the individual files. This adds an extra step later
when the tarball is unpacked because the files have to be copied to
the correct location.
Fix the minor file copying issue to make the code cleaner.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Add apexer and android.jar to the android container to support building
new apex packages in the cts/vts jobs.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Since the android container is being rebuilt, update the cuttlefish
packages that it uses from v1.0.1 -> v.1.5.0.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Currently the android container is using 24.10 just to be consistent
with the aospless container, but since 24.10 is reaching end of life,
rebuild the android container with Ubuntu 22.04 for long-term support.
Ubuntu 22.04 is a better base than 24.04 because the cuttlefish support
packages expect older package versions.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Currently __ANDROID_API__ is defined by adding it directly to the
aospless cross-configuration file. But aospless is designed to use the
meson.build files in drm-hwcomposer, so put the flag in there instead.
This aligns better with the proper use of aospless.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
The aospless container uses the Ubuntu interim release 24.10 as its base
because, originally, clang 19 packages were not available in the Ubuntu
long-term support release 24.04. But these packages were backported to
24.04 in February 2025 as part of the 24.04.2 update.
Change the aospless container base to 24.04 since it now provides all
necessary packages and will ensure long-term support.
The ANDROID_SDK_VERSION variable is defined separately in the jobs that
build the android and aospless containers. Instead, defined it globally
and make it available to all CI jobs. This will avoid errors and make it
easier to update in the future.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
This change removes a check in DrmPlane::IsValidForLayer which would
verify that the buffer size matches known accepted values from the
DRM_CAP_CURSOR or SIZE_HINTS properties. Those properties are required
to return valid buffer sizes for committing to the cursor plane, but
they are not meant to be exhaustive. As a result, this check was
returning false negatives, and forcing the cursor into client
composition unnecessarily. The intended usage is that these props
should be checked during buffer allocation, not during composition.
Instead, test commits are sufficient for detecting whether a buffer
is valid for the cursor plane, and triggering fallback logic as needed.
Change-Id: Iae14436a6f50e45a113a4d18de67e73810b2a83e
Signed-off-by: Andrew Wolfers <aswolfers@google.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
Move the implementations for properties related functions on non-Android
platforms into properties.cpp
Change-Id: I91fce6a618445ea3021ef1013228285c99d819bd
Add Properties::GetBackendOverride to query the sysprop, and handle the
default in BackendManager.
Change-Id: Ifc01a23d64a5406ba5c9f065b7d5967b42b1b5d5
Now that the helper thread doesn't acquire the global lock, we can wait
for the helper thread to exit without risk of deadlock.
Change-Id: Ibaf8a1a64fb1aa64f8b75fd9a8ae1eff81dae0df