[PATCH 03/12] glamor: Use the new upload/download interface for XV uploads.
Eric Anholt
eric at anholt.net
Wed Jul 8 12:45:09 PDT 2015
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 <eric at anholt.net>
---
glamor/glamor_pixmap.c | 2 +-
glamor/glamor_priv.h | 4 ----
glamor/glamor_xv.c | 38 ++++++++++++++++++++++++--------------
3 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c
index 9a14527..5a09d32 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 d085ff2..1614b6f 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 364104d..85e6528 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 <X11/extensions/Xv.h>
#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);
-
- glamor_upload_sub_pixmap_to_texture(port_priv->src_pix[2],
- 0, 0, width >> 1, (nlines + 1) >> 1,
- srcPitch2,
- buf + s3offset, 0);
+
+ full_box.x1 = 0;
+ full_box.y1 = 0;
+ full_box.x2 = width;
+ full_box.y2 = nlines;
+
+ 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;
--
2.1.4
More information about the xorg-devel
mailing list