profile/ivi/weston-ivi-shell.git
11 years agowindow: move toysurface and allocation to struct surface
Pekka Paalanen [Wed, 13 Feb 2013 14:17:14 +0000 (16:17 +0200)]
window: move toysurface and allocation to struct surface

Fields 'allocation' and 'server_allocation' are surface specific. Fields
'saved_allocation', 'min_allocation', and 'pending_allocation' are
window specific, and will not be moved.

Field 'toysurface' is naturally surface specific, since it provides the
backing storage for the wl_surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agowindow: create new struct surface with wl_surface
Pekka Paalanen [Wed, 13 Feb 2013 14:17:13 +0000 (16:17 +0200)]
window: create new struct surface with wl_surface

Struct window has many fields that are directly related to the
wl_surface, more than to the window as a whole. When we start composing
a window from several wl_surfaces, these fields need to be per
wl_surface, not per window.

Start separating such fields from struct window into struct surface by
moving the wl_surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agowindow: destroy the 2nd shm buffer, if both released
Pekka Paalanen [Wed, 13 Feb 2013 14:17:12 +0000 (16:17 +0200)]
window: destroy the 2nd shm buffer, if both released

Handle the case when we the compositor somehow migrates from requiring
double buffering into working on single buffering, so we release the
extra shm buffer.

Currently, I do not think this can happen in practice, but in the future
it may happen with sub-surfaces.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agowindow: check the initial wl_display_dispatch()
Pekka Paalanen [Thu, 14 Feb 2013 10:18:00 +0000 (12:18 +0200)]
window: check the initial wl_display_dispatch()

Check for errors in the first wl_display_dispatch() call. Otherwise
doing something silly like
  $ WAYLAND_SOCKET=999 ./clickdot
will segfault.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agowindow: improve EGL-related error messages
Pekka Paalanen [Thu, 14 Feb 2013 09:49:12 +0000 (11:49 +0200)]
window: improve EGL-related error messages

Make them explicitly mention EGL, otherwise one can easily think that
"failed to initialize display" refers to Wayland display.

Also explicitly mention falling back to wl_shm. I tested this with a
LD_PRELOAD trick that overrides eglBindAPI and makes it fail.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoconfigure.ac: Add version to bug URL as well
Kristian Høgsberg [Thu, 14 Feb 2013 17:09:41 +0000 (12:09 -0500)]
configure.ac: Add version to bug URL as well

11 years agoconfigure.ac: Change bugs.freedesktop.org product to Wayland
Scott Moreau [Wed, 13 Feb 2013 21:29:35 +0000 (14:29 -0700)]
configure.ac: Change bugs.freedesktop.org product to Wayland

Update the bug link. Thanks to Rune K. Svendsen for spotting this.

https://bugs.freedesktop.org/show_bug.cgi?id=60818

11 years agocompositor: Init fade surface color properly
Ander Conselvan de Oliveira [Wed, 13 Feb 2013 14:06:37 +0000 (16:06 +0200)]
compositor: Init fade surface color properly

When fading in, if a repaint was triggered after a call to
weston_compositor_fade() but before the first call to fade_frame(),
the fade surface wouldn't be drawn because its alpha channel wasn't
initialized properly.

11 years agoscreenshot: Print warning if we're not launched from weston
Kristian Høgsberg [Wed, 13 Feb 2013 18:40:58 +0000 (13:40 -0500)]
screenshot: Print warning if we're not launched from weston

weston-screenshooter is a helper binary that weston launches to write the
screenshot to disk.  If somebody tries to launch it by hand, print a
warning and mention the screenshot keybinding.

11 years agoxwm: Support _NET_WM_STATE_FULLSCREEN
Kristian Høgsberg [Wed, 13 Feb 2013 01:07:05 +0000 (20:07 -0500)]
xwm: Support _NET_WM_STATE_FULLSCREEN

We can now handle fullscreen X windows.  X clients request to go fullscreen
buy sending a _NET_WM_STATE client message to the root window.  When that
happens we call into the shell interface and asks the shell to make the
surface fullscreen.  The shell will then resize the window, which causes
the X wm to configure the X window appropriately.

Make sure we ignore configure requests from fullscreened clients and send out
the synthetic configure notify as required in that case.

Finally, inspect _NET_WM_STATE before mapping so we can handle initial
fullscreen correctly.

11 years agoUse __func__ in log message instead of hard coded function name
Scott Moreau [Mon, 11 Feb 2013 11:45:38 +0000 (04:45 -0700)]
Use __func__ in log message instead of hard coded function name

