Commit graph

19 commits

Author SHA1 Message Date
Marius Vlad 788e80db77 backend-drm: Skip testing plane state if plane is not enabled
Adds a further assert() to make sure we're not checking against invalid
values. This was seen in the wild when the kernel rejects the commit for
overlay resulting in a check for invalid zpos values.

Fixes: #304

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-22 17:11:36 +02:00
Marius Vlad bd002b9884 backend-drm: Assign the primary plane the lowest zpos value
when switching to mixed-mode of compositing

This way we avoid an (incorrect) duplicate check of zpos values. Also,
this would be needed because the renderer needs have the lowest zpos value
available as we don't (yet) properly support underlays, the primary
plane serves as our renderer.

Adds also a check to see if we try to assign a view to a plane with
a lower zpos value than the one assigned to the primary when switching
to mixed-mode of compositing.

Fixes: #304

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-22 17:11:28 +02:00
Marius Vlad 28bb2da0ba backend-drm: Print whenever a view could not placed on the primary due to
invalid size

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 555bfaf617 backend-drm: Print whenever a view will reach the renderer region
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 36f11a53e1 backend-drm: Move plane's availability in drm_output_try_view_on_plane()
It makes much more sense to be there. It adds some additional drm_debug()
statements to provide reason for failing to place the view in the HW
plane. Makes the reason for failing more accurate.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad eef694547d backend-drm: Pass the drm_fb to each prepare_overlay/scanout_view functions
Avoids the need to retrieve the DRM framebuffer in each function and
re-uses the one got before constructing the zpos candidate list.

Takes another reference for the scanout as to live the state, like
there's one for the overlay bit.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 677e4598d9 backend-drm: Pass the plane to prepare_overlay_view
As we already have a potential plane available to use, pass it
over the _prepare_overlay_view instead of trying to find one
from the backend plane list.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 80a62e5873 backend-drm: Allow for views to reach overlays/underlays planes
In this manner we will allow views to reach the overlay (or underlays)
even if the damage tracking will detect that the new view will
occlude the view underneath it.

Renames occluded_region to planes_region, and uses occluded_region
to represent the region where we add each view's visible-and-opaque region.
Sprinkle some comments about each region.

Re-uses the view's clipped region to determine visible-and-opaque region
which is accumulated (for both renderer and HW planes cases) into
occluded_region. The current view's clipped_region is then checked against
occluded_region.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 26dcce06d7 backend-drm: Check pixel format before constructing the zpos candidate list
We can determine if the pixel format used by the clients buffer is
scan-out capable much sooner, so do it when constructing the zpos
candidate list. It also removes the checks in their respective
prepare_ functions.

Avoids the situation where we'd need to retrieve the DRM framebuffer each time
when checking the pixel format.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 3b13f56a1d backend-drm: Place pixel format checks for the cursor plane in its own
function

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 4eeb402553 backend-drm: Place pixel format checks for the overlay plane in its own
function

The idea is to place pixel the format checks in a common part and until
then, to make it available as a function so we can re-use easily.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 2538aaccc7 backend-drm: Construct a zpos candidate list of planes
In order to better optimize view assignment to HW planes, we construct
an intermediary zpos candidate list which is used aggregate all suitable
planes for handling scan-out capable client buffers.

We go over it twice: once to construct it and once to pick-and-choose a
suitable plane based its highest zpos position.

In order to maintain the view order correctly we track current zpos
value being applied to the plane state and use it when trying to place
a view into a plane.

Pass the computed zpos value to be applied to the plane state.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 47e3d1e481 libweston: Add a new helper to check if the view spawns the entire
output

Helpful to determine if the view can go through the scanout or not.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-11 16:51:48 +00:00
Marius Vlad 5f6bee49ed libweston: Add a new helper weston_view_has_valid_buffer
Helper to determine if the buffer attached to the view is valid.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-11 16:51:48 +00:00
Daniel Stone 2cb926c558 Revert "backend-drm: Teach drm_property_info_populate() to retrieve range values"
Due to an error in driving GitLab, this commit erroneously contained the
entirety of !267 (zpos support in the KMS backend) squashed into one
single commit, pushed into master.

In order to keep the history clean, this is being reverted; a rebased
version of !267 with the clear individual commits which were already
present will be applied in its place.

This reverts commit 95e3b0deae.
2019-11-11 16:48:54 +00:00
Marius Vlad 95e3b0deae backend-drm: Teach drm_property_info_populate() to retrieve range values
Useful for zpos range values.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
2019-11-11 15:24:25 +00:00
Stefan Agner ccf24076dd backend-drm: make GBM optional
Make GBM optional in case GL renderer is disabled. This allows to
build Weston with DRM backend without Mesa dependencies.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2019-10-25 15:32:07 +02:00
Ankit Nautiyal a344fe3245 backend-drm: Add support for content-protection
Currently drm-layer supports HDCP1.4 using connector property:
Content Protection. This property if available for a platform, can be
read and set for requesting content-protection.
Also, the patch series [1] adds HDCP2.2 support in drm, and patch [2]
adds support to send udev events for change in connector properties,
made by the kernel.

This patch adds these HDCP connector properties in weston, and exposes
the content-protection support to the client for drm-backend.

It adds the enums to represent 'Content Protection' and 'Content Type'
connector properties exposed by drm layer. It adds a member
'protection' in drm_output_state, to store the desired protection
from the weston_output in the drm-backend output-repaint cycle. This
is then used to write the HDCP connector properties for the drm_heads
attached to the drm_output.

The kernel sends uevents to the user-space for any change made by it
in the "Content Protection" connector property. No event is sent in
case of change in the property made by the user-space.
It means, when there is a change of the property value from "DESIRED"
to "ENABLE" i.e. successful authentication by the kernel, a uevent
will be generated, but in case of userspace requesting for disabling
the protection by writing "UNDESIRED" into the property, no uevent
will be generated.

This patch also adds support for handling new udev events for HDCP
connector property changes. Any such change, triggers change in the
weston_head's current_protection.

[1] https://patchwork.freedesktop.org/series/57233/#rev7
[2] https://patchwork.freedesktop.org/patch/303903/?series=57233&rev=7

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2019-08-26 16:18:22 +05:30
Daniel Stone e404b72fd5 compositor-drm: Split assign_planes() into separate file
drm_assign_planes() is called to separate views out and decide what will
be taken out for plane composition and what will be left for the
renderer to compose.

It calls drm_output_propose_state() in order to find a good
configuration, which itself has a number of helpers that it calls. Break
these out into a separate file.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2019-06-26 23:08:36 +01:00