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>
This commit is contained in:
Chris Wilson 2012-06-28 12:24:27 +01:00
parent 93e77ee019
commit 47e6bfa4f4
2 changed files with 10 additions and 0 deletions

View File

@ -234,6 +234,7 @@ struct sna {
struct sna_mode {
drmModeResPtr kmode;
int max_tile_offset;
int shadow_active;
DamagePtr shadow_damage;

View File

@ -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);