1 From bdf0ee509c26ab35e60f3ed02549efa435be032f Mon Sep 17 00:00:00 2001
2 From: Daniel Vetter <daniel.vetter@ffwll.ch>
3 Date: Thu, 8 Apr 2010 13:29:04 +0200
4 Subject: [PATCH 1/3] i965 Xv: fix chroma pitch
6 In my recent fix for the chroma pitch for i915 xvmc I've forgotten about
7 i965 class hw. For videos with a non-even sized stride (measured in dwords)
8 the chroma pitch was internally incosistent and one dword off.
10 Fix this by using pitch2 for the chroma pitch in i965 textured video like
13 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
14 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27417
15 Tested-by: Nick Bowler <nbowler@draconx.ca>
16 Tested-by: Sven Arvidsson <sa@whiz.se>
18 src/i830_video.c | 2 +-
19 src/i830_video.h | 2 +-
20 src/i965_video.c | 5 +++--
21 3 files changed, 5 insertions(+), 4 deletions(-)
23 diff --git a/src/i830_video.c b/src/i830_video.c
24 index c8edcd6..45213cb 100644
25 --- a/src/i830_video.c
26 +++ b/src/i830_video.c
27 @@ -1525,7 +1525,7 @@ I830PutImageTextured(ScrnInfoPtr scrn,
29 if (IS_I965G(intel)) {
30 I965DisplayVideoTextured(scrn, adaptor_priv, id, clipBoxes,
31 - width, height, dstPitch,
32 + width, height, dstPitch, dstPitch2,
34 drw_w, drw_h, pixmap);
36 diff --git a/src/i830_video.h b/src/i830_video.h
37 index fcdae73..b5753bf 100644
38 --- a/src/i830_video.h
39 +++ b/src/i830_video.h
40 @@ -76,7 +76,7 @@ void I915DisplayVideoTextured(ScrnInfoPtr scrn,
41 void I965DisplayVideoTextured(ScrnInfoPtr scrn,
42 intel_adaptor_private *adaptor_priv,
43 int id, RegionPtr dstRegion, short width,
44 - short height, int video_pitch,
45 + short height, int video_pitch, int video_pitch2,
46 short src_w, short src_h,
47 short drw_w, short drw_h, PixmapPtr pixmap);
49 diff --git a/src/i965_video.c b/src/i965_video.c
50 index 05dd2c3..c537860 100644
51 --- a/src/i965_video.c
52 +++ b/src/i965_video.c
53 @@ -980,7 +980,8 @@ void
54 I965DisplayVideoTextured(ScrnInfoPtr scrn,
55 intel_adaptor_private *adaptor_priv, int id,
57 - short width, short height, int video_pitch,
58 + short width, short height,
59 + int video_pitch, int video_pitch2,
60 short src_w, short src_h,
61 short drw_w, short drw_h, PixmapPtr pixmap)
63 @@ -1023,7 +1024,7 @@ I965DisplayVideoTextured(ScrnInfoPtr scrn,
64 src_surf_format = BRW_SURFACEFORMAT_R8_UNORM;
65 src_width[1] = src_width[0] = width;
66 src_height[1] = src_height[0] = height;
67 - src_pitch[1] = src_pitch[0] = video_pitch * 2;
68 + src_pitch[1] = src_pitch[0] = video_pitch2;
69 src_width[4] = src_width[5] = src_width[2] = src_width[3] =
71 src_height[4] = src_height[5] = src_height[2] = src_height[3] =