Commit Graph

7297 Commits

Author SHA1 Message Date
Harish Krupo
71078b4044 gl-renderer: Add debug scope for shader generator
This helps accounting how many shaders live in the cache, what the
shader source code is, and when shaders are compiled.

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>

v2: Resolved rebase conflicts.
    Put shader_scope in struct gl_renderer, remove struct
    gl_shader_generator.
    Wrote commit message.
    Rebased for "gl-renderer: rewrite fragment shaders" which completely
    changed how shader sources are generated.
    Added cache statistics to debug output on subscribe.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
7714c6172d gl-renderer: add missing glActiveTexture calls
Various functions leave the current active texture as whatever. The
functions touched in this commit forgot to reset the active texture to
slot 0 before binding their textures. If not explicitly unbound, this
could leave textures lingering in unused slots, perhaps. Not sure if
that could cause any harm, but for consistency's sake, always use slot 0
when not multitexturing.

Found by code inspection.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
c12963f98d gl-renderer: add fallback shader
If shader compiling on demand fails, then rather than using whatever
random shader happens to be current, use an explicit fallback shader
painting stuff brown.

The color is chosen dim enough to hopefully not cause problems even in
a HDR setting as it will be written verbatim into the fb/shadow.

This also prevents NULL dereference on shader->key.variant in
draw_view().

One way to test this shader is to hack fragment.glsl:
 #if DEF_VARIANT == SHADER_VARIANT_EXTERNAL
 #extension GL_OES_EGL_image_external : require
+#error haa haa
 #endif

and then run e.g. weston-simple-dmabuf-v4l -f YUYV
with vivid kernel module loaded. This worked on Intel.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
06c9d0f054 gl-renderer: send protocol error on shader failure
If we are trying to use a NULL shader, it is likely that the shader
compilation failed for some reason. Since we are trying this for a view,
the failure was probably triggered by a client. If there is a client,
get rid of it by sending it a protocol error. Hopefully the compositor
can then continue operation after a glitch on screen.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Harish Krupo
7903c5e667 gl-renderer: Requirement based shader generation
This patch modifies the shader generation code so that the shaders are
stitched together based on the requirement instead of creating them
during initialization. This is necessary for HDR use cases where each
surface would have different properties based on which different
de-gamma or tone mapping or gamma shaders are stitched together.

v2: Use /* */ instead of // (Pekka)
    Move shader strings to gl-shaders.c file (Pekka)
    Remove Makefile.am changes (Pekka)
    Use a struct instead of uint32_t for storing requirements (Pekka)
    Clean up shader list on destroy (Pekka)
    Rename shader_release -> shader_destroy (Pekka)
    Move shader creation/deletion into gl-shaders.c (Pekka)
    Use create_shaders's multi string capbility instead of
    concatenating (Pekka)

v3: Add length check when adding shader string (Pekka)

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>

v4: Rebased, PROTECTION_MODE_ENFORCED converted.
    Dropped unnecessary { }.
    Ported setup_censor_overrides().
    Split out moving code into gl-shaders.c.
    Changed to follow "gl-renderer: rewrite fragment shaders",
    no more shader source stitching.
    Added SHADER_VARIANT_XYUV.
    Const'fy function arguments.
    Added gl_shader_requirements_cmp() and moved the early return in
    use_gl_program().
    Moved use_gl_program() before first use in file.
    Split solid shader requirements by use case: requirements_censor and
    requirements_triangle_fan.
    Simplified fragment_debug_binding() since no need to force anything.

    Ensure struct gl_shader_requirements has no padding. This allows us
    to use normal C syntax instead of memset() and memcpy() when
    initializing or assigning. See also:
    https://gitlab.freedesktop.org/mesa/mesa/-/issues/2071
    Make it also a bitfield to squeeze the size.

v5: Move wl_list_insert() into gl_shader_create() (Daniel)
    Compare variant to explicit value. (Daniel)
    Change functions to gl_renderer_get_program,
    gl_renderer_use_program, and
    gl_renderer_use_program_with_view_uniforms.
    Use local variable instead of gr->current_shader. (Daniel)
    Simplified gl_renderer_get_program.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
e41c6d90d0 gl-renderer: simplify shader replacement in draw_view()
Do not change in setup_censor_overrides() and then put back gs->shader
in draw_view() when the shader needs to be something else than what the
surface content calls for.

This makes the logic simpler, and makes following changes simpler as
well.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
5b86f366c7 gl-renderer: dump failed shader source
To help debugging shader compilation errors, print the shader source the
way it was given to the GLSL compiler and with line numbers that match
the compiler error messages.

