Skip to contentSkip to conversation

pixman patch queue

PATCH Applied Gerd Hoffmann 3 participants 8 messages Dec 14, 2012 – Dec 15, 2012

lore
Share & tools
lore
#0 lore raw

cover pixman patch queue

Hi,

Pixman patch queue, fixing vnc tight/png and tackeling build issues.

cheers,
Gerd

Gerd Hoffmann (5):
pixman: fix version check for PIXMAN_TYPE_BGRA
Revert "pixman: require 0.18.4 or newer"
pixman: update internal copy to pixman-0.28.2
pixman: fix vnc tight png/jpeg support
console: clip update rectangle

 configure          |    4 ++--
 console.h          |   10 ++++++++++
 hw/vga.c           |    2 +-
 pixman             |    2 +-
 qemu-pixman.c      |    6 +++---
 qemu-pixman.h      |    2 +-
 ui/vnc-enc-tight.c |    4 ++--
 ui/vnc.c           |    2 +-
 8 files changed, 21 insertions(+), 11 deletions(-)
#2 lore raw

PATCH 2/5 Revert "pixman: require 0.18.4 or newer"

This reverts commit 288fa40736e6eb63132d01aa6dc21ee831b796ae.

The only reason old pixman versions didn't work was the missing PIXMAN_TYPE_BGRA, which is properly #ifdef'ed now. So we don't have to require a minimum pixman version.

Conflicts:

configure

---
 configure |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 38b1cc6..ecdb33a 100755
@@ -2127,7 +2127,7 @@ fi
 # pixman support probe
 
 if test "$pixman" = ""; then
-  if $pkg_config --atleast-version=0.18.4 pixman-1 > /dev/null 2>&1; then
+  if $pkg_config pixman-1 > /dev/null 2>&1; then
     pixman="system"
   else
     pixman="internal"
@@ -2138,7 +2138,7 @@ if test "$pixman" = "system"; then
   pixman_libs=`$pkg_config --libs pixman-1 2>/dev/null`
 else
   if test ! -d ${source_path}/pixman/pixman; then
-    echo "ERROR: pixman not present (or older than 0.18.4). Your options:"
+    echo "ERROR: pixman not present. Your options:"
     echo "  (1) Preferred: Install the pixman devel package (any recent"
     echo "      distro should have packages as Xorg needs pixman too)."
     echo "  (2) Fetch the pixman submodule, using:"
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/5 pixman: update internal copy to pixman-0.28.2

In reply to Gerd Hoffmann

Some w64 fixes by Stefan Weil found their way into 0.28.2, so update the internal copy to that version to improve windows support.

---
 pixman |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
pixman +1 -1
index 97336fa..a5e5179 160000
@@ -1 +1 @@
-Subproject commit 97336fad32acf802003855cd8bd6477fa49a12e3
+Subproject commit a5e5179b5624c99c812e9bf6e7b907e355a811e8
Signature · 1 line
1.7.1
#5 lore raw

PATCH 5/5 console: clip update rectangle

In reply to Gerd Hoffmann
---
 console.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
console.h +10 -0
index 50a0512..edb1950 100644
@@ -229,6 +229,16 @@ static inline void unregister_displaychangelistener(DisplayState *ds,
 static inline void dpy_gfx_update(DisplayState *s, int x, int y, int w, int h)
 {
     struct DisplayChangeListener *dcl;
+    int width = pixman_image_get_width(s->surface->image);
+    int height = pixman_image_get_height(s->surface->image);
+
+    x = MAX(x, 0);
+    y = MAX(y, 0);
+    x = MIN(x, width);
+    y = MIN(y, height);
+    w = MIN(w, width - x);
+    h = MIN(h, height - y);
+
     QLIST_FOREACH(dcl, &s->listeners, next) {
         if (dcl->dpy_gfx_update) {
             dcl->dpy_gfx_update(s, x, y, w, h);
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/5 pixman: fix version check for PIXMAN_TYPE_BGRA

In reply to Gerd Hoffmann
---
 qemu-pixman.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-pixman.c +1 -1
index e46e180..79e175b 100644
@@ -21,7 +21,7 @@ int qemu_pixman_get_type(int rshift, int gshift, int bshift)
         if (rshift == 0) {
             type = PIXMAN_TYPE_ABGR;
         } else {
-#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0, 21, 8)
+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0, 16, 0)
             type = PIXMAN_TYPE_BGRA;
 #endif
         }
Signature · 1 line
1.7.1
#4 lore raw

PATCH 4/5 pixman: fix vnc tight png/jpeg support

In reply to Gerd Hoffmann

This patch adds an x argument to qemu_pixman_linebuf_fill so it can also be used to convert a partial scanline. Then fix tight + png/jpeg encoding by passing in the x+y offset, so the data is read from the correct screen location instead of the upper left corner.

---
 hw/vga.c           |    2 +-
 qemu-pixman.c      |    4 ++--
 qemu-pixman.h      |    2 +-
 ui/vnc-enc-tight.c |    4 ++--
 ui/vnc.c           |    2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)
hw/vga.c +1 -1
index 2b0200a..c266161 100644
@@ -2413,7 +2413,7 @@ void ppm_save(const char *filename, struct DisplaySurface *ds, Error **errp)
     }
     linebuf = qemu_pixman_linebuf_create(PIXMAN_BE_r8g8b8, width);
     for (y = 0; y < height; y++) {
-        qemu_pixman_linebuf_fill(linebuf, ds->image, width, y);
+        qemu_pixman_linebuf_fill(linebuf, ds->image, width, 0, y);
         clearerr(f);
         ret = fwrite(pixman_image_get_data(linebuf), 1,
                      pixman_image_get_stride(linebuf), f);
qemu-pixman.c +2 -2
index 79e175b..e7263fb 100644
@@ -52,10 +52,10 @@ pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format,
 }
 
 void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb,
-                              int width, int y)
+                              int width, int x, int y)
 {
     pixman_image_composite(PIXMAN_OP_SRC, fb, NULL, linebuf,
-                           0, y, 0, 0, 0, 0, width, 1);
+                           x, y, 0, 0, 0, 0, width, 1);
 }
 
 pixman_image_t *qemu_pixman_mirror_create(pixman_format_code_t format,
qemu-pixman.h +1 -1
index bee55eb..3c05c83 100644
@@ -31,7 +31,7 @@ pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf);
 pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format,
                                            int width);
 void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb,
