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>
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
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
This change refactors the IRect and FRect types into a single
templated type Rect<T>, which allows the implementation to be
shared across both variants. This change also adds convenience
getters for the rect widths and heights, and updates callsites
accordingly.
Change-Id: I38509631d57706266186a7b7fa21bd43c0860890
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
Ensure that the thread has stopped and has stopped executing before
destructing the FlatteningController.
Change-Id: I32c631cbbfffc99dbd6c6b65bf1e86b670eca171
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>
Instead, reuse generic API SetColorTransformMatrix. The only valid hints
are abitrary and identity. Convert color_transform_hint_ member variable
to a bool.
Change-Id: Iac05c54394bee67637caa3edd3cde4e2097f6e1f
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
Add generic API for Set/GetColorMode and move HWC2 specific behavior to
hwc2_device.
Remove HwcDisplay::SetColorModeWithIntent, as the only supported intent
is colormetric.
Rename Colormode to ColorMode.
Fix contract between color mode and render intent. All supported color
modes should have a supported render intent (COLORMETRIC at least).
Change-Id: Ic1002b630f925e1ea75cb6ad7822b1384010143e
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
Internal ContentType and ContentType.aidl both match the HDMI 1.4 specification exactly.
Change-Id: If345a794a10c967b7fdb513f9056de39c7260678
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
This change adds a damage property to LayerData which is populated
from the damage provided via the layer command.
Change-Id: Ie6c069a1c2c81a8dc588a518f553ff087b0299dd
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
This change fixes an issue during display validation where
cursor layer failures would trigger a fallback that forces
all other layers to be client composited.
Prior to this fix, if the cursor layer could not match to
the cursor plane, DrmKmsPlan would attempt to match it to
another plane. This could result in the number of layers
exceeding the number of available planes, which causes the
composition to fail into the client-composition fallback
behavior.
This fix changes the first-level fallback behavior, so
that when the cursor layer doesn't match to the cursor
plane, the client range will be recaluclated in order to
reserve an additional plane for device composition. Then
the cursor layer is converted to device composition and
the composition is retried.
Change-Id: Id704e182b7cc1dc66270de45a986a29e4b71a5a8
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
Add a new function to set the HDMI content type, and call this from the
frontend.
Change-Id: I338a00b7a142c6d2e2c3a727e8e7df7d24c1594d
Signed-off-by: Drew Davenport <ddavenport@google.com>
This change adds support for presenting to the cursor plane.
Logic is added to match cursor layers with cursor planes during
composition, plus additional test commit logic with backoff
behavior. Prior to this change, cursor planes were never
considered during composition. After this change, cursor
planes are available to be matched with compatible layers and
then used for presentation.
Change-Id: I3acd131cd210de46ff19af5a8960b07a82f462b2
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
This change adds cursor plane binding into DrmDisplayPipeline.
The signature of DrmDisplayPipeline::GetUsablePlanes is updated
to return a pair where the second element points to the bound
cursor plane (if it exists), and the first element points to
all other planes.
Change-Id: Ic6a623b10383b7dd0a0c2e79fc2d87329ebc6214
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
- Make HwcDisplay CreateLayer/DestroyLayer frontend-agnostic.
- Provide LayerId as an input for CreateLayer. It is necessary to add
the HWC3 LayerLifecycleBatchCommand feature, where layer ID is
generated by the client.
Change-Id: I317dcf22461fe4390ced9f0c0c780cffaa3b8f5d
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
0.0-1.0F range is a natural way to store alpha value internally,
to be converted later to DRM-specific 0-0xFFFF fixed point type at
DRM layer.
Change-Id: Iedf2b11e53bf38efd08cd4eda1346647b9ff721f
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
This commit introduces two improvements:
1. Introduces frontend-agnostic structures for rects.
2. Support default values in them so that the backend can handle
cases where rects are not specified by the client, like
the client layer display frame, etc.
This reduces the complexity of the Internal layer, making it
feasible to use a single Frontend<->Internal layer API for
regular layers, as well as for the Client and Output layers.
Change-Id: Iab5030ad523d36ea4c5af142f6f628952467d6ab
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Retrieve color and HDR information from the EDID.
Change-Id: I1aac27644d5c4fd5d5f295ca32b69ed69e94e0c6
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
Setting a config is currently implemented by queuing a config change to
take effect at the next vsync. Add HwcDisplay::QueueConfig to support
this functionality, which is implemented using the HWC2
setActiveConfigWithConstraints and setActiveConfigInternal as a
reference.
Implement HWC3 setActiveConfig and setActiveConfigWithConstraints in
terms of HwcDisplay::QueueConfig.
Change-Id: I127f569fe889e7370de1987137345b5b75ff04b6
Signed-off-by: Drew Davenport <ddavenport@google.com>
Implement ComposerClient::getDisplayPhysicalOrientation() by querying
the DRM display panel orientation property and translating the result to
the correct common::Transform enum value.
The result is used by SurfaceFlinger to correctly rotate the image
before displaying it to the user.
Signed-off-by: Tim Van Patten <timvp@google.com>
Optionally, get the Colorspace drm property and populate an enum mapping
for the property types. Add implementation to HwcDisplay::SetColorMode
to set this property and map between HAL_COLOR_MODE types to Colorspace
formats.
Change-Id: Id532e94207c1b1a2623b7d77db239735df18b30f
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
Disable flattening controller at creation time. Without disabling the
flattening controller, it could result in refresh event being set to
composer clients early before the display is validated which can result
in VTS test failures as it checks for invalid refresh events at
test teardown.
Change-Id: I4a91032fdce1be0a7ee0d26b52914992a95842b5
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Drew Davenport <ddavenport@google.com>
It's a pain to use logcat filters for drm_hwcomposer since each file has a different tag necessitating one to specify each tag for the logcat filter or use a regex.
Use one tag for all of drm_hwcomposer to simplify this.
Signed-off-by: Sean Paul <seanpaul@chromium.org>
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>
Since acquire_fence is now std::shared_ptr, struct LayerData has default
copy constructor and LayerData::Clone() function is no longer required.
Also we can now remove 'test' argument from HwcLayer::PopulateLayerData
function, since copy operation for acquire_fence is now available.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
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>
Some of existing include guards were copy-pasted without modification,
therefore have incorrect name. Switch to 'pragma once' in order to fix
it and avoid such copy-paste issues in the future.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Address new clang-tidy findings, in most cases 'misc-const-correctness'
check was addressed by adding 'const' modifier, or in some cases changed
to 'auto' (where it's better for formatting).
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
1. Move BlendMode, ColorSpace, SampleRange fields to the struct BufferInfo,
allowing extraction of the data from native_handle using Metadata@4 API.
Use it when data from HWC2 API can't be used (Currently it's a BlendMode
case for CLIENT layer)
2. Rename DrmHwcLayer to LayerData and move it to compositor/ directory.
(I was confused in the past because of similarity of names DrmHwcLayer
vs HwcLayer, so this step should meke it easier for newcomers to
understand the code)
3. Allow clonning of the LayerData to propagate it through the composition
pipeline. Thus LayerData can be used by both HwcLayer to track state
and by the compositor.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Primary responsibilities of this class are:
1. Send composition/mode/active state over DRM atomic commit IOCTL
to the kernel
2. Track commit state and keep planes owned by the Pipeline while they
are either displayed or staged for displaying.
3. Keep framebuffers alive while they are in use or staged.
Not much related to composition itself, therefore rename it to
DrmAtomicStateManager and move it to drm folder.
Bump clang-tidy level of DrmAtomicStateManager.c to normal by fixing
minor clang-tidy findings.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Now we can use empty DrmKmsPlan to achieve the same goal.
+ Remove unused HwcDisplay::ClearDisplay()
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>