weston-info: client that print out information about the running compositor

This includes seat capabilities, shm formats and output information.
clients: Move weston-info to bin_PROGRAMS

It's properly prefixed and pretty useful; let's install it.
weston-info: remove timerfd termination hack

Use wl_display_roundtrip to listen exactly as long as necessary.
weston-info: an output can have multiple modes
Correct mistake in config file.
Remove unused enum.
compositor: Clear only the the damage that was actually repainted

Instead of clearing the whole output region after a repaint, clear
only the regions that were actually painted. This way, the damage
added when a surface moves from the primary plane to another one is
kept while this region is obscured by the opaque region. This allows
the contents below an overlaid surface to be culled, but to make this
work properly, it is also necessary to change the way previous damage
is drawn.

Consider the following scenario: a surface is moved to an overlay plane
leaving some damage in the primary plane. On the following frame, the
surface on the overlay moves, revealing part of the damaged region on
the primary plane. On the frame after that, the overlaid surface moves
back to its previous position obscuring the region of the primary plane
repainted before. At this point, the repainted region was added to the
output's previous damage so that it is draw to both buffers. But since
this region is now obscured, the redrawing is skipped. If the overlaid
surface moves again revealing this region, one of the buffers actually
contains the wrong content.

To fix this problem, this patch ensures that any previous damage that
would be lost is actually preserved by folding it back into the
primary plane damage just before repainting.
toytoolkit: don't ignore resizes with negative width or height

E.g. this can happen when you grab the lower right corner of a window
and move over the top of the window when resizing. In this case, the
changed width is still important and should be acted upon.

https://bugs.freedesktop.org/show_bug.cgi?id=53560
Implement output transformations.

This patch allows rotation and mirroring outputs for x11 and drm backends.
A new 'transform' key can be set in the [output] section. From the protocol:

"The flipped values correspond to an initial flip around a vertical axis
followed by rotation."

The transform key can be one of the following 8 strings:

normal
90
180
270
flipped
flipped-90
flipped-180
flipped-270
terminal: support entering non-ascii characters

Unless the alt modifier is active and the MODE_ALT_SENDS_ESC mode is not
set, any value over 127 is converted to a UTF8 sequence.

Part of https://bugs.freedesktop.org/show_bug.cgi?id=53648 should be
fixed with this.

Part of https://bugs.freedesktop.org/show_bug.cgi?id=52419 is fixed, but
interestingly it depends on the activated keymap (i.e. it works with
dvorak, but not with ch).
screenshot: Use correct buffer size for transformed outputs.

This is a workaround for screenshots with transformed outputs. It reorders
the output positions so the correct buffer size is determined for the final
image. This assumes the outputs are in succession on the x axis. The outputs
are rendered in their transformed state.
tests: Explicitly define the test client to launch

Allow different test clients to launch. The test client is defined by
an argument in the test_client_launch() function.
tests: Add unit test for text model

Add tests for activate/deactivate and unfocusing of the assigned
surface.
toytoolkit: try multiple names when loading cursors

The correspondence between cursor functions and names of cursors has
never been standardized. As a consequence, each cursor function can be
represented as a cursor with one of several names. Be more robust when
loading cursor by trying all known names that correspond to a cursor.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=50487
and https://bugs.freedesktop.org/show_bug.cgi?id=52609 a bit more
thoroughly.
desktop-shell: respect CURSOR_NONE as grab cursor
desktop-shell: don't segfault on invalid icon path

Instead draw a fallback icon and proceed as normal.

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

v2: coding style fixes
v3: memory leak, draw icon instead of relying on external files
man: add man page for weston

It is not complete, but has lots of stuff already.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
compositor: add support for OES_EGL_image_external

In cases where the GPU can natively handle certain YUV formats,
eglQueryWaylandBufferWL() can return the value EGL_TEXTURE_EXTERNAL_WL
and the compositor will treat the buffer as a single egl-image-external.

See:
http://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external.txt

v1: original
v2: rename EGL_TEXTURE_EXTERNAL_OES -> EGL_TEXTURE_EXTERNAL_WL and query
    for the extension
v3: fix build without updated mesa headers, if EGL_TEXTURE_EXTERNAL_WL
    #define is missing from older mesa headers.
v4: resend without missing parts

Signed-off-by: Rob Clark <rob@ti.com>
compositor: simplify shaders

Re-work how the shaders and emitted vertices work.  Rather than always
rendering clip-rect sized quads and doing transformation in tex coords
(and requiring the corresponding clipping in frag shader), instead
emit transformed vertices, clipped wrt. dirty region, and use simpler
frag shaders.  Also, split the rendering, so blended surfaces with an
opaque region have the opaque region drawn with blend disabled.  The
result is considerably fewer pixels drawn with blend enabled, and much
fewer cycles in the frag shader.

This requires having some more complex logic to figure out the vertices
of the shape which forms the intersection of the clip rect and the
transformed surface.  Which has perhaps got a few bugs or missing cases,
still (visual glitches in some cases) but at this point more or less is
starting to work.  I think it is at least far enough along to get some
initial review.

The result, on small SoC GPU (omap4/pandaboard) on 1920x1080 display,
for simple stuff like moving windows around, I get 60fps (before 30fps
or less), and pushing YUV buffers for hw decoded 1080p video goes from
~6fps to 30fps, with no drop in framerate for transformed/rotated video
surface.

v1: original
v2: check that perpendicular intersect vertex falls within bounds of
    transformed surface
v3: update w/ comments and fixes from Pekka Paalanen
v4: fix for full surface alpha from Pekka Paalanen, fix compositor-
    wayland build

Signed-off-by: Rob Clark <rob@ti.com>
compositor: specialised fragment shader for RGBX

Remove the weston_surface::blend attribute, which really meant that the
texture produced valid alpha values. This was used to override the opaque
region for RGBX surfaces, which produce undefined values for alpha.

Instead, compile a new shader especially for RGBX surfaces, that
hardcodes the sampled alpha as 1.0.

Before "compositor: optimize/simplify shaders" there was a 'vec4 opaque'
in the shaders, that would cause part of the texture to be forced to
alpha=1.0. Now that is gone, and we need this replacement.

To test: launch simple-shm, and use the super+alt+mousewheel combination
to make it transparent. It should not show a light cross over the window.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>