11 years agotests: add test for buffer release event
Pekka Paalanen [Fri, 8 Feb 2013 15:01:27 +0000 (17:01 +0200)]
tests: add test for buffer release event

Tests especially, that attach-attach-commit does not result in a release
of the first buffer.

Also tests, that the old buffer is released when a new buffer has been
attached, committed, and displayed (frame callback).

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotests: export create_shm_buffer() helper
Pekka Paalanen [Fri, 8 Feb 2013 15:01:26 +0000 (17:01 +0200)]
tests: export create_shm_buffer() helper

Lets the tests create additional buffers easily.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotests: add frame callback waiting helpers
Pekka Paalanen [Fri, 8 Feb 2013 15:01:25 +0000 (17:01 +0200)]
tests: add frame callback waiting helpers

To avoid duplicating the code for setting and waiting for a frame
callback, add helpers for it.

Convert move_client() to use the new helpers.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotests: Add XWayland test
Tiago Vignatti [Fri, 8 Feb 2013 12:57:00 +0000 (14:57 +0200)]
tests: Add XWayland test

By default enabled but one can disable it by passing --disable-xwayland-test
to the configure script. Also, the weston-tests-env script is trying to load
xwayland.so in either case, but it behaves resilient in the absence of that
meaning all the other tests are still going to be kicked for running.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
11 years agoconfigure: prevent premature HAVE_GLU check
Konno, Joe [Wed, 30 Jan 2013 15:38:57 +0000 (07:38 -0800)]
configure: prevent premature HAVE_GLU check

When cairo-gl and mesa-glu are present on the system, autoconf successfully
recognizes both. However, I was wondering why weston-screensaver was not
building since autoconf reported all dependencies were met.

Move the mesa-glu PKG_CHECK before the conditional. Additionally, remove
redundant check for enable_egl, as it is implied when GLU is 'yes.'

Signed-off-by: Joe Konno <joe.konno@intel.com>
11 years agotests: fix assignment typo, should be comparison
U. Artie Eoff [Tue, 29 Jan 2013 23:30:09 +0000 (15:30 -0800)]
tests: fix assignment typo, should be comparison

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agofbdev: Add an fbdev compositor backend using pixman and evdev
Philip Withnall [Sat, 2 Feb 2013 12:02:32 +0000 (12:02 +0000)]
fbdev: Add an fbdev compositor backend using pixman and evdev

Add a frame buffer backend using pixman to render to fbdev.
This has been tested against nouveaufb but nothing else. Much of the code
came straight from the rpi backend (and copyright has been attributed
accordingly).

The behaviour of this backend on less modern frame buffers has yet to be
tested.

The refresh rate is calculated from the frame buffer's metadata. Every frame
is finished in synchrony with the refresh rate.

Frame buffer devices are currently specified on the command line (or using
the default of /dev/fb0); udev could be used in future to enumerate them.

pixman is used for compositing, and a suitable pixman format is built from
the frame buffer's metadata. This doesn't support the full range of
frame buffer formats, but does support varying BPPs of RGBA and ARGB. That
should be enough for now.

The following are not currently supported:
 • FOURCC
 • Non-packed formats (interleaved, planes, etc.)
 • Non-true-colour formats (monochrome, greyscale, etc.)
 • Big-endian formats (with component MSBs on the right)
 • Non-RGBA and non-ARGB formats

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
11 years agoconfigure.ac: Bump git master version to 1.0.90
Kristian Høgsberg [Sat, 2 Feb 2013 15:32:25 +0000 (10:32 -0500)]
configure.ac: Bump git master version to 1.0.90

We use 1.0.90 as the version number for the git master code.  This way it's
always newer than any stable version.

11 years agoAdd --version option
Scott Moreau [Wed, 29 Aug 2012 21:15:58 +0000 (15:15 -0600)]
Add --version option

11 years agocompositor-drm: Use matrix type to test for drm plane compatibility
Kristian Høgsberg [Tue, 29 Jan 2013 21:56:15 +0000 (16:56 -0500)]
compositor-drm: Use matrix type to test for drm plane compatibility

The drm planes (sprites) only support translation and scaling.  Now that
we have matrix.type, we can just look there to see if the transform is
compatible with kms.

11 years agoweston-launch: Clear environment and set it up from scratch
Kristian Høgsberg [Tue, 29 Jan 2013 19:14:06 +0000 (14:14 -0500)]
weston-launch: Clear environment and set it up from scratch

With recent systemd[1] XDG_VTNR will leak through to pam, which ends up
setting a vtnr pam argument with the wrong value.  The fix is to clear
XDG_VTNR first, but what we should have been doing all along is resetting
the environment.

