summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-09-14 12:27:27 +0300
committerAlon Levy <alevy@redhat.com>2012-10-23 18:50:55 +0200
commit2e89b65507ded885d1ae6f53efdb4a010803359c (patch)
treeb226bb052655e36bb411dcaa543e51cd8e51ca70
parenta2f07c132b6d837d82c8de02fd2d342fd1b9bb67 (diff)
lots of debugging comments, workaround to composite off before client connect glyph assert, use off image compression due to lz width%4!=0 bug
-rw-r--r--src/qxl.h1
-rw-r--r--src/qxl_driver.c35
-rw-r--r--src/qxl_image.c6
-rw-r--r--src/qxl_surface.c83
4 files changed, 83 insertions, 42 deletions
diff --git a/src/qxl.h b/src/qxl.h
index 8b4ae4b..bad523f 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -480,6 +480,7 @@ static inline qxl_surface_t *get_surface (PixmapPtr pixmap)
static inline void set_surface (PixmapPtr pixmap, qxl_surface_t *surface)
{
+ fprintf(stderr, "pixmap %p, surface %p\n", pixmap, surface);
dixSetPrivate(&pixmap->devPrivates, &uxa_pixmap_index, surface);
}
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index db72c8d..744ed95 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1608,31 +1608,20 @@ can_accelerate_picture (PicturePtr pict)
static Bool
qxl_has_composite (qxl_screen_t *qxl)
{
-#ifndef XSPICE
return
#ifndef XSPICE
qxl->pci->revision >= 4 &&
#endif
QXL_HAS_CAP (qxl, SPICE_DISPLAY_CAP_COMPOSITE);
-#else
- /* FIXME */
- return FALSE;
-#endif
}
static Bool
qxl_has_a8_surfaces (qxl_screen_t *qxl)
{
#ifndef XSPICE
- return
-#ifndef XSPICE
qxl->pci->revision >= 4 &&
#endif
QXL_HAS_CAP (qxl, SPICE_DISPLAY_CAP_A8_SURFACE);
-#else
- /* FIXME */
- return FALSE;
-#endif
}
static Bool
@@ -1676,6 +1665,7 @@ qxl_check_composite (int op,
return FALSE;
found:
+ printf("%s returning TRUE\n", __func__);
return TRUE;
}
@@ -1774,9 +1764,9 @@ qxl_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usage)
*/
goto fallback;
}
-
+
surface = qxl_surface_create (qxl->surface_cache, w, h, depth);
-
+
if (surface)
{
/* ErrorF (" Successfully created surface in video memory\n"); */
@@ -2033,7 +2023,7 @@ qxl_screen_init (SCREEN_INIT_ARGS_DECL)
qxl_blank_screen (pScreen, SCREEN_SAVER_ON);
miClearVisualTypes ();
- if (!miSetVisualTypes (pScrn->depth, miGetDefaultVisualMask(pScrn->depth),
+ if (!miSetVisualTypes (pScrn->depth, miGetDefaultVisualMask (pScrn->depth),
pScrn->rgbBits, pScrn->defaultVisual))
goto out;
if (!miSetPixmapDepths ())
@@ -2071,10 +2061,10 @@ qxl_screen_init (SCREEN_INIT_ARGS_DECL)
qxl->uxa = uxa_driver_alloc ();
/* Set up resources */
- qxl->reset_and_create_mem_slots(qxl);
- ErrorF("done reset\n");
+ qxl->reset_and_create_mem_slots (qxl);
+ ErrorF ("done reset\n");
- if (!is_kms(qxl)) {
+ if (!is_kms (qxl)) {
#ifndef XSPICE
qxl->io_pages = (void *)((unsigned long)qxl->ram);
qxl->io_pages_physical = (void *)((unsigned long)qxl->ram_physical);
@@ -2091,14 +2081,14 @@ qxl_screen_init (SCREEN_INIT_ARGS_DECL)
}
qxl->surface_cache = qxl_surface_cache_create (qxl);
- /* xf86DPMSInit(pScreen, xf86DPMSSet, 0); */
+ /* xf86DPMSInit (pScreen, xf86DPMSSet, 0); */
pScreen->SaveScreen = qxl_blank_screen;
setup_uxa (qxl, pScreen);
#if 0
- uxa_set_fallback_debug(pScreen, TRUE);
+ uxa_set_fallback_debug (pScreen, TRUE);
#endif
DamageSetup (pScreen);
@@ -2161,7 +2151,7 @@ qxl_enter_vt (VT_FUNC_ARGS_DECL)
SCRN_INFO_PTR (arg);
qxl_screen_t *qxl = pScrn->driverPrivate;
- qxl_save_state(pScrn);
+ qxl_save_state (pScrn);
qxl->reset_and_create_mem_slots(qxl);
@@ -2558,7 +2548,8 @@ qxl_init_randr (ScrnInfoPtr pScrn, qxl_screen_t *qxl)
qxl->crtcs = xnfcalloc (sizeof (xf86CrtcPtr), qxl->num_heads);
qxl->outputs = xnfcalloc (sizeof (xf86OutputPtr), qxl->num_heads);
- for (i = 0 ; i < qxl->num_heads; ++i) {
+ for (i = 0 ; i < qxl->num_heads; ++i)
+ {
qxl->crtcs[i] = xf86CrtcCreate (pScrn, &qxl_crtc_funcs);
if (!qxl->crtcs[i])
xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "failed to create Crtc %d", i);
@@ -2629,6 +2620,8 @@ qxl_ums_add_reloc(qxl_screen_t *qxl, qxl_cmd_t *cmd, void *src,
uint32_t src_handle, uint32_t src_offset, void *dst,
uint32_t dst_handle, uint32_t dst_offset)
{
+ fprintf(stderr, "ums_add_reloc: %p, %u, %u, %p, %u, %u\n",
+ src, src_handle, src_offset, dst, dst_handle, dst_offset);
*(uint64_t *)((uint8_t *)src + src_offset) =
physical_address (qxl, dst, qxl->main_mem_slot) + dst_offset;
}
diff --git a/src/qxl_image.c b/src/qxl_image.c
index 792e1ba..0efa641 100644
--- a/src/qxl_image.c
+++ b/src/qxl_image.c
@@ -139,9 +139,9 @@ qxl_image_create (qxl_screen_t *qxl, uint32_t *image_handle,
struct QXLImage *image;
struct QXLDataChunk *head;
struct QXLDataChunk *tail;
- uint32_t chunk_handle;
- uint32_t tail_handle;
- uint32_t head_handle;
+ uint32_t chunk_handle = 0;
+ uint32_t tail_handle = 0;
+ uint32_t head_handle = 0;
int dest_stride = (width * Bpp + 3) & (~3);
int h;
diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index dbd2fd2..4285fa5 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -1046,8 +1046,8 @@ real_upload_box (qxl_surface_t *surface, int x1, int y1, int x2, int y2)
image = qxl_image_create (
qxl, &handle, &cmd, (const uint8_t *)data, x1, y1, x2 - x1, y2 - y1, stride,
surface->bpp == 24 ? 4 : surface->bpp / 8, TRUE);
- qxl->add_reloc(qxl, &cmd, drawable, 0, offsetof(QXLDrawable, u.copy.src_bitmap),
- image, handle, 0);
+ qxl->add_reloc (qxl, &cmd, drawable, 0, offsetof(QXLDrawable, u.copy.src_bitmap),
+ image, handle, 0);
qxl->push_drawable (qxl, drawable, &cmd);
}
@@ -1337,6 +1337,7 @@ qxl_surface_copy (qxl_surface_t *dest,
drawable = make_drawable (qxl, dest->id, QXL_DRAW_COPY, &qrect);
+ fprintf(stderr, "add_reloc offset %lu\n", offsetof(QXLDrawable, u.copy.src_bitmap));
qxl->add_reloc(qxl, &cmd, drawable, 0,
offsetof(QXLDrawable, u.copy.src_bitmap),
image, image_handle, 0);
@@ -1395,9 +1396,11 @@ static QXLImage *
image_from_picture (qxl_screen_t *qxl,
PicturePtr picture,
qxl_surface_t *surface,
- int *force_opaque)
+ int *force_opaque,
+ uint32_t *handle)
{
- struct QXLImage *image = qxl_allocnf (qxl, sizeof *image, "image struct for picture");
+ struct QXLImage *image = qxl->alloc_data (qxl, handle, sizeof *image,
+ "image struct for picture");
image->descriptor.id = 0;
image->descriptor.type = SPICE_IMAGE_TYPE_SURFACE;
@@ -1414,11 +1417,12 @@ image_from_picture (qxl_screen_t *qxl,
}
static QXLTransform *
-get_transform (qxl_screen_t *qxl, PictTransform *transform)
+get_transform (qxl_screen_t *qxl, PictTransform *transform, uint32_t *handle)
{
if (transform)
{
- QXLTransform *qxform = qxl_allocnf (qxl, sizeof (QXLTransform), "transform");
+ QXLTransform *qxform =
+ qxl->alloc_data (qxl, handle, sizeof (QXLTransform), "transform");
qxform->t00 = transform->matrix[0][0];
qxform->t01 = transform->matrix[0][1];
@@ -1456,6 +1460,7 @@ qxl_surface_composite (qxl_surface_t *dest,
int dest_x, int dest_y,
int width, int height)
{
+ qxl_cmd_t cmd;
qxl_screen_t *qxl = dest->cache->qxl;
PicturePtr src = dest->u.composite.src_picture;
qxl_surface_t *qsrc = dest->u.composite.src;
@@ -1469,7 +1474,11 @@ qxl_surface_composite (qxl_surface_t *dest,
QXLTransform *trans;
int n_deps = 0;
int force_opaque;
+ uint32_t img_handle = 0;
+ uint32_t trans_handle = 0;
+ fprintf(stderr, "%s src: %x,%x,%x\n", __func__);
+ memset(&cmd, 0, sizeof(cmd));
#if 0
ErrorF ("QXL Composite: src: %x (%d %d) id: %d; \n"
" mask: id: %d\n"
@@ -1495,21 +1504,40 @@ qxl_surface_composite (qxl_surface_t *dest,
composite = &drawable->u.composite;
composite->flags = 0;
+ composite->src_transform = 0;
+ composite->mask = 0;
+ composite->mask_transform = 0;
if (dest->u.composite.dest_picture->format == PICT_x8r8g8b8)
composite->flags |= SPICE_COMPOSITE_DEST_OPAQUE;
composite->flags |= (op & 0xff);
- img = image_from_picture (qxl, src, qsrc, &force_opaque);
+ img = image_from_picture (qxl, src, qsrc, &force_opaque, &img_handle);
+ fprintf(stderr, "add_reloc u.composite.src offset %lu\n",
+ offsetof(QXLDrawable, u.composite.src));
+ qxl->add_reloc (qxl, &cmd, drawable, 0,
+ offsetof (QXLDrawable, u.composite.src), img, img_handle, 0);
+ assert(virtual_address (qxl, u64_to_pointer (drawable->u.composite.src),
+ qxl->main_mem_slot) == img);
if (force_opaque)
composite->flags |= SPICE_COMPOSITE_SOURCE_OPAQUE;
- composite->src = physical_address (qxl, img, qxl->main_mem_slot);
composite->flags |= (src->filter << 8);
composite->flags |= (src->repeat << 14);
- trans = get_transform (qxl, src->transform);
- composite->src_transform = trans?
- physical_address (qxl, trans, qxl->main_mem_slot) : 0x00000000;
+ if (src->transform)
+ {
+ trans = get_transform (qxl, src->transform, &trans_handle);
+ fprintf(stderr, "add_reloc u.composite.src_transform offset %lu\n",
+ offsetof(QXLDrawable, u.composite.src_transform));
+ qxl->add_reloc (qxl, &cmd, drawable, 0,
+ offsetof (QXLDrawable, u.composite.src_transform),
+ trans, trans_handle, 0);
+ assert(composite->src_transform == trans?
+ physical_address (qxl, trans, qxl->main_mem_slot) : 0x00000000);
+ assert(virtual_address (qxl, u64_to_pointer (drawable->u.composite.src_transform),
+ qxl->main_mem_slot)
+ == trans);
+ }
drawable->surfaces_dest[n_deps] = qsrc->id;
drawable->surfaces_rects[n_deps] = full_rect (qsrc);
@@ -1518,10 +1546,17 @@ qxl_surface_composite (qxl_surface_t *dest,
if (mask)
{
- img = image_from_picture (qxl, mask, qmask, &force_opaque);
+ img = image_from_picture (qxl, mask, qmask, &force_opaque, &img_handle);
if (force_opaque)
composite->flags |= SPICE_COMPOSITE_MASK_OPAQUE;
- composite->mask = physical_address (qxl, img, qxl->main_mem_slot);
+ fprintf(stderr, "add_reloc u.composite.mask offset %lu\n",
+ offsetof(QXLDrawable, u.composite.mask));
+ qxl->add_reloc (qxl, &cmd, drawable, 0,
+ offsetof (QXLDrawable, u.composite.mask),
+ img, img_handle, 0);
+ assert(virtual_address (qxl, u64_to_pointer (drawable->u.composite.mask),
+ qxl->main_mem_slot) == img);
+ printf("%lX\n", composite->mask);
composite->flags |= (mask->filter << 11);
composite->flags |= (mask->repeat << 16);
composite->flags |= (mask->componentAlpha << 18);
@@ -1530,9 +1565,19 @@ qxl_surface_composite (qxl_surface_t *dest,
drawable->surfaces_rects[n_deps] = full_rect (qmask);
n_deps++;
- trans = get_transform (qxl, src->transform);
- composite->mask_transform = trans?
- physical_address (qxl, trans, qxl->main_mem_slot) : 0x00000000;
+ if (src->transform)
+ {
+ trans = get_transform (qxl, src->transform, &trans_handle);
+ fprintf(stderr, "add_reloc u.composite.mask_transform offset %lu\n",
+ offsetof(QXLDrawable, u.composite.mask_transform));
+ qxl->add_reloc (qxl, &cmd, drawable, 0,
+ offsetof (QXLDrawable, u.composite.mask_transform),
+ trans, trans_handle, 0);
+ printf("%lX\n", composite->mask_transform);
+ assert(virtual_address (qxl, u64_to_pointer (drawable->u.composite.mask_transform),
+ qxl->main_mem_slot) == trans);
+
+ }
}
else
{
@@ -1550,7 +1595,9 @@ qxl_surface_composite (qxl_surface_t *dest,
drawable->effect = QXL_EFFECT_BLEND;
- push_drawable (qxl, drawable);
+ fprintf(stderr, "pushing composite flags=%d, src_origin=%d,%d\n",
+ composite->flags, composite->src_origin.x, composite->src_origin.y);
+ qxl->push_drawable (qxl, drawable, &cmd);
}
Bool
@@ -1562,7 +1609,7 @@ qxl_surface_put_image (qxl_surface_t *dest,
qxl_screen_t *qxl = dest->cache->qxl;
struct QXLRect rect;
struct QXLImage *image;
- uint32_t handle;
+ uint32_t handle = 0;
qxl_cmd_t cmd;
memset(&cmd, 0, sizeof(cmd));