[PATCH 3/3] screenshooter: Scale damage by output scale in screen recorder

2013-05-29 Thread alexl
From: Alexander Larsson 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. --- src/screenshooter.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/screenshooter.c b/src/screenshooter.c index d088cf7..8

[PATCH 2/3] pixman-renderer: Fix read_pixels for screen recorder

2013-05-29 Thread alexl
From: Alexander Larsson 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, suc

[PATCH 1/3] screenshoter: Make recorder handle PIXMAN_x8r8g8b8

2013-05-29 Thread alexl
From: Alexander Larsson This is what the pixman renderer reports for the read format. --- src/screenshooter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/screenshooter.c b/src/screenshooter.c index dde052f..d088cf7 100644 --- a/src/screenshooter.c +++ b/src/screenshooter.c @@ -465,6

[PATCH 0/3] Fix screenshooter/recorder for scale

2013-05-29 Thread alexl
From: Alexander Larsson The actual fix for output scale is trivial, but I needed two fixes to get screenshooting to work with the pixman renderer. Alexander Larsson (3): screenshoter: Make recorder handle PIXMAN_x8r8g8b8 pixman-renderer: Fix read_pixels for screen recorder screenshooter: S

[PATCH] compositor-drm: Handle cursors on scaled screens

2013-05-28 Thread alexl
From: Alexander Larsson We fall back to not using the drm cursor any time the scale differs, or the scaled size is to large. --- src/compositor-drm.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 4222e57..a87cbc3 100

[PATCH 9/9] shell: Center window in fullscreen if needed

2013-05-28 Thread alexl
From: Alexander Larsson If modeset fails With DRIVER method, and always with FILL method we want to center the window. --- src/shell.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shell.c b/src/shell.c index eac8471..ebeef55 100644 --- a/src/shell.c +++ b/src/shell

[PATCH 7/9] shell: Use buffer_scale as output scale on fullscreen DRIVER

2013-05-28 Thread alexl
From: Alexander Larsson 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

[PATCH 8/9] shell: Always go to original mode when focused window not fullscreen

2013-05-28 Thread alexl
From: Alexander Larsson 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 no

[PATCH 5/9] compositor: Store modes in physical units

2013-05-28 Thread alexl
From: Alexander Larsson 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. --- src/compositor-drm.c | 37 +--

[PATCH 6/9] compositor: Store original output scale

2013-05-28 Thread alexl
From: Alexander Larsson We want this so we can restore the original mode with the original size (after having been fullscreen). --- src/compositor.c | 1 + src/compositor.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/compositor.c b/src/compositor.c index 79acc76..8f82ba6 100644 ---

[PATCH 4/9] compositor-x11: Set original mode after current

2013-05-28 Thread alexl
From: Alexander Larsson Otherwise we're pointing the original mode on some uninitialized value. --- src/compositor-x11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compositor-x11.c b/src/compositor-x11.c index 279f1b3..ba6d053 100644 --- a/src/compositor-x11.c +++ b/

[PATCH 3/9] fullscreen: Add fullscreen testing client

2013-05-28 Thread alexl
From: Alexander Larsson 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). --- clients/Makefile.am | 4 + clients/fullscreen.c | 356 +++

[PATCH 2/9] input: Fix possible crash in clip_pointer_motion

2013-05-28 Thread alexl
From: Alexander Larsson 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. --- src/input.c | 2 +- 1 fi

[PATCH 1/9] shell: Position DRIVER fullscreen surfaces at origin

2013-05-28 Thread alexl
From: Alexander Larsson 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. --- src/shell.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shell.c b/src/s

[PATCH 0/9] Update weston to the change in how modes work

2013-05-28 Thread alexl
From: Alexander Larsson This series updates weston wrt the protocol changes in: http://lists.freedesktop.org/archives/wayland-devel/2013-May/009498.html It also has a test client and some general fullscreen bugfixes. Alexander Larsson (9): shell: Position DRIVER fullscreen surfaces at origin

[PATCH] protocol: Modes are specified in HW pixels

2013-05-28 Thread alexl
From: Alexander Larsson Modes are mainly meant to be used in coordination with fullscreen in DRIVER mode, by e.g. games. For such games what they generally want is to match some hardware mode and resize their window for that. We don't really need to complicate this with the scaling. So, we keep t

[PATCH] Convert all scales to int32_t

2013-05-24 Thread alexl
From: Alexander Larsson The type changed in the protocol, so update weston for this. --- clients/desktop-shell.c | 2 +- clients/window.c| 24 clients/window.h| 2 +- src/compositor-x11.c| 4 ++-- src/compositor.c| 12 ++-- src/comp