Thanks to Ray Strode for helping debug this.

[1] http://cgit.freedesktop.org/systemd/systemd/commit/?id=a8573ccc35a4efe8900be5d48c6c803670540c2b

11 years agoshell: Whitespaces cleanup
Quentin Glidic [Tue, 29 Jan 2013 13:16:13 +0000 (14:16 +0100)]
shell: Whitespaces cleanup

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
11 years agopixman renderer: respect output position
Vasily Khoruzhick [Tue, 29 Jan 2013 11:58:14 +0000 (14:58 +0300)]
pixman renderer: respect output position

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agopixman-renderer: handle surface transform matrix properly
Vasily Khoruzhick [Mon, 28 Jan 2013 19:40:29 +0000 (22:40 +0300)]
pixman-renderer: handle surface transform matrix properly

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agomatrix: track transform type
Vasily Khoruzhick [Mon, 28 Jan 2013 19:40:28 +0000 (22:40 +0300)]
matrix: track transform type

Introduce several matrix transform types and track type for matrix.
Could be usefull for activating some fastpath that depends on some
transform type.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agotoytoolkit: Remove left-over pixman dependency
Kristian Høgsberg [Mon, 28 Jan 2013 21:03:51 +0000 (16:03 -0500)]
toytoolkit: Remove left-over pixman dependency

toytoolkit doesn't use pixman.  Remove the pixman.h include and the
LDADD.

https://bugs.freedesktop.org/show_bug.cgi?id=57812

11 years agoAdd new shared/image-loader.h to separate include dependencies
Kristian Høgsberg [Mon, 28 Jan 2013 21:01:22 +0000 (16:01 -0500)]
Add new shared/image-loader.h to separate include dependencies

Before, cairo-util.h would combine pixman and cairo includes.  X11 and
Wayland compositors uses this to load an image as a pixman_image_t but are
forced to include cairo headers.  Clients use load_cairo_surface to
load images as cairo_surface_t's, but are forced to include pixman.h.

We move the load_image pixman prototype to its own header, so compositors
can get at the pixman prototype without including cairo.h and clients
can include the cairo based function without including pixman.h.

11 years agoclients: Make libtoytoolkit a libtool library
Kristian Høgsberg [Mon, 28 Jan 2013 20:35:03 +0000 (15:35 -0500)]
clients: Make libtoytoolkit a libtool library

This way libtool will remember the libtoytoolkit LIBADD libraries.
We can drop the toolkit_libs hack and just link to libtoytoolkit.la and
libtool will add the dependencies.

11 years agoterminal: Handle the window close event
Dima Ryazanov [Mon, 28 Jan 2013 09:11:06 +0000 (01:11 -0800)]
terminal: Handle the window close event

There may be multiple windows open, so destroy the terminal instead of exiting.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
11 years agopixman-renderer: Don't unreference NULL hw_buffer image
Ander Conselvan de Oliveira [Fri, 25 Jan 2013 13:13:06 +0000 (15:13 +0200)]
pixman-renderer: Don't unreference NULL hw_buffer image

If the buffer for an output was never set, or was reset to NULL at some
point, destroying the renderer output private would cause a crash.

11 years agocompositor-drm: Add support for using the pixman renderer
Ander Conselvan de Oliveira [Fri, 25 Jan 2013 13:13:05 +0000 (15:13 +0200)]
compositor-drm: Add support for using the pixman renderer

If --use-pixman is passed as command line option to weston, the drm
backend will use the pixman renderer instead of the gl one.

11 years agocompositor-drm: Support creating drm_fb backed by dumb buffers
Ander Conselvan de Oliveira [Fri, 25 Jan 2013 13:13:04 +0000 (15:13 +0200)]
compositor-drm: Support creating drm_fb backed by dumb buffers

11 years agocompositor-drm: Put logic of destroy/releasing bo's in its own function
Ander Conselvan de Oliveira [Fri, 25 Jan 2013 13:13:03 +0000 (15:13 +0200)]
compositor-drm: Put logic of destroy/releasing bo's in its own function

We have this duplicated in a few places.

11 years agocompositor-drm: Split kms initialization out of init_egl()
Ander Conselvan de Oliveira [Fri, 25 Jan 2013 13:13:02 +0000 (15:13 +0200)]
compositor-drm: Split kms initialization out of init_egl()

11 years agopixman-renderer: Move shadow buffer into renderer
Ander Conselvan de Oliveira [Fri, 25 Jan 2013 13:13:01 +0000 (15:13 +0200)]
pixman-renderer: Move shadow buffer into renderer

