diff options
author | Dave Airlie <airlied@redhat.com> | 2008-03-06 20:17:45 -0500 |
---|---|---|
committer | Alex Deucher <alex@cube.(none)> | 2008-03-06 20:17:45 -0500 |
commit | c3a3635865e380c784a226c8ead069d4716d6b75 (patch) | |
tree | 12537f190ca33621cb6cebb409f87d5862664c72 /src/radeon_crtc.c | |
parent | df1b94dc4eb1f35b636dbf2ec0ab1c2da9937c0d (diff) |
RADEON: fix tiling/interlaced interaction with randr 1.2
Diffstat (limited to 'src/radeon_crtc.c')
-rw-r--r-- | src/radeon_crtc.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c index 7164138e..3628d969 100644 --- a/src/radeon_crtc.c +++ b/src/radeon_crtc.c @@ -723,3 +723,39 @@ RADEONUnblank(ScrnInfoPtr pScrn) } } +Bool +RADEONSetTiling(ScrnInfoPtr pScrn) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONCrtcPrivatePtr radeon_crtc; + xf86CrtcPtr crtc; + int c; + int can_tile = 1; + Bool changed = FALSE; + + for (c = 0; c < xf86_config->num_crtc; c++) { + crtc = xf86_config->crtc[c]; + radeon_crtc = crtc->driver_private; + + if (!radeon_crtc->can_tile) + can_tile = 0; + } + + if (info->tilingEnabled != can_tile) + changed = TRUE; + +#ifdef XF86DRI + if (info->directRenderingEnabled && (info->tilingEnabled != can_tile)) { + RADEONSAREAPrivPtr pSAREAPriv; + if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_SWITCH_TILING, (info->tilingEnabled ? 1 : 0)) < 0) + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "[drm] failed changing tiling status\n"); + /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */ + pSAREAPriv = DRIGetSAREAPrivate(screenInfo.screens[pScrn->scrnIndex]); + info->tilingEnabled = pSAREAPriv->tiling_enabled ? TRUE : FALSE; + } +#endif + + return changed; +} |