Jason Ekstrand [Fri, 14 Jun 2013 15:08:00 +0000 (10:08 -0500)]
input: Use wl_resource_get accessor functions for resources
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Fri, 14 Jun 2013 15:07:59 +0000 (10:07 -0500)]
text-backend: Change resources to wl_resource pointers
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Fri, 14 Jun 2013 15:07:58 +0000 (10:07 -0500)]
input_panel_surface: Change resource to a wl_resource pointer
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Fri, 14 Jun 2013 15:07:57 +0000 (10:07 -0500)]
callback: Change resource to a wl_resource pointer
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Fri, 14 Jun 2013 15:07:56 +0000 (10:07 -0500)]
region: Change resource to a wl_resource pointer
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Fri, 14 Jun 2013 15:07:54 +0000 (10:07 -0500)]
shell: Convert resources to pointers
This commit converts shell_surface.resource to a pointers and updates
shell.c to use wl_resource_get accessors for shell_surface, desktop_shell,
screensaver, and workspace_manager related resources.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Jason Ekstrand [Fri, 14 Jun 2013 15:07:53 +0000 (10:07 -0500)]
Use wl_resource_get_user_data for weston_surface resources
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Samuel Iglesias Gonsalvez [Thu, 13 Jun 2013 08:03:33 +0000 (10:03 +0200)]
compositor-drm: free plane resources using drm function.
Free plane resources using drmModeFreePlaneResources()
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Tiago Vignatti [Wed, 12 Jun 2013 18:43:21 +0000 (15:43 -0300)]
xwayland: Forward global position to X
xeyes works as expected now. subwindows are popped also as expected. This
patch should fix the following:
https://bugs.freedesktop.org/show_bug.cgi?id=59983
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
MoD [Wed, 12 Jun 2013 00:59:42 +0000 (19:59 -0500)]
xwm: Check result of xcb_get_atom_name_reply
When printing debug information about atoms, the XWM would crash if the X
server failed to respond to a request about atom names. In practice this
occurred when the server itself crashed, e.g. when starting mplayer with the
"xv" vo.
MoD [Wed, 12 Jun 2013 00:58:55 +0000 (19:58 -0500)]
xwm: Define SEND_EVENT_MASK and EVENT_TYPE macros to clarify xcb event type checks
Jason Ekstrand [Fri, 7 Jun 2013 03:34:41 +0000 (22:34 -0500)]
Change weston_surface.resource to a wl_resource pointer.
This is the first in what will be a series of weston patches to convert
instances of wl_resource to pointers so we can make wl_resource opaque.
This patch handles weston_surface and should be the most invasive of the
entire series. I am sending this one out ahead of the rest for review.
Specifically, my machine is not set up to build XWayland so I have no
ability to test it fully. Could someone please test with XWayland and let
me know if this causes problems?
Because a surface may be created from XWayland, the resource may not always
exist. Therefore, a destroy signal was added to weston_surface and
everything used to listen to surface->resource.destroy_signal now listens
to surface->destroy_signal.
Eduardo Lima (Etrunko) [Fri, 10 May 2013 20:50:36 +0000 (17:50 -0300)]
text: Fix misleading error message
This should be "input_method" and not "desktop_shell"
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
Sinclair Yeh [Thu, 6 Jun 2013 23:41:30 +0000 (16:41 -0700)]
Avoid unnecessarily re-allocating texture buffer when the size hasn't changed.
v4:
Incorporated krh and anderco's comments. Now adding newly allocated
buffer's dimensions to texture_damage
v3:
* Removed unnecessary parentheses
* Added check for switching from EGL image to SHM buffer
* Moved shader assignment out of IF condition
v2:
Fixed the wrong comparison
v1:
Depending on specific DRI driver implementation, glTexImage2D() with data
set to NULL may or may not re-allocate the texture buffer each time it is
called. Unintended consequences happen if later glTexSubImage2D() is called
to only update a sub-region of the texture buffer.
I've explored moving glTexImage2D() from gl_renderer_attach() and simply
mark the texture dirty, but the current implemention seems cleaner because
I won't have to worry about calling ensure_textures() and re-assigning
gs->shader unnecessarily.
Pekka Paalanen [Wed, 5 Jun 2013 13:25:11 +0000 (16:25 +0300)]
shared: build fix for config-parser test
One more wayland-util.h not found issue, triggered by having libwayland
installed to a custom prefix.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Daniel Stone [Wed, 22 May 2013 15:03:19 +0000 (18:03 +0300)]
configure.ac: Enable AC_USE_SYSTEM_EXTENSIONS
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar
macros to expose the largest extent of functionality supported by the
underlying system. This is required since these macros are often
limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually
on some systems hide declarations which are not part of the X/Open spec.
Since this goes into config.h rather than the command line, ensure all
source is consistently including config.h before anything else,
including system libraries. This doesn't need to be guarded by a
HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org
modular transition.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
[pq: rebased and converted more files]
Rob Bradford [Fri, 31 May 2013 17:09:59 +0000 (18:09 +0100)]
udev-seat: Use udev rules to support multiple seats
By labelling devices with ENV{WL_SEAT} in udev rules the devices will be
pulled into multiple weston seats.
As a result you can get multiple independent seats under the DRM and
fbdev backends.
Rob Bradford [Fri, 31 May 2013 17:09:58 +0000 (18:09 +0100)]
udev-seat: Separate the seat out to its own structure
Thie will allow us to instantiate multiple seats.
Rob Bradford [Fri, 31 May 2013 17:09:57 +0000 (18:09 +0100)]
compositor-fbdev: Rename seat variable to seat_id to clarify purpose
Rob Bradford [Fri, 31 May 2013 17:09:56 +0000 (18:09 +0100)]
compositor-fbdev: Remove unused fbdev_seat code
The fbdev compositor uses the commons seat handling code with the drm
compositor.
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.