The X11 backend uses a shadow buffer to be able to support transformed
outputs. However, this belongs in the renderer, since otherwise this
code would have to be copied into every backend that uses the pixman
renderer and supports transformed outputs.

11 years agopixman-renderer: Add repaint debugging feature
Ander Conselvan de Oliveira [Fri, 25 Jan 2013 13:13:00 +0000 (15:13 +0200)]
pixman-renderer: Add repaint debugging feature

Add 'R' as a debug shortcut that highlights repainted regions.

11 years agoWeston: weston.ini.man page
Martin Minarik [Fri, 18 Jan 2013 17:44:29 +0000 (18:44 +0100)]
Weston: weston.ini.man page

changes:
 - launcher path, passing environment variables and parameter
 - indent modeline example

11 years agoclients: add global_remove handler stubs
Pekka Paalanen [Tue, 22 Jan 2013 12:53:55 +0000 (14:53 +0200)]
clients: add global_remove handler stubs

All the clients here were missing the global_remove handler. Because
window.c did not have it, weston-desktop-shell and weston-keyboard
segfaulted on compositor exit, as they received some
wl_registry.global_remove events.

Add more or less stub global_remove handlers, so that clients do not
crash on such events. Toytoolkit and all applications would need a lot
more code to properly handle the global object removal.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoweston-launch: Use "weston-launch" for --help instead of "weston".
Scott Moreau [Tue, 22 Jan 2013 06:40:59 +0000 (23:40 -0700)]
weston-launch: Use "weston-launch" for --help instead of "weston".

The output of weston-launch --help was "Usage: weston [args...] ...".
This changes it to read "Usage: weston-launch [args...] ...".

11 years agoconfigure: remove C++ support
Pekka Paalanen [Fri, 18 Jan 2013 10:11:10 +0000 (12:11 +0200)]
configure: remove C++ support

With the Android backend gone, there is no C++ code anymore. Remove
support for C++ in the build.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agocompositor: remove android backend
Pekka Paalanen [Fri, 18 Jan 2013 10:11:09 +0000 (12:11 +0200)]
compositor: remove android backend

The Android backend has been fairly unused, since we do not have
projects actively using it. It gets basic build testing as part of the
normal build, but runtime testing it takes a considerable effort, and so
I have not done that in a long time. The code is slowly rotting, and
with new emerging backends it starts to be a burden, since it cannot use
udev, but needs evdev.

Therefore to ease Weston going forward, remove the Android backend. If
someone misses it, it can still be found in the stable 1.0 branch, and
of course resurrected from git history if someone wants to put in the
effort and maintain it.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotests: make signal other than ABRT a hard failure
Pekka Paalanen [Tue, 18 Dec 2012 15:30:16 +0000 (17:30 +0200)]
tests: make signal other than ABRT a hard failure

We handle FAIL_TEST tests by simply inverting the success flag. The
problem with this is, that if a FAIL_TEST fails by a SIGSEGV, it will be
interpreted as passed. However, no code should ever cause a SEGV, or any
other signal than ABRT. And even ABRT only in the case of an assert()
that is meant to fail. We would probably need more sophistication for the
FAIL_TEST cases.

For now, just interpret any other signal than ABRT as a hard failure,
regardless whether it is a TEST or FAIL_TEST. At least segfaults do not
cause false passes anymore.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoshell: remove remnants of screensaver surface list
Pekka Paalanen [Thu, 20 Dec 2012 12:02:13 +0000 (14:02 +0200)]
shell: remove remnants of screensaver surface list

The list became stale probably when the lock_layer was introduced. Now
one less (ab)user of weston_surface::link.

Also add a comment on screensaver_configure(), that it is (and has been)
broken for pre-started screensavers.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agogl-renderer: make EGL typedefs similar to EGL/egl.h when building without EGL support
Vasily Khoruzhick [Fri, 11 Jan 2013 10:50:45 +0000 (13:50 +0300)]
gl-renderer: make EGL typedefs similar to EGL/egl.h when building without EGL support

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agoshell: Don't lower fullscreen layer on activate
Jonas Ådahl [Tue, 15 Jan 2013 20:25:56 +0000 (21:25 +0100)]
shell: Don't lower fullscreen layer on activate

To be able to have a fullscreen surface on one output, and interact with
surfaces on another output, don't lower the fullscreen layer on
activate.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoshell: Set input region of the black fullscreen surface
Jonas Ådahl [Tue, 15 Jan 2013 20:25:55 +0000 (21:25 +0100)]
shell: Set input region of the black fullscreen surface