[PATCH] protocol: Use signed int for scale values

2013-05-24 Thread alexl
From: Alexander Larsson We usually use signed ints for things like this, to avoid issues C sign coersion. --- protocol/wayland.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index acfb140..0c7c053 100644 --- a/protocol/wayl

[PATCH] window: Bind to version 3 of compositor

2013-05-24 Thread alexl
From: Alexander Larsson We need version 3 of the compositor to get version 3 of wl_surface which has set_buffer_transform and set_buffer_scale. --- clients/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/window.c b/clients/window.c index b2e1af7..8e49f22 1006

[PATCH 2/2] wayland-server: Version check requests

2013-05-24 Thread alexl
From: Alexander Larsson If an interface has any messages and its version is larger than 1 then we emit a method counts array which lists the number of methods for each version of the interface. This can be used in addition to the normal method_count to reject requests that the server doesn't supp

[PATCH 1/2] wl_resource: Add version field and getter/setter

2013-05-24 Thread alexl
From: Alexander Larsson We create a private structure for extra data and store it in a destroy notifier. In this way we can store the version in a backwards compatible way. This lets us track the actual version of a resource which is generally the min of what the client requested and what the se

[PATCH 0/2] resource versioning V3

2013-05-24 Thread alexl
From: Alexander Larsson New in this version: * We look up the private with wl_signal_get * Fixed off-by-one error in method_counts array lookup (version 1 is at offset 0) Alexander Larsson (2): wl_resource: Add version field and getter/setter wayland-server: Version check requests src/sc

[PATCH] wayland-server: Version check requests

2013-05-23 Thread alexl
From: Alexander Larsson If an interface has any messages and its version is larger than 1 then we emit a method counts array which lists the number of methods for each version of the interface. This can be used in addition to the normal method_count to reject requests that the server doesn't supp

[PATCH 2/2] compositor/shell: Set version on all wl_resources

2013-05-23 Thread alexl
From: Alexander Larsson A few wl_resources have version != 1, we need to set this based on the supported version and the client requested version. --- src/compositor.c | 22 -- src/shell.c | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/compos

[PATCH 1/2] Add MIN() macro

