debian/patches/hsw-green-xv.patch |   79 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

New commits:
commit 72d3038f0d641f0c168dfc6985a12830cfec209c
Author: Timo Aaltonen <tjaal...@ubuntu.com>
Date:   Sat Sep 28 09:14:05 2013 +0300

    add the patch too

diff --git a/debian/patches/hsw-green-xv.patch 
b/debian/patches/hsw-green-xv.patch
new file mode 100644
index 0000000..1cba97e
--- /dev/null
+++ b/debian/patches/hsw-green-xv.patch
@@ -0,0 +1,79 @@
+From 8f340f90f4b2f269d6308d0bd31fbc2a5f579608 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <ch...@chris-wilson.co.uk>
+Date: Thu, 13 Jun 2013 15:08:49 +0000
+Subject: sna/gen7: Set sampler swizzle for video sources
+
+Otherwise the sampler on Haswell will just read all zeros when trying to
+playback a video.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65699
+Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
+---
+diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
+index 1212975..20dc6d8 100644
+--- a/src/sna/gen7_render.c
++++ b/src/sna/gen7_render.c
+@@ -1638,33 +1638,41 @@ gen7_composite_create_blend_state(struct 
sna_static_stream *stream)
+ }
+ 
+ static uint32_t gen7_bind_video_source(struct sna *sna,
+-                                     struct kgem_bo *src_bo,
+-                                     uint32_t src_offset,
+-                                     int src_width,
+-                                     int src_height,
+-                                     int src_pitch,
+-                                     uint32_t src_surf_format)
++                                     struct kgem_bo *bo,
++                                     uint32_t offset,
++                                     int width,
++                                     int height,
++                                     int pitch,
++                                     uint32_t format)
+ {
+-      struct gen7_surface_state *ss;
++      uint32_t *ss, bind;
+ 
+-      sna->kgem.surface -= sizeof(struct gen7_surface_state) / 
sizeof(uint32_t);
++      bind = sna->kgem.surface -=
++              sizeof(struct gen7_surface_state) / sizeof(uint32_t);
+ 
+-      ss = memset(sna->kgem.batch + sna->kgem.surface, 0, sizeof(*ss));
+-      ss->ss0.surface_type = GEN7_SURFACE_2D;
+-      ss->ss0.surface_format = src_surf_format;
++      assert(bo->tiling == I915_TILING_NONE);
+ 
+-      ss->ss1.base_addr =
+-              kgem_add_reloc(&sna->kgem,
+-                             sna->kgem.surface + 1,
+-                             src_bo,
++      ss = sna->kgem.batch + bind;
++      ss[0] = (GEN7_SURFACE_2D << GEN7_SURFACE_TYPE_SHIFT |
++               format << GEN7_SURFACE_FORMAT_SHIFT);
++      ss[1] = kgem_add_reloc(&sna->kgem, bind + 1, bo,
+                              I915_GEM_DOMAIN_SAMPLER << 16,
+-                             src_offset);
++                             offset);
++      ss[2] = ((width - 1)  << GEN7_SURFACE_WIDTH_SHIFT |
++               (height - 1) << GEN7_SURFACE_HEIGHT_SHIFT);
++      ss[3] = (pitch - 1) << GEN7_SURFACE_PITCH_SHIFT;
++      ss[4] = 0;
++      ss[5] = 0;
++      ss[6] = 0;
++      ss[7] = 0;
++      if (sna->kgem.gen == 075)
++              ss[7] |= HSW_SURFACE_SWIZZLE(RED, GREEN, BLUE, ALPHA);
+ 
+-      ss->ss2.width  = src_width - 1;
+-      ss->ss2.height = src_height - 1;
+-      ss->ss3.pitch  = src_pitch - 1;
++      DBG(("[%x] bind bo(handle=%d, addr=%d), format=%d, width=%d, height=%d, 
pitch=%d, offset=%d\n",
++           bind, bo->handle, ss[1],
++           format, width, height, pitch, offset));
+ 
+-      return sna->kgem.surface * sizeof(uint32_t);
++      return bind * sizeof(uint32_t);
+ }
+ 
+ static void gen7_emit_video_state(struct sna *sna,
+--
+cgit v0.9.0.2-2-gbebe


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1vpnn7-0000te...@vasks.debian.org

Reply via email to