The input region of the black surface placed under the fullscreen shell
surface did not have a specified input region. Because the initial input
region of a surface is infinity, no other surface on any other output
could get any focus.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
11 years agoxwayland/window-manager: Avoid doing work for unknown window
Rob Bradford [Thu, 10 Jan 2013 19:48:57 +0000 (19:48 +0000)]
xwayland/window-manager: Avoid doing work for unknown window

In particular if the hash table lookup fails and returns NULL then that value
would be passed into weston_wm_window_schedule_repaint which does not accept a
NULL value.

11 years agobacklight: Avoid passing an invalid fd into close()
Rob Bradford [Thu, 10 Jan 2013 19:48:56 +0000 (19:48 +0000)]
backlight: Avoid passing an invalid fd into close()

11 years agoimage: Free allocated memory on error path
Rob Bradford [Thu, 10 Jan 2013 19:48:55 +0000 (19:48 +0000)]
image: Free allocated memory on error path

11 years agowindow: Free allocated memory on error path
Rob Bradford [Thu, 10 Jan 2013 19:48:54 +0000 (19:48 +0000)]
window: Free allocated memory on error path

11 years agotests/setbacklight: Close filedescriptor on return paths
Rob Bradford [Thu, 10 Jan 2013 19:48:53 +0000 (19:48 +0000)]
tests/setbacklight: Close filedescriptor on return paths

11 years agoscreenshooter: Free allocated memory where missing from some return paths
Rob Bradford [Thu, 10 Jan 2013 19:48:52 +0000 (19:48 +0000)]
screenshooter: Free allocated memory where missing from some return paths

11 years agogl: fix read-back format reporting in the log
Pekka Paalanen [Thu, 10 Jan 2013 14:50:42 +0000 (16:50 +0200)]
gl: fix read-back format reporting in the log

weston_compositor::read_format is in Pixman values now, so comparing to
a GL value does not work. Compare to the right value.

This fix affects only the log output of the GL renderer.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoconfigure.ac: Indent --disable-egl option correctly
Kristian Høgsberg [Wed, 9 Jan 2013 18:36:39 +0000 (13:36 -0500)]
configure.ac: Indent --disable-egl option correctly

11 years agoMake EGL/GLESv2 dependencies optional
Vasily Khoruzhick [Tue, 8 Jan 2013 16:09:02 +0000 (19:09 +0300)]
Make EGL/GLESv2 dependencies optional

Introduce --disable-egl switch for configure to disable
EGL/GLESv2 support.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agorenderer: introduce destroy callback
Vasily Khoruzhick [Tue, 8 Jan 2013 16:09:01 +0000 (19:09 +0300)]
renderer: introduce destroy callback

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agoAdd missing pixman-renderer.h to Makefile.am
Vasily Khoruzhick [Tue, 8 Jan 2013 16:09:00 +0000 (19:09 +0300)]
Add missing pixman-renderer.h to Makefile.am

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agoDocument --use-pixman option
Kristian Høgsberg [Mon, 7 Jan 2013 20:52:44 +0000 (15:52 -0500)]
Document --use-pixman option

11 years agowindow: Fall back to cairo image when cairo EGL isn't available
Kristian Høgsberg [Mon, 7 Jan 2013 20:47:14 +0000 (15:47 -0500)]
window: Fall back to cairo image when cairo EGL isn't available

11 years agocompositor-x11: rename use-shm to use-pixman
Vasily Khoruzhick [Mon, 7 Jan 2013 19:36:02 +0000 (22:36 +0300)]
compositor-x11: rename use-shm to use-pixman

So it could be reused with other backends and not be easily confused
with wl_shm

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agox11 backend: add option to use pixman renderer
Vasily Khoruzhick [Mon, 7 Jan 2013 17:39:50 +0000 (20:39 +0300)]
x11 backend: add option to use pixman renderer

When --use-shm is passed to weston and x11 backend is active,
it will use SHM surfaces with pixman renderer instead of EGL

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agoImplement pixman renderer
Vasily Khoruzhick [Mon, 7 Jan 2013 17:39:49 +0000 (20:39 +0300)]
Implement pixman renderer

This renderer could be used when there's no graphic accelerator available,
for example in (future) KMS and fbdev backends.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agoscreenshoter: add cases for x8r8g8b8 and x8b8g8r8 formats
Vasily Khoruzhick [Sun, 6 Jan 2013 09:12:41 +0000 (12:12 +0300)]
screenshoter: add cases for x8r8g8b8 and x8b8g8r8 formats

