Commit Graph

2172 Commits

Author SHA1 Message Date
Kristian Høgsberg
1f5de35482 compositor-drm: Only update hw cursor contents when it changes
We avoid the memcpy, gbm_bo_write and the drmModeSetCursor ioctl per frame.
2012-07-18 15:52:14 -04:00
Kristian Høgsberg
24e4275c30 compositor-drm: Only call drmModeMoveCursor() if hw cursor position changed
Saves an ioctl per frame.
2012-07-18 15:52:14 -04:00
Kristian Høgsberg
f1ea63ff05 compositor: Don't record surface damage when we move or transform surfaces
surface->damage is for when the contents of the surface changes.  Instead,
use weston_surface_damage_below() to repaint the damaged area.  We avoid
unecessary uploading shm and hw cursor contents this way.
2012-07-18 15:52:14 -04:00
Kristian Høgsberg
c12efd0aa7 wcap: Just make wcap-decode dump YUV4MPEG2
Instead of having a custom fork of the vpxenc tool in weston, we can
just dump raw YUV data in the YUV4MPEG2 format and feed that into the
upstream vpxenc.  This also works with theora_encoder and probably many
other encoders.
2012-07-18 15:52:13 -04:00
Kristian Høgsberg
94de680439 shell: Default to maximize/fullscreen on current output 2012-07-18 15:52:13 -04:00
Kristian Høgsberg
971cbc8c9e compositor: Free the right EGLImage
We forgot to index the image array and freed image[0] multiple times
2012-07-17 14:21:25 -04:00
Kristian Høgsberg
4901f6ceea compositor-drm: Allocate hw cursor like other planes
We no longer reserve the hw cursor for just the pointer sprite.  Any
surface that satisfies the requirements for the hw cursor can be used.

Of course that's more or less always the pointer sprite, but at least now
we don't hard-code the references to compositor->seat anymore.
2012-07-16 16:44:24 -04:00
Kristian Høgsberg
a6edab3e23 compositor-drm: Combine drm_output_set_cursor and weston_output_set_cursor
weston_output_set_cursor was the left-over of a core compositor cursor
helper that we moved into compositor-drm.c.
2012-07-16 16:44:24 -04:00
Kristian Høgsberg
6143f7dfbd compositor-drm: Assign primary framebuffer in assign_planes callout
Determining whether it was possible to use a surface buffer as the
primary framebuffer was always a bit of a hack.  Just before rendering,
we look at the second top-most surface to see if it's the right size and
position and then use it if it is.  If we have a hw cursor and a drm
plane on top, it's no longer the second top-most and it wouldn't be picked
even if it could work.

With this change, we inspect surfaces in drm_assign_planes and try to find
a candidate for the primary fb there.  We track the overlap like for
overlays and if there is a surface that's not overlapped and fills the
output we pick it.

This commit also consolidate the logic to track damage as we move a surface
in and out of the primary plane, which was missing in the drm plane case.
2012-07-16 16:44:23 -04:00
Kristian Høgsberg
3b00bae996 compositor-drm: Support hardware scaling with drm planes
The kms planes support scaling, so try to detect transformations that
are just translations + scaling and program the kms plane accordingly.

In particular, this lets us fullscreen a yuv surfaces with the scale method
and have the compositor use a kms plane for scaling and color conversion.
2012-07-16 16:44:23 -04:00
Kristian Høgsberg
270a7cb02d compositor-drm: Follow gbm_bo_get_pitch rename to gbm_bo_get_stride
It was always a confusing mis-nomer, fix it while we can.
2012-07-16 16:44:16 -04:00
Kristian Høgsberg
2763a2e94e compositor-drm: Use gbm_bo_import instead of gbm_bo_create_from_egl_surface
This lets us create the gbm bo from the wl_buffer instead of the
EGLImage.  With planar buffer, the EGLImage corresponds to a plane
and not the entire planar buffer.

More importantly, with some YUV formats (packed YUYV and similar) we use
several EGLImages to sample the different components, but KMS only
want one plane in that case.
2012-07-16 16:40:29 -04:00
Tiago Vignatti
c190323c90 xwm: set the root window pointer to left_ptr
More pretty and also consistent with toytoolkit.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-07-16 13:35:27 -04:00
Tiago Vignatti
236b48d414 xwm: set appropriate cursors for the frame window
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-07-16 13:35:27 -04:00
Tiago Vignatti
90fada4338 xwayland: add simple xcb-cursor hook based on libXcursor
It's in fact based on the core of libXcursor, which doesn't bring any Xlib
dependency.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-07-16 13:35:27 -04:00
Kristian Høgsberg
e89cef37eb xwayland: Look up 32 depth rgba render format as well 2012-07-16 13:35:27 -04:00
Kristian Høgsberg
e6d8d2f62a xwayland: Use the right length for iterating through the formats array
Spotted by Tiago Vignatti, minimal fix to just use the right length.
2012-07-16 13:35:26 -04:00
Ander Conselvan de Oliveira
07a91cd9fd desktop-shell: Don't get a shell surface for the grab surface
The grab surface does not depend on any of the shell surface
functionality, so don't allocated one.
2012-07-16 13:35:26 -04:00
Ander Conselvan de Oliveira
ddca49600f window: Workaround a stuck frame callback on the cursor surface
It is possible that a client loses the focus between receiving a
pointer.enter event and sending a pointer.set_cursor request. In that
case, the cursor surface might not be mapped and the frame callback
requested on it will never trigger.

