summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Airlie <airlied@asimov.stargames.com.au>2007-01-23 10:36:06 +1100
committerDave Airlie <airlied@linux.ie>2007-01-23 10:22:08 +1100
commit2a13a3b641d9acf4f50472e1c8ba07633c3b78d6 (patch)
tree7f8ccbc8ecff6492034f0218cf6094fcda26b217 /src
parentcbd84bed13582e82f8b2e84aa152602474c09cd4 (diff)
fixup init disp bandwidth
This probably break old-style dualhead badly
Diffstat (limited to 'src')
-rw-r--r--src/radeon_display.c43
-rw-r--r--src/radeon_driver.c3
-rw-r--r--src/radeon_randr.c4
3 files changed, 35 insertions, 15 deletions
diff --git a/src/radeon_display.c b/src/radeon_display.c
index afe6f944..1c8d4732 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -1699,8 +1699,7 @@ void RADEONEnableDisplay(ScrnInfoPtr pScrn, xf86OutputPtr output, BOOL bEnable)
}
/* Calculate display buffer watermark to prevent buffer underflow */
-void RADEONInitDispBandwidth2(ScrnInfoPtr pScrn, RADEONInfoPtr info, RADEONInfoPtr info2,
- DisplayModePtr mode1, DisplayModePtr mode2)
+void RADEONInitDispBandwidth2(ScrnInfoPtr pScrn, RADEONInfoPtr info, int pixel_bytes2, DisplayModePtr mode1, DisplayModePtr mode2)
{
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
@@ -1750,11 +1749,6 @@ void RADEONInitDispBandwidth2(ScrnInfoPtr pScrn, RADEONInfoPtr info, RADEONInfoP
/* R420 and RV410 family not supported yet */
if (info->ChipFamily == CHIP_FAMILY_R420 || info->ChipFamily == CHIP_FAMILY_RV410) return;
- if (pRADEONEnt->pSecondaryScrn) {
- if (info->IsSecondary) return;
- info2 = RADEONPTR(pRADEONEnt->pSecondaryScrn);
- } else if (pRADEONEnt->Controller[1]->binding == 1) info2 = info;
-
/*
* Determine if there is enough bandwidth for current display mode
*/
@@ -1767,8 +1761,8 @@ void RADEONInitDispBandwidth2(ScrnInfoPtr pScrn, RADEONInfoPtr info, RADEONInfoP
pix_clk2 = 0;
peak_disp_bw = (pix_clk * info->CurrentLayout.pixel_bytes);
- if (info2)
- peak_disp_bw += (pix_clk2 * info2->CurrentLayout.pixel_bytes);
+ if (pixel_bytes2)
+ peak_disp_bw += (pix_clk2 * pixel_bytes2);
if (peak_disp_bw >= mem_bw * min_mem_eff) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -1908,8 +1902,8 @@ void RADEONInitDispBandwidth2(ScrnInfoPtr pScrn, RADEONInfoPtr info, RADEONInfoP
Find the drain rate of the display buffer.
*/
disp_drain_rate = pix_clk / (16.0/info->CurrentLayout.pixel_bytes);
- if (info2)
- disp_drain_rate2 = pix_clk2 / (16.0/info2->CurrentLayout.pixel_bytes);
+ if (pixel_bytes2)
+ disp_drain_rate2 = pix_clk2 / (16.0/pixel_bytes2);
else
disp_drain_rate2 = 0;
@@ -1962,7 +1956,7 @@ void RADEONInitDispBandwidth2(ScrnInfoPtr pScrn, RADEONInfoPtr info, RADEONInfoP
(unsigned int)info->SavedReg.grph_buffer_cntl, INREG(RADEON_GRPH_BUFFER_CNTL)));
if (mode2) {
- stop_req = mode2->HDisplay * info2->CurrentLayout.pixel_bytes / 16;
+ stop_req = mode2->HDisplay * pixel_bytes2 / 16;
if (stop_req > max_stop_req) stop_req = max_stop_req;
@@ -2015,8 +2009,11 @@ void RADEONInitDispBandwidth(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
DisplayModePtr mode1, mode2;
RADEONInfoPtr info2 = NULL;
+ xf86CrtcPtr crtc;
+ int pixel_bytes2 = 0;
if (pRADEONEnt->pSecondaryScrn) {
if (info->IsSecondary) return;
@@ -2030,7 +2027,27 @@ void RADEONInitDispBandwidth(ScrnInfoPtr pScrn)
mode2 = NULL;
}
- RADEONInitDispBandwidth2(pScrn, info, info2, mode1, mode2);
+ if (info2)
+ pixel_bytes2 = info2->CurrentLayout.pixel_bytes;
+
+
+ if (xf86_config->num_crtc == 2) {
+ pixel_bytes2 = 0;
+ mode2 = NULL;
+
+ if (xf86_config->crtc[1]->enabled && xf86_config->crtc[0]->enabled) {
+ pixel_bytes2 = info->CurrentLayout.pixel_bytes;
+ mode1 = &xf86_config->crtc[0]->curMode;
+ mode2 = &xf86_config->crtc[1]->curMode;
+ } else if (xf86_config->crtc[0]->enabled) {
+ mode1 = &xf86_config->crtc[0]->curMode;
+ } else if (xf86_config->crtc[1]->enabled) {
+ mode1 = &xf86_config->crtc[1]->curMode;
+ } else
+ return;
+ }
+
+ RADEONInitDispBandwidth2(pScrn, info, pixel_bytes2, mode1, mode2);
}
void RADEONBlank(ScrnInfoPtr pScrn)
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index a935da04..9c4b509b 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -6374,6 +6374,9 @@ _X_EXPORT Bool RADEONEnterVT(int scrnIndex, int flags)
RADEONBlank(pScrn);
RADEONRestoreMode(pScrn, &info->ModeReg);
RADEONUnblank(pScrn);
+
+ if (info->DispPriority)
+ RADEONInitDispBandwidth(pScrn);
}
#if 0
if (!RADEONModeInit(pScrn, pScrn->currentMode)) return FALSE;
diff --git a/src/radeon_randr.c b/src/radeon_randr.c
index 4e21a333..63b00802 100644
--- a/src/radeon_randr.c
+++ b/src/radeon_randr.c
@@ -656,8 +656,8 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
RADEONUnblank(pScrn);
info->IsSwitching = FALSE;
}
- // if (info->DispPriority)
- // RADEONInitDispBandwidth(pScrn);
+ if (info->DispPriority)
+ RADEONInitDispBandwidth(pScrn);
}
if (pos_changed && mode)