2013-05-23 Thread alexl
From: Alexander Larsson This will be needed for the version negotiation --- src/compositor.h | 4 1 file changed, 4 insertions(+) diff --git a/src/compositor.h b/src/compositor.h index 06476cc..8f96016 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -36,6 +36,10 @@ extern "C" { #i

[PATCH 0/2] Do proper version negotiation V2

2013-05-23 Thread alexl
From: Alexander Larsson This initializes the new version field of wl_resource to the negotiated value (i.e. the min of the requested version and the version supported by weston). Alexander Larsson (2): Add MIN() macro compositor/shell: Set version on all wl_resources src/compositor.c | 22

[PATCH] wl_resource: Add version field and getter/setter

2013-05-23 Thread alexl
From: Alexander Larsson We create a private structure for extra data and store it in a destroy notifier. In this way we can store the version in a backwards compatible way. This lets us track the actual version of a resource which is generally the min of what the client requested and what the se

[PATCH] Add version support to wl_resource

2013-05-23 Thread alexl
From: Alexander Larsson New simpler version that uses a destroy notify to stash away the private pointer. Alexander Larsson (1): wl_resource: Add version field and getter/setter src/wayland-server.c | 58 +++- src/wayland-server.h | 6 ++

[PATCH 3/3] compositor/shell: Set version on all wl_resources

2013-05-23 Thread alexl
From: Alexander Larsson A few wl_resources have version != 1, we need to set this based on the supported version and the client requested version. --- src/compositor.c | 22 -- src/shell.c | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/compos

[PATCH 2/3] Add MIN() macro

2013-05-23 Thread alexl
From: Alexander Larsson This will be needed for the version negotiation --- src/compositor.h | 4 1 file changed, 4 insertions(+) diff --git a/src/compositor.h b/src/compositor.h index 176b501..5ddbc95 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -36,6 +36,10 @@ extern "C" { #i

[PATCH 1/3] Update wl_resource.link to wl_slist due to wayland change

2013-05-23 Thread alexl
From: Alexander Larsson --- src/compositor.c | 12 ++- src/compositor.h | 12 +-- src/data-device.c | 10 + src/input.c | 62 +++ src/shell.c | 10 + 5 files changed, 69 insertions(+), 37 deletions(

[PATCH 0/3] Do proper version negotiation

2013-05-23 Thread alexl
From: Alexander Larsson This initializes the new version field of wl_resource to the negotiated value (i.e. the min of the requested version and the version supported by weston). Alexander Larsson (3): Update wl_resource.link to wl_slist due to wayland change Add MIN() macro compositor/she

[PATCH 4/4] wl_resource: Add version field and getter/setter

2013-05-23 Thread alexl
From: Alexander Larsson This lets us track the actual version of a resource which is generally the min of what the client requested and what the server supports. This will let us avoid sending messages the client doesn't support and to not handle requests the server doesn't support. --- src/wayl

[PATCH 3/4] wl_resource: Add a private field to wl_resource

2013-05-23 Thread alexl
From: Alexander Larsson This takes the place of the second pointer in the old wl_list and lets us add more fields to wl_resource in a backwards compat fashion. --- src/wayland-private.h | 4 src/wayland-server.c | 17 - src/wayland-server.h | 4 +++- 3 files changed, 23

[PATCH 2/4] Convert wl_resource.link to a wl_slink

2013-05-23 Thread alexl
From: Alexander Larsson This lets us free up an extra pointer in wl_resource for other use. --- src/wayland-server.c | 17 ++--- src/wayland-server.h | 3 ++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/wayland-server.c b/src/wayland-server.c index a3d3887..f

[PATCH 1/4] Add single linked lists wl_slist similar to wl_list

2013-05-23 Thread alexl
From: Alexander Larsson --- src/wayland-util.c | 66 ++ src/wayland-util.h | 24 2 files changed, 90 insertions(+) diff --git a/src/wayland-util.c b/src/wayland-util.c index 598ab42..c774a7e 100644 --- a/src/wayland-util.c

[PATCH 0/4] Add version support to wl_resource

2013-05-23 Thread alexl
From: Alexander Larsson Unfortunately there seems to be no easy way to add a version field to wl_resource in a compatible way, even if we are willing to break the server library API for compositors, as the wl_resource struct is embedded in a struct in the EGL code in mesa. Here is a version that

[PATCH 15/15] compositor-drm: Support output scaling

2013-05-22 Thread alexl
From: Alexander Larsson 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. --- src/compositor-drm.c | 87 +++---

[PATCH 14/15] compositor-x11: Only repaint the damaged region

2013-05-22 Thread alexl
From: Alexander Larsson Set a clip on the GC when painting the damaged region so that we don't copy the entire shadow buffer each time. --- src/compositor-x11.c | 106 +++ 1 file changed, 106 insertions(+) diff --git a/src/compositor-x11.c b/src/c

[PATCH 13/15] compositor: Support output/buffer scaling

2013-05-22 Thread alexl
From: Alexander Larsson 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

[PATCH 12/15] pixman-renderer: Fix up transform handling

2013-05-22 Thread alexl
From: Alexander Larsson 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.

[PATCH 11/15] transformed: Add keyboard shortcuts to change transform

2013-05-22 Thread alexl
From: Alexander Larsson 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 --- clients/transformed.c | 54 +++ 1 file changed, 54 insertions(+) diff --git

[PATCH 10/15] terminal: Handle output transform

2013-05-22 Thread alexl
From: Alexander Larsson We pick the highest scale of any output the terminal is on, and the transform from the last one it entered. --- clients/terminal.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/clients/terminal.c b/clients/terminal.c index f11a6cc..2985

[PATCH 09/15] window: Add window_get_output_scale()

2013-05-22 Thread alexl
From: Alexander Larsson This lets you find the maximal scale for all the outputs a window is on, which is useful for picking a buffer_scale. --- clients/window.c | 18 ++ clients/window.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/clients/window.c b/clients/window.

[PATCH 08/15] desktop-shell: Respect output scale and translate

2013-05-22 Thread alexl
From: Alexander Larsson We pick the window scale/tranform based on what the output uses, which means we can avoid rotations in the compositor, and get sharper rendering in scaled outputs. --- clients/desktop-shell.c | 75 - 1 file changed, 62 inser

[PATCH 07/15] window: Store server_allocation in surface size

2013-05-22 Thread alexl
From: Alexander Larsson We used to just store the buffer size here which is not right if the surface has a buffer_transform or a buffer_scale. To fix this we pass the transform and scale into the toysurface prepare and swap calls and move both the surface to buffer and the buffer to surface size

[PATCH 06/15] transformed: Use the scale factor from the output

2013-05-22 Thread alexl
From: Alexander Larsson --- clients/transformed.c | 1 + 1 file changed, 1 insertion(+) diff --git a/clients/transformed.c b/clients/transformed.c index 560ddf3..d685330 100644 --- a/clients/transformed.c +++ b/clients/transformed.c @@ -140,6 +140,7 @@ output_handler(struct window *window, stru

[PATCH 05/15] window: Apply buffer_scale automatically in widget_cairo_create

2013-05-22 Thread alexl
From: Alexander Larsson --- clients/window.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clients/window.c b/clients/window.c index 378cc75..00ffd27 100644 --- a/clients/window.c +++ b/clients/window.c @@ -1636,11 +1636,13 @@ widget_cairo_update_transform(struct widget *widget, cairo_

[PATCH 04/15] window: allow setting a buffer scale on a window

2013-05-22 Thread alexl
From: Alexander Larsson --- clients/window.c | 25 +++-- clients/window.h | 7 +++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/clients/window.c b/clients/window.c index 36fda25..378cc75 100644 --- a/clients/window.c +++ b/clients/window.c @@ -152,7 +1

[PATCH 03/15] window: Track output scales

2013-05-22 Thread alexl
From: Alexander Larsson --- clients/window.c | 30 -- clients/window.h | 3 +++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/clients/window.c b/clients/window.c index 48b784d..36fda25 100644 --- a/clients/window.c +++ b/clients/window.c @@ -322,6 +

[PATCH 02/15] transformed: Rely on transformation in widget_cairo_create

2013-05-22 Thread alexl
From: Alexander Larsson Rather than doing our own transformation handling when drawing we just rely on the generic code in widget_cairo_create --- clients/transformed.c | 69 ++- 1 file changed, 8 insertions(+), 61 deletions(-) diff --git a/client

[PATCH 01/15] window: Support transform in widget_cairo_create()

2013-05-22 Thread alexl
From: Alexander Larsson If a buffer_transform it specified in the window we automatically compensate for it in the cairo_t --- clients/window.c | 77 1 file changed, 77 insertions(+) diff --git a/clients/window.c b/clients/window.c index

[PATCH 00/15] weston scaling support

2013-05-22 Thread alexl
ious issue is how we handle scaling wrt modes. I'll bring this up in another mail. The series is also availible in the scale branch here: (eventually) http://cgit.freedesktop.org/~alexl/weston/ Alexander Larsson (15): window: Support transform in widget_cairo_create() transformed: Rely on

[PATCH 2/2] protocol: Support scaled outputs and surfaces

2013-05-16 Thread alexl
From: Alexander Larsson This adds the wl_surface.set_buffer_scale request, and a wl_output.scale event. These together lets us support automatic upscaling of "old" clients on very high resolution monitors, while allowing "new" clients to take advantage of this to render at the higher resolution w

[PATCH 1/2] protocol: Allow output changes to be treated atomically

2013-05-16 Thread alexl
From: Alexander Larsson This add a wl_output.done event which is send after every group of events caused by some property change. This allows clients to treat changes touching multiple events in an atomic fashion. --- protocol/wayland.xml | 12 +++- 1 file changed, 11 insertions(+), 1 de

[PATCH 0/2] Updated scaling patch

2013-05-16 Thread alexl
From: Alexander Larsson Here is a new version of the scaling work, based on the feedback from Pekka. Changes in this version are: * Better documentation in general, and about coordinate spaces in particular. * Scaling is an integer * Updated wl_compository version as needed * Added a flag to w

[PATCH] protocol: Add buffer_scale to wl_surface and wl_output

2013-05-14 Thread alexl
From: Alexander Larsson This adds wl_surface_set_buffer_scale() to set the buffer scale of a surface. It is similar to set_buffer_transform that the buffer is stored in a way that has been transformed (in this case scaled). This means that if an output is scaled we can directly use the pre-scale

[PATCH 2/2] protocol: Add buffer_scale to wl_surface and wl_output

2013-05-08 Thread alexl
From: Alexander Larsson This adds wl_surface_set_buffer_scale() to set the buffer scale of a surface. It is similar to set_buffer_transform in that it says that the buffer is stored in a way that has been transformed (in this case scaled). This means that if an output is naturally scaled (i.e. h

[PATCH 1/2] protocol: Allow versioned message arguments

2013-05-08 Thread alexl
From: Alexander Larsson This allows an event to be extended in a backwards compatible way (on the client side) by marking an argument with a since attribute. Any arguments with a since value later than then value of the message itself will be marked optional and the demarshaller will supply defau

[PATCH 0/2] Support for high DPI outputs via scaling

2013-05-08 Thread alexl
From: Alexander Larsson I'm working on trying to make high DPI (i.e. retina-class) outputs work well on Linux. I've written a proposal here: https://docs.google.com/document/d/1rvtiZb_Sm9C9718IoYQgnpzkirdl-wJZBBu_qLgaYyY/edit?usp=sharing This adds the initial protocol support needed for this. I