These formats are used by pixman renderer for framebuffer surface, without
this patch screenshoter produces empty image.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agoscreenshoter: don't use hardcoded bpp value
Vasily Khoruzhick [Sun, 6 Jan 2013 09:12:40 +0000 (12:12 +0300)]
screenshoter: don't use hardcoded bpp value

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
11 years agotests: Pass --backend so the test suite runs with the right modules
Kristian Høgsberg [Fri, 14 Dec 2012 21:19:43 +0000 (16:19 -0500)]
tests: Pass --backend so the test suite runs with the right modules

Without this we try to load the installed backends, which is nasty for
regular runs, and just doesn't work for make distcheck, which sets
prefix to $PWD/_inst.  This makes sure we load the right backend
and make distcheck pass.  Other modules (xwayland, shells etc) just don't
get loaded for distcheck and for make check we still try to load the
installed modules.

11 years agocompositor-drm: Reduce code duplication on drm_output_switch_mode()
Ander Conselvan de Oliveira [Fri, 14 Dec 2012 15:37:30 +0000 (13:37 -0200)]
compositor-drm: Reduce code duplication on drm_output_switch_mode()

Call drm_output_init_egl() instead of duplicating the gbm surface and
gl renderer state initialization code.

Note that this makes error handling a bit worse. Before, if we failed
to allocate a gbm surface we could still recover. Failing the renderer
state creation would lead to inconsisten state. Now we end up in
inconsistent state on both cases.

11 years agocompositor-drm: Move output gl state initialization to own function
Ander Conselvan de Oliveira [Fri, 14 Dec 2012 15:37:29 +0000 (13:37 -0200)]
compositor-drm: Move output gl state initialization to own function

11 years agocompositor-drm: Don't do a mode set on drm_output_switch_mode()
Ander Conselvan de Oliveira [Fri, 14 Dec 2012 15:37:28 +0000 (13:37 -0200)]
compositor-drm: Don't do a mode set on drm_output_switch_mode()

At this point, we reallocated the gbm surface, but we don't have an
fb with the right size to use. If we're going to a larger mode, the fb
would be too small and the mode set would fail. Besides, the repaint
logic will already do a mode set if necessary, so rely on that instead.

11 years agocompositor-drm: Fix a return value check in drm_output_switch_mode()
Ander Conselvan de Oliveira [Fri, 14 Dec 2012 15:37:27 +0000 (13:37 -0200)]
compositor-drm: Fix a return value check in drm_output_switch_mode()

gl_rederer_output_create() returns 0 on success, but drm compositor
would consider this a failure.

11 years agocompositor: Don't let pointers get outside of an output on mode switch
Ander Conselvan de Oliveira [Fri, 14 Dec 2012 15:37:26 +0000 (13:37 -0200)]
compositor: Don't let pointers get outside of an output on mode switch

When an output suffers a mode switch, it is possible that a pointer
was inside the old output area but falls outside of it with the new
size. In that case, move the cursor to the output's bottom-right
corner. Otherwise, there's a crash in clip_pointer_motion().

11 years agocompositor: Update output state after mode switch
Ander Conselvan de Oliveira [Fri, 14 Dec 2012 15:37:25 +0000 (13:37 -0200)]
compositor: Update output state after mode switch

After a mode switch, the output region and transformation matrix need
to be updated. The call to weston_output_move() would do the former but
not the latter, but calling that when the output remains in the same
coordinate doesn't make much sense. Instead, update this state and the
transformation matrix in weston_output_mode_switch().

11 years agotransformed: Add options for using debuging driver fullscreen method
Ander Conselvan de Oliveira [Fri, 14 Dec 2012 15:37:24 +0000 (13:37 -0200)]
transformed: Add options for using debuging driver fullscreen method

Add options for setting width, height and using the driver fullscreen
method.

11 years agowindow: Allow clients to choose the fullscreen method
Ander Conselvan de Oliveira [Fri, 14 Dec 2012 15:37:23 +0000 (13:37 -0200)]
window: Allow clients to choose the fullscreen method

11 years agoclients: Add screenshooter-client-protocol.h to screenshooter sources
Kristian Høgsberg [Fri, 14 Dec 2012 15:18:39 +0000 (10:18 -0500)]
clients: Add screenshooter-client-protocol.h to screenshooter sources

