Add and use DisplayHotplugConnectModeDetectedAtomReporter, which logs
all valid modes of a hotplugged display.
Change-Id: Ie93487ad8e4936195e3d949ce46034c5ec4fda83
* Android Automotive configurations rely on hardcoded port ids.
These are used on EVS camera configuration and configuring instrument
cluster on secondary display.
* On Pi 5 the reverted commit changed the port ids for HDMI-A-1 and HDMI-A-2
from 0 and 1 to 32 and 33, respectively.
* Doesn't produce stable ids between rpi4 and rpi5 where there are different
number of drm cards and in different order.
* Lets keep running number from 0 for now vs. what 3/5 bit split would
produce on rpi4 and rpi5.
rpi4:
card0 - HDMI-A-1, HDMI-A-2, DSI-0 & DSI-1
000 00000 -> 0
000 00001 -> 1
000 00010 -> 2
000 00011 -> 3
rpi5:
card1 - HDMI-A-1 & HDMI-A-2
001 00000 -> 32
001 00001 -> 33
card2 - DSI-0
010 00000 -> 64
card3 - DSI-1
011 00000 -> 96
* Only revert the relevant part to avoid merge conflicts.
This partially reverts commit 907a51ab1b.
* It has been reported that HDR is not working properly on Raspberry Pi
with HDMI displays that support it.
Change-Id: I31f9d7bb5a3f81eeca1f98a72c26786d97edc28d
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
Make Backend a member of DrmDisplayPipeline and move the creation of the
Backend to where the DrmDisplayPipeline is created.
Change-Id: Ib7b799df5a2ba16015b7072b0e5ce89a174932c3
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
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
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>
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
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
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
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
Pass a timeout to the FlatteningController constructor. Move the
original default timeout from FlatteningController to HwcDisplay.cpp
Change-Id: I6e3f8950badc38a5ccad8ae68e1b11317c850d61
Currently, drm_hwcomposer has two main ways to lock up in the
composition hot path:
1. HwcDisplay::WaitForPresenttime(), where it looks at the expected
present time of the frame and sleeps until it is close to it (0.75
vsync period away from the target vsync).
2. DrmAtomicStateManager::WaitLastFrame(), where it waits on the
present fence of the last commit so that we don't call commit when
another present is pending
These are called in-order, which in certain multi-display configuration
with heterogenous refresh rates can lead to the slower display locking
up due to sleep in WaitForPresenttime().
This CL makes DrmAtomicStateManager::WaitLastFrame() public, and moves
its invocation to right before the call to
HwcDisplay::WaitForPresenttime(). This should minimize the impact of
WaitForPresenttime(), and allow drm_hwcomposer to hit more present
targets that it can hit.
Test: atest GraphicsComposerAidlCommandTest
Test: Manual testing w/ perfetto
Change-Id: Ic9c07ff0b6d00dfafce5dd109d8195886dd3094e
Signed-off-by: Su Hong Koo <sukoo@google.com>
This change moves the pixops calculation into HwcLayer. This
simplifies the logic to determine the total pixops over the
client range performed within Backend. This change also moves
the display size calculation into HwcDisplay.
Change-Id: Id7e12657a512db3aaea98d88833c818c10efef66
drm_hwc currently does not support tone mapping. This causes a visual
color flickers when switching between CLIENT and DEVICE composition.
Temporarily disable non-native color modes until tone mapping work is
completed.
Change-Id: I114a12c474990a5a81181c52307469c7b139a2b0
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
Add some const correctness to HwcDisplay. Narrow the public
interface of HwcDisplay to avoid exposing non-const members
unnecessarily.
Change-Id: I691c9e0025065085ca1e2045bb1d6614535fdbdc
Since CreateComposition is only being used in the present path, rename
it to CommitComposition to indicate that it's going to commit the
composition that was previously created during Validate.
Change-Id: Ia4627ff1e32b655273421510f8e1b844c6dd5e06
Making TestComposition const ensures that the Backend can't modify any
HwcDisplay state while creating and validating a composition.
Also make a bunch of other stuff const-correct since there is a const
version of GetPipe()
Change-Id: Ib7769d290148ce496b0165b64806dbd0a601b213
The client layer may be updated as part of Present, since the Client
doesn't know if the client layer is used or not until after Validate is
complete.
Move PopulateLayerData call out of CreateFrameUpdateCommit so that
CreateFrameUpdateCommit doesn't modify HwcDisplay state.
Change-Id: I0a78075f9476e0d27111b860b6a39fb46814b235
DrmKmsPlan lifetime is used to manage ownership of drm planes that have
affinity for multiple crtcs. As such, the DrmKmsPlan lifetime needs to
persist from a Validate call to when the composition is Presented to
ensure that such planes aren't stolen by another display.
Rather than stashing the DrmKmsPlan as part of TestComposition, return
the DrmKmsPlan as part of the Backend's Validate. HwcDisplay::Validate
then becomes responsible for lifetime management of the resulting
DrmKmsPlan as before.
Change-Id: I14ae115b2eed5c9b27e70f0b695fbbc4f3a4faa6
Extract the functionality to create the AtomicCommitArgs for a frame
update and call this from the TestComposition and CreateComposition
paths.
Change-Id: Ibb0695fd37e9f43eb8f97b3fd901109839d0f9ea
Rather than using next_config to determine if there was a config change
during the frame update, check the a_args.
Change-Id: Ib71dd3d542d7915e1fbfba0045c1d604382b1aab
QueueConfig allows for a seamless refresh rate change to be queued at
some arbitrary point in the future.
Previous behavior was to report `desired_time` as the time to request
a new frame from the client to apply the refresh rate change. Since
`desired_time` could be any arbitrary point in time, this may not align
with the current refresh rate.
This change addresses a failure in
SetActiveConfigWithConstraints_Delayed exposed by the previous change to
avoid setting the active_config_id until a full commit.
Change-Id: I92888cd1a6a330455f9e7e496d6900d494605248
HwcDisplay internal tracking state should only be modified for the
commit, not for the test commit
Change-Id: Idd63e300e724ff1b6986362d2b47e7b024346e05
Call this from the Backend when testing a composition. Future commit
will make this a const function to indicate that it doesn't change
HwcDisplay internal state.
Change-Id: I9bd6962e213acd76d13afbdc620418bd1ff95557
Backend shouldn't directly mutate HwcLayer state, so make HwcLayer
const. Make a few other related functions const correct as well.
Change-Id: Id7f8e255e9e72b756399b1a4dabc3db779d64bc9