Rob Bradford [Fri, 31 May 2013 17:09:55 +0000 (18:09 +0100)]
udev-seat: Make the udev_input structure an embedded structure
And as a result of this stop iterating through the compositor seat list
(of one item) and instead access the udev_input structure directly.
This enables a refactoring to pull out the weston_seat into a separate
structure permitting multiple seats.
Rob Bradford [Fri, 31 May 2013 17:09:54 +0000 (18:09 +0100)]
udev-seat: Rename udev_seat to udev_input
This is a pure rename of the structure, functions and local variables in
preparation of the separation of the seat from the other udev input
handling.
Rob Bradford [Fri, 31 May 2013 17:09:53 +0000 (18:09 +0100)]
compositor-drm: Rename seat variable to seat_id to clarify it's purpose
This change is a straight refactor that has no functional change.
Rob Bradford [Fri, 31 May 2013 17:09:52 +0000 (18:09 +0100)]
weston-info: Report the seat name provided by the compositor
Rob Bradford [Fri, 31 May 2013 17:09:51 +0000 (18:09 +0100)]
input: Send the seat name if the client advertises verson 2 of wl_seat
Rob Bradford [Fri, 31 May 2013 17:09:50 +0000 (18:09 +0100)]
input: Add a seat name parameter to weston_seat_init
Ander Conselvan de Oliveira [Tue, 4 Jun 2013 13:24:05 +0000 (16:24 +0300)]
compositor-drm: Force DPMS state to ON after drmModeSetCrtc()
The kernel is supposed to set this when drmModeSetCrtc() is called but
at least the i915 driver wouldn't do that in all cases. A fix for this
should be released with kernel 3.10, but we work around the issue in
older kernels by always forcing DPMS to ON when doing a mode set.
https://bugs.freedesktop.org/show_bug.cgi?id=64873
Ander Conselvan de Oliveira [Tue, 4 Jun 2013 13:24:04 +0000 (16:24 +0300)]
compositor-drm: Cache the DPMS property on drm_output
This avoids one drmModeGetConnector() call every time the DPMS mode is
set. That call can take hundreds of milliseconds due to DDC.
Armin K [Tue, 4 Jun 2013 11:05:22 +0000 (13:05 +0200)]
clients/nested: Fix compilation
U. Artie Eoff [Tue, 4 Jun 2013 17:10:56 +0000 (10:10 -0700)]
add fullscreen to .gitignore
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Pekka Paalanen [Tue, 4 Jun 2013 15:47:39 +0000 (18:47 +0300)]
shared: fix build of libshared-cairo
Another case of missing wayland-util.h, as we didn't pass any libwayland
CFLAGS. This is triggerable on a system, where libwayland is installed
in a custom prefix, and pixman, cairo, libpng, and webp are either
not installed or are installed in the standard path.
COMPOSITOR_CFLAGS contains more than just the libwayland CFLAGS, though.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Rob Bradford [Tue, 4 Jun 2013 12:23:01 +0000 (13:23 +0100)]
build: Add declaration checks to check for required syscall flags
The required flags are relatively new and some older enterprise
distributions do not feature them.
https://bugs.freedesktop.org/show_bug.cgi?id=63360
Kristian Høgsberg [Fri, 12 Apr 2013 01:47:41 +0000 (21:47 -0400)]
clients: Nested compositor example
A wayland compositor doesn't provide a mechanism for buffer sharing between
clients. Under X, one client can render to a Pixmap and another can use it
as a source in a subsequent drawing operations. Wayland doesn't have a
mechanims to share Pixmaps or textures between clients like that, but it's
possible for one client to act as a nested compositor to another client.
This less work than it sounds, since the nested compositor won't have to
provide input devices or even any kind of shell extension. The nested
compositor and its client can be very tightly coupled and have very specific
expectations of what the other process should provide.
In this example, nested.c is a toytoolkit application that uses cairo-gl
for rendering and forks and execs nested-client.c. As it execs the client,
it passes it one end of a socketpair that will be the clients connection
to the nested compositor. The nested compositor doesn't even create a
listening socket.
The client is a minimal GLES2 application, which just renders a spinning
triangle in its frame callback.
Jan Arne Petersen [Thu, 30 May 2013 11:57:05 +0000 (13:57 +0200)]
editor: Do not commit/preedit after invalid delete
Ignore the whole commit-string or preedit_string transaction when the
delete_surrounding event was invalid.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Thu, 30 May 2013 11:57:04 +0000 (13:57 +0200)]
editor: Improve checks on delete add asserts
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Thu, 30 May 2013 11:57:03 +0000 (13:57 +0200)]
editor: Properly adjust cursor on delete
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Thu, 30 May 2013 11:57:02 +0000 (13:57 +0200)]
editor: Support deleting text in preedit_string
Delete text marked with wl_text_input::delete_surrounding_text on
preedit_string event. When text is explicitly marked with
delete_surrounding_text do not delete selected text.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Thu, 30 May 2013 11:57:01 +0000 (13:57 +0200)]
editor: Fix text selection
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Armin K [Thu, 30 May 2013 13:16:40 +0000 (15:16 +0200)]
Don't fail if colord or libunwind are not present
This patch adds auto detection for presence of
the colord and libunwind packages.
Eduardo Lima (Etrunko) [Mon, 3 Jun 2013 15:24:09 +0000 (12:24 -0300)]
weston.pc: Added libexecdir and pkglibexecdir variables
These can be used by external clients to check the installation path
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
Rob Bradford [Mon, 3 Jun 2013 17:46:13 +0000 (18:46 +0100)]
udev-seat: Fail input setup only if no devices are found
Rather than failing if we cannot open any single device fail the input
setup if there are no input devices added.
https://bugs.freedesktop.org/show_bug.cgi?id=64506
Hardening [Mon, 3 Jun 2013 20:55:47 +0000 (22:55 +0200)]
Handle mouse wheel
The RDP compositor was ignoring mouse wheel events, this patch adds
support for it.
U. Artie Eoff [Mon, 3 Jun 2013 23:22:31 +0000 (16:22 -0700)]
use _exit instead of exit if client fails to exec
exit() calls atexit() handlers and C++ destructors (e.g. a C++
weston module) which could destroy state that the main process
depends on (e.g. ioctl's, tmpfiles, sockets, etc...). If an exec
fails, call _exit() instead of exit().
v2: prefer _exit over _Exit
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Alexander Larsson [Wed, 29 May 2013 10:01:34 +0000 (12:01 +0200)]
screenshooter: Scale damage by output scale in screen recorder
The damage region is in compositor coords, we need to scale it by
the output scale when using the damage to read output buffer data.
Alexander Larsson [Wed, 29 May 2013 10:01:33 +0000 (12:01 +0200)]
pixman-renderer: Fix read_pixels for screen recorder
The old code had an off-by-one error on the y coordinate
where it says height - (cur_y - y). And it does the vflipping of
the *destination* buffer, whereas what is really needed is to
vflip the whole source buffer. This only affects when you read
out part of the image, such as when using the screen recoder.
Also, instead of doing the flipping manually we just let pixman
handle it.
Alexander Larsson [Wed, 29 May 2013 10:01:32 +0000 (12:01 +0200)]
screenshoter: Make recorder handle PIXMAN_x8r8g8b8
This is what the pixman renderer reports for the read format.
Alexander Larsson [Tue, 28 May 2013 14:23:32 +0000 (16:23 +0200)]
shell: Position DRIVER fullscreen surfaces at origin
When a window is fullscreened with DRIVER method and we succeeded
in changing mode we need to actually move the surface to the
origin of the output, or it won't be used for scanout.
Alexander Larsson [Tue, 28 May 2013 14:23:40 +0000 (16:23 +0200)]
shell: Center window in fullscreen if needed
If modeset fails With DRIVER method, and always with FILL method
we want to center the window.
Alexander Larsson [Tue, 28 May 2013 14:23:39 +0000 (16:23 +0200)]
shell: Always go to original mode when focused window not fullscreen
Right now we only switch mode on activating a fullscreened window.
This has several problems:
* Once you're in fullscreen its hard to switch to a non-fullscreened
window with alt-tab as you stay in the small resolution.
* If you switch from a fullscreened window to a non-fullscreened
window and the fullscreened window is destroyed we will not
restore the original mode (since the window is not
shell_surface_is_top_fullscreen()
* Its hard to reach a different output on the right with the mouse
when the mode is smaller that the original, as there is a "gap"
between the two outputs. So, if you alt-tab to another window
you can not always reach it.
This is somewhat of a sledge hammer, as it means you can't e.g.
focus a non-fullscreen on one output and have a window fullscreened
on another output. However, trying to restore only the outputs
the new window is on is problematic:
* It may later change output
* We want to see all windows anyway during alt-tab
* Can't reach the other windows with the mouse anyway
So, this seems like an ok solution.
Alexander Larsson [Tue, 28 May 2013 14:23:38 +0000 (16:23 +0200)]
shell: Use buffer_scale as output scale on fullscreen DRIVER
It may happen that you e.g. fullscreen a 800x600 surface with
buffer_scale 1 (e.g. a 800x600 buffer) on an output that is
otherwise scale 2. In this case we want to temporarily set
the output scale to 1, as we're really scanning out of a
scale 1 buffer. This causes us to e.g. report the input
positions in the right place, etc.
When we restore the original mode we also restore the original
scale.
Note that the scale change is a purely compositor internal change,
to clients it still looks like the output is scale 2.
Alexander Larsson [Tue, 28 May 2013 14:23:37 +0000 (16:23 +0200)]
compositor: Store original output scale
We want this so we can restore the original mode
with the original size (after having been fullscreen).
Alexander Larsson [Tue, 28 May 2013 14:23:36 +0000 (16:23 +0200)]
compositor: Store modes in physical units
We changed the protocol to always list modes in physical pixel
units (not scaled). And we removed the scaled mode flag. This
just updates the DRM and X11 compositors and the gl and pixman renderers
to handle this.
Alexander Larsson [Tue, 28 May 2013 14:23:35 +0000 (16:23 +0200)]
compositor-x11: Set original mode after current
Otherwise we're pointing the original mode on some uninitialized
value.
Alexander Larsson [Tue, 28 May 2013 14:23:34 +0000 (16:23 +0200)]
fullscreen: Add fullscreen testing client
This lets you try fullscreen in different methods, sizes, scales,
translations, etc. You can verify both output and input (via mouse over
of the rectangles).
Alexander Larsson [Tue, 28 May 2013 14:23:33 +0000 (16:23 +0200)]
input: Fix possible crash in clip_pointer_motion
It was erronously using output->current->height in one
place where it should use output->height. This may cause
it to create an invalid clipped coordinate in case of output
scaling or transform, because the next round "prev" would
end up NULL.
Hardening [Mon, 27 May 2013 21:13:45 +0000 (23:13 +0200)]
Fix name clash in RDP compositor
This patch fixes some name clashes introduced by last patches.
Kristian Høgsberg [Tue, 28 May 2013 19:34:46 +0000 (15:34 -0400)]
config-parser: Add tests for expect behavuor on NULL configs and sections
Mun Gwan-gyeong [Mon, 27 May 2013 15:20:04 +0000 (00:20 +0900)]
config-parser: Avoid null dereference when exiting. (case: weston starts without config file.)
backtrace:
(gdb) bt
#0 0xb7704424 in __kernel_vsyscall ()
#1 0xb757ddde in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
#2 <signal handler called>
#3 weston_config_destroy (config=0x0) at config-parser.c:508
#4 0xb75cbc0e in x11_destroy (ec=0x93506b0) at compositor-x11.c:1473
#5 0x0804e0e9 in main (argc=1, argv=0xbffe5354) at compositor.c:3337
Mun Gwan-gyeong [Mon, 27 May 2013 15:04:26 +0000 (00:04 +0900)]
config-parser: Avoid null dereference when handling config-parser ( when weston starts without config file. )
backtrace:
(gdb) bt
#0 weston_config_next_section (config=0x0, section=0xbfb2b608, name=0xbfb2b618) at config-parser.c:485
#1 0xb75b1371 in x11_compositor_create (config=0x1, argv=0xbfb2ba44, argc=<optimized out>, use_pixman=0, no_input=0, fullscreen=0, display=0xb75b55f9)
at compositor-x11.c:1582
#2 backend_init (display=0x8354490, argc=0xbfb2b9b0, argv=0xbfb2ba44, config=0x0) at compositor-x11.c:1674
#3 0x0804df7b in main (argc=1, argv=0xbfb2ba44) at compositor.c:3289
Alexander Larsson [Fri, 24 May 2013 11:09:43 +0000 (13:09 +0200)]
Convert all scales to int32_t
The type changed in the protocol, so update weston for this.
Kristian Høgsberg [Mon, 27 May 2013 01:48:14 +0000 (21:48 -0400)]
compositor: Parse config file in main(), only keep weston config object
Now that all backends and modules have been converted to the new
config parser API, we don't have to keep the fd around.
Kristian Høgsberg [Mon, 27 May 2013 01:30:14 +0000 (21:30 -0400)]
cms-static: Don't crash on outputs with NULL name
Kristian Høgsberg [Mon, 27 May 2013 01:21:23 +0000 (21:21 -0400)]
compositor-x11: Use new config file parser
With the iterator API we can now convert the X11 backend.
Kristian Høgsberg [Mon, 27 May 2013 00:50:53 +0000 (20:50 -0400)]
config-parser: Add section iterator API
The X backend needs to iterate through all outputs.
Hardening [Sun, 26 May 2013 21:34:00 +0000 (23:34 +0200)]
Don't store FreeRDP file descriptors
Weston don't uses the file descriptors from FreeRDP, there's no need
to store them.
Mun Gwan-gyeong [Fri, 24 May 2013 17:09:13 +0000 (02:09 +0900)]
config-parser: Avoid null dereference when handling config-parser
backtrace:
(gdb) bt
#0 weston_config_get_section (config=0x0, section=0x8062f31 "keyboard", key=0x0, value=0x0)
at config-parser.c:265
#1 0x080535a1 in weston_compositor_init (ec=0x905b690, display=0x9056490, argc=0xbf8bd2f0,
argv=0xbf8bd384, config_fd=-1) at compositor.c:2819
#2 0xb75d72bb in x11_compositor_create (config_fd=-1, argv=0xbf8bd384, argc=<optimized out>,
use_pixman=0, no_input=0, fullscreen=0, display=0x9056490) at compositor-x11.c:1527
#3 backend_init (display=0x9056490, argc=0xbf8bd2f0, argv=0xbf8bd384, config_fd=-1)
at compositor-x11.c:1746
Mun Gwan-gyeong [Fri, 24 May 2013 16:13:09 +0000 (01:13 +0900)]
config-parser-test: fix compile error
Add COMPOSITOR_CFLAGS to Makefile.am
Kristian Høgsberg [Fri, 24 May 2013 01:47:37 +0000 (21:47 -0400)]
shell: Remove input panel debug fprintf
Kristian Høgsberg [Fri, 24 May 2013 01:45:51 +0000 (21:45 -0400)]
text-backend: Use new config parser
Kristian Høgsberg [Fri, 24 May 2013 01:40:56 +0000 (21:40 -0400)]
shell: Use new config parser
Kristian Høgsberg [Thu, 23 May 2013 21:23:15 +0000 (17:23 -0400)]
compositor-drm: Convert to new config parser
Kristian Høgsberg [Thu, 23 May 2013 20:06:56 +0000 (16:06 -0400)]
cms-static: Convert cms-static to use new config parser
Almost half of the logic here was about wrestling the silly config parser
API.
Kristian Høgsberg [Thu, 23 May 2013 19:56:29 +0000 (15:56 -0400)]
compositor: Use new config parser for keyboard options
Kristian Høgsberg [Mon, 1 Apr 2013 16:41:23 +0000 (12:41 -0400)]
Add new config parser
The current config parser, parses the ini file and pulls out the values
specified by the struct config_section passed to parse_config_file() and
then throw the rest away. This means that every place we want to get
info out of the ini file, we have to parse the whole thing again. It's not
a big overhead, but it's also not a convenient API.
This patch adds a parser that parses the ini file to a data structure and
puts that in weston_compositor->config along with API to query comfig
keys from the data structure. The old parser is still available, but
we'll transition to the new approach over the next few commits.
Kristian Høgsberg [Fri, 24 May 2013 00:30:26 +0000 (20:30 -0400)]
compositor: Make backlight_current int32_t to avoid unsigned overflow
Backlight brightness was wrapping around when decrementing from 0.
Kristian Høgsberg [Fri, 24 May 2013 00:29:40 +0000 (20:29 -0400)]
compositor-drm: Log failure and which backlight sysfs file we're using
Pekka Paalanen [Thu, 23 May 2013 10:31:39 +0000 (13:31 +0300)]
compositor-x11: fix default output scale
Default output scale of 256 makes little sense. Actually this is a type
mismatch between wl_fixed and int, probably a leftover from when the
scale factor was proposed as a fixed point number.
Scale 256 probably causes the Window creation to fail, but that actually
leads to a segfault in Mesa libEGL later:
Program received signal SIGSEGV, Segmentation fault.
0 dri2_create_window_surface (drv=0x645060, disp=0x646610, conf=<optimized out>, window=<optimized out>, attrib_list=<optimized out>)
at platform_x11.c:291
291 surf->SwapInterval = 1;
Here 'surf' is NULL.
1 0x00007ffff76c0709 in eglCreateWindowSurface (dpy=0x646610, config=<optimized out>, window=
58720261, attrib_list=0x0) at eglapi.c:534
2 0x0000000000421549 in gl_renderer_output_create (output=0x673ae0, window=
58720261) at gl-renderer.c:1661
3 0x00007ffff41c456b in x11_compositor_create_output (c=0x6388b0, x=0, y=0, width=1024, height=640, fullscreen=0, no_input=0,
configured_name=0x0, transform=0, scale=256) at compositor-x11.c:928
4 0x00007ffff41c5ca0 in x11_compositor_create (display=0x631950, fullscreen=0, no_input=0, use_pixman=0, argc=0x7fffffffda7c,
argv=0x7fffffffdd18, config_fd=14) at compositor-x11.c:1596
5 0x00007ffff41c63db in backend_init (display=0x631950, argc=0x7fffffffda7c, argv=0x7fffffffdd18, config_fd=14) at compositor-x11.c:1746
6 0x000000000040fcb7 in main (argc=1, argv=0x7fffffffdd18) at compositor.c:3293
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Cc: Alexander Larsson <alexl@redhat.com>
Kristian Høgsberg [Thu, 23 May 2013 01:53:09 +0000 (21:53 -0400)]
rdp: Update output initialization to new API
Hardening [Wed, 22 May 2013 21:40:20 +0000 (23:40 +0200)]
rdp: Improve raw surfaces
This patch does miscellanous improvements with raw surfaces:
* some frames markers are sent to identify a single frame made of
multiple surface updates
* we send the dirty sub-rectangles instead of the full bouncing box
* the size of the fragmentation buffer is now honored, so that our big
surface updates don't look like a DoS
* the subtile and image flipping are done in one step (not requiring a
temporary tile)
* we don't care about the size of the dirty region and always use the
preferred codec for surface update
Hardening [Wed, 22 May 2013 21:40:19 +0000 (23:40 +0200)]
rdp: Don't rely on Synchronize packet for first screen refresh
Last FreeRDP don't send Synchronize packets anymore, so send the
first screen refresh when we're "connected". The client cursor is
also disabled during this step.
Hardening [Wed, 22 May 2013 21:40:18 +0000 (23:40 +0200)]
rdp: Fixed codec initialisations
This patch fixes NSC codec initialisation that was not done (an
erronous copy'n paste).
The remoteFx context must be resetted when we go through an activation
sequence
Hardening [Wed, 22 May 2013 21:40:17 +0000 (23:40 +0200)]
rdp: Drop unneeded main_seat
With recent changes in shell.c the fake seat is not required to
start a compositor, this patch removes it.
Hardening [Wed, 22 May 2013 21:40:16 +0000 (23:40 +0200)]
rdp: Fix compilation against FreeRDP and weston
The stream utils of FreeRDP have changed recently, this patch fixes
the compositor compilation against FreeRdp master.
The backend_init() prototype has changed too, this fixes it.
Pekka Paalanen [Wed, 22 May 2013 15:03:12 +0000 (18:03 +0300)]
screenshooter: print info to log
Print the recording info to Weston log, not stderr.
Also fix the frame counter.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Louis-Francis Ratté-Boulianne [Wed, 22 May 2013 15:03:11 +0000 (18:03 +0300)]
toytoolkit: Make the window resizing optimization optional
Whether or not a shm pool is used for resizing is now configurable at
build time (--disable-resize-optimization).
[pq: removed an unnecessary hunk from the patch]
Pekka Paalanen [Wed, 22 May 2013 15:03:10 +0000 (18:03 +0300)]
desktop-shell: new wallpaper mode scale-crop
Scale-crop mode scales the wallpaper to tightly fill the whole output,
but preserving wallpaper aspect ratio. If aspect ratio differs from the
output's, the wallpaper is centered cutting it from top/bottom or
left/right.
Add this to the weston.ini man page, and explain all three modes.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 22 May 2013 15:03:09 +0000 (18:03 +0300)]
shell: wait for desktop-shell init before fade in
On Raspberry Pi, weston-desktop-shell is so slow to start, that the
compositor has time to run the fade-in before the wallpaper is up. The
user launching Weston sees the screen flipping to black, the fbcon
fading in, and then the desktop popping up.
To fix this, wait for the weston-desktop-shell to draw
everything before starting the initial fade-in. A new request is
added to the private desktop-shell protocol to signal it. If a
desktop-shell client does not support the new request, the fade-in
happens already at bind time.
If weston-desktop-shell crashes, or does not send the 'desktop_ready'
request in 15 seconds, the compositor will fade in anyway. This should
avoid a blocked screen in case weston-desktop-shell malfunction.
shell_fade_startup() does not directly start the fade-in but schedules
an idle callback, so that the compositor can process all pending events
before starting the fade clock. Otherwise (on RPi) we risk skipping part
of the animation. Yes, it is a hack, that should have been done in
window.c and weston-desktop-shell instead.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 22 May 2013 15:03:08 +0000 (18:03 +0300)]
rpi: remove weston_plane support
There is no need to support weston_plane anymore.
The max-planes option is removed as unused.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 22 May 2013 15:03:07 +0000 (18:03 +0300)]
rpi: switch to rpi-renderer
Replace the GL renderer with the new rpi-renderer on the Raspberry Pi
backend. This makes Weston on rpi not use EGL or GL anymore, at all.
The weston_plane feature is disabled, since the rpi-renderer does the
same, but better.
Add a command line option to select the output transform. It is not a
weston.ini option for now, since the rpi backend does not read the
configuration file yet. Hopefully that will be done later with some
shared code.
Add the rpi options to 'weston --help' output.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 22 May 2013 15:03:06 +0000 (18:03 +0300)]
rpi: add a Dispmanx renderer
Dispmanx is the prorietary display API on the Raspberry Pi, which
provides hardware compositing. Every visible surface is assigned a
Dispmanx element, and the hardware or firmware will do all compositing
onto screen. The API supports translation, scaling, flips, discrete
rotations in 90-degree steps, alpha channel on the surfaces, and
full-surface alpha on top.
Previously, Dispmanx capabilities were used via the weston_plane
mechanism, where surfaces were assigned to planes when possible, and
otherwise transparently falling back to GLESv2 compositing. Because we
have no way to use the same memory buffer as a GL texture and a Dispmanx
resource, we had to prepare for both. In the worst case, that means one GL
texture, and two (double-buffered case) Dispmanx resources, all the size
of a whole surface, for all surfaces. This was eating memory fast. To
make things worse (and less slow), the wl_shm buffer was kept around,
since it was copied to either a texture or a resource as needed. This
caused all clients to need two buffers. In a Dispmanx-only renderer, we
can drop the GL texture, and we can release wl_shm buffer immediately
after the first copy, so clients become effectively single-buffered. So
from the worst case of 5 buffers per surface, we go down to 3 or just
2 (single-buffered Dispmanx element, one wl_shm buffer in the client)
buffers per surface.
As this will replace the GL renderer on rpi, we cannot fall back to the
GLESv2 compositing anymore. We lose arbitrary surface rotation, but we
lose also the GL fallback, which caused glitches.
This patch depends on new RaspberryPi firmware. Older firmware may not
render ARGB surfaces correctly, solid color surfaces maybe cause a
performance hit, and the output may completely fail in case the firmware
does not fall back internal off-line compositing properly as needed.
This new rpi-renderer support surface translation and scaling, but not
rotation or transpose (not even in 90-deg steps). In theory, 90-deg step
surface rotation is possible to support. Output transformations are
supported, but flipped variants do not seem to work right.
As a detail, menus and other surfaces that are simply translated with
respect to another surface caused falling back to the GL renderer. The
rpi-renderer handles them directly.
This patch only adds the new renderer, but does not hook it up into use.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 22 May 2013 15:03:05 +0000 (18:03 +0300)]
compositor: add capability CAPTURE_YFLIP
Both GL and pixman renderer (pixman probably only because GL did?)
return the screen capture image as y-flipped, therefore Weston y-flips
it again. However, the future rpi-renderer can produce only right-way-up
(non-flipped) screen captures, and does not need an y-flip.
Add a capability flag for y-flip, which the rpi-renderer will not set,
to get screen captures the right way up.
The wcap recording code needs yet another temporary buffer for the
non-flipped case, since the WCAP format is flipped, and the code
normally overwrites the input image as it compresses it. This becomes
difficult, if the compressor is supposed to flip while processing.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Wed, 22 May 2013 15:03:04 +0000 (18:03 +0300)]
compositor: add capability flag for arbitrary surface rotation
The upcoming rpi-renderer cannot handle arbitrary rotations. Introduce
Weston capability bits, and add a bit for arbitrary rotation. GL and
Pixman renderers support it.
Shell or any other module must not produce surface transformations with
rotation, if the capability bit is not set. Do not register the surface
rotation binding in desktop shell, if arbitary rotation is not
supported.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Ander Conselvan de Oliveira [Wed, 22 May 2013 19:55:33 +0000 (22:55 +0300)]
weston-launch: Fix failure to exec weston due to initalized argv values
The array of arguments supplied to execv must be NULL terminated. If
unitialized values are used as pointers the exec call may fail with a
EFAULT error ("Bad address").
https://bugs.freedesktop.org/show_bug.cgi?id=64874
Alexander Larsson [Wed, 22 May 2013 12:41:39 +0000 (14:41 +0200)]
compositor-drm: Support output scaling
If you specify e.g. scale=2 in an output section in weston.ini
we scale all modes by that factor.
We also correctly scale cursor positioning, but ATM there is no
scaling of the cursor sprite itself.
Alexander Larsson [Wed, 22 May 2013 12:41:38 +0000 (14:41 +0200)]
compositor-x11: Only repaint the damaged region
Set a clip on the GC when painting the damaged region so that
we don't copy the entire shadow buffer each time.
Alexander Larsson [Wed, 22 May 2013 12:41:37 +0000 (14:41 +0200)]
compositor: Support output/buffer scaling
If you specify e.g. scale=2 in weston.ini an output section for the
X11 backend we automatically upscale all normal surfaces by this
amount. Additionally we respect a buffer_scale set on the buffer to
mean that the buffer is already in a scaled form.
This works with both the gl and the pixman renderer. The non-X
backends compile and work, but don't support changing the output
scale (they do downscale as needed due to buffer_scale though).
This also sends the new "scale" and "done" events on wl_output,
making clients aware of the scale.
Alexander Larsson [Wed, 22 May 2013 12:41:36 +0000 (14:41 +0200)]
pixman-renderer: Fix up transform handling
Rather than storing the shadow_image in the untransformed space
and rotating on copy to hw_buffer we store both on the transformed
space. This means a copy between them is a straight copy, and that
apps supplying correctly transformed surface buffers need not
change them.
We also correctly handle all output transform including the previously
unhandled flipped ones, as well as client supplied buffer_transforms (which
were previously ignored).
We also simplify the actual rendering by just converting any damage
region to output coordinates and set it on a clip and composite
the whole buffer, letting pixman do the rectangle handling. This
means we always do all the transforms, including the surface positioning
as a pixman_image transform. This simplifies the code and sets us up
for handling scaling at a later stage.
The transform looks complicated, but in practice it ends up being
an integer translation almost always, so it will hit the pixman
fastpaths.
Alexander Larsson [Wed, 22 May 2013 12:41:35 +0000 (14:41 +0200)]
transformed: Add keyboard shortcuts to change transform
This makes it easy to test buffer_transform and buffer_scale handling.
left-right: rotate
space: toggle inverse
z: toggle scale between 1 and 2
Alexander Larsson [Wed, 22 May 2013 12:41:34 +0000 (14:41 +0200)]
terminal: Handle output transform
We pick the highest scale of any output the terminal is on, and the
transform from the last one it entered.
Alexander Larsson [Wed, 22 May 2013 12:41:33 +0000 (14:41 +0200)]
window: Add window_get_output_scale()
This lets you find the maximal scale for all the outputs a window
is on, which is useful for picking a buffer_scale.
Alexander Larsson [Wed, 22 May 2013 12:41:32 +0000 (14:41 +0200)]
desktop-shell: Respect output scale and translate
We pick the window scale/tranform based on what the output uses, which means
we can avoid rotations in the compositor, and get sharper rendering
in scaled outputs.
Alexander Larsson [Wed, 22 May 2013 12:41:31 +0000 (14:41 +0200)]
window: Store server_allocation in surface size
We used to just store the buffer size here which is not right if the
surface has a buffer_transform or a buffer_scale. To fix this we pass
the transform and scale into the toysurface prepare and swap calls and
move both the surface to buffer and the buffer to surface size
conversion there.
Without this interactive resize on the top or left sides of a transformed
or scaled surface will not work correctly.
Alexander Larsson [Wed, 22 May 2013 12:41:30 +0000 (14:41 +0200)]
transformed: Use the scale factor from the output
Alexander Larsson [Wed, 22 May 2013 12:41:29 +0000 (14:41 +0200)]
window: Apply buffer_scale automatically in widget_cairo_create
Alexander Larsson [Wed, 22 May 2013 12:41:28 +0000 (14:41 +0200)]
window: allow setting a buffer scale on a window
Alexander Larsson [Wed, 22 May 2013 12:41:27 +0000 (14:41 +0200)]
window: Track output scales
Alexander Larsson [Wed, 22 May 2013 12:41:26 +0000 (14:41 +0200)]
transformed: Rely on transformation in widget_cairo_create
Rather than doing our own transformation handling when drawing we
just rely on the generic code in widget_cairo_create
Alexander Larsson [Wed, 22 May 2013 12:41:25 +0000 (14:41 +0200)]
window: Support transform in widget_cairo_create()
If a buffer_transform it specified in the window we automatically
compensate for it in the cairo_t
Pekka Paalanen [Wed, 22 May 2013 07:20:05 +0000 (10:20 +0300)]
window: avoid a gcc warning in buffer release handler
Apparently some compilers complain about set but not used variables
'available' and 'bufs', but I don't get the warning. Still, separate the
debugging code from shm_surface_buffer_release(), so that we only
compute 'bufs' when it is printed. This should fix the warnings.
The debugging code now prints the shm_surface buffer state before and
after, instead of just after.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Kristian Høgsberg [Tue, 21 May 2013 15:44:22 +0000 (11:44 -0400)]
cms-static: Use the right wl_listener for the output hotplug listener
Mun Gwan-gyeong [Sat, 18 May 2013 12:43:10 +0000 (21:43 +0900)]
configure.ac: colord version to 0.1.27
Rob Bradford [Mon, 20 May 2013 15:55:10 +0000 (16:55 +0100)]
weston-launch: Print explanation of why we failed to open the device
Rob Bradford [Mon, 20 May 2013 11:09:20 +0000 (12:09 +0100)]
shell: End grab if the grabbed shell surface has been destroyed
The shell_grab_start function sets up a destroy notification on the
shell surface such that when the shell surface is destroyed the pointer
on the grab to the shell surface is set to NULL.
We must therefore check whether the shell surface is NULL and end the
grab if it is.
https://bugs.freedesktop.org/show_bug.cgi?id=64689
Pekka Paalanen [Fri, 17 May 2013 13:46:03 +0000 (16:46 +0300)]
protocol: improve sub-surface spec wording
Mention, that sub-surfaces are not clipped to the parent.
Be more accurate on surface commit vs. apply state.
Mention the initial stacking order.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Hardening [Fri, 17 May 2013 16:07:41 +0000 (18:07 +0200)]
Fix surface_pong when a seat doesn't have a pointer
This patch fixes a crash with the surface_pong when one of the
seats doesn't have a pointer. This was the case with the RDP compositor
that use a fake seat with no mouse or keyboard.
Quentin Glidic [Fri, 17 May 2013 14:20:37 +0000 (16:20 +0200)]
weston-launch: Run weston in the user login shell
This patch brings back the user environment from the shell.
In the future, weston-launch could create the Wayland socket earlier, in
which case the user's shell could be used to run Wayland-specific tools
in the new Weston session.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Pekka Paalanen [Fri, 17 May 2013 13:46:08 +0000 (16:46 +0300)]
protocol: remove an unused sub-surface error code
This was left over from allowing nesting.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 17 May 2013 13:46:07 +0000 (16:46 +0300)]
compositor: forbid sub-surface nesting loops
The only way to create a sub-surface loop by recursive nesting is to
make the main surface (which does not have a role) a sub-surface of any
of its sub-surfaces. All other cases should already be cought.
This change checks for that exact case, and sends a protocol error.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 17 May 2013 13:46:06 +0000 (16:46 +0300)]
tests: add a sub-surface nesting loop test
It should not be possible to create a loop by nesting sub-surfaces.
Currently Weston fails this test.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Pekka Paalanen [Fri, 17 May 2013 13:46:05 +0000 (16:46 +0300)]
protocol: set_desync should flush
wl_subsurface.set_desync should apply the cached wl_surface state.
Otherwise, the sub-surface may be stuck: a commit on the parent surface,
if desynchronized, will not commit the sub-surface because it is
desynchronized, too. A commit on the sub-surface may not happen, if it
is waiting for the frame callback from the previous commit.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>