11 years agotests: remove test logs on 'make clean'
Pekka Paalanen [Thu, 13 Dec 2012 08:01:25 +0000 (10:01 +0200)]
tests: remove test logs on 'make clean'

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotests: check wl_display_roundtrip() for errors
Pekka Paalanen [Wed, 12 Dec 2012 12:26:41 +0000 (14:26 +0200)]
tests: check wl_display_roundtrip() for errors

Add a macro that wraps wl_display_roundtrip() and check for errors. It
is a macro, so that the assert would show the relevant file and line
number.

This will also catch protocol errors, that would go unnoticed otherwise.

All roundtrips in tests are replaced with the check.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotests: set client log handler
Pekka Paalanen [Wed, 12 Dec 2012 12:26:40 +0000 (14:26 +0200)]
tests: set client log handler

Otherwise we cannot normally see protocol errors etc. in the test
output.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agoupdate git ignores
Pekka Paalanen [Wed, 12 Dec 2012 12:26:39 +0000 (14:26 +0200)]
update git ignores

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
11 years agotests: write logs to files
Pekka Paalanen [Wed, 12 Dec 2012 12:26:38 +0000 (14:26 +0200)]
tests: write logs to files

This cleans up the 'make check' output considerably. When all goes well,
you will only see the "PASS" line for each of $TESTS.

Weston logs into a separate file than stdout and stderr, so server logs
end up in one file per test, and other output to another file per test.

'make distclean' does not remove the tests/logs/ directory.

Also changes the weston-tests-env interpreter to bash, since I think &>
and ${1/.la/.so} might be bashisms.

11 years agotests: Convert remaining module tests to not use test-runner.c
Kristian Høgsberg [Wed, 12 Dec 2012 04:22:16 +0000 (23:22 -0500)]
tests: Convert remaining module tests to not use test-runner.c

The remaining module tests don't need to fork and talk to a test client,
so just convert them to regular modules and let them handle running their
tests themselves.  Then drop test-runner.[ch].

11 years agotests: Remove client-test test
Kristian Høgsberg [Wed, 12 Dec 2012 04:16:11 +0000 (23:16 -0500)]
tests: Remove client-test test

This test case is the last user of the test-client code and it only
tests launching the test-client.  In other words it's a minimal test
of the framework we're dropping, so just drop this test.

11 years agotests: Port text-test to new test framework
Kristian Høgsberg [Wed, 12 Dec 2012 04:03:56 +0000 (23:03 -0500)]
tests: Port text-test to new test framework

So much simpler this way and the test suite is now back too 100% pass.

11 years agotests: Drop yield() helper function
Kristian Høgsberg [Wed, 12 Dec 2012 03:17:35 +0000 (22:17 -0500)]
tests: Drop yield() helper function

Remaining use case was when we move the pointer.  This doesn't change
geometry so we can just use a wl_display_roundtrip() to make sure
we get the request to the server and receive the resulting events.

11 years agokeyboard-test: Use wl_display_roundtrip() instead of yield()
Kristian Høgsberg [Wed, 12 Dec 2012 03:00:50 +0000 (22:00 -0500)]
keyboard-test: Use wl_display_roundtrip() instead of yield()

As for button-test, a wl_display_roundtrip is sufficient here.  The
yield() between wl_test_activate_surface() and wl_test_send_key() is
also not needed, since the two requests will arrive at the server in
order, and will activate the surface first, then send a key event.

11 years agobutton-test: Use wl_display_roundtrip instead of yield()
Kristian Høgsberg [Wed, 12 Dec 2012 02:56:13 +0000 (21:56 -0500)]
button-test: Use wl_display_roundtrip instead of yield()

A round trip is sufficient here.  We need to make sure that the server
has received the wl_test request and that we've received the event
that the request triggers.  The wl_display_roundtrip() helper does
exactly that: it sends a wl_display.sync request, which will hit the
server after the wl_test requests and thus the wl_callback.done event
will come back after the server has seen all the previous requests and
after we've handled all preceeding event.

11 years agoweston-test-client-helper: Use a frame callback to flush surface geometry
Kristian Høgsberg [Wed, 12 Dec 2012 02:49:13 +0000 (21:49 -0500)]
weston-test-client-helper: Use a frame callback to flush surface geometry

When moving a test surface, use a frame callback to make sure the
surface has been moved and the geometry updated.  The compositor may
delay updating the transform matrices, but once we get the frame
callback we know the surface has been repainted and the geometry
updated.

