Commit Graph

37 Commits

Author SHA1 Message Date
Marius Vlad
a72e3716e8 libweston: Introduce libweston-internal.h
Introduce a new private header file that only internal parts of the
library are allowed to use and shouldn't be exposed in the public header
of libweston.

Start by adding by adding functions that operate on the 'weston_buffer*'.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 06:43:38 +00:00
Marius Vlad
c2e18e896f libweston: Removed unused tty_* functions
These are nowhere defined, so it seems the we're only left with these
declarations.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 06:43:38 +00:00
Marius Vlad
4d79283248 libweston: Migrate weston_environment_get_fd() to weston-launch header
This is private so it doesn't belong to public libweston API header.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 06:43:38 +00:00
Pekka Paalanen
1c0d04bff7 libweston: do not include config-parser.h
config-parser.h is a helper API that libweston core must never depend on. Using
it is a compositor frontend decision.

Including it in libweston.h would give the wrong message.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-07-18 06:43:38 +00:00
Robert Beckett
c569bdc236 libweston: make session_active a bool
compositor->session_active should be a bool as it tracks a boolean
condition.

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
2019-07-18 06:35:41 +00:00
Antonio Borneo
c90fccc256 backend-drm: fix race during system suspend
Depending on system loading, weston-launcher could drop the drm
master access before the compositor and all the clients receive
the notification. In this case, some commit could be sent to the
drm driver too late and get refused with error EACCES.
This error condition is not properly managed and causes weston to
hang.

Change the return type of start_repaint_loop() and repaint_flush()
from void to int, and return 0 on success or -1 if the repaint has
to be cancelled.
In the callers of start_repaint_loop() and repaint_flush() handle
the return value and cancel the repaint when needed.
In backend-drm detect the error EACCES and return -1.
Note: to keep the code cleaner, this change inverts the execution
order between weston_output_schedule_repaint_reset() and
repaint_cancel().

No need to wait for suspend or for any notification; in case the
weston reschedules a repaint, it will get EACCES again.
At resume, damage-all guarantees a complete repaint.

This fix is for atomic modeset only.
Legacy modeset suffers from similar problems, but it is not fixed
by this change. Since drm_pending_state_apply() never returns
error for legacy modeset, this change has no impact on legacy
modeset.

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/117
2019-07-12 17:16:52 +00:00
Ankit Nautiyal
2844f8eaaf compositor: Enable HDCP for an output using weston.ini
This patch enables a user to opt for HDCP per output, by writing into
the output section of weston.ini configuration file. HDCP is always
enabled by default for the outputs.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2019-07-05 14:13:30 +05:30
Ankit Nautiyal
f74c35b1f4 libweston: Notify client for change in content-protection status
The change in an output's content-protection may trigger a change in
the surface's content-protection status, and inturn the
content-protection available for the client.

This patch recomputes the content-protection level for a surface,
in case there is a change in content-protection level of an output,
showing the surface. In case of a change in the surface's
content-protection, the client associated with that surface is
notified.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2019-07-05 14:13:24 +05:30
Ankit Nautiyal
5cfe03c863 libweston: Add content-protection protocol implementation
This patch adds the content-protection protocol implementation, to
enable a weston client application to request for content-protection
for its content via HDCP.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2019-07-04 14:18:50 +05:30
Ankit Nautiyal
4b6e73d617 libweston: Add support to set content-protection for a weston_surface
The protection requested for a given surface, must reach through the
weston_surface::pending_state, in the commit-cycle for the
weston_surface, so that it gets updated in the next commit.

As some protection is requested for a given weston_surface, it means
protection must be set for each of the outputs which show the surface.

While setting the protection of a weston_output, care must be taken
so as to avoid, degrading the protection of another surfaces, enjoying
the protection. For this purpose, all the weston_surfaces that are
shown on a weston_output are checked for their desired protection.
The highest of all such desired protections must be set for the
weston_output to avoid degrading of existing protected surfaces.
A surface requesting protection for a lower content-type can still be
provided protection for a higher type but the converse cannot be
allowed.

This patch adds support to set content-protection for a suface, which
inturn sets the content-protection for each of the outputs on which
it is shown, provided, none of the existing surface's protection
request is downgraded.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2019-07-04 14:18:50 +05:30
Ankit Nautiyal
4f64ff8b2f libweston: Compute current protection for weston_output and weston_head
The actual protection status for a given weston_head depends upon the
corresponding drm_head's connector HDCP properties. On the other hand,
the actual protection for a weston_output is the minimum of the
protection status of its attached heads.
As a head's protection changes, the current protection of the output
to which the head is attached is recomputed.

This patch adds the support to keep track of the current
content-protection for heads and the outputs.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2019-07-04 14:18:50 +05:30
Ankit Nautiyal
2690a77088 libweston: Add support to set content-protection for a weston_output
For making an output secure, the content-protection should be set for
each of head attached to that output. So whenever the protection for
a weston_output is desired, it means that protection is desired for
each of the weston_head attached to that weston_output.

This patch introduces a new enum in libweston to represent the
requested/current protection statuses, equivalent to the type enum
defined by the weston-secure-output protocol. The new enum helps to
extend the content-protection status and requests to libweston and
the backends.
This patch also adds a new member desired_protection to store the
desired protection for an output in weston_output.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2019-07-04 14:18:50 +05:30
Roman Gilg
e97391c49f compositor: Support xdg_output_unstable_v1
The xdg-output resources are listed in each head struct. They become idle when
the respective weston_output has been removed again. The client is supposed to
destroy them explicitly afterwards.