This is necessary because some snippets are added at runtime to the
beginning, the source is not only what is in the respective .glsl file.

I did look into using #line directives, but you cannot put source file
names to it, only "source string numbers" which must be an integer
expression. If we used #line, the reader would need to know that string
number 0 is the version, string 1 is the config and string number 2 is
fragment.glsl. I think that would have been too cumbersome.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
5d64e66e06 gl-renderer: rename shader debug flag to green_tint
The new name reflects better what it does.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
477bdc85c9 gl-renderer: rewrite fragment shaders
The main goal of this patch is to improve the readability of how and
what fragment shaders are generated.

Instead of having C code that assembles each shader variant from literal
string snippets, create one big fragment shader source that has
everything in it. This relies on a GLSL compiler to optimize statically
false conditions and unused uniforms away.

Having all the fragment shader code in one file, uncluttered by C string
literal syntax, improves readability significantly. A disadvantage is
that the code is more verbose, but it allows comments much better.

The actual shader code is kept unchanged except:
- FRAGMENT_CONVERT_YUV macro is now a proper function
- GLSL version is explicitly set to 1.00 ES
- RGBA and EXTERNAL use the same path, the difference is how the sampler
  is declared

Further shader code consolidation is possible, but is left for another
time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
d913363394 gl-renderer: move vertex shader into new file
This patch adds the tooling for incorporating files as C data, so that
files can be built into the binaries. The tool is in Python to avoid
adding extra dependencies like xxd.

xxd.py is copied from Mesa as-is, from commit
b729cd58d76f97f3fc04a67569535ee5ef2f5278 (master branch on 2021-01-26),
a.k.a 21.0-branchpoint-635-gb729cd58d76.

Moving the GLSL vertex shader into a separate file is not that
interesting, the purpose of this commit is to provide a simple
demonstration of the tooling. The real benefits come in a following
patch where the fragment shaders are re-written and externalized.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
3ec25d7812 gl-renderer: split into gl-shaders.c
This is purely moving code as is with no changes other than making the
three functions non-static.

Originally this was part of "gl-renderer: Requirement based shader
generation" by Harish Krupo, but that patch made also big changes to the
code at the same time. Patches are easier to review when code movement
is separate from behavioral changes, therefore I introduced this patch.

Cc: Harish Krupo <harishkrupo@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
d8a0ba893d gl-renderer: bikeshed GL version handling
The main point here is to print "GL ES %d.%d" instead of "GL ES 2"
because GL-renderer can and will use GL ES 3 features when present.
Saying it's GL ES 2 renderer is not quite true.

To print that, I need to extract major, minor from gr->gl_version and
those didn't have ready made macros yet. While writing the extraction,
make all these trivial functions, so that the compiler might warn us if
one passes e.g. negative literal numbers to gr_gl_version(). Explicit
types help keeping the bit operations safe too.

The only purpose for GR_GL_VERSION_INVALID was to fall back to version
2.0. Moving the fallback and logging into get_gl_version() makes that
macro unnecessary.

Finally, just in case GL version string contained garbage, reject
negative version numbers.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:16:02 +02:00
Pekka Paalanen
fbd4160474 tests: add output damage test
This test ensures that client submitted damage goes to the screen
correctly, regardless of output scale or transform.

The added quirk is explained in the test that uses it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 12:54:17 +02:00
Pekka Paalanen
1e365c8c4c gl-renderer: assume pbuffers preserve contents
For a pbuffer EGLSurface, assume that EGL swap behavior is "preserved"
which means buffer age is always 1 (after the very first
eglSwapBuffers()).

EGL pbuffers are always single-buffered.

Mesa EGL Surfaceless platform does not seem to expose EGL_EXT_buffer_age
that could have told us the same. Hence all repaints to pbuffer surfaces
used to need to repaint the whole output always. This patch makes
repainting only the latest damage possible.

Repainting only the latest damage is required for a future test on
output damage regions: "tests: add output damage test".

Technically, setting buffer_age to 1 is not correct before the very
first eglSwapBuffers(), but to keep the code simpler I chose to rely on
a newly enabled output always having full damage anyway.

Checking that EGL_SWAP_BEHAVIOR is EGL_BUFFER_PRESERVED would do too.
Unfortunately, Mesa seems to return EGL_BUFFER_DESTROYED, so I cannot
fail the headless-backend in that check. Even so, the output damage test
actually succeeds.

