summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/xorg
diff options
context:
space:
mode:
authorYounes Manton <[email protected]>2010-06-13 17:37:33 -0400
committerYounes Manton <[email protected]>2010-06-13 17:37:33 -0400
commitb9fe9665194899fc0a6336d876ab0596418c7287 (patch)
tree9f3691f31113a7076fcba704fe51af5cde6c175d /src/gallium/state_trackers/xorg
parent4b2fcb2bcb7a93cf3dc8cd164f4e87b5c538f7f6 (diff)
vl: Fix RGB subpictures.
Diffstat (limited to 'src/gallium/state_trackers/xorg')
-rw-r--r--src/gallium/state_trackers/xorg/xvmc/subpicture.c33
-rw-r--r--src/gallium/state_trackers/xorg/xvmc/surface.c4
2 files changed, 19 insertions, 18 deletions
diff --git a/src/gallium/state_trackers/xorg/xvmc/subpicture.c b/src/gallium/state_trackers/xorg/xvmc/subpicture.c
index 59842c90d0d..e0c9e303817 100644
--- a/src/gallium/state_trackers/xorg/xvmc/subpicture.c
+++ b/src/gallium/state_trackers/xorg/xvmc/subpicture.c
@@ -234,10 +234,12 @@ Status XvMCCompositeSubpicture(Display *dpy, XvMCSubpicture *subpicture, XvImage
{
XvMCSubpicturePrivate *subpicture_priv;
XvMCContextPrivate *context_priv;
- struct pipe_screen *screen;
+ struct pipe_video_context *vpipe;
struct pipe_transfer *xfer;
- unsigned char *src, *dst;
+ unsigned char *src, *dst, *dst_line;
unsigned x, y;
+ struct pipe_box dst_box = {dstx, dsty, 0, width, height, 1};
+ struct pipe_subresource sr = {0, 0};
XVMC_MSG(XVMC_TRACE, "[XvMC] Compositing subpicture %p.\n", subpicture);
@@ -257,20 +259,19 @@ Status XvMCCompositeSubpicture(Display *dpy, XvMCSubpicture *subpicture, XvImage
subpicture_priv = subpicture->privData;
context_priv = subpicture_priv->context->privData;
- screen = context_priv->vctx->vpipe->screen;
+ vpipe = context_priv->vctx->vpipe;
/* TODO: Assert rects are within bounds? Or clip? */
-#if 0
- xfer = screen->get_tex_transfer(screen, subpicture_priv->sfc->texture, 0, 0, 0,
- PIPE_TRANSFER_WRITE, dstx, dsty, width, height);
+ xfer = vpipe->get_transfer(vpipe, subpicture_priv->sfc->texture,
+ sr, PIPE_TRANSFER_WRITE, &dst_box);
if (!xfer)
return BadAlloc;
src = image->data;
- dst = screen->transfer_map(screen, xfer);
+ dst = vpipe->transfer_map(vpipe, xfer);
if (!dst) {
- screen->tex_transfer_destroy(xfer);
+ vpipe->transfer_destroy(vpipe, xfer);
return BadAlloc;
}
@@ -278,21 +279,21 @@ Status XvMCCompositeSubpicture(Display *dpy, XvMCSubpicture *subpicture, XvImage
case FOURCC_RGB:
assert(subpicture_priv->sfc->format == XvIDToPipe(image->id));
for (y = 0; y < height; ++y) {
- for (x = 0; x < width; ++x, src += 3, dst += 4) {
- /* TODO: Confirm or fix */
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
+ dst_line = dst;
+ for (x = 0; x < width; ++x, src += 3, dst_line += 4) {
+ dst_line[0] = src[2]; /* B */
+ dst_line[1] = src[1]; /* G */
+ dst_line[2] = src[0]; /* R */
}
+ dst += xfer->stride;
}
break;
default:
XVMC_MSG(XVMC_ERR, "[XvMC] Unrecognized Xv image ID 0x%08X.\n", image->id);
}
- screen->transfer_unmap(screen, xfer);
- screen->tex_transfer_destroy(xfer);
-#endif
+ vpipe->transfer_unmap(vpipe, xfer);
+ vpipe->transfer_destroy(vpipe, xfer);
XVMC_MSG(XVMC_TRACE, "[XvMC] Subpicture %p composited.\n", subpicture);
diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c
index ea1f648e7fc..0decc45a0bb 100644
--- a/src/gallium/state_trackers/xorg/xvmc/surface.c
+++ b/src/gallium/state_trackers/xorg/xvmc/surface.c
@@ -423,7 +423,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p has subpicture %p.\n", surface, surface_priv->subpicture);
assert(subpicture_priv->surface == surface);
- vpipe->set_picture_layers(vpipe, &subpicture_priv->sfc, &src_rects, &dst_rects, 1);
+ vpipe->set_picture_layers(vpipe, &subpicture_priv->sfc, src_rects, dst_rects, 1);
surface_priv->subpicture = NULL;
subpicture_priv->surface = NULL;
@@ -432,7 +432,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
vpipe->set_picture_layers(vpipe, NULL, NULL, NULL, 0);
vpipe->render_picture(vpipe, surface_priv->pipe_vsfc, PictureToPipe(flags), &src_rect,
- drawable_surface, &dst_rect, surface_priv->disp_fence);
+ drawable_surface, &dst_rect, &surface_priv->disp_fence);
XVMC_MSG(XVMC_TRACE, "[XvMC] Submitted surface %p for display. Pushing to front buffer.\n", surface);