Mesa (master): st/xorg: fix xv
Zack Rusin
zack at kemper.freedesktop.org
Wed Oct 28 00:54:37 UTC 2009
Module: Mesa
Branch: master
Commit: 2947d1420270476730711892909c3683bb6c5bff
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2947d1420270476730711892909c3683bb6c5bff
Author: Zack Rusin <zackr at vmware.com>
Date: Sun Oct 25 12:19:38 2009 -0400
st/xorg: fix xv
---
src/gallium/state_trackers/xorg/xorg_exa_tgsi.c | 13 +++++--------
src/gallium/state_trackers/xorg/xorg_renderer.c | 1 +
src/gallium/state_trackers/xorg/xorg_xv.c | 16 +++++++++++++++-
3 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c
index 30fcff8..83cc12f 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c
@@ -259,14 +259,6 @@ create_vs(struct pipe_context *pipe,
src = ureg_DECL_vs_input(ureg, input_slot++);
dst = ureg_DECL_output(ureg, TGSI_SEMANTIC_GENERIC, 0);
ureg_MOV(ureg, dst, src);
-
- src = ureg_DECL_vs_input(ureg, input_slot++);
- dst = ureg_DECL_output(ureg, TGSI_SEMANTIC_GENERIC, 1);
- ureg_MOV(ureg, dst, src);
-
- src = ureg_DECL_vs_input(ureg, input_slot++);
- dst = ureg_DECL_output(ureg, TGSI_SEMANTIC_GENERIC, 2);
- ureg_MOV(ureg, dst, src);
}
if (is_composite) {
@@ -328,6 +320,11 @@ create_yuv_shader(struct pipe_context *pipe, struct ureg_program *ureg)
ureg_TEX(ureg, v,
TGSI_TEXTURE_2D, pos, v_sampler);
+ ureg_SUB(ureg, u, ureg_src(u),
+ ureg_scalar(matrow0, TGSI_SWIZZLE_W));
+ ureg_SUB(ureg, v, ureg_src(v),
+ ureg_scalar(matrow0, TGSI_SWIZZLE_W));
+
ureg_MUL(ureg, rgb,
ureg_scalar(ureg_src(y), TGSI_SWIZZLE_X),
matrow0);
diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c
index ec5268f..a740e86 100644
--- a/src/gallium/state_trackers/xorg/xorg_renderer.c
+++ b/src/gallium/state_trackers/xorg/xorg_renderer.c
@@ -869,6 +869,7 @@ void renderer_draw_textures(struct xorg_renderer *r,
pos[2], pos[3],
width, height,
textures);
+ num_textures = 1;
break;
default:
debug_assert(!"Unsupported number of textures");
diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c
index f4b0d56..2a3a42b 100644
--- a/src/gallium/state_trackers/xorg/xorg_xv.c
+++ b/src/gallium/state_trackers/xorg/xorg_xv.c
@@ -22,17 +22,31 @@
/* The ITU-R BT.601 conversion matrix for SDTV. */
+/* original, matrix, but we transpose it to
+ * make the shader easier
static const float bt_601[] = {
- 1.0, 0.0, 1.4075, 0,
+ 1.0, 0.0, 1.4075, ,
1.0, -0.3455, -0.7169, 0,
1.0, 1.7790, 0., 0,
+};*/
+static const float bt_601[] = {
+ 1.0, 1.0, 1.0, 0.5,
+ 0.0, -0.3455, 1.7790, 0,
+ 1.4075, -0.7169, 0., 0,
};
/* The ITU-R BT.709 conversion matrix for HDTV. */
+/* original, but we transpose to make the conversion
+ * in the shader easier
static const float bt_709[] = {
1.0, 0.0, 1.581, 0,
1.0, -0.1881, -0.47, 0,
1.0, 1.8629, 0., 0,
+};*/
+static const float bt_709[] = {
+ 1.0, 1.0, 1.0, 0.5,
+ 0.0, -0.1881, 1.8629, 0,
+ 1.581,-0.47 , 0.0, 0,
};
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
More information about the mesa-commit
mailing list