See also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4278

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 12:47:07 +02:00
Pekka Paalanen
b4f91edb5e libweston: do not damage on screenshot
If full output damage is forced every time a screenshot is taken, the
test suite cannot take screenshots of damage as that would depend on
repainting only the damaged area.

Stop damaging the output and instead just schedule a repaint so the
screenshot can be taken. This is safe because:

- if any views were promoted to hw planes previously,
  weston_output_disable_planes_incr() would force them to be demoted at
  assing_planes() time causing damage via weston_view_move_to_plane()

- even when hardware primary plane has no damage, DRM-backend will not
  skip calling to the renderer after commit
  "drm-backend: do not skip renderer if capturing screen".

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 12:47:07 +02:00
Pekka Paalanen
7f1a113c89 drm-backend: do not skip renderer if capturing screen
The renderer must be called for any pending screen capture to complete.
Previously this was guaranteed by weston_screenshooter_shoot() forcing
full output damage, so damage was never empty. If the future,
screenshooting stops inflicting damage, and the damage on the primary
plane even after disabling hardware planes may be empty.

This patch ensures that screenshots do not get stuck until damage
occurs.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 12:47:07 +02:00
Pekka Paalanen
0f7da612eb tests: add drm_screenshot_no_damage
I am working on adding a test to ensure Weston repaints damage
correctly, where I rely on Weston repainting exactly and only the damage
submitted by a client. That means I have to stop screenshooting from
damaging everything automatically. Doing that, I noticed that
screenshots on DRM-backend could theoretically get stuck if I do that.
So test for it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 12:47:07 +02:00
Maxime Roussin-Bélanger
4cff869a4f doc: fix typos
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
2021-02-24 10:01:25 -05:00
Maxime Roussin-Bélanger
1d009c248e libweston: fix typos
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
2021-02-24 10:01:17 -05:00
Maxime Roussin-Bélanger
35e34505ce backend-drm: fix typos
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
2021-02-24 10:01:07 -05:00
Maxime Roussin-Bélanger
3ae4a467e6 protocol: fix "assigne" typo
Signed-off-by: Maxime Roussin-Bélanger
<maxime.roussinbelanger@gmail.com>
2021-02-24 10:00:45 -05:00
Maxime Roussin-Bélanger
5d10fe0264 shared: fix typos
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
2021-02-24 10:00:32 -05:00
Maxime Roussin-Bélanger
4e8ea1f9d5 tests: fix typos
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
2021-02-24 10:00:21 -05:00
Pekka Paalanen
9dc1f26818 CONTRIBUTING: make S-o-b mandatory but pseudonym ok
This was prompted by a recent discussion on #dri-devel IRC channel,
where the use of pseudonyms to maintain anonymity was said to be a
normal and accepted practice. See:
https://people.freedesktop.org/~cbrill/dri-log/index.php?channel=dri-devel&highlight_names=&date=2021-02-09
and look for the discussion around pq and Lyude.
Until then, I was hesitant to accept Signed-off-by's with names that
looked very much not a real name.

Clarify our documentation that pseudonyms are ok.

Note, that is not what the Linux kernel documentation says today in
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst
which says that pseudonyms are not ok. According to the discussion, this
should probably be fixed in the kernel too.

Since we are now ok with pseudonyms in Signed-off-by, there is no reason
left to accept any patches without a Signed-off-by. This clarifies our
policy and takes the burden of case-by-case consideration away from
maintainers.

The wording about needing to use a personal email address is my
addition. The intention is to ensure a globally unique handle for a
person while that person remains anonymous, so that the Signed-off-by
cannot be mistaken for someone elses.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-22 10:52:28 +00:00
Pekka Paalanen
abfe9c0f4d CONTRIBUTING: no more emailed patches
We haven't received any emailed patches in years I think, and they would
be inconvenient to process. Make it clear that emailed patches are
unwanted.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-22 10:52:28 +00:00
Pekka Paalanen
946b933f9e tests: clarify --help
Use consistent terminology with the code: index starts from zero,
numbering starts from one. Fixture 0 runs all fixtures.

Suggested-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Pekka Paalanen
3ee1f27278 tests: --list lists individual fixture setups
When there is a fixture setup array, list all fixture setups with their
numbers and names. This should help people picking a single fixture to
run and makes the --list output more interesting.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Pekka Paalanen
d91e63dea0 tests: use fixture names in reports
Instead of "fixture %d", use the proper fixture name if it exists or
nothing. Some places still show the fixture index because it is used on
the command line.

