summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-11 13:52:42 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-11 13:52:42 +0000
commit3ae7fb918a2ca47d3944521a1ae30143dcb14eeb (patch)
treebfb606aed532c7b157c944d3865ce93926e05cbe
parent2f35d77cd07a4974051c922f4809ce44939b0556 (diff)
sna: Restrict pitch alignment on 945gm to 64 bytes
In theory we should be able to disable dual-stream mode and so be subject to much looser restrictions (such as the pitch need only be dword aligned). However, achieving single-stream mode seems quite difficult! Reported-by: Paul Neumann <paul104x@yahoo.de> References: https://bugs.freedesktop.org/show_bug.cgi?id=43706 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen3_render.c19
-rw-r--r--src/sna/kgem.c20
2 files changed, 11 insertions, 28 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index ffde637f..0be78c84 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -2201,25 +2201,6 @@ gen3_composite_set_target(struct sna *sna,
if (priv == NULL)
return FALSE;
- /* XXX This should only be necessary if we fail to disable depth! */
-#if 0
- if (priv->gpu_bo->pitch < 16) {
- struct kgem_bo *bo;
-
- if (priv->pinned)
- return FALSE;
-
- bo = kgem_replace_bo(&sna->kgem, priv->gpu_bo,
- op->dst.width, op->dst.height, 16,
- op->dst.pixmap->drawable.bitsPerPixel);
- if (bo == NULL)
- return FALSE;
-
- kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
- priv->gpu_bo = bo;
- }
-#endif
-
op->dst.bo = priv->gpu_bo;
op->damage = &priv->gpu_damage;
if (sna_damage_is_all(op->damage, op->dst.width, op->dst.height))
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 6657dc8b..f7c4ca3d 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -433,6 +433,16 @@ static uint32_t kgem_get_unique_id(struct kgem *kgem)
return id;
}
+static uint32_t kgem_untiled_pitch(struct kgem *kgem,
+ uint32_t width, uint32_t bpp,
+ bool scanout)
+{
+ /* XXX workaround an issue on gen3 where we appear to fail to
+ * disable dual-stream mode */
+ return ALIGN(width * bpp,
+ scanout || (kgem->gen >= 30 && kgem->gen < 33) ? 8*64 : 8*4) >> 3;
+}
+
static uint32_t kgem_surface_size(struct kgem *kgem,
bool relaxed_fencing,
bool scanout,
@@ -456,7 +466,7 @@ static uint32_t kgem_surface_size(struct kgem *kgem,
} else switch (tiling) {
default:
case I915_TILING_NONE:
- tile_width = scanout ? 64 : 4;
+ tile_width = scanout || kgem->gen < 33 ? 64 : 4;
tile_height = 2;
break;
case I915_TILING_X:
@@ -507,14 +517,6 @@ static uint32_t kgem_surface_size(struct kgem *kgem,
return tile_width;
}
-static uint32_t kgem_untiled_pitch(struct kgem *kgem,
- uint32_t width,
- uint32_t bpp,
- bool scanout)
-{
- return ALIGN(width * bpp / 8, scanout ? 64 : 4);
-}
-
static uint32_t kgem_aligned_height(struct kgem *kgem,
uint32_t height, uint32_t tiling)
{