Commit Graph

1440 Commits

Author SHA1 Message Date
Kristian Høgsberg
1eb482d814 launcher: Handle drm set/drop master and vt switch signals in launcher 2013-09-18 11:14:14 -07:00
Kristian Høgsberg
61741a293c compositor: Generalize VT switching as a session_signal
Instead of a callback from the tty module, we now have a compositor level
signal that fires when our session is activated or deactivated.
2013-09-18 11:14:14 -07:00
Kristian Høgsberg
05ad1e4e8a launcher: Collect launcher state in new struct weston_launcher
We're going to add a bit more launcher state, so start out by creating
a new struct weston_launcher we can track it in.
2013-09-18 11:14:14 -07:00
Kristian Høgsberg
bf3c374b1b weston-launch: Use SOCK_SEQPACKET for the launcher socket
This lets us detect hang-up when weston-launch dies and clean up properly.
2013-09-18 11:14:14 -07:00
Kristian Høgsberg
f45b1e8284 weston-launch: Pass the right CLOEXEC flag to fcntl
Passing O_CLOEXEC to fcntl is wrong, we need to pass FD_CLOEXEC.
2013-09-18 11:14:14 -07:00
Kristian Høgsberg
1ff5109b5f compositor: Open drm device through launcher 2013-09-17 14:05:47 -07:00
Sam Spilsbury
619859ce90 Split vertex clipping code out into vertex-clipping.c 2013-09-16 21:40:31 -07:00
Giulio Camuffo
62942ad3a6 xwm: set the shell_surface's title
add a new function pointer to the weston_shell_interface struct that
shells will set accordingly.
2013-09-11 13:50:54 -07:00
Giulio Camuffo
ca43f0942e xwm: place transient windows at the right position 2013-09-11 13:50:03 -07:00
Kristian Høgsberg
2e3c396ae3 shell: Use wl_resource_for_each() for sending out workspace status 2013-09-11 12:00:47 -07:00
Rob Bradford
6e737f590b input: Use new wl_resource_for_each for sending updated seat caps 2013-09-11 11:57:28 -07:00
Ander Conselvan de Oliveira
a62ef3e0b6 vaapi-recorder: Don't leak drm fd
Make vaapi_recorder take onwership of the fd and close it at destroy
time.
2013-09-11 11:55:32 -07:00
Ander Conselvan de Oliveira
b85ded0cb8 vaapi-recorder: Encode frames in a separate thread
Previously, vaapi_recorder_frame() would wait until the encoded
contents for a frame is written to the output file descriptor. This
delayed the repainting of the next frame, and affected frame rate
when capturing with high resolutions. Instead, wait only if there is
and attempted to encode two frames at the same time.

Increases framerate from 30 to 60 fps when capturing at 1920x1200 on
my SandryBridge system, although there are periodic slowdowns due to
disk writes.
2013-09-11 11:55:15 -07:00
Adrian Negreanu
4aa756dc7a add libhybris support
it uses the Android fbdev HAL[1] (through libhybris[2])
and the libhybris implementation of wayland-egl.

Configure flags:
 cairo:
   --enable-glesv2=yes  --enable-egl=yes
 weston:
   --with-cairo-glesv2 --enable-fbdev-compositor
 hybris:
   --enable-wayland --enable-arch=x86
   --with-android-headers=<android-headers> --enable-alinker=jb

The android headers are extracted from an AOSP tree,
using hybris/utils/extract-headers.sh

[1]:
https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/fb.h

[2]: https://github.com/libhybris/libhybris

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-09-11 11:54:11 -07:00
Andrew Wedgbury
a94dc8a51b compositor-x11: Copying xkb_info when creating a seat causes problems
Sorry, I missed updating use of xkb_info in compositor-x11.c.
I've updated the patch.
2013-09-11 11:20:35 -07:00
Marc Chalain
ffbddff89a fbdev: Support of TrueColor and Directcolor of video hardware
backend check the type of the framebuffer and accept DirectColor and TrueColor
I use a "switch case" to implement other cases in the future.
2013-09-11 11:20:26 -07:00
Stanislav Vorobiov
bfbb8e59fa gl_renderer: Use EGL_WAYLAND_Y_INVERTED_WL to query wl_buffer's orientation 2013-09-11 10:56:00 -07:00
Andrew Wedgbury
9a6f02a6b1 Copying xkb_info when creating a seat causes problems
Hi Kristian,

