summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <ssp@redhat.com>2010-06-09 11:28:26 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2010-09-14 06:38:49 -0400
commit3169cd116ee7210589b6bb8718f401d2f68ab773 (patch)
tree40fa1cb41266a899b731a67ad3ab6f0b940a9dbf
parentd3cf206b9bfb3c59e2dfc113a7843ea421189239 (diff)
Use the correct strides. It's now slow, but working
-rw-r--r--src/qxl_driver.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 3729a3a..75a9279 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -310,7 +310,8 @@ set_screen_pixmap_header (ScreenPtr pScreen)
if (pPixmap && qxl->current_mode)
{
- ErrorF ("new stride: %d (display width: %d, bpp: %d)\n", qxl->pScrn->displayWidth * qxl->bytes_per_pixel, qxl->pScrn->displayWidth, qxl->bytes_per_pixel);
+ ErrorF ("new stride: %d (display width: %d, bpp: %d)\n",
+ qxl->pScrn->displayWidth * qxl->bytes_per_pixel, qxl->pScrn->displayWidth, qxl->bytes_per_pixel);
pScreen->ModifyPixmapHeader(
pPixmap,
@@ -845,7 +846,7 @@ qxl_prepare_access(PixmapPtr pixmap, uxa_access_t access)
w = pixmap->drawable.width;
h = pixmap->drawable.height;
- stride = qxl->current_mode->stride;
+ stride = - qxl->current_mode->stride;
ErrorF ("Width, stride: %d %d, real stride: %d, display wid: %d\n", w, stride, pixmap->devKind, pScrn->displayWidth);
@@ -860,8 +861,12 @@ qxl_prepare_access(PixmapPtr pixmap, uxa_access_t access)
outb (qxl->io_base + QXL_IO_UPDATE_AREA, 0);
- n_bytes = ((stride > 0)? stride : -stride) * pixmap->drawable.height;
+ usleep (10000);
+ n_bytes = ((stride < 0)? -stride : stride) * pixmap->drawable.height;
+
+ ErrorF ("allocated %d bytes\n", n_bytes);
+
copy = malloc (n_bytes);
if (!copy)
@@ -869,8 +874,16 @@ qxl_prepare_access(PixmapPtr pixmap, uxa_access_t access)
memcpy (copy, qxl->ram, n_bytes);
+ if (stride < 0)
+ copy += - stride * (h - 1);
+
pScreen->ModifyPixmapHeader(
- pixmap, w, h, -1, -1, stride, copy);
+ pixmap, w, h, -1, -1, -1, copy);
+
+ /* miModifyPixmapHeader() doesn't seem to actually set a negative
+ * stride, so just set it here.
+ */
+ pixmap->devKind = stride;
return TRUE;
}
@@ -884,10 +897,10 @@ qxl_finish_access (PixmapPtr pixmap)
struct qxl_drawable *drawable;
int w = pixmap->drawable.width;
int h = pixmap->drawable.height;
- int stride = (pixmap->drawable.width * pixmap->drawable.bitsPerPixel + 7) / 8;
+ int stride = pixmap->devKind;
struct qxl_rect rect;
- ErrorF ("Finishing access to %p\n", pixmap);
+ ErrorF ("Finishing access to %p (stride: %d)\n", pixmap, stride);
rect.left = 0;
rect.right = w;
@@ -911,7 +924,7 @@ qxl_finish_access (PixmapPtr pixmap)
push_drawable (qxl, drawable);
pScreen->ModifyPixmapHeader(
- pixmap, w, h, -1, -1, pScrn->displayWidth * pixmap->drawable.bitsPerPixel, NULL);
+ pixmap, w, h, -1, -1, 0, NULL);
}
static Bool