Commit Graph

28 Commits

Author SHA1 Message Date
Marek Vasut bd3de08b13 backend-drm: document additional-devices parameter
Document the --additional-devices parameter to Weston to add secondary
DRM devices that will only be used as outputs, but not for rendering.

Fixes: 3c6cfe6bf4 ("backend-drm: add additional-devices to support multi GPU")
Signed-off-by: Marek Vasut <marex@denx.de>
2023-10-03 12:29:21 +00:00
Philipp Zabel 397e66a4dd backend-drm: allow more formats with pixman-renderer
Clean up the code a little by dropping the now unnecessary switch case
in drm_output_init_pixman(). As a side effect, this enables all formats
that have a pixman_format entry in the pixel format table:

  - rgb565
  - xrgb8888
  - argb8888
  - xbgr8888
  - abgr8888
  - rgbx8888
  - rgba8888
  - bgrx8888
  - bgra8888
  - xrgb2101010
  - argb2101010
  - xbgr2101010
  - abgr2101010

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-01-31 15:32:24 +00:00
Philipp Zabel 84c10124cd compositor: support loading backend via shortened name
While the --backend parameter looks like it takes a file name, it really
is selected from a list of supported strings that are then funneled
through a translation to enum weston_compositor_backend [1].

Because all backend parameters are of the form "...-backend.so", and
writing "--backend=...-backend.so" is boring, allow the --backend option
to match the backend name without "-backend.so" suffix instead.

For example, this allows to use "--backend=headless" instead of
"--backend=headless-backend.so".

Update help text and documentation. Keep the old way working for
backwards compatibility.

[1] 50dbf38514 ("libweston: use enum to choose the backend")

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2022-12-08 17:39:12 +01:00
vanfanel 3240ccc69d Don't change the max_bpc connector prop if mode=current.
As things are, even when mode=current is specified on the .ini file,
a full modeset is needed (and done), which causes a very noticeable
screen blinking. That is because setting the max_bpc on a connector
needs full modesetting.
The idea here is that if mode=current on the .ini, no modesetting
should be done, so the current max_bpc is programmed into the
connector.
But if a custom max-bpc=... is specified, that will be used instead,
even if mode=current on the .ini

Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/660

Signed-off-by: vanfanel <redwindwanderer@gmail.com>
2022-09-23 11:05:34 +00:00
Pekka Paalanen 8de94ec9c9 compositor: add weston.ini option max-bpc
For working around hardware limitations as explained in the man page.
Now added for completeness' sake without knowing if anyone will ever
need this.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-06-15 12:58:38 +00:00
Pekka Paalanen e6a9e3c4ee backend-drm: default to XRGB2101010 for HDR
Trying to do HDR with XRGB8888 is a bit like using RGB565 on SDR: you
get visible color quantization and banding in gradients (without dithering
which Weston does not implement yet, and might not work too well for HDR
anyway).

Therefore, on any HDR mode, default output framebuffer format to 10 bpc
instead of 8 bpc.

Ideally we'd also optionally try 16F or 16 bpc formats, but automatic
fallbacks for those are more complicated to arrange. You can still
configure 16F or 16 bpc manually.

This patch also moves the default format setting from
drm_output_set_gbm_format() to drm_output_enable(), because setting the
default now requires eotf_mode. Frontends may call set_gbm_format()
first and set eotf_mode next. This does create an awkward situation for
outputs that a frontend disables and re-enables. This patch here makes
sure that the old output configuration remains, but changing eotf_mode
may not change the default format. One needs to call
set_gbm_format(NULL) to re-evaluate the default format. Resetting the
format on drm_output_deinit() would lose the current setting.

DRM_FORMAT_INVALID was introduced in libdrm 2.4.95 which we already
hard-depend on.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-05-02 12:19:24 +00:00
Pekka Paalanen bfefe8e8d4 man: add gbm-format in output section
Looks like at least from 2016 onwards the gbm-format option has also
been recognized in an output section.

Time to document that.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-03-14 19:42:33 +02:00
Pekka Paalanen ce059cffdb man: expand on gbm-format
Since 62a9436417 the gbm-format option has
recognized all pixel formats listed in libweston/pixel-formats.c.

Clarify what pixel formats can be used.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-03-14 19:42:33 +02:00
Pekka Paalanen 1f5e19fab3 man: move pageflip-timeout from weston.ini(5) to weston-drm(7)
This option is used only with the DRM-backend. Options in weston.ini(5)
should be either generic or for backends that do not have their own man
page yet.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-03-14 19:42:33 +02:00
Pekka Paalanen 79f73d2247 man: move gbm-format from weston.ini(5) to weston-drm(7)
This option is used only with the DRM-backend. Options in weston.ini(5)
should be either generic or for backends that do not have their own man
page yet.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-03-14 19:42:33 +02:00
Derek Foreman 2c91c70250 launchers: Remove --tty option
This doesn't work with any of the launchers we've kept. Remove the option
and all the bits that handle it.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-03-03 17:00:15 -06:00
Derek Foreman a96dfc7098 launchers: remove launchers
Moving forward we're going to be supporting libseat and logind as our
only launchers. We're doing this to reduce our maintenance burden,
and security impact.

