1 From eca670dc31eb1793297b524760c057b80da194a9 Mon Sep 17 00:00:00 2001
2 From: Nick Bowler <nbowler@elliptictech.com>
3 Date: Mon, 5 Apr 2010 08:38:58 -0400
4 Subject: [PATCH] Revert "Xv: fixup XvMC on i915"
6 This reverts commit cb06aa32d433f54affe87da2cf964f0308d3c258.
12 src/i830_video.c | 67 +++++++++++++++++++++++++++++------------------------
13 1 files changed, 37 insertions(+), 30 deletions(-)
15 diff --git a/src/i830_video.c b/src/i830_video.c
16 index db72863..1def5e1 100644
17 --- a/src/i830_video.c
18 +++ b/src/i830_video.c
19 @@ -267,7 +267,7 @@ static void drmmode_overlay_off(ScrnInfoPtr scrn)
21 drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
22 int id, short width, short height,
23 - int dstPitch, int dstPitch2,
25 BoxPtr dstBox, short src_w, short src_h, short drw_w,
28 @@ -282,7 +282,7 @@ drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
30 request.bo_handle = adaptor_priv->buf->handle;
32 - request.stride_Y = dstPitch2;
33 + request.stride_Y = dstPitch * 2;
34 request.stride_UV = dstPitch;
36 request.stride_Y = dstPitch;
37 @@ -959,12 +959,12 @@ static void i830_memcpy_plane(unsigned char *dst, unsigned char *src,
40 I830CopyPlanarData(intel_adaptor_private *adaptor_priv,
41 - unsigned char *buf, int srcPitch, int srcPitch2,
42 - int dstPitch, int dstPitch2,
43 - int srcH, int top, int left,
44 + unsigned char *buf, int srcPitch,
45 + int srcPitch2, int dstPitch, int srcH, int top, int left,
48 unsigned char *src1, *src2, *src3, *dst_base, *dst1, *dst2, *dst3;
49 + int dstPitch2 = dstPitch << 1;
52 ErrorF("I830CopyPlanarData: srcPitch %d, srcPitch %d, dstPitch %d\n"
53 @@ -1181,7 +1181,7 @@ static int xvmc_passthrough(int id)
55 i830_display_overlay(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
56 int id, short width, short height,
57 - int dstPitch, int dstPitch2,
59 BoxPtr dstBox, short src_w, short src_h, short drw_w,
62 @@ -1214,7 +1214,7 @@ i830_display_overlay(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
65 return drmmode_overlay_put_image(scrn, crtc, id, width, height,
66 - dstPitch, dstPitch2, dstBox,
68 src_w, src_h, drw_w, drw_h);
71 @@ -1362,33 +1362,28 @@ i830_setup_dst_params(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, sho
75 - pitchAlignMask = 255;
76 + pitchAlignMask = 63;
80 - /* for i915 xvmc, hw requires 1kb aligned surfaces */
81 - if ((id == FOURCC_XVMC) && IS_I915(intel))
82 - pitchAlignMask = 0x3ff;
85 /* Determine the desired destination pitch (representing the chroma's pitch,
88 - if (is_planar_fourcc(id)) {
92 if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
94 ((height / 2) + pitchAlignMask) & ~pitchAlignMask;
96 - (height + pitchAlignMask) & ~pitchAlignMask;
97 *size = *dstPitch * width * 3;
100 ((width / 2) + pitchAlignMask) & ~pitchAlignMask;
102 - (width + pitchAlignMask) & ~pitchAlignMask;
103 *size = *dstPitch * height * 3;
110 if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
112 ((height << 1) + pitchAlignMask) & ~pitchAlignMask;
113 @@ -1398,7 +1393,18 @@ i830_setup_dst_params(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, sho
114 ((width << 1) + pitchAlignMask) & ~pitchAlignMask;
115 *size = *dstPitch * height;
121 + *dstPitch = ((width / 2) + pitchAlignMask) & ~pitchAlignMask;
122 + *dstPitch2 = (width + pitchAlignMask) & ~pitchAlignMask;
132 ErrorF("srcPitch: %d, dstPitch: %d, size: %d\n", srcPitch, *dstPitch,
133 @@ -1409,12 +1415,12 @@ i830_setup_dst_params(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, sho
135 if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
136 adaptor_priv->UBufOffset =
137 - adaptor_priv->YBufOffset + (*dstPitch2 * width);
138 + adaptor_priv->YBufOffset + (*dstPitch * 2 * width);
139 adaptor_priv->VBufOffset =
140 adaptor_priv->UBufOffset + (*dstPitch * width / 2);
142 adaptor_priv->UBufOffset =
143 - adaptor_priv->YBufOffset + (*dstPitch2 * height);
144 + adaptor_priv->YBufOffset + (*dstPitch * 2 * height);
145 adaptor_priv->VBufOffset =
146 adaptor_priv->UBufOffset + (*dstPitch * height / 2);
148 @@ -1445,8 +1451,7 @@ i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv,
150 if (is_planar_fourcc(id)) {
151 I830CopyPlanarData(adaptor_priv, buf, srcPitch, srcPitch2,
152 - *dstPitch, *dstPitch2,
153 - height, top, left, nlines,
154 + *dstPitch, height, top, left, nlines,
157 I830CopyPackedData(adaptor_priv, buf, srcPitch, *dstPitch, top, left,
158 @@ -1483,7 +1488,8 @@ I830PutImageTextured(ScrnInfoPtr scrn,
159 intel_screen_private *intel = intel_get_screen_private(scrn);
160 intel_adaptor_private *adaptor_priv = (intel_adaptor_private *) data;
161 PixmapPtr pixmap = get_drawable_pixmap(drawable);
162 - int dstPitch, dstPitch2;
167 int top, left, npixels, nlines;
168 @@ -1509,8 +1515,8 @@ I830PutImageTextured(ScrnInfoPtr scrn,
170 i830_free_video_buffers(adaptor_priv);
172 - i830_setup_dst_params(scrn, adaptor_priv, width, height,
173 - &dstPitch, &dstPitch2, &size, id);
174 + i830_setup_dst_params(scrn, adaptor_priv, width, height, &dstPitch,
175 + &dstPitch2, &size, id);
177 if (IS_I915G(intel) || IS_I915GM(intel)) {
178 /* XXX: i915 is not support and needs some
179 @@ -1540,7 +1546,8 @@ I830PutImageTextured(ScrnInfoPtr scrn,
180 drw_w, drw_h, pixmap);
182 I915DisplayVideoTextured(scrn, adaptor_priv, id, clipBoxes,
183 - width, height, dstPitch, dstPitch2,
184 + width, height, dstPitch,
186 src_w, src_h, drw_w, drw_h,
189 @@ -1608,7 +1615,7 @@ I830PutImageOverlay(ScrnInfoPtr scrn,
192 if (!i830_display_overlay
193 - (scrn, crtc, id, width, height, dstPitch, dstPitch2,
194 + (scrn, crtc, id, width, height, dstPitch,
195 &dstBox, src_w, src_h, drw_w, drw_h))