xf86-video-intel: 2 commits - src/sna/gen3_render.c src/sna/kgem.c
Chris Wilson
ickle at kemper.freedesktop.org
Sun Dec 11 06:00:59 PST 2011
src/sna/gen3_render.c | 19 -------------------
src/sna/kgem.c | 16 ++++++++++++++--
2 files changed, 14 insertions(+), 21 deletions(-)
New commits:
commit 3ae7fb918a2ca47d3944521a1ae30143dcb14eeb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Dec 11 13:52:42 2011 +0000
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 at yahoo.de>
References: https://bugs.freedesktop.org/show_bug.cgi?id=43706
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index ffde637..0be78c8 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 6657dc8..f7c4ca3 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)
{
commit 2f35d77cd07a4974051c922f4809ce44939b0556
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Dec 11 13:37:18 2011 +0000
sna: Update computation of untiled pitch to cater for CREATE_SCANOUT
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 3609a6f..6657dc8 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -507,6 +507,14 @@ 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)
{
@@ -1527,7 +1535,9 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
if (flags & CREATE_INACTIVE)
goto skip_active_search;
- untiled_pitch = ALIGN(width * bpp / 8, bpp > 8 ? 64 : 4);
+ untiled_pitch = kgem_untiled_pitch(kgem,
+ width, bpp,
+ flags & CREATE_SCANOUT);
for (i = 0; i <= I915_TILING_Y; i++)
tiled_height[i] = kgem_aligned_height(kgem, height, i);
More information about the xorg-commit
mailing list