summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-06-28 12:24:27 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-06-28 12:37:35 +0100
commit47e6bfa4f40cf7efcfe7eee24d2512d737fd7e89 (patch)
treead9343df39051bf4711c09f1458bdd69180c8b11 /src/sna
parent93e77ee019248fe77483e83f2210d584bb5d1be2 (diff)
sna: Force use of per-crtc scanout if the offset is too large
On gen4+, the scanout offset into a tiled surface is specified through the DSPTILEOFF register and limited to 12bits of precision. So if we have a CRTC positioned in that nether-region, we need to allocate a separate per-crtc pixmap for it and perform shadowing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna.h1
-rw-r--r--src/sna/sna_display.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 2e8925b7..d4cb42f6 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -234,6 +234,7 @@ struct sna {
struct sna_mode {
drmModeResPtr kmode;
+ int max_tile_offset;
int shadow_active;
DamagePtr shadow_damage;
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index fed7411d..648d5c53 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -790,6 +790,14 @@ static bool use_shadow(struct sna *sna, xf86CrtcPtr crtc)
return true;
}
+ if (crtc->x >= sna->mode.max_tile_offset ||
+ crtc->y >= sna->mode.max_tile_offset) {
+ DBG(("%s: offset too large (%d, %d) >= %d\n",
+ __FUNCTION__,
+ crtc->x, crtc->y, sna->mode.max_tile_offset));
+ return true;
+ }
+
transform = NULL;
if (crtc->transformPresent)
transform = &crtc->transform;
@@ -2201,6 +2209,7 @@ Bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
"failed to get resources: %s\n", strerror(errno));
return FALSE;
}
+ mode->max_tile_offset = 4096;
set_size_range(sna);