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>
62626cbfec ensures that the GL render will not render a view's content
to the screen when the surface has requested a higher content-protection
level than the output currently offers.
When the HDCP MR was split into the core content-protection support in !83
and specific DRM support for HDCP in !48 (not yet landed), this opened a
hole where the DRM backend could promote a view to a hardware plane,
even if the output offered a lower protection level than the surface
wanted to enforce.
In the DRM backend, check the desired protection level, and refuse to
promote the view to a hardware plane if the output does not offer
sufficient protection. This will lead to presentation falling back to
the renderer, which may censor the content, reduce quality, etc.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: 4b6e73d617 ("libweston: Add support to set content-protection for a weston_surface")
This ensures that the default signal action doesn't kill weston-terminal
when the terminal tries to paste into a pipe whose read end has already
been shut down. (For example, a pipe from a misconfigured program or from
one which crashes/exits before the terminal calls write().)
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Otherwise 'log_extensions()' will not know how to properly format the
data.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The function pixman_blt may return false in case there is no
accelerated blit function available. In this case the remote shared
screen stays black.
This has been observed on Weston compiled for aarch64. In currrent
pixman 0.38.4 there is no accelerated pixman_blt function for
aarch64 available.
Use pixman_image_composite32 instead which is guaranteed to have a
working fallback implementation.
Fixes: #253
Signed-off-by: Stefan Agner <stefan@agner.ch>
Calculate damage region after resizing the cache image. This
avoids unnecessary calculation of damaged regions on resize,
makes sure that the whole screen is considered damaged on
resize and simplifies error handling.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Calculate y_orig separately first makes it easer to understand the
code and aligns with how pixels are read in screenshooter.c.
Signed-off-by: Stefan Agner <stefan@agner.ch>
This was caused by weston_wm_handle_xfixes_selection_notify() calling
weston_seat_set_selection() with a NULL source, apparently only
sometimes when closing an Xwayland window.
Check return values for wl_display_dispatch_* functions, so that
the program stops running when the compositor that it is connected
to crashes.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Fixes the following warn/error when using combination of flags like
building with debug, when disabling optimization and/or when enabling ASAN:
../shared/option-parser.c:61:1: error: control reaches end of non-void function [-Werror=return-type]
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
A few things have changed:
- Meson is used instead of autotools
- Wayland and Weston releases are not synchronized anymore
- Artifact deployment happens via wayland.freedesktop.org's Git repo
While at it, also convert the file to Markdown. Instructions to locally install
Xwayland/libinput have been dropped.
Signed-off-by: Simon Ser <contact@emersion.fr>
Although we already supported minor version 2 of the explicit sync
protocol, we couldn't advertise it previously, since it was not in any
released version of wayland-protocols. With the release of
wayland-protocols 1.18, which includes minor version 2 of this protocol,
and the recent update in weston to require 1.18, we can now safely
advertise minor version 2.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Commit 4fc5dd0099 ("compositor: add capability CAPTURE_YFLIP")
introduced a capability flag which indicates whether y-flipping is
necessary. As already indicated in that commit message, it seems
that pixman flipps the y-axis only due to historic reasons.
Drop y-flipping and use the WESTON_CAP_CAPTURE_YFLIP flag to
indicate that y-flipping is not necessary. This simplifies code
and improves screen share performance (on my test by about 3% down
to 18% CPU load on the sharing instance of Weston).
Signed-off-by: Stefan Agner <stefan@agner.ch>
To fully allow parallel-installation of libweston, we have to make sure
anything that is implemented in libweston is in a versioned directory.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
When building without GL renderer the compiler prints the following
warning:
../clients/subsurfaces.c: In function ‘egl_state_create’:
../clients/subsurfaces.c:225:35: warning: passing argument 1 of
‘weston_platform_get_egl_display’ makes pointer from integer without a
cast [-Wint-conversion]
225 | weston_platform_get_egl_display(EGL_PLATFORM_WAYLAND_KHR,
| ^~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
...
Define the fallback implementation of weston_platform_get_egl_display
to take an integer which is the underlaying datatype of EGLenum.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Destroy seats when they get removed. This makes sure that seats
properly disappear when screen-share RDP clients disconnect.
There will be no excessive amount of mouse pointer anymore after
several client connection/disconnections.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Currently, the HDCP support in drm-backend is under review and no
other backend supports HDCP yet. This patch is just to update the
weston.ini with this information.
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
It is quite similar to the remoting plugin. It just exports the frames via
pipewire instead of the builtin GStreamer pipeline.
It implements the same virtual output API. Virtual outputs can be created
by adding 'pipewire-output' sections to weston.ini.
The generated frames can be accessed with any pipewire client. e.g. with
GStreamer:
gst-launch-1.0 pipewiresrc ! video/x-raw,format=BGRx ! ...
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This details the logging/debugging framework with the latest changes,
making use of the groups added by "weston-log: Start adding
documentation" and "libweston/log: Add 'wlog' group".
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Adds initial grouping for sphinx/breathe for the logging/debugging
framework. We add a few groups: log (public API), internal-log (private API,
not exported) and debug-protocol, specific to the weston
debug protocol.
In latest version of breathe, '\memberof' command is recognized as such.
But it conflicts with '\ingroup' command and can't be used in the same
time (leading to duplicate symbols), so we follow a simple rule: object
tagging with '\ingroup' then use '\memberof' command for the functions
that work on that object.
There's also a caveat here: we have objects that are private (opaque)
but the functions are public. For those cases we resort to using
'internal-log' for the object (class) and 'log' for the functions.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
We have dedicated header for the internal parts of the logging
framework, use that for the set-up part instead of the libweston public
API header.
Further more this removes weston_vlog() from public header as well and
moves them to weston-log-internal.h file.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Place the subscribe parts and displaying of available scopes out of
main as it makes no sense to keep them there.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Uses (debug key-binding mod+shift+space) KEY_D to display/dump
the contents of the flight recorder.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Like a black box in an airplane, the flight recorder can be used to
accumulate data and, when needed, to display its contents.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Avoids a potential dependency on the log scope being set-up before
actually creating the scope. Destroy part of the log context could
suffer from the same issue if the log scope is destroyed before.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Logging should start as early as possible so create the log scope as
early as possible, before subscribing to it.
Open the logfile before creating the 'logger' subscriber, making sure
we're logging to the file properly.
Also migrate `weston_log_set_handler()` to avoid potential calls to
`weston_log` before installing the log handler.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Destroying the compositor after destroying the log scope will not print
out the messages in the tear down/clean-up phase of the compositor, so
add a new tear_down function which allows keeping a valid reference to
the compositor. This way we can destroy the compositor before destroying
the scope and keep the debug messages.
While at it remove the log context destroy part from the clean-up
of the compositor and make it stand on its own.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Pass log scopes from the command line to subscribe log scopes
dynamically to the 'logger' subscriber.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
With the logging infrastructure in place this patch add a new user: file
type of stream backed-up by a std file descriptor.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Rather than using 'begin_cb' rename it to a more suitable name.
Further more instead of using the scope use the subscription to pass as
an argument. The source scope is attached to the subscription when
creating it so we can access it that way.
This also adds a _complete and a _printf method for the subscription
such that the callbacks can use to write data to only _that_
subscription and to close/complete it, otherwise writing to a scope
results in writing to all subscriptions for that scope which is not
correct.
In the same time, the scope counter-parts of _write and _complete will
now use the subscription function as well.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniels@collabora.com>
This avoids duplicated bits, by calling the scopes's callback (if any)
and adding the subscription to the scope's subscription list. Further
more, the scope's name when creating the subscription is not needed so
removed that as well.
In mirror, also inline removing of subscription for scope's subscription
list. Fix a potential corner case when the user can request a
subscription to an invalid scope in stream_destroy().
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
As described in e10c9f89826bb: "weston-debug: Introduce...", the
subscriber object need further functionality to make use of it.
Current form of the weston-debug protocol would not need this, as it
creates underneath a new subscriber each time a client connects and
subscriptions are created/destroyed automatically with the help of
wayland protocol. For other types of streams, we require to manually
create a subscriber and to subscribe to log scopes.
This patch introduces the ability to create subscriptions, and
implicitly to subscribe to (previously created) scopes.
In the event the scope(s) are not created we temporary store the
subscription as a pending one: a subscription for which a scope doesn't
exist at the time of the subscription. When the scope for which the
subscription has been created we take care to create the subscription as
well.
While at it the documentation bits are modified accommodate the subscribe
method and its further functionality.
Lastly, it removes an unlikely case when a scope is not created so we
avoid any kind of dandling (pending) subscription in case there is
subscription to it. We can only do something about in the destroy part
of the scope.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Pekka Paalanen <pekka.paalanen@collabora.com>