This makes the reports more readable.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Pekka Paalanen
345d7da606 tests: refactor into fixture_setup_array_get_arg()
Make it more explicit that the return value is NULL when there is no
arrray.

This patch makes the following patch smaller.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Pekka Paalanen
ef81388466 tests: introduce struct fixture_metadata
This allows tests to give a meaningful name for their fixture setups
when they use more than one of them.

If a test uses DECLARE_FIXTURE_SETUP_WITH_ARG(), it must now pass a
third argument naming the field which is struct fixture_metadata. This
also means that the fixture setup data must now be a struct, it cannot
be a plain type anymore. A compiler error is generated if the field type
is not the expected one.

All tests using DECLARE_FIXTURE_SETUP_WITH_ARG() and converted to the
new form and given names for their fixture setups.

The fixture setup names not actually used yet, that will be another
patch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Pekka Paalanen
eb5a95bfc9 libweston: move TYPEVERIFY macro into shared
This will be useful in the test harness macros.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-17 12:52:33 +00:00
Kenny Levinsen
69039ceb43 libweston-desktop: Disable xdg_shell_v6
xdg_shell stable has been available for a long time, so xdg_shell_v6 should no
longer be needed. However, to play it safe, we just disable it for now. We can
then remove the implementation entirely later.

Signed-off-by: Kenny Levinsen <kl@kl.wtf>
2021-02-16 12:30:10 +01:00
Pekka Paalanen
5580cb13c9 tests: switch to TAP
This makes sub-tests visible in the junit output, making Gitlab test
reports more detailed.

This does not apply to zuc tests, which look like they could produce
junit XML directly. And maybe TAP? Left for another time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-15 11:17:17 +02:00
Pekka Paalanen
c0565b61d3 build: bump Meson requirement to 0.52.1
Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/296

The conclusion (quite a while ago, too) was that requiring Meson 0.52 is
fine. Mesa does that too. Bump the requirement to 0.52.1 which is the
last release of the 0.52 series.

This allows all issues listed in #296 to be worked on. It also allows
switching to TAP in the test suite for more detailed reports.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-15 11:17:17 +02:00
Pekka Paalanen
bcf37c937a CI: expose test results as junit
This allows Gitlab to show a detailed test report in a human friendly
manner on a merge request page.

The junit output depends on Meson 0.55, but Meson in CI is bumped to the
latest release on Feb 15th. It is beneficial to use the newest
possible Meson in CI even if we do not require it, so that we benefit
from fixes, e.g. new warnings about accidentally using more recent
Meson features than our minimum Meson version supports.

Meson 0.57 is required for proper test names in the Gitlab report after
switching the tests to TAP. See:
https://github.com/mesonbuild/meson/issues/8316

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-15 11:16:15 +02:00
Emmanuel Gil Peyrot
5b5decb99b compositor: Add suggestion when colord is enabled but not LCMS
Most other errors caused by missing dependencies offer this helpful
suggestion.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2021-02-12 12:13:28 +00:00
Emmanuel Gil Peyrot
0b48e6b5ca backend-wayland: Abort early when wl_shm isn’t advertised
This prevents a segfault in libwayland-cursor when the parent compositor
doesn’t have any of the needed protocols implemented.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2021-02-12 12:31:26 +01:00
Veeresh Kadasani
557dea5660 weston.ini.man :remove tablet shell related things
Remove info about tablet-shell related things
which are not used.

Signed-off-by: Veeresh Kadasani <veeresh.kadasani@huawei.com>
2021-01-29 13:25:53 +05:30
xndcn
ffe422116d screen-share: fix possible memory leak for out_pixman_error case
shm buffer should be freed in case of `out_pixman_error`, and should
be inserted into shared_output just before the success return.

Signed-off-by: xndcn <xndchn@gmail.com>
2021-01-27 14:59:26 +00:00
Veeresh Kadasani
ed4a0e9275 desktop-shell:change expiration of minute and sec
Fixes: #400

the clock on upper right corner of screen for
desktop shell is behind one minute when compared
to output of date command, so change initial expiration
it_value for minute and sec to remove the delay.

