]> git.draconx.ca Git - gentoo-draconx.git/commitdiff
xf86-video-intel: Update Xv fix to the actual patches in git.
authorNick Bowler <nbowler@draconx.ca>
Fri, 9 Apr 2010 14:12:00 +0000 (10:12 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 9 Apr 2010 14:12:50 +0000 (10:12 -0400)
x11-drivers/xf86-video-intel/Manifest
x11-drivers/xf86-video-intel/files/0001-Revert-Xv-fixup-XvMC-on-i915.patch [deleted file]
x11-drivers/xf86-video-intel/files/0001-i965-Xv-fix-chroma-pitch.patch [new file with mode: 0644]
x11-drivers/xf86-video-intel/files/0002-Xv-fixup-overlay-stride-confusion.patch [new file with mode: 0644]
x11-drivers/xf86-video-intel/xf86-video-intel-2.11.0.ebuild

index 9ed0a9b0ed3c4e25e2cfbfe08e2daf8a49b78f9a..fabe3de61d70a9e0222813eab60c2a28ec52ba48 100644 (file)
@@ -1,3 +1,4 @@
-AUX 0001-Revert-Xv-fixup-XvMC-on-i915.patch 6620 RMD160 46c76543ffbc08c69881ae61ca6cfd37ae3e6845 SHA1 b9b4aac92895352a53ac39b09b41ed72b2c990aa SHA256 1e43c43f5f2c51468b792f0cf2c4979f546d2fa76089379a89146c3f311934c5
+AUX 0001-i965-Xv-fix-chroma-pitch.patch 2720 RMD160 23ab0acb4121bad484ba876d967b084a771c24b8 SHA1 c4fa5b41191d796fcb5cd42af7b8bdae1320a4e7 SHA256 536408a2e14096181948ff4da48f98a67e9fa58bcd5a78d78e1eee960189e183
+AUX 0002-Xv-fixup-overlay-stride-confusion.patch 1146 RMD160 aa10d8e51d293442e819b5bed5c741c9dae26536 SHA1 aa01f79634c986af8ab56f6315e16a4a083aa254 SHA256 c6457f3fbcebfa402a5506e05f39683a0e909ecd462d2bebe8da5644eb833a6e
 DIST xf86-video-intel-2.11.0.tar.bz2 871551 RMD160 a857942e7eacd9e7c517c485fb6e400103e238f3 SHA1 f25eb8619ac7c107fdcee525388a8a03dd62719b SHA256 db292cbc25f3b132357795697a61c5ec6f08cb041a2cb6fd081298306f4f5a4f
-EBUILD xf86-video-intel-2.11.0.ebuild 1425 RMD160 a6ef265f2175178ce76a995e6917fa59f8fadcea SHA1 26bf76846050c9555134b9b09acd21c2df95c7ab SHA256 1cd166abcc8070111c4e7ef8e3089583f1cf5308138a0c285feb078e7668342b
+EBUILD xf86-video-intel-2.11.0.ebuild 1488 RMD160 7efc519ad50a74fffccc0c05904793619494d333 SHA1 3ed5a7fe54e6d718c569f885157812c5a1381687 SHA256 60885d3c3b2bc42875d15b6ab200a9fb010f8e5f91d38fd2d804fd2e3e4ae20b
diff --git a/x11-drivers/xf86-video-intel/files/0001-Revert-Xv-fixup-XvMC-on-i915.patch b/x11-drivers/xf86-video-intel/files/0001-Revert-Xv-fixup-XvMC-on-i915.patch
deleted file mode 100644 (file)
index 012abd5..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-From eca670dc31eb1793297b524760c057b80da194a9 Mon Sep 17 00:00:00 2001
-From: Nick Bowler <nbowler@elliptictech.com>
-Date: Mon, 5 Apr 2010 08:38:58 -0400
-Subject: [PATCH] Revert "Xv: fixup XvMC on i915"
-
-This reverts commit cb06aa32d433f54affe87da2cf964f0308d3c258.
-
-Conflicts:
-
-       src/i830_video.c
----
- src/i830_video.c |   67 +++++++++++++++++++++++++++++------------------------
- 1 files changed, 37 insertions(+), 30 deletions(-)
-
-diff --git a/src/i830_video.c b/src/i830_video.c
-index db72863..1def5e1 100644
---- a/src/i830_video.c
-+++ b/src/i830_video.c
-@@ -267,7 +267,7 @@ static void drmmode_overlay_off(ScrnInfoPtr scrn)
- static Bool
- drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
-                         int id, short width, short height,
--                        int dstPitch, int dstPitch2,
-+                        int dstPitch,
-                         BoxPtr dstBox, short src_w, short src_h, short drw_w,
-                         short drw_h)
- {
-@@ -282,7 +282,7 @@ drmmode_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
-       request.bo_handle = adaptor_priv->buf->handle;
-       if (planar) {
--              request.stride_Y = dstPitch2;
-+              request.stride_Y = dstPitch * 2;
-               request.stride_UV = dstPitch;
-       } else {
-               request.stride_Y = dstPitch;
-@@ -959,12 +959,12 @@ static void i830_memcpy_plane(unsigned char *dst, unsigned char *src,
- static void
- I830CopyPlanarData(intel_adaptor_private *adaptor_priv,
--                 unsigned char *buf, int srcPitch, int srcPitch2,
--                 int dstPitch, int dstPitch2,
--                 int srcH, int top, int left,
-+                 unsigned char *buf, int srcPitch,
-+                 int srcPitch2, int dstPitch, int srcH, int top, int left,
-                  int h, int w, int id)
- {
-       unsigned char *src1, *src2, *src3, *dst_base, *dst1, *dst2, *dst3;
-+      int dstPitch2 = dstPitch << 1;
- #if 0
-       ErrorF("I830CopyPlanarData: srcPitch %d, srcPitch %d, dstPitch %d\n"
-@@ -1181,7 +1181,7 @@ static int xvmc_passthrough(int id)
- static Bool
- i830_display_overlay(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
-                    int id, short width, short height,
--                   int dstPitch, int dstPitch2,
-+                   int dstPitch,
-                    BoxPtr dstBox, short src_w, short src_h, short drw_w,
-                    short drw_h)
- {
-@@ -1214,7 +1214,7 @@ i830_display_overlay(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
-       }
-       return drmmode_overlay_put_image(scrn, crtc, id, width, height,
--                                       dstPitch, dstPitch2, dstBox,
-+                                       dstPitch, dstBox,
-                                        src_w, src_h, drw_w, drw_h);
- }
-@@ -1362,33 +1362,28 @@ i830_setup_dst_params(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, sho
-               if (IS_I965G(intel))
-                       pitchAlignMask = 255;
-               else
--                      pitchAlignMask = 255;
-+                      pitchAlignMask = 63;
-       }
--#if INTEL_XVMC
--      /* for i915 xvmc, hw requires 1kb aligned surfaces */
--      if ((id == FOURCC_XVMC) && IS_I915(intel))
--              pitchAlignMask = 0x3ff;
--#endif
--
-       /* Determine the desired destination pitch (representing the chroma's pitch,
-        * in the planar case.
-        */
--      if (is_planar_fourcc(id)) {
-+      switch (id) {
-+      case FOURCC_YV12:
-+      case FOURCC_I420:
-               if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
-                       *dstPitch =
-                           ((height / 2) + pitchAlignMask) & ~pitchAlignMask;
--                      *dstPitch2 =
--                          (height + pitchAlignMask) & ~pitchAlignMask;
-                       *size = *dstPitch * width * 3;
-               } else {
-                       *dstPitch =
-                           ((width / 2) + pitchAlignMask) & ~pitchAlignMask;
--                      *dstPitch2 =
--                          (width + pitchAlignMask) & ~pitchAlignMask;
-                       *size = *dstPitch * height * 3;
-               }
--      } else {
-+              break;
-+      case FOURCC_UYVY:
-+      case FOURCC_YUY2:
-+
-               if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
-                       *dstPitch =
-                           ((height << 1) + pitchAlignMask) & ~pitchAlignMask;
-@@ -1398,7 +1393,18 @@ i830_setup_dst_params(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, sho
-                           ((width << 1) + pitchAlignMask) & ~pitchAlignMask;
-                       *size = *dstPitch * height;
-               }
--              *dstPitch2 = 0;
-+              break;
-+#ifdef INTEL_XVMC
-+      case FOURCC_XVMC:
-+              *dstPitch = ((width / 2) + pitchAlignMask) & ~pitchAlignMask;
-+              *dstPitch2 = (width + pitchAlignMask) & ~pitchAlignMask;
-+              *size = 0;
-+              break;
-+#endif
-+      default:
-+              *dstPitch = 0;
-+              *size = 0;
-+              break;
-       }
- #if 0
-       ErrorF("srcPitch: %d, dstPitch: %d, size: %d\n", srcPitch, *dstPitch,
-@@ -1409,12 +1415,12 @@ i830_setup_dst_params(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, sho
-       if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
-               adaptor_priv->UBufOffset =
--                  adaptor_priv->YBufOffset + (*dstPitch2 * width);
-+                  adaptor_priv->YBufOffset + (*dstPitch * 2 * width);
-               adaptor_priv->VBufOffset =
-                   adaptor_priv->UBufOffset + (*dstPitch * width / 2);
-       } else {
-               adaptor_priv->UBufOffset =
--                  adaptor_priv->YBufOffset + (*dstPitch2 * height);
-+                  adaptor_priv->YBufOffset + (*dstPitch * 2 * height);
-               adaptor_priv->VBufOffset =
-                   adaptor_priv->UBufOffset + (*dstPitch * height / 2);
-       }
-@@ -1445,8 +1451,7 @@ i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv,
-       /* copy data */
-       if (is_planar_fourcc(id)) {
-               I830CopyPlanarData(adaptor_priv, buf, srcPitch, srcPitch2,
--                                 *dstPitch, *dstPitch2,
--                                 height, top, left, nlines,
-+                                 *dstPitch, height, top, left, nlines,
-                                  npixels, id);
-       } else {
-               I830CopyPackedData(adaptor_priv, buf, srcPitch, *dstPitch, top, left,
-@@ -1483,7 +1488,8 @@ I830PutImageTextured(ScrnInfoPtr scrn,
-       intel_screen_private *intel = intel_get_screen_private(scrn);
-       intel_adaptor_private *adaptor_priv = (intel_adaptor_private *) data;
-       PixmapPtr pixmap = get_drawable_pixmap(drawable);
--      int dstPitch, dstPitch2;
-+      int dstPitch;
-+      int dstPitch2 = 0;
-       BoxRec dstBox;
-       xf86CrtcPtr crtc;
-       int top, left, npixels, nlines;
-@@ -1509,8 +1515,8 @@ I830PutImageTextured(ScrnInfoPtr scrn,
-               int size;
-               i830_free_video_buffers(adaptor_priv);
--              i830_setup_dst_params(scrn, adaptor_priv, width, height,
--                              &dstPitch, &dstPitch2, &size, id);
-+              i830_setup_dst_params(scrn, adaptor_priv, width, height, &dstPitch,
-+                              &dstPitch2, &size, id);
-               if (IS_I915G(intel) || IS_I915GM(intel)) {
-                       /* XXX: i915 is not support and needs some
-@@ -1540,7 +1546,8 @@ I830PutImageTextured(ScrnInfoPtr scrn,
-                                        drw_w, drw_h, pixmap);
-       } else {
-               I915DisplayVideoTextured(scrn, adaptor_priv, id, clipBoxes,
--                                       width, height, dstPitch, dstPitch2,
-+                                       width, height, dstPitch,
-+                                       dstPitch2,
-                                        src_w, src_h, drw_w, drw_h,
-                                        pixmap);
-       }
-@@ -1608,7 +1615,7 @@ I830PutImageOverlay(ScrnInfoPtr scrn,
-               return BadAlloc;
-       if (!i830_display_overlay
--          (scrn, crtc, id, width, height, dstPitch, dstPitch2,
-+          (scrn, crtc, id, width, height, dstPitch,
-            &dstBox, src_w, src_h, drw_w, drw_h))
-               return BadAlloc;
--- 
-1.7.0.4
-
diff --git a/x11-drivers/xf86-video-intel/files/0001-i965-Xv-fix-chroma-pitch.patch b/x11-drivers/xf86-video-intel/files/0001-i965-Xv-fix-chroma-pitch.patch
new file mode 100644 (file)
index 0000000..567ff0c
--- /dev/null
@@ -0,0 +1,74 @@
+From bdf0ee509c26ab35e60f3ed02549efa435be032f Mon Sep 17 00:00:00 2001
+From: Daniel Vetter <daniel.vetter@ffwll.ch>
+Date: Thu, 8 Apr 2010 13:29:04 +0200
+Subject: [PATCH 1/3] i965 Xv: fix chroma pitch
+
+In my recent fix for the chroma pitch for i915 xvmc I've forgotten about
+i965 class hw. For videos with a non-even sized stride (measured in dwords)
+the chroma pitch was internally incosistent and one dword off.
+
+Fix this by using pitch2 for the chroma pitch in i965 textured video like
+everywhere else.
+
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27417
+Tested-by: Nick Bowler <nbowler@draconx.ca>
+Tested-by: Sven Arvidsson <sa@whiz.se>
+---
+ src/i830_video.c |    2 +-
+ src/i830_video.h |    2 +-
+ src/i965_video.c |    5 +++--
+ 3 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/i830_video.c b/src/i830_video.c
+index c8edcd6..45213cb 100644
+--- a/src/i830_video.c
++++ b/src/i830_video.c
+@@ -1525,7 +1525,7 @@ I830PutImageTextured(ScrnInfoPtr scrn,
+       if (IS_I965G(intel)) {
+               I965DisplayVideoTextured(scrn, adaptor_priv, id, clipBoxes,
+-                                       width, height, dstPitch,
++                                       width, height, dstPitch, dstPitch2,
+                                        src_w, src_h,
+                                        drw_w, drw_h, pixmap);
+       } else {
+diff --git a/src/i830_video.h b/src/i830_video.h
+index fcdae73..b5753bf 100644
+--- a/src/i830_video.h
++++ b/src/i830_video.h
+@@ -76,7 +76,7 @@ void I915DisplayVideoTextured(ScrnInfoPtr scrn,
+ void I965DisplayVideoTextured(ScrnInfoPtr scrn,
+                             intel_adaptor_private *adaptor_priv,
+                             int id, RegionPtr dstRegion, short width,
+-                            short height, int video_pitch,
++                            short height, int video_pitch, int video_pitch2,
+                             short src_w, short src_h,
+                             short drw_w, short drw_h, PixmapPtr pixmap);
+diff --git a/src/i965_video.c b/src/i965_video.c
+index 05dd2c3..c537860 100644
+--- a/src/i965_video.c
++++ b/src/i965_video.c
+@@ -980,7 +980,8 @@ void
+ I965DisplayVideoTextured(ScrnInfoPtr scrn,
+                        intel_adaptor_private *adaptor_priv, int id,
+                        RegionPtr dstRegion,
+-                       short width, short height, int video_pitch,
++                       short width, short height,
++                       int video_pitch, int video_pitch2,
+                        short src_w, short src_h,
+                        short drw_w, short drw_h, PixmapPtr pixmap)
+ {
+@@ -1023,7 +1024,7 @@ I965DisplayVideoTextured(ScrnInfoPtr scrn,
+               src_surf_format = BRW_SURFACEFORMAT_R8_UNORM;
+               src_width[1] = src_width[0] = width;
+               src_height[1] = src_height[0] = height;
+-              src_pitch[1] = src_pitch[0] = video_pitch * 2;
++              src_pitch[1] = src_pitch[0] = video_pitch2;
+               src_width[4] = src_width[5] = src_width[2] = src_width[3] =
+                   width / 2;
+               src_height[4] = src_height[5] = src_height[2] = src_height[3] =
+-- 
+1.6.4.4
+
diff --git a/x11-drivers/xf86-video-intel/files/0002-Xv-fixup-overlay-stride-confusion.patch b/x11-drivers/xf86-video-intel/files/0002-Xv-fixup-overlay-stride-confusion.patch
new file mode 100644 (file)
index 0000000..ea304ff
--- /dev/null
@@ -0,0 +1,37 @@
+From 3d7723526b181686d62f09f81fba3ccdbf7d2b1a Mon Sep 17 00:00:00 2001
+From: Daniel Vetter <daniel.vetter@ffwll.ch>
+Date: Thu, 8 Apr 2010 22:21:01 +0200
+Subject: [PATCH 2/3] Xv: fixup overlay stride confusion
+
+For some reason I've made a mess out of the overlay stride constrains.
+Fix it up.
+
+Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
+Tested-by: Calvin Walton <calvin.walton@gmail.com>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27453
+---
+ src/i830_video.c |    7 +++++--
+ 1 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src/i830_video.c b/src/i830_video.c
+index 45213cb..c6fd78d 100644
+--- a/src/i830_video.c
++++ b/src/i830_video.c
+@@ -1348,9 +1348,12 @@ i830_setup_dst_params(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, sho
+               pitchAlignMask = 3;
+       } else {
+               if (IS_I965G(intel))
+-                      pitchAlignMask = 255;
++                      /* Actually the alignment is 64 bytes, too. But the
++                       * stride must be at least 512 bytes. Take the easy fix
++                       * and align on 512 bytes unconditionally. */
++                      pitchAlignMask = 511;
+               else
+-                      pitchAlignMask = 255;
++                      pitchAlignMask = 63;
+       }
+ #if INTEL_XVMC
+-- 
+1.6.4.4
+
index 677aed4b71ec7aede3dc8cc24f83885aa80de558..e774c402c603560ed74c5beb92d15db67d383952 100644 (file)
@@ -34,7 +34,8 @@ pkg_setup() {
 }
 
 src_prepare() {
-       epatch "${FILESDIR}/0001-Revert-Xv-fixup-XvMC-on-i915.patch"
+       epatch "${FILESDIR}/0001-i965-Xv-fix-chroma-pitch.patch"
+       epatch "${FILESDIR}/0002-Xv-fixup-overlay-stride-confusion.patch"
 }
 
 pkg_postinst() {