11 years agotests: Convert button-test to new test extension
U. Artie Eoff [Fri, 7 Dec 2012 21:50:34 +0000 (13:50 -0800)]
tests: Convert button-test to new test extension

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56821

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agotests: Convert event-test to new test extension
U. Artie Eoff [Fri, 7 Dec 2012 21:50:33 +0000 (13:50 -0800)]
tests: Convert event-test to new test extension

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56819

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agotests: Convert keyboard-test to new test extension
U. Artie Eoff [Fri, 7 Dec 2012 21:50:32 +0000 (13:50 -0800)]
tests: Convert keyboard-test to new test extension

This adds a weston-test-runner for the weston test extension and
some weston test client helper methods.

Converted keyboard-test to use the new test interface, runner,
and helper methods.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56822

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agotests: Allow weston-tests-env to process different test types
U. Artie Eoff [Fri, 7 Dec 2012 21:50:31 +0000 (13:50 -0800)]
tests: Allow weston-tests-env to process different test types

The weston-tests-env script needs to be able to handle weston
test extension style tests as well as module style tests.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agotests: Rename weston-test to weston-tests-env
U. Artie Eoff [Fri, 7 Dec 2012 21:50:30 +0000 (13:50 -0800)]
tests: Rename weston-test to weston-tests-env

Renamed weston-test test environment script to weston-tests-env
to avoid ambiguity with weston-test.c (the weston test extension).

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agotests: Define and implement a test protocol extension.
U. Artie Eoff [Fri, 7 Dec 2012 21:50:29 +0000 (13:50 -0800)]
tests: Define and implement a test protocol extension.

The weston test extension, called weston-test.so, can be loaded
from the "modules" configuration option on the command line
or in the .ini file.

Clients can bind to the "wl_test" interface to interact with
the weston test extension.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
11 years agosimple-egl: Remove old obsolete fbo and color_rbo fields
Kristian Høgsberg [Tue, 11 Dec 2012 20:23:14 +0000 (15:23 -0500)]
simple-egl: Remove old obsolete fbo and color_rbo fields

Finally a commit that actually makes simple-egl simpler.

11 years agoLink matrix.c into weston again
Kristian Høgsberg [Fri, 7 Dec 2012 20:00:32 +0000 (15:00 -0500)]
Link matrix.c into weston again

We want to make sure that the matrix symbols are exported from weston and
that modules get them from there.  To do that, we pull matrix.[ch] out of
libshared and back into weston.  calibrator now also links to matrix.[ch]
and we add a IN_WESTON define to enable the WL_EXPORT macro when compiled
inside weston.

11 years agocompositor-drm: Dont pass ARGB format to addfb2 for primary fbs
Kristian Høgsberg [Fri, 7 Dec 2012 17:37:58 +0000 (12:37 -0500)]
compositor-drm: Dont pass ARGB format to addfb2 for primary fbs

Trying to create a ARGB framebuffer for scanout results in EINVAL when
trying to queue the pageflip.  This patch overrides the format we pass
to addfb2 in case of primary buffers like we do for sprites.

Since we always have to inspect and override the format, don't try to
look up the format in drm_fb_get_from_bo().  Instead return format from
drm_output_check_scanout_format().

Rename drm_surface_format_supported() to drm_output_check_sprite_format()
and make it follow the same convention.

We started scanning out ARGB surfaces in commit e920941032979d.

11 years agocompositor-drm: Use overlays for ARGB surfaces if they are opaque
Ander Conselvan de Oliveira [Fri, 7 Dec 2012 11:18:11 +0000 (13:18 +0200)]
compositor-drm: Use overlays for ARGB surfaces if they are opaque

Since the call to drmModeSetPlane() fails with EINVAL if the supplied
fb has an unsupported format (which is the case of ARGB8888), the fb
format needs to be overridden.

11 years agoshell: Remove confusing case fall-through
Rob Bradford [Thu, 6 Dec 2012 12:07:48 +0000 (12:07 +0000)]
shell: Remove confusing case fall-through

This avoids calling weston_surface_set_position twice on the same surface. The
second call has no effect in many cases because sx and sy
are usually zero on this path.

This change now means that any sx/sy values passed into ::attach will be
ignored on the first attach for popup surfaces. This similar to the behaviour
for other surface types.

11 years agoweston-launch: Add some error reporting for weston-launch
Rob Bradford [Wed, 5 Dec 2012 18:47:11 +0000 (18:47 +0000)]
weston-launch: Add some error reporting for weston-launch

This also avoids us passing (size_t)(-1 * sizeof(gid_t)) into malloc

11 years agocompositor: Cleanup if we can't find the symbol in the module
Rob Bradford [Wed, 5 Dec 2012 18:47:10 +0000 (18:47 +0000)]
compositor: Cleanup if we can't find the symbol in the module