After starting an XWayland client xrandr displays the logical size as expected.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
2019-07-01 08:24:25 +00:00
Marius Vlad
9fdda7f5eb libweston: Add ingroup tag for weston_compositor
This is a continuation of "e2cc7aa40fd: libweston: Define head, output and
compositor group".

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00
Marius Vlad
55d8736ed1 libweston: Add ingroup tag for weston_output
This is a continuation of "e2cc7aa40fd: libweston: Define head, output and
compositor group".

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00
Marius Vlad
78984ee971 libweston: Define head, output and compositor group
Also, add tag symbols related to 'weston_head'.

The bridge between sphinx and doxygen (breathe) has a useful directive:
doxygengroup. By using it we can scoop out symbols we'd like to display
documentation from/of.

At the same time some bits of the code has been using '\memberof' (a
doxygen command useful in C code to establish class like
relationship between objects and functions) but this seems not to be
recognized by the sphinx bridge.

Until we find a better solution, we replace '\memberof' command with
'\ingroup' one as to tag the symbols with an "object". This patch does
that for 'weston_head' object.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00
Marius Vlad
ae26341037 doc/sphinx: Add doxygen aliases for easier rst embedding
With these aliases we can use rST directives inside comment blocks. This
adds also a doxygen command '\rststar' where ignores the asterisk --
typical to multi-line comment blocks.

While at it, add a simple example on how to use them.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00
Stefan Agner
b0e16d4c53 backend-rdp: allow to force compression off
By default the client communicates its preference with regards to
compression to the server. However, some clients always use
compression, which is not ideal for certain environments (e.g.
low performance embedded devices in a local network with plenty
of bandwidth). Allow to disable compression server-side which will
override the clients request for compression.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2019-06-20 16:39:13 +02:00
Robert Beckett
8d23ab78bd backend-drm: handle multiple drm nodes with logind
When using logind launcher, we receive a PauseDevice "gone" message
from logind session management for each device we close while looking
for KMS devices.

Make logind notify the backend of the device add/remove so that the
backend can decide what to do, instead of assuming that if it is a
DRM_MAJOR device the session should be (de)activated. The backend can
then react to its specific device.

Fixes #251

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
2019-06-13 18:40:56 +01:00
Marius Vlad
c0d205ba44 include: Install weston-debug header
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-05-10 12:02:00 +00:00
Marius Vlad
f4f4c2bcf1 libweston: Add weston-debug header to libweston
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-05-10 12:02:00 +00:00
Marius Vlad
5d5e335845 libweston: Rename weston_debug_scope to weston_log_scope
This is a continuation of the previous patch to align more closely to
the weston log framework.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-05-10 12:02:00 +00:00
Marius Vlad
3d7d978c21 libweston: Rename weston_debug_compositor to weston_log_context
As we transition towards a more generic API for weston loggging
framework rename weston_debug_compositor to weston_log_context to show
the fact that this is not really debug but a logging context.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-05-10 12:02:00 +00:00
Marius Vlad
880b485d76 libweston: Decouple weston_debug_compositor from weston_compositor
This patch allows initialization of weston-debug/log framework much earlier
than weston_compositor, which in turn will provide the option start
logging before weston_compositor has been created.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-05-10 12:01:59 +00:00
Marius Vlad
78ef426892 libweston: Remove functions with no implementation/definition
Seems that these functions: weston_compositor_fade()/weston_compositor_unlock()
lost their implementation a while ago.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-05-06 20:16:38 +03:00
Harish Krupo
737ac0d4b3 data-device: send INVALID_FINISH when operation != dnd
The documentation of wl_data_offer::finish states that it should be
used to signify that a drag and drop operation is completed. So send
WL_DATA_OFFER_ERROR_INVALID_FINISH when the client calls the finish
request but the operation isn't dnd.

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
2019-04-19 22:06:37 +05:30
Pekka Paalanen
8ebd9817e7 Move libweston-desktop.h
This too is a public installed header.

The public headers are moved under a new top-level directory include/ to make
them clearly stand out as special (public API).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
cda1488ce0 Rename version.h to libweston/version.h
This is an installed public header, and without the subdir would surely
conflict with something else.

include/libweston/meson.build is necessary for putting the generated header in
the right subdirectory so that '#include <libweston/version.h>' can work.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
eebb7dc9ce Rename xwayland-api.h to libweston/xwayland-api.h
See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
ecbdcfd373 Rename zalloc.h to libweston/zalloc.h
It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
91b1010de9 Rename config-parser.h to libweston/config-parser.h
It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
96dc449259 Rename matrix.h to libweston/matrix.h
matrix.h is a public installed header and even used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
9eda0ea825 Rename windowed-output-api.h to libweston/windowed-output-api.h
See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
27b377f51f Rename plugin-registry.h to libweston/plugin-registry.h
See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
7571027f17 Rename public backend headers
The backend headers are renamed from compositor-foo.h to backend-foo.h to
better describe their purpose. These headers are public libweston API for each
specific backend.

The headers will also be used like

 #include <libweston/backend-drm.h>

instead of

 #include <compositor-drm.h>

to give them a more explicit namespace.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
3d5d9476e3 Rename compositor.h to libweston/libweston.h
The main idea is to make libweston users use the form

 #include <libweston/libweston.h>

instead of the plain

 #include <compositor.h>

which is prone to name conflicts. This is reflected both in the installed
files, and the internal header search paths so that Weston would use the exact
same form as an external project using libweston would.

The public headers are moved under a new top-level directory include/ to make
them clearly stand out as special (public API).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:46 +03:00
Pekka Paalanen
a78cf77582 Rename timeline-object.h to libweston/timeline-object.h
This patch sets up the stage for similarly renaming compositor.h which will
justify this. That patch will be big, so moving timeline-object.h first makes
it easy to see the changes to the build and install directives.

This and all the following moves essentially break the API, so libweston major
is bumped.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-04-18 12:31:45 +03:00