Here's a new patch for ref counting weston_xkb_info, as suggested.
So a seat created with a NULL keymap will now point to the global xkb_info.
2013-09-11 10:06:23 -07:00
Kristian Høgsberg
1702d4cfca input: Initialize data source to NULL
This way we do the right thing, when we get a NULL wl_resource for self-dnd.
2013-09-11 09:45:03 -07:00
Kristian Høgsberg
0abad07750 compositor: Return 0 on success
Add missing return statement.
2013-09-11 09:42:26 -07:00
Kristian Høgsberg
73bdc0ce85 xwm: Fix fd leak in weston_wm_send_data()
The call to source->send(source, mime_type, p[1]); dups the fd, and we have
to close p[1] to not leak it.
2013-09-04 22:32:50 -07:00
Kristian Høgsberg
3f7fcf83f6 xwm: Try a non-blocking write before setting up an fd watch for property data
Typically we can write it immediately without blocking, so save the overhead
of setting up an fd watch and writing the data in a callback.  For the
case where the immediate write doesn't write all data, we fallback and
set up the fd watch as usual.

This patch also consolidates setting up the async write a bit.
2013-09-04 22:12:28 -07:00
Kristian Høgsberg
f9cb3b17d5 xwm: Add support for bridging Xdnd to wayaland DnD 2013-09-04 21:24:41 -07:00
Kristian Høgsberg
9466e50626 xwm: Only handle selection notify events for CLIPBOARD in selection code 2013-09-04 21:09:24 -07:00
Kristian Høgsberg
668fc0de0b xwm: Fix fd leak in selection code
The file descriptors we receive in the wayland protocol callbacks are
already O_CLOEXEC, so don't dup them to set O_CLOEXEC.`
2013-09-04 20:52:20 -07:00
Kristian Høgsberg
85de9c25fe compositor: Split dnd setup up into weston_seat_start_drag()
This makes the drag-and-drop code available to in-weston data sources,
similar to how we can set a selection data source internally.  The
wl_data_device.start_drag entry point now calls this function after
validating protocol arguments.
2013-09-04 20:46:56 -07:00
Kristian Høgsberg
6399646a6b compositor-drm: Pass the wl_resource to gbm_bo_import()
Another silent regression from the wl_resource opaquify effort.  This was
causing our pageflip-to-client-buffer and sprites optimizations to
not kick in.
2013-09-03 22:32:52 -07:00
Kristian Høgsberg
ab6d6674b6 xwm: Unmap frame window when client window is unmapped
We used to destroy the frame window and reparent the client window to
wm_window.  That means that we lose the destroy_notify event when the
client window is destroyed later, since we don't select for
substructure_notify on wm_window.

Instead of destroying and reparenting, just unmap the frame window.
2013-09-03 20:57:18 -07:00
Kristian Høgsberg
318ea37782 xwm: Split creation of frame window out into its own function 2013-09-03 20:57:18 -07:00
Kristian Høgsberg
81cadc725c xwm: Set window->surface to NULL when surface goes away
Otherwise we may end up trying to remove the destroy listener if we
get the surface_destroy callback before the unmap_notify.
2013-09-03 20:57:18 -07:00
Kristian Høgsberg
1a7a57f0d9 xwm: Detect WM_NORMAL_HINTS fullscreen attempts 2013-09-03 20:57:11 -07:00
Kristian Høgsberg
59f44c184d xwm: Detect legacy fullscreen modes 2013-09-03 20:56:20 -07:00
Kristian Høgsberg
1b6fed41dd xwm: Update size when override redirect windows change size 2013-09-03 20:56:12 -07:00
Kristian Høgsberg
69e25fc538 compositor: Implement release request for input interfaces
v2 (Rob Bradford): Update the version numbering for this change
2013-08-30 14:53:17 -07:00
Kristian Høgsberg
0eac34ab28 configure.ac: Auto-enable vaapi recorder, but allow overrides
If libva is available and recent, we'll enable the vaapi recorder feature,
but it can also be forced on or off by --enable/disable-vaapi-recorder.
2013-08-30 14:29:03 -07:00
Ander Conselvan de Oliveira
6aae4d39d5 compositor-drm: Add hardware accelerated capture of screen using libva
This patch adds a feature to the DRM backend that uses libva for
encoding the screen contents in H.264. Screen recording can be
activated by pressing mod-shift-space q. A file named capture.h264
will be created in the current directory, which can be muxed into
an MP4 file with gstreamer using

gst-launch filesrc location=capture.h264 ! h264parse ! mp4mux ! \
           filesink location=file.mp4

This is limitted to the DRM compositor in order to avoid a copy when
submitting the front buffer to libva. The code in vaapi-recorder.c
takes a dma_buf fd referencing it, does a colorspace conversion using
the video post processing pipeline and then uses that as input to the
encoder.