Libseat supports all our existing use cases, and seatd can replace
weston-launch so we no longer have to carry a setuid-root program.

This patch removes weston-launch, and launcher-direct, leaving only
libseat and logind.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-03-03 16:54:14 -06:00
Leandro Ribeiro e57d8ae818 drm-backend: add --continue-without-input command line option to DRM-backend
In the test suite we may want to run a DRM-backend test on a
non-default seat, which may not have a input device associated.
Weston's default behavior is to not open if input devices are
not found, as it may cause troubles. For instance, Weston can
open but if no input device is set than the user can not
interact or leave it.

Add flag --continue-without-input to DRM-backend so we can run
these types of tests with no input. Notice that this won't force
the compositor to skip opening a input device if it finds it on
the non-default seat.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-06-02 13:47:15 +00:00
Paul Menzel bac1a7a71f man/weston-drm: Use third person singular conjugation
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
2020-04-06 10:35:17 +02:00
Pekka Paalanen 8060d826b7 Redefine output rotations
It was discovered in issue #99 that the implementations of the 90 and 270
degree rotations were actually the inverse of what the Wayland specification
spelled out. This patch fixes the libweston implementation to follow the
specification.

As a result, the behaviour of the the weston.ini transform key also changes. To
force all users to re-think their configuration, the transform key values are
also changed. Since Weston and libweston change their behaviour, the handling
of clients' buffer transform changes too.

All the functions had their 90/270 cases simply swapped, probably due to
confusion of whether WL_OUTPUT_TRANSFORM_* refers to rotating the monitor or
the content.

Hint: a key to understanding weston_matrix_rotate_xy(m, c, s) is that the
rotation matrix is formed as

  c -s
  s  c

that is, it's column-major. This fooled me at first.

Fixing window.c fixes weston-terminal and weston-transformed.

In simple-damage, window_get_transformed_ball() is fixed to follow the proper
transform definitions, but the fix to the viewport path in redraw() is purely
mechanical.  The viewport path looks broken to me in the presence of any
transform, but it is not this patch's job to fix it.

Screen-share fix just repeats the general code fix pattern, I did not even try
to understand that bit.

https://gitlab.freedesktop.org/wayland/weston/issues/99

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-02-27 11:08:48 +00:00
Tomohito Esaki 3ea03bb85e remoting: make a gstreamer pipeline configurable
Allow a gstreamer pipeline to be configurable via an weston.ini. It is
necessary that source is appsrc, its name is "src", and sink name is
"sink" in pipeline. Also, remoting plugin ignore port and host
configuration if the gst-pipeline is specified.
2019-07-09 14:22:25 +00:00
Emmanuel Gil Peyrot 426c24673f Fix typos all around (thanks codespell!) 2019-02-20 16:47:35 +01:00
Tomohito Esaki f709d22038 Add remoting plugin for output streaming
Remoting plugin support streaming image of virtual output on drm-backend
to remote output. By appending remote-output section in weston.ini,
weston loads remoting plugin module and creates virtual outputs via
remoting plugin. The mode, host, and port properties are configurable in
remote-output section.

This plugin send motion jpeg images to client via RTP using gstreamer.
Client can receive by using following pipeline of gst-launch.

gst-launch-1.0 rtpbin name=rtpbin \
   udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,
		encoding-name=JPEG,payload=26" port=[PORTNUMBER] !
          rtpbin.recv_rtp_sink_0 \
   rtpbin. ! rtpjpegdepay ! jpegdec ! autovideosink \
   udpsrc port=[PORTNUMBER+1] ! rtpbin.recv_rtcp_sink_0 \
   rtpbin.send_rtcp_src_0 !
          udpsink port=[PORTNUMBER+2] sync=false async=false

where, PORTNUMBER is specified in weston.ini.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2018-10-30 17:09:01 +09:00
Pekka Paalanen d117f33d9b man: make substitutions meson-friendly
Change format of substituted variables to follow the pattern used by
configure_file() in Meson.

