From b51e079e1877411fde72372c3953d71e42ac1d6e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jul 2015 12:40:05 -0700 Subject: [PATCH] glamor: Use the new upload/download interface for XV uploads. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't need any of its weird handling of picture formats, since our XV pixmaps don't have any pictures attached. Signed-off-by: Eric Anholt Reviewed-by: Michel Dänzer Reviewed-by: Dave Airlie --- glamor/glamor_pixmap.c | 2 +- glamor/glamor_priv.h | 4 ---- glamor/glamor_xv.c | 34 ++++++++++++++++++++++------------ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c index 9a14527c9..5a09d32dd 100644 --- a/glamor/glamor_pixmap.c +++ b/glamor/glamor_pixmap.c @@ -931,7 +931,7 @@ glamor_put_bits(char *dst_bits, int dst_stride, char *src_bits, } } -Bool +static Bool glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, int h, int stride, void *bits, int pbo) { diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index d085ff258..1614b6fd8 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -708,10 +708,6 @@ Bool glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag); */ enum glamor_pixmap_status glamor_upload_pixmap_to_texture(PixmapPtr pixmap); -Bool glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, - int h, int stride, void *bits, - int pbo); - glamor_pixmap_clipped_regions * glamor_compute_clipped_regions(PixmapPtr pixmap, RegionPtr region, int *clipped_nbox, diff --git a/glamor/glamor_xv.c b/glamor/glamor_xv.c index 364104ddd..85e652832 100644 --- a/glamor/glamor_xv.c +++ b/glamor/glamor_xv.c @@ -37,6 +37,7 @@ #endif #include "glamor_priv.h" +#include "glamor_transfer.h" #include #include "../hw/xfree86/common/fourcc.h" @@ -410,6 +411,7 @@ glamor_xv_put_image(glamor_port_private *port_priv, int srcPitch, srcPitch2; int top, nlines; int s2offset, s3offset, tmp; + BoxRec full_box, half_box; s2offset = s3offset = srcPitch2 = 0; @@ -452,20 +454,28 @@ glamor_xv_put_image(glamor_port_private *port_priv, s2offset = s3offset; s3offset = tmp; } - glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[0], - 0, 0, width, nlines, - srcPitch, - buf + (top * srcPitch), 0); - glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[1], - 0, 0, width >> 1, (nlines + 1) >> 1, - srcPitch2, - buf + s2offset, 0); + full_box.x1 = 0; + full_box.y1 = 0; + full_box.x2 = width; + full_box.y2 = nlines; - glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[2], - 0, 0, width >> 1, (nlines + 1) >> 1, - srcPitch2, - buf + s3offset, 0); + half_box.x1 = 0; + half_box.y1 = 0; + half_box.x2 = width >> 1; + half_box.y2 = (nlines + 1) >> 1; + + glamor_upload_boxes(port_priv->src_pix[0], &full_box, 1, + 0, 0, 0, 0, + buf + (top * srcPitch), srcPitch); + + glamor_upload_boxes(port_priv->src_pix[1], &half_box, 1, + 0, 0, 0, 0, + buf + s2offset, srcPitch2); + + glamor_upload_boxes(port_priv->src_pix[2], &half_box, 1, + 0, 0, 0, 0, + buf + s3offset, srcPitch2); break; default: return BadMatch;