I'm sending this now so I get comments, but this is not ready for
prime time yet. I have a somewhat consistent GPU hang when using
i915 with SandyBridge. Sometimes a page flip never completes. If you
want to try this anyway and your system get stuck, you might need to
run the following:

  # echo 1 > /sys/kernel/debug/dri/0/i915_wedged

After that, alt-sysrq [rv] should work.

Once that's fixed it would also be good to make the parameters used by
the encoder more flexible. For now the QP parameter is hardcoded to 0
and we have only I and P frames (no B frames), which causes the
resulting files to be very large.
2013-08-30 13:44:40 -07:00
Kristian Høgsberg
037bdc4c5d evdev: Don't parse config file again, use compositor->config 2013-08-29 13:49:35 -07:00
Kristian Høgsberg
e1b655df92 shell: Make sure we have seat->pointer and seat->touch before dereferencing
Either of these may not be available when we handle wl_shell_surface.move,
and we need to not crash when that's the case.

https://bugs.freedesktop.org/show_bug.cgi?id=68649
2013-08-28 23:17:09 -07:00
Kristian Høgsberg
73db924ad3 gl-renderer: Use GL_UNSIGNED_SHORT for index array type
GL_UNSIGNED_INT is only supported when GL_OES_element_index_uint is
available (mesa implements that extension).  We don't need 32-bit
indices, so just use GL_UNSIGNED_SHORT.
2013-08-28 23:05:31 -07:00
Kristian Høgsberg
6c7583de2a evdev: Don't transform device->abs.x/y in place
We don't always get both an X and an Y event in a SYN report, so we end
up transforming the coordinate we don't get twice.  For example, if we
only receive an ABS_X event, we transform the already transformed
device->abs.y again in transform_absolute() when applying the calibration.
2013-08-28 22:12:24 -07:00
Jason Ekstrand
a985da48a7 Add a --shell option to override the default desktop-shell
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-08-26 22:07:03 -07:00
Pier Luigi Fiorini
403ea92c48 compositor.h: Don't include config.h
Public headers should not include config.h.
2013-08-26 15:22:42 -07:00
Kristian Høgsberg
c7d2c4c147 Add more missing config.h #includes
Now that we use AC_SYS_LARGEFILE, we need to pull in config.h at least
whereever we use mmap().  Fixes at least the test-suite and simple-shm
on 32 bit systems.
2013-08-26 14:59:14 -07:00
Kristian Høgsberg
4e55d067ea evdev: Initliaze device->link so we can wl_list_remove() without crashing
We were testing for wl_list_empty() on a { NULL, NULL } list (which
returns false) and then wl_list_remove()ing the device (which crashes).
2013-08-26 14:35:34 -07:00
Kristian Høgsberg
146f5ba466 xwm: Use window->x/y for override redirect surfaces
window->x/y is the coordinate of the top-level surface (whether that's
the frame window or an override-redirect window) and the wayland surface
should be placed there, without the t->margin offset.
2013-08-22 16:30:21 -07:00
Kristian Høgsberg
e89a8b6ba1 xwm: Fix transform listener
The coordinate transformation was broken (worked for first output where
output->x/y was 0,0, broke on all other outputs).  We can just use
surface->geometry.x/y directly.  We can't use the full transformation,
the best we can do is to move the X window to the geometry.x/y location.

Get rid of the static old_sx/sy hack as well.
2013-08-22 16:23:35 -07:00
Kristian Høgsberg
122877d5e7 xwm: Fix configure notify handler
We only get configure notify for toplevel (frame or override-redirect window)
and those are the cases where we want to update window->x/y.  The way the
code worked, we'd exit immeidately in those cases and window->x/y would
not be updated.
2013-08-22 16:18:17 -07:00
Kristian Høgsberg
69981d9621 xwm: Set _NET_WM_CM_S0 instead of relying on the xwayland module to do it
Not sure why I made xwayland claim this selection, seem a little
awkward in retrospect.
2013-08-21 22:14:58 -07:00
Kristian Høgsberg
ac6104ea11 compositor-drm: Zero out create_arg when creating dumb framebuffers
The create_arg struct has a flags member that we didn't properly set to 0.
2013-08-21 22:14:14 -07:00
Kristian Høgsberg
a34e2f2adc data-device: Only bail out if we failed to allocate offer
It's valid to have a NULL data source (self-dnd) in which case we send
a NULL offer on enter.
2013-08-20 15:58:25 -07:00