-                              int width, int y);
+                              int width, int x, int y);
 pixman_image_t *qemu_pixman_mirror_create(pixman_format_code_t format,
                                           pixman_image_t *image);
 void qemu_pixman_image_unref(pixman_image_t *image);
ui/vnc-enc-tight.c +2 -2
index 9ae4cab..62d0fde 100644
@@ -1212,7 +1212,7 @@ static int send_jpeg_rect(VncState *vs, int x, int y, int w, int h, int quality)
     buf = (uint8_t *)pixman_image_get_data(linebuf);
     row[0] = buf;
     for (dy = 0; dy < h; dy++) {
-        qemu_pixman_linebuf_fill(linebuf, vs->vd->server, w, dy);
+        qemu_pixman_linebuf_fill(linebuf, vs->vd->server, w, x, y + dy);
         jpeg_write_scanlines(&cinfo, row, 1);
     }
     qemu_pixman_image_unref(linebuf);
@@ -1356,7 +1356,7 @@ static int send_png_rect(VncState *vs, int x, int y, int w, int h,
         if (color_type == PNG_COLOR_TYPE_PALETTE) {
             memcpy(buf, vs->tight.tight.buffer + (dy * w), w);
         } else {
-            qemu_pixman_linebuf_fill(linebuf, vs->vd->server, w, dy);
+            qemu_pixman_linebuf_fill(linebuf, vs->vd->server, w, x, y + dy);
         }
         png_write_row(png_ptr, buf);
     }
ui/vnc.c +1 -1
index ba30362..04afcff 100644
@@ -2569,7 +2569,7 @@ static int vnc_refresh_server_surface(VncDisplay *vd)
             uint8_t *server_ptr;
 
             if (vd->guest.format != VNC_SERVER_FB_FORMAT) {
-                qemu_pixman_linebuf_fill(tmpbuf, vd->guest.fb, width, y);
+                qemu_pixman_linebuf_fill(tmpbuf, vd->guest.fb, width, 0, y);
                 guest_ptr = (uint8_t *)pixman_image_get_data(tmpbuf);
             } else {
                 guest_ptr = guest_row;
Signature · 1 line
1.7.1
#6 lore raw
In reply to Gerd Hoffmann

Am 14.12.2012 08:54, schrieb Gerd Hoffmann:

Quoted 14 lines
   Hi,

Pixman patch queue, fixing vnc tight/png and tackeling build issues.

cheers,
Gerd

Gerd Hoffmann (5):
pixman: fix version check for PIXMAN_TYPE_BGRA
Revert "pixman: require 0.18.4 or newer"
pixman: update internal copy to pixman-0.28.2
pixman: fix vnc tight png/jpeg support
console: clip update rectangle

Quoted 9 lines
  configure          |    4 ++--
  console.h          |   10 ++++++++++
  hw/vga.c           |    2 +-
  pixman             |    2 +-
  qemu-pixman.c      |    6 +++---
  qemu-pixman.h      |    2 +-
  ui/vnc-enc-tight.c |    4 ++--
  ui/vnc.c           |    2 +-
  8 files changed, 21 insertions(+), 11 deletions(-)

Anthony or Blue, could you please commit these patches with high priority?

They should fix configure failures on several buildbots and a bug in the vnc code.

I suggest to commit them to QEMU 1.3, too, after some test time in git master.

Regards,
Stefan W.

Applied
#7 lore raw
In reply to Gerd Hoffmann
Quoted 3 lines · Gerd Hoffmann

Hi,

Pixman patch queue, fixing vnc tight/png and tackeling build issues.

Thanks, applied all.

Quoted 22 lines

cheers,
Gerd

Gerd Hoffmann (5):
pixman: fix version check for PIXMAN_TYPE_BGRA
Revert "pixman: require 0.18.4 or newer"
pixman: update internal copy to pixman-0.28.2
pixman: fix vnc tight png/jpeg support
console: clip update rectangle

 configure          |    4 ++--
 console.h          |   10 ++++++++++
 hw/vga.c           |    2 +-
 pixman             |    2 +-
 qemu-pixman.c      |    6 +++---
 qemu-pixman.h      |    2 +-
 ui/vnc-enc-tight.c |    4 ++--
 ui/vnc.c           |    2 +-
 8 files changed, 21 insertions(+), 11 deletions(-)