Signed-off-by: Veeresh Kadasani <veeresh.kadasani@huawei.com>
2021-01-21 16:04:34 +05:30
nerdopolis
9cb96f8353 launcher-logind: handle any seat without VTs
Instead of assuming that seat0 has TTYs, use logind to check if
the seat has TTYs
2021-01-21 09:02:26 +00:00
nerdopolis
72db3ac694 launcher-direct: handle seat0 without VTs
This allows launcher-direct to run when seat0 has no TTYs
This checks for a proper /dev/tty0 device as /dev/tty0
does not get created by kernels compiled with CONFIG_VT=n
2021-01-21 09:02:26 +00:00
Marius Vlad
fbc065fdc5 doc: Add running-weston.rst file
Documentation file for explaning in more detail how to run weston, using
launcher direct and specifying a non-default seat. This explains how to
create a udev file and assign a particular GPU card to it, and
potentially, other input devices. It also describes a bit additional
arguments that can be passed on, as an introduction to using the DRM
node for that particular seat.

Fixes #460

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2021-01-19 22:40:46 +02:00
Ambareesh Balaji
a67393c353 pipewire: fix null deref in 0.3 API
Signed-off-by: Ambareesh Balaji <ambareeshbalaji@gmail.com>
2021-01-12 16:02:19 +00:00
Pekka Paalanen
ae12b9596d tests: add yuv-buffer test
This adds a test to ensure that the wl_shm formats YUV420, NV12 and YUYV
are decoded and converted to RGB correctly in GL-renderer.

The test deliberately uses a 256 x 256 test image so that effects from
width vs. pitch vs. stride cannot be observed, and row padding is zero.
Also padding between planes is zero. Attempting to use a test image with
less "round" dimensions lead to stride mismatch in GL-renderer, likely
due to GL_UNPACK_ALIGNMENT being left at value 4. It is unclear if YUV
wl_shm buffers' row stride needs to be aligned to 4 bytes or not, so I
did not pursue fixing it. GL-renderer seems to be confusing width, pitch
and stride even further, and not e.g. allow padding with ARGB buffers.
See also: https://gitlab.freedesktop.org/wayland/weston/-/issues/354

Furthermore, the test arranges so that each 2x2 pixel block has the same
color. This avoids having to consider chroma siting when sub-sampling.
This way all the test cases can use the same reference image.

The source image chocolate-cake.png is taken and copyright by Pekka
Paalanen, hereby licensed as
http://creativecommons.org/licenses/by-sa/4.0/ .

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-12-17 09:34:09 +00:00
Anurup M
aa7de33e03 launcher: Add more error logging to launcher backends
Add error logging in three different launcher backends:
launcher-logind, launcher-weston-launch, and launcher-direct
to indicate failures for easier debug

Signed-off-by: Anurup M <anurup.m@huawei.com>
2020-12-16 07:23:02 +00:00
Pekka Paalanen
593d5af43a gl-renderer: require GL_EXT_unpack_subimage
Require GL_EXT_unpack_subimage unconditionally in GL-renderer. Without
this extension, it would take considerable effort in GL-renderer to
handle correctly images that contain row padding, either as a temporary
copy to remove padding or doing SubImage updates row by row.

I would guess that this path has gone long completely untested, and if
it was exercised, the rows never had padding thanks to 32-bit pixel
formats. Instead of writing tests to poke the corner cases and fixing
it, remove it.

This will make it easier to fix other problems in GL-renderer in this
area in the future - one less path to consider and many restrictions in
GL API gone.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-12-15 14:42:46 +00:00
Pekka Paalanen
2d738b856d launcher-direct: warn when opening devices non-root
Warn the user that this is not supposed to work. Developers who know
what they are doing know to ignore this message, others should think
twice.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-12-11 10:18:19 +00:00
Pekka Paalanen
4e9f4d0474 launcher-direct: allow non-root on non-seat0
If the launcher is told to use a non-default seat (not seat0), there
will not be a VT or tty to set up. VT/tty setup requires privileges.

This patch allows a non-root user to use launcher-direct, provided that
the seat is not the default. There is still the problem of opening DRM
and input devices, which is left for the user to solve.

This mode of operation is useful for developers who can set up a
secondary seat on their machine. You can run Weston/DRM from a terminal
window by pointing it to a non-default seat. You have to arrange a
DRM device by having an extra unused graphics card in the machine. You
also need dedicated input devices. Both the DRM device and the input
devices must be assigned to the secondary seat and device file
permissions adjusted so that they can be opened.

Doing so is an obvious security risk, as input could easily be
eavesdropped.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-12-11 10:18:19 +00:00
Anurup M
6aa46844a6 compositor: Fix possible memory leak when wl_display_create() fails
The buffer created for flight recorder, the allocations done in 'logger' and
'flight_rec' subscribers were not freed when wl_display_create() fails. So
move them to out_display

Signed-off-by: Anurup M <anurup.mokkil@gmail.com>
2020-12-10 09:19:09 +00:00