This helps the migration to Meson, making man/meson.build much cleaner.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-08-27 10:52:35 +01:00
Ankit Nautiyal f82ff35e8e man: add description for specifying modes with aspect-ratio in weston.ini
This patch adds information about the new resolution-format that can
be specified by a user in weston.ini to select a CEA mode. CEA defines
timing of a video mode, which is considered as a standard for
HDMI certification and compliance testing. It defines each and every
parameter, of  a video mode, like h/vactive,h/vfront h/vback etc.,
including aspect-ratio information. The drm layer, specifies the
aspect-ratio information in user-mode flag bits 19-22. For the non-CEA
modes a value of 0 is given in the aspect-ratio flag bits. Each
CEA-mode is identified by a unique, Video Identification Code (VIC).
For example, VIC=4 is 1280x720@60 aspect-ratio 16:9.
This mode will be different than a non-CEA mode 1280x720@60 0:0.

The new mode-format helps to differentiate between the CEA and
non-CEA modes, by letting user specify aspect-ratio along with other
paremeters: mode=widthxheight@rr ratio.

This helps when certification testing is done, in tests like 7-27,
the HDMI analyzer applies a particular CEA mode, and expects the
applied mode to be with exactly same timings, including the
aspect-ratio and VIC field.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-07-06 12:09:19 +03:00
nerdopolis b16c4ac55b libweston: set the seat automatically based on the XDG_SEAT environment variable
This will allow the seat to be set by the environment as pam_systemd typically
sets the XDG_SEAT variable

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-07-02 15:29:38 +03:00
Pekka Paalanen 9071817089 weston: add force-on option for DRM
Add a new boolean output section key "force-on". When set to true, the
output will be enabled regardless of connector status. This is the
opposite of the mode=off setting.

Forcing connectors on is useful in special circumstances: avoid output
configuration changes due to hotplug e.g. with KVM switches, or hardware
with unreliable connector status readout for example.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-06-29 16:08:35 +03:00
Pekka Paalanen 944dd235b4 weston: support clone mode on DRM-frontend
Add a new output section key "same-as" for configuring clone mode. An
output marked "same-as" another output will be configured identically to
the other output.

The current implementation supports only CRTC sharing for clone mode.
Independent CRTC clone mode cannot be supported until output layout
logic is moved from libweston into the frontend and libweston's damage
tracking issues stemming from overlapping outputs are solved.

Quite a lot of infrastructure is needed to properly configure clone
mode. The implemented logic allows easy addition of independent CRTC
clone mode once libweston supports it. The idea is that wet_layoutput is
the item to be laid out and all weston_outputs a wet_layoutput
contains show exactly the same area of the desktop.

The configuration logic attempts to automatically fall back to creating
more weston_outputs when all heads do not work under the same
weston_output. For now, the fallback path ends with an error message.

Enabling a weston_output is bit complicated, because one needs to first
collect all relevant heads, try to attach them all to the weston_output,
and then back up head by head until enabling the weston_output succeeds.
A new weston_output is created for the left-over heads and the process
is repeated.

CRTC-sharing clone mode is the most efficient clone mode, offering
synchronized scanout timings, but it is not always supported by
hardware.

v10:
- rebased trivial conflicts in man page
- switch to gitlab issue URL

v9:
- replace weston_compositor_set_heads_changed_cb() with
  weston_compositor_add_heads_changed_listener()
- remove workaround in simple_head_enable()

v6:
- Add man-page note about cms-colord.
- Don't create an output just to turn it off.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/22

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-06-29 16:07:03 +03:00
Pekka Paalanen 325ff4cba1 main: add setting for DRM/pixman shadow framebuffer
Allows to control the Pixman-renderer shadow framebuffer usage from
weston.ini. It defaults to enabled, and whether it is a good idea to
disable or not depends on the platform and the workload.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
2018-05-24 17:20:04 +03:00
Pekka Paalanen d61da83cb0 man: document WESTON_LIBINPUT_LOG_PRIORITY env
Commit c81c4241d9 added this environment
variable. Document it.

It applies also to the fbdev-backend but that has no man page.

v2:
- Rewording by Peter Hutterer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-20 15:27:54 +03:00
Pekka Paalanen 8a9c8b08cf weston: add --drm-device option for DRM-backend
Developers with testing rigs having multiple graphics cards plugged in
often want to test things on a specific card. We have ways to choose a
card through seat assignments, but configuring that run by run is
awkward.

Add a command line option for opening a specific DRM device.

v2: call it --drm-device instead of --device

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-18 13:58:17 +02:00
Ucan, Emre (ADITG/SW1) 38ea2d2254 compositor-drm: remove connector option
Remove the option, because it is hard to use.
Drm connector ids are hard to reach for users,
and they can change when kernel or device tree
is modified.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
[Pekka: bump WESTON_DRM_BACKEND_CONFIG_VERSION]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-09-04 15:47:03 +03:00
Pekka Paalanen 424820f4bc man: add weston-drm page
Add some documentation about the DRM backend into its own man page, and
refer to it in weston(1).

Environment variable, that are reserved for backends, and currently used
only by the DRM backend, are moved to weston-drm page.

NOTE: This is a candidate for the stable branch
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-27 11:12:56 -05:00