input: fix jumpy mouse cursor with USB mouse emulation

Guest mouse pointer was jumpy, when moving host mouse in the vertical direction (see bug #1327800).

Signed-off-by: Christian Burger <christian@krikkel.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
console: add qemu_pixelformat_from_pixman

Function to convert pixman format to qemu PixelFormat.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
console: add qemu_default_pixman_format

Function returning the default pixman format for a given depth.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
console: reimplement qemu_default_pixelformat

Use the new qemu_pixelformat_from_pixman and qemu_default_pixman_format
functions to reimplement qemu_default_pixelformat
(qemu_different_endianness_pixelformat too).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
console: stop using PixelFormat

With this patch the qemu console core stops using PixelFormat and pixman
format codes side-by-side, pixman format code is the primary way to
specify the DisplaySurface format:

 * DisplaySurface stops carrying a PixelFormat field.
 * qemu_create_displaysurface_from() expects a pixman format now.

Functions to convert PixelFormat to pixman_format_code_t (and back)
exist for those who still use PixelFormat.   As PixelFormat allows
easy access to masks and shifts it will probably continue to exist.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
console: Fix Gerd missing conversion

[Should be folded into Gerd's patch]

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Create direct surface for depth 15 as well as 16

We currently create a direct surface for depth 32 and if
native endian, for 16, but never for 15, which pixman supports
fine so let's do it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Create direct sufaces for depth 24 too

pixman supports 24bpp directly, let's share surfaces
For both endians even !

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
ui: Remove unused QEMU_BIG_ENDIAN_FLAG

If we need to, we should use the pixman formats instead but for
now this is unused except in commented out code so take it out
to avoid further confusion about surface endianness.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Start cutting out non-32bpp conversion support

Nowadays, we either share a surface with the host, or we create
a 32bpp ARGB console surface.

So we only need to draw/convert to 32bpp, enabling us to remove
all but one instance of vga_template.h inclusion (to be further
cleaned up), rgb_to_pixel_* etc...

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Remove remainder of old conversion cruft

All the macros used to generate different versions of vga_template.h
are now unnecessary, take them all out and remove the _32 suffix from
most functions.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Remove unused vga_draw_line24() and vga_draw_line32()

24 and 32bpp surfaces are always shared, we never "draw" them anymore

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: 15 and 16bpp draw functions are "swapping" only

We now only use vga_draw_line15() and vga_draw_line16() when
byteswapping. Otherwise we have a shared surface. Make this
explicit and remove the reliance on lduw_p which uses
TARGET_WORDS_ENDIAN. We now only rely on the "byteswap" variable
in vga_draw_graphic().

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Remove rgb_to_pixel indirection

We always use rgb_to_pixel32 nowadays.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Simplify vga_draw_blank() a bit

The test for surface_bits_per_pixel() isn't necessary anymore,
the 8bpp case never happens.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
cirrus: Remove non-32bpp cursor drawing

We only draw cursor on non-shared surfaces (so it seems...) and
these are always 32bpp

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Remove some "should be done in BIOS" comments

Not all platforms have a VGA BIOS, powerpc typically relies on
using the DISPI interface to initialize the card.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Make fb endian a common state variable

And initialize it based on target endian

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Rename vga_template.h to vga-helpers.h

It's no longer a template, we only instanciate the file once.

Keep it a #included file so the functions remain static.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
vga: Add endian control register

Include the endian state in the migration stream as an optional
subsection which we only include when the endian isn't the default,
thus enabling backward compatibility of the common case.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>