summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alex@t41p.hsd1.va.comcast.net>2008-03-07 14:10:49 -0500
committerAlex Deucher <alex@t41p.hsd1.va.comcast.net>2008-03-07 14:10:49 -0500
commitc28c30c9f3d7bfebfd56a5c982c96f0090982054 (patch)
treec0a8d2c07599d348cbd4807f8cf753e376545da6
parentc3a3635865e380c784a226c8ead069d4716d6b75 (diff)
RADEON: Fix crash in last commit
-rw-r--r--src/legacy_crtc.c2
-rw-r--r--src/radeon_crtc.c25
-rw-r--r--src/radeon_driver.c6
3 files changed, 22 insertions, 11 deletions
diff --git a/src/legacy_crtc.c b/src/legacy_crtc.c
index 63f536c2..06891142 100644
--- a/src/legacy_crtc.c
+++ b/src/legacy_crtc.c
@@ -1665,7 +1665,7 @@ legacy_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
Bool tilingChanged = FALSE;
if (info->allowColorTiling) {
- radeon_crtc->can_tile = (adjusted_mode->Flags & (V_DBLSCAN | V_INTERLACE)) ? FALSE : TRUE;
+ radeon_crtc->can_tile = (adjusted_mode->Flags & (V_DBLSCAN | V_INTERLACE)) ? FALSE : TRUE;
tilingChanged = RADEONSetTiling(pScrn);
}
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index 3628d969..87514b02 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -537,11 +537,12 @@ static const xf86CrtcFuncsRec radeon_crtc_funcs = {
Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask)
{
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
+ RADEONInfoPtr info = RADEONPTR(pScrn);
if (mask & 1) {
if (pRADEONEnt->Controller[0])
return TRUE;
-
+
pRADEONEnt->pCrtc[0] = xf86CrtcCreate(pScrn, &radeon_crtc_funcs);
if (!pRADEONEnt->pCrtc[0])
return FALSE;
@@ -553,16 +554,20 @@ Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask)
pRADEONEnt->pCrtc[0]->driver_private = pRADEONEnt->Controller[0];
pRADEONEnt->Controller[0]->crtc_id = 0;
pRADEONEnt->Controller[0]->crtc_offset = 0;
+ if (info->allowColorTiling)
+ pRADEONEnt->Controller[0]->can_tile = 1;
+ else
+ pRADEONEnt->Controller[0]->can_tile = 0;
}
if (mask & 2) {
if (!pRADEONEnt->HasCRTC2)
return TRUE;
-
+
pRADEONEnt->pCrtc[1] = xf86CrtcCreate(pScrn, &radeon_crtc_funcs);
if (!pRADEONEnt->pCrtc[1])
return FALSE;
-
+
pRADEONEnt->Controller[1] = xnfcalloc(sizeof(RADEONCrtcPrivateRec), 1);
if (!pRADEONEnt->Controller[1])
{
@@ -573,6 +578,10 @@ Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask)
pRADEONEnt->pCrtc[1]->driver_private = pRADEONEnt->Controller[1];
pRADEONEnt->Controller[1]->crtc_id = 1;
pRADEONEnt->Controller[1]->crtc_offset = AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL;
+ if (info->allowColorTiling)
+ pRADEONEnt->Controller[1]->can_tile = 1;
+ else
+ pRADEONEnt->Controller[1]->can_tile = 0;
}
return TRUE;
@@ -738,9 +747,11 @@ RADEONSetTiling(ScrnInfoPtr pScrn)
crtc = xf86_config->crtc[c];
radeon_crtc = crtc->driver_private;
- if (!radeon_crtc->can_tile)
- can_tile = 0;
- }
+ if (crtc->enabled) {
+ if (!radeon_crtc->can_tile)
+ can_tile = 0;
+ }
+ }
if (info->tilingEnabled != can_tile)
changed = TRUE;
@@ -748,7 +759,7 @@ RADEONSetTiling(ScrnInfoPtr pScrn)
#ifdef XF86DRI
if (info->directRenderingEnabled && (info->tilingEnabled != can_tile)) {
RADEONSAREAPrivPtr pSAREAPriv;
- if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_SWITCH_TILING, (info->tilingEnabled ? 1 : 0)) < 0)
+ if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_SWITCH_TILING, (can_tile ? 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 */
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index f7fc1918..de81b2d5 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -2220,7 +2220,7 @@ static void RADEONPreInitColorTiling(ScrnInfoPtr pScrn)
info->pKernelDRMVersion->version_minor,
info->pKernelDRMVersion->version_patchlevel);
info->allowColorTiling = FALSE;
- return;
+ return;
}
#endif /* XF86DRI */
@@ -2687,7 +2687,7 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
if (!RADEONPreInitWeight(pScrn))
goto fail;
- info->DispPriority = 1;
+ info->DispPriority = 1;
if ((s = xf86GetOptValString(info->Options, OPTION_DISP_PRIORITY))) {
if (strcmp(s, "AUTO") == 0) {
info->DispPriority = 1;
@@ -2696,7 +2696,7 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
} else if (strcmp(s, "HIGH") == 0) {
info->DispPriority = 2;
} else
- info->DispPriority = 1;
+ info->DispPriority = 1;
}
if (!RADEONPreInitInt10(pScrn, &pInt10))