Work around this by trying to remap the cursor surface whenever there
is a frame callback and the serial for the enter event is higher than
the cursor serial.
2012-07-16 13:35:25 -04:00
Ander Conselvan de Oliveira
eac9a46012 shell: Don't ping the grab surface
If the grab surface happens to be unresponsive, the busy cursor grab
will be started and that will cause the grab surface to receive focus,
which in turn leads to it being pingged again. Break the cycle by not
sending pings to it. If the shell is unresponsive it won't be able to
set the busy cursor anyway.
2012-07-16 13:35:25 -04:00
Kristian Høgsberg
c7814d2e98 compositor: Don't send wl_surface.enter/leave if we didn't find a resource 2012-07-12 12:34:43 -04:00
Kristian Høgsberg
240dfeb0fe shell: Scale fullscreen surface without cropping them, center on output 2012-07-12 12:32:31 -04:00
Scott Moreau
fe89f07e33 toytoolkit: Remove obsolete function window_set_custom(). 2012-07-12 09:18:49 -04:00
Scott Moreau
a6e24d3104 wscreensaver: Fix --demo mode. 2012-07-12 09:18:45 -04:00
Tiago Vignatti
cd717b5695 compositor: remove useless weston_compositor_repick call
compositor->focus was just unset, and weston_compositor_repick() has no
effect.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-07-11 22:26:25 -04:00
Philipp Brüschweiler
c547477e27 Remove dead code
window->title is always NULL inside window_create_internal
2012-07-11 15:46:37 -04:00
Kristian Høgsberg
c234fb819f image-loader: Use pixman_image_t, not struct pixman_image_t 2012-07-11 15:45:59 -04:00
Rafal Mielniczuk
9d4ddefcce image-loader: don't leak pixman_image bits data
Set the pixman_image destroy function to free bits data
2012-07-11 15:42:51 -04:00
Rafal Mielniczuk
96ddcb25ab clipboard: add seat destroy signal handler 2012-07-11 15:42:46 -04:00
Gwenole Beauchesne
28f59b027a compositor: handle YUV buffers.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-10 15:57:01 -04:00
Kristian Høgsberg
76574d1fb7 Update weston-egl-ext.h with EGL_WL_bind_wayland_display changes 2012-07-10 15:56:12 -04:00
Gwenole Beauchesne
faf91854a8 compositor: add YUV shaders.
Add shaders for NV12 (2 planes), YUV (3 planes) and YUYV (sampled as 2 planes)

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-10 15:54:17 -04:00
Gwenole Beauchesne
6d0304904c compositor: factor out RGB shader.
Simplify RGB shader code and split off common code that could be reused.
This is preparatory work for YUV shaders.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-10 15:44:33 -04:00
Gwenole Beauchesne
023f855f8d compositor: prepare for multi-planar surfaces.
Make weston_surface::texture and ::surface an array, while keeping
[0] for RGB surfaces.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-10 15:44:33 -04:00
Juan Zhao
4ab9468865 shell: Use the correct the member name when iterating panel_list
It does not get the correct panel height for now.  The memeber of list
to read should be layer_link not link now.

Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
2012-07-10 08:47:25 -04:00
Kristian Høgsberg
dd263e546b window.c: Only set input region when we have a decoration
https://bugs.freedesktop.org/show_bug.cgi?id=50490
2012-07-09 22:23:39 -04:00
Kristian Høgsberg
5085001f82 tests: Handle modifier event in test-client.c
We need the handle the newly added modifiers event.

https://bugs.freedesktop.org/show_bug.cgi?id=51567
2012-07-09 22:17:03 -04:00
Kristian Høgsberg
e4d3a2bce6 Only position fullscreen surface in surface->configure callback
We end up calling shell_configure_fullscreen() from activate(), where
surface->buffer may be NULL.  Instead, call it on initial map and
first buffer attach after surface type change.  Both code path
come from the surface->configure callback where surface->buffer is know
to be non-NULL.

https://bugs.freedesktop.org/show_bug.cgi?id=51678
2012-07-09 21:49:10 -04:00
Jan Engelhardt
e3ebd33e88 wcap-snapshot: add return value
Distro build with rpmlint aborts due to missing exit status.
2012-07-09 18:04:13 -04:00
Daniel Stone
d4756b7955 toytoolkit: Remove redundant XKB free
We already unref these in fini_xkb().

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 18:03:06 -04:00
Martin Olsson
61d67df18b Add cscope.out to .gitignore 2012-07-09 17:57:55 -04:00
Martin Olsson
c663b22c20 clients: Free resources on exit in eventdemo 2012-07-09 17:50:57 -04:00
Martin Olsson
8df662ad87 clients: Silence 2x gcc 4.6.3 "warn_unused_result" compiler warnings
window.c:1173:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
desktop-shell.c:305:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
2012-07-09 17:50:46 -04:00
Martin Olsson
9988633f58 wcap: Plug memory leak in wcap_decoder_create() 2012-07-09 17:50:46 -04:00
Martin Olsson
197214112c xwayland: Don't leak fd while reading lock file in src/xwayland/launcher.c 2012-07-09 17:50:45 -04:00
Martin Olsson
11434bb2ea compositor-x11: Add error handling in x11_compositor_create() 2012-07-09 17:50:45 -04:00
Martin Olsson
c5db50f549 compositor-wayland: Add error handling in wayland_compositor_create() 2012-07-09 17:50:45 -04:00
Martin Olsson
c5da0999fe compositor-android: Add proper error handling in android_compositor_create() 2012-07-09 17:50:45 -04:00
Martin Olsson
712f5f405e shared: Don't leak file descriptor in shared/image-loader.c 2012-07-09 17:50:44 -04:00
Martin Olsson
444799adbb clients: Don't leak "menu" on error path in clients/window.c 2012-07-09 17:50:44 -04:00