diff options
author | Alex Deucher <alex@t41p.hsd1.va.comcast.net> | 2007-06-25 15:49:19 -0400 |
---|---|---|
committer | Alex Deucher <alex@t41p.hsd1.va.comcast.net> | 2007-06-25 15:49:19 -0400 |
commit | 52cc1dc1491559a9055f3ba6dd54064bb382ad86 (patch) | |
tree | 1b1ba8a3948cb66736cf2ef9f6276297863c2d40 /src/radeon_crtc.c | |
parent | 3bb46c03fddd3bd79bdab887366aeeced0290a3a (diff) |
RADEON: tiling and FB size fixes
- fix tiling on older radeons
- allow the user to specify FB size using Virtual line in config
Current default is 1600x1200
- reset ecp_div for Xv in randr crtc mode set
Diffstat (limited to 'src/radeon_crtc.c')
-rw-r--r-- | src/radeon_crtc.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c index bee05e27..d7eadd86 100644 --- a/src/radeon_crtc.c +++ b/src/radeon_crtc.c @@ -746,9 +746,25 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; RADEONInfoPtr info = RADEONPTR(pScrn); RADEONMonitorType montype = MT_NONE; + Bool tilingOld = info->tilingEnabled; int i = 0; double dot_clock = 0; + + if (info->allowColorTiling) { + info->tilingEnabled = (adjusted_mode->Flags & (V_DBLSCAN | V_INTERLACE)) ? FALSE : TRUE; +#ifdef XF86DRI + if (info->directRenderingEnabled && (info->tilingEnabled != tilingOld)) { + 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"); + pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen); + info->tilingEnabled = pSAREAPriv->tiling_enabled ? TRUE : FALSE; + } +#endif + } + for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; RADEONOutputPrivatePtr radeon_output = output->driver_private; @@ -811,6 +827,17 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, if (info->DispPriority) RADEONInitDispBandwidth(pScrn); + if (info->tilingEnabled != tilingOld) { + /* need to redraw front buffer, I guess this can be considered a hack ? */ + xf86EnableDisableFBAccess(pScrn->scrnIndex, FALSE); + RADEONChangeSurfaces(pScrn); + xf86EnableDisableFBAccess(pScrn->scrnIndex, TRUE); + /* xf86SetRootClip would do, but can't access that here */ + } + + /* reset ecp_div for Xv */ + info->ecp_div = -1; + } static void |