xserver-xorg-video-ati: Changes to 'upstream-experimental'
configure.ac | 2
man/radeon.man | 6 +
src/radeon.h | 3
src/radeon_display.c | 7 +
src/radeon_driver.c | 10 --
src/radeon_modes.c | 181 +++------------------------------------------------
src/radeon_output.c | 146 +++++++++++++++++++++++++----------------
src/radeon_probe.c | 2
src/radeon_probe.h | 9 ++
src/radeon_reg.h | 6 +
src/radeon_video.c | 27 +++++++
src/radeon_vip.c | 7 +
12 files changed, 172 insertions(+), 234 deletions(-)
New commits:
commit 22cccb99d762567757d3fd38795f71e943f1faf9
Author: Alex Deucher <alex@botch2.(none)>
Date: Mon Sep 24 00:10:01 2007 -0400
bump for RC release
diff --git a/configure.ac b/configure.ac
index bd5109b..7204a31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-ati],
- 6.7.193,
+ 6.7.194,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-ati)
commit fad9e7b00de051f632000eb2304ac23a524f7c8e
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date: Sun Sep 23 23:43:26 2007 -0400
RADEON: Rework LVDS mode validation
The old validation code wasn't really well suited to randr.
This fixes several issues:
- missing display size for panels with edid
- broken duplicate modes
diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index 9c12ecb..af56cdf 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -82,7 +82,7 @@ static DisplayModePtr RADEONTVModes(xf86OutputPtr output)
{
DisplayModePtr new = NULL;
- /* just a place holder */
+ /* just a place holder */
new = xf86CVTMode(800, 600, 60.00, FALSE, FALSE);
new->type = M_T_DRIVER | M_T_PREFERRED;
@@ -125,161 +125,25 @@ static DisplayModePtr RADEONFPNativeMode(xf86OutputPtr output)
new->next = NULL;
new->prev = NULL;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "No valid mode specified, force to native mode\n");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Added native panel mode: %dx%d\n",
+ radeon_output->PanelXRes, radeon_output->PanelYRes);
}
return new;
}
-/* FP mode initialization routine for using on-chip RMX to scale
- */
-int RADEONValidateFPModes(xf86OutputPtr output, char **ppModeName, DisplayModePtr *modeList)
-{
- ScrnInfoPtr pScrn = output->scrn;
- RADEONOutputPrivatePtr radeon_output = output->driver_private;
- DisplayModePtr last = NULL;
- DisplayModePtr new = NULL;
- DisplayModePtr first = NULL;
- DisplayModePtr p, tmp;
- int count = 0;
- int i, width, height;
-
- pScrn->virtualX = pScrn->display->virtualX;
- pScrn->virtualY = pScrn->display->virtualY;
-
- /* We have a flat panel connected to the primary display, and we
- * don't have any DDC info.
- */
- for (i = 0; ppModeName[i] != NULL; i++) {
-
- if (sscanf(ppModeName[i], "%dx%d", &width, &height) != 2) continue;
-
- /* Note: We allow all non-standard modes as long as they do not
- * exceed the native resolution of the panel. Since these modes
- * need the internal RMX unit in the video chips (and there is
- * only one per card), this will only apply to the primary head.
- */
- if (width < 320 || width > radeon_output->PanelXRes ||
- height < 200 || height > radeon_output->PanelYRes) {
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Mode %s is out of range.\n", ppModeName[i]);
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "Valid modes must be between 320x200-%dx%d\n",
- radeon_output->PanelXRes, radeon_output->PanelYRes);
- continue;
- }
-
- new = xnfcalloc(1, sizeof(DisplayModeRec));
- new->name = xnfalloc(strlen(ppModeName[i]) + 1);
- strcpy(new->name, ppModeName[i]);
- new->HDisplay = width;
- new->VDisplay = height;
-
- /* These values are effective values after expansion They are
- * not really used to set CRTC registers.
- */
- new->HTotal = radeon_output->PanelXRes + radeon_output->HBlank;
- new->HSyncStart = radeon_output->PanelXRes + radeon_output->HOverPlus;
- new->HSyncEnd = new->HSyncStart + radeon_output->HSyncWidth;
- new->VTotal = radeon_output->PanelYRes + radeon_output->VBlank;
- new->VSyncStart = radeon_output->PanelYRes + radeon_output->VOverPlus;
- new->VSyncEnd = new->VSyncStart + radeon_output->VSyncWidth;
- new->Clock = radeon_output->DotClock;
- new->Flags |= RADEON_USE_RMX;
-
-#ifdef M_T_PREFERRED
- if (width == radeon_output->PanelXRes && height == radeon_output->PanelYRes)
- new->type |= M_T_PREFERRED;
-#endif
-
- new->type |= M_T_USERDEF;
-
- new->next = NULL;
- new->prev = last;
-
- if (last) last->next = new;
- last = new;
- if (!first) first = new;
-
- pScrn->display->virtualX =
- pScrn->virtualX = MAX(pScrn->virtualX, width);
- pScrn->display->virtualY =
- pScrn->virtualY = MAX(pScrn->virtualY, height);
- count++;
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Valid mode using on-chip RMX: %s\n", new->name);
- }
-
- /* If all else fails, add the native mode */
- if (!count) {
- first = last = RADEONFPNativeMode(output);
- if (first) count = 1;
- }
-
- /* add in all default vesa modes smaller than panel size, used for randr*/
- for (p = *modeList; p && p->next; p = p->next->next) {
- if ((p->HDisplay <= radeon_output->PanelXRes) && (p->VDisplay <= radeon_output->PanelYRes)) {
- tmp = first;
- while (tmp) {
- if ((p->HDisplay == tmp->HDisplay) && (p->VDisplay == tmp->VDisplay)) break;
- tmp = tmp->next;
- }
- if (!tmp) {
- new = xnfcalloc(1, sizeof(DisplayModeRec));
- new->name = xnfalloc(strlen(p->name) + 1);
- strcpy(new->name, p->name);
- new->HDisplay = p->HDisplay;
- new->VDisplay = p->VDisplay;
-
- /* These values are effective values after expansion They are
- * not really used to set CRTC registers.
- */
- new->HTotal = radeon_output->PanelXRes + radeon_output->HBlank;
- new->HSyncStart = radeon_output->PanelXRes + radeon_output->HOverPlus;
- new->HSyncEnd = new->HSyncStart + radeon_output->HSyncWidth;
- new->VTotal = radeon_output->PanelYRes + radeon_output->VBlank;
- new->VSyncStart = radeon_output->PanelYRes + radeon_output->VOverPlus;
- new->VSyncEnd = new->VSyncStart + radeon_output->VSyncWidth;
- new->Clock = radeon_output->DotClock;
- new->Flags |= RADEON_USE_RMX;
-
- new->type |= M_T_DEFAULT;
-
- if (last) last->next = new;
- last = new;
- if (!first) first = new;
- }
- }
- }
-
- /* Close the doubly-linked mode list, if we found any usable modes */
- if (last) {
- last->next = NULL; //first;
- first->prev = NULL; //last;
- *modeList = first;
- //RADEONSetPitch(pScrn);
- }
-
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Total number of valid FP mode(s) found: %d\n", count);
-
- return count;
-}
-
DisplayModePtr
RADEONProbeOutputModes(xf86OutputPtr output)
{
ScrnInfoPtr pScrn = output->scrn;
RADEONOutputPrivatePtr radeon_output = output->driver_private;
- DisplayModePtr mode;
xf86MonPtr edid_mon;
DisplayModePtr modes = NULL;
#if 0
/* force reprobe */
radeon_output->MonType = MT_UNKNOWN;
-
+
RADEONConnectorFindMonitor(pScrn, output);
#endif
ErrorF("in RADEONProbeOutputModes\n");
@@ -288,7 +152,7 @@ RADEONProbeOutputModes(xf86OutputPtr output)
if (radeon_output->type == OUTPUT_DVI || radeon_output->type == OUTPUT_VGA) {
edid_mon = xf86OutputGetEDID (output, radeon_output->pI2CBus);
xf86OutputSetEDID (output, edid_mon);
-
+
modes = xf86OutputGetEDIDModes (output);
return modes;
}
@@ -299,29 +163,17 @@ RADEONProbeOutputModes(xf86OutputPtr output)
if (radeon_output->type == OUTPUT_LVDS) {
/* okay we got DDC info */
if (output->MonInfo) {
- /* Debug info for now, at least */
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EDID for output %d\n", radeon_output->num);
- xf86PrintEDID(output->MonInfo);
-
- modes = xf86DDCGetModes(pScrn->scrnIndex, output->MonInfo);
-
- for (mode = modes; mode != NULL; mode = mode->next) {
- if (mode->Flags & V_DBLSCAN) {
- if ((mode->CrtcHDisplay >= 1024) || (mode->CrtcVDisplay >= 768))
- mode->status = MODE_CLOCK_RANGE;
- }
- }
- xf86PruneInvalidModes(pScrn, &modes, TRUE);
-
- /* do some physcial size stuff */
- }
-
- if (modes == NULL) {
- RADEONValidateFPModes(output, pScrn->display->modes, &modes);
- }
+ edid_mon = xf86OutputGetEDID (output, radeon_output->pI2CBus);
+ xf86OutputSetEDID (output, edid_mon);
+
+ modes = xf86OutputGetEDIDModes (output);
+ return modes;
+ } else
+ /* add native panel mode */
+ modes = RADEONFPNativeMode(output);
}
}
-
+
if (modes) {
xf86ValidateModesUserConfig(pScrn, modes);
xf86PruneInvalidModes(pScrn, &modes, FALSE);
commit bf9674b9df351108e069d037ec10869a4154a881
Author: Alex Deucher <alex@botch2.(none)>
Date: Sun Sep 23 15:01:34 2007 -0400
RADEON: properly set default RMX types
diff --git a/src/radeon_output.c b/src/radeon_output.c
index eab39a6..6ece28a 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2475,10 +2475,12 @@ void RADEONInitConnector(xf86OutputPtr output)
}
if (radeon_output->type == OUTPUT_LVDS) {
+ radeon_output->rmx_type = RMX_FULL;
RADEONGetLVDSInfo(output);
}
if (radeon_output->type == OUTPUT_DVI) {
+ radeon_output->rmx_type = RMX_OFF;
RADEONGetTMDSInfo(output);
}
commit b27135bce8b41d69290613b440a338b0a7fe0200
Author: Alex Deucher <alex@botch2.(none)>
Date: Sun Sep 23 14:44:38 2007 -0400
RADEON: fix up LVDS handling for r3xx and newer
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 3b8454f..e7cccf6 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -4172,8 +4172,8 @@ void RADEONRestoreLVDSRegisters(ScrnInfoPtr pScrn, RADEONSavePtr restore)
if (info->IsMobility) {
OUTREG(RADEON_LVDS_GEN_CNTL, restore->lvds_gen_cntl);
- /*OUTREG(RADEON_LVDS_PLL_CNTL, restore->lvds_pll_cntl);
- OUTREG(RADEON_BIOS_4_SCRATCH, restore->bios_4_scratch);
+ OUTREG(RADEON_LVDS_PLL_CNTL, restore->lvds_pll_cntl);
+ /*OUTREG(RADEON_BIOS_4_SCRATCH, restore->bios_4_scratch);
OUTREG(RADEON_BIOS_5_SCRATCH, restore->bios_5_scratch);
OUTREG(RADEON_BIOS_6_SCRATCH, restore->bios_6_scratch);*/
}
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 346fdc4..eab39a6 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -790,7 +790,7 @@ static void RADEONInitFP2Registers(xf86OutputPtr output, RADEONSavePtr save,
if (IsPrimary) {
if ((info->ChipFamily == CHIP_FAMILY_R200) || IS_R300_VARIANT) {
save->fp2_gen_cntl &= ~R200_FP2_SOURCE_SEL_MASK;
- if (mode->Flags & RADEON_USE_RMX)
+ if (mode->Flags & RADEON_USE_RMX)
save->fp2_gen_cntl |= R200_FP2_SOURCE_SEL_RMX;
} else {
save->fp2_gen_cntl &= ~RADEON_FP2_SRC_SEL_CRTC2;
@@ -812,16 +812,30 @@ static void RADEONInitLVDSRegisters(xf86OutputPtr output, RADEONSavePtr save,
ScrnInfoPtr pScrn = output->scrn;
RADEONInfoPtr info = RADEONPTR(pScrn);
- save->lvds_pll_cntl = info->SavedReg.lvds_pll_cntl;
+ save->lvds_pll_cntl = (info->SavedReg.lvds_pll_cntl |
+ RADEON_LVDS_PLL_EN);
+
+ save->lvds_pll_cntl &= ~RADEON_LVDS_PLL_RESET;
save->lvds_gen_cntl = info->SavedReg.lvds_gen_cntl;
save->lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS;
save->lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_BLON);
- if (IsPrimary)
- save->lvds_gen_cntl &= ~RADEON_LVDS_SEL_CRTC2;
- else
- save->lvds_gen_cntl |= RADEON_LVDS_SEL_CRTC2;
+ if (IS_R300_VARIANT)
+ save->lvds_pll_cntl &= ~(R300_LVDS_SRC_SEL_MASK);
+
+ if (IsPrimary) {
+ if (IS_R300_VARIANT) {
+ if (mode->Flags & RADEON_USE_RMX)
+ save->lvds_pll_cntl |= R300_LVDS_SRC_SEL_RMX;
+ } else
+ save->lvds_gen_cntl &= ~RADEON_LVDS_SEL_CRTC2;
+ } else {
+ if (IS_R300_VARIANT) {
+ save->lvds_pll_cntl |= R300_LVDS_SRC_SEL_CRTC2;
+ } else
+ save->lvds_gen_cntl |= RADEON_LVDS_SEL_CRTC2;
+ }
}
diff --git a/src/radeon_reg.h b/src/radeon_reg.h
index af62a69..96adb22 100644
--- a/src/radeon_reg.h
+++ b/src/radeon_reg.h
@@ -924,6 +924,12 @@
#define RADEON_LVDS_PLL_CNTL 0x02d4
# define RADEON_HSYNC_DELAY_SHIFT 28
# define RADEON_HSYNC_DELAY_MASK (0xf << 28)
+# define RADEON_LVDS_PLL_EN (1 << 16)
+# define RADEON_LVDS_PLL_RESET (1 << 17)
+# define R300_LVDS_SRC_SEL_MASK (3 << 18)
+# define R300_LVDS_SRC_SEL_CRTC1 (0 << 18)
+# define R300_LVDS_SRC_SEL_CRTC2 (1 << 18)
+# define R300_LVDS_SRC_SEL_RMX (2 << 18)
#define RADEON_MAX_LATENCY 0x0f3f /* PCI */
#define RADEON_MC_AGP_LOCATION 0x014c
commit d5cf268be2c9b3e320d7101f5213f7d5609b6308
Author: Alex Deucher <alex@botch2.(none)>
Date: Sat Sep 22 18:31:51 2007 -0400
RADEON: Fix crash when Xv window is outside of either crtc
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 271f7fe..dca9695 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -2907,6 +2907,15 @@ RADEONPutImage(
clipBoxes, width, height))
return Success;
+ if (!crtc) {
+ if (pPriv->videoStatus & CLIENT_VIDEO_ON) {
+ unsigned char *RADEONMMIO = info->MMIO;
+ OUTREG(RADEON_OV0_SCALE_CNTL, 0);
+ pPriv->videoStatus &= ~CLIENT_VIDEO_ON;
+ }
+ return Success;
+ }
+
dstBox.x1 -= crtc->x;
dstBox.x2 -= crtc->x;
dstBox.y1 -= crtc->y;
@@ -3285,6 +3294,15 @@ RADEONDisplaySurface(
surface->width, surface->height))
return Success;
+ if (!crtc) {
+ if (pPriv->isOn) {
+ unsigned char *RADEONMMIO = info->MMIO;
+ OUTREG(RADEON_OV0_SCALE_CNTL, 0);
+ pPriv->isOn = FALSE;
+ }
+ return Success;
+ }
+
dstBox.x1 -= crtc->x;
dstBox.x2 -= crtc->x;
dstBox.y1 -= crtc->y;
@@ -3419,6 +3437,15 @@ RADEONPutVideo(
clipBoxes, width, height))
return Success;
+ if (!crtc) {
+ if (pPriv->videoStatus & CLIENT_VIDEO_ON) {
+ unsigned char *RADEONMMIO = info->MMIO;
+ OUTREG(RADEON_OV0_SCALE_CNTL, 0);
+ pPriv->videoStatus &= ~CLIENT_VIDEO_ON;
+ }
+ return Success;
+ }
+
dstBox.x1 -= crtc->x;
dstBox.x2 -= crtc->x;
dstBox.y1 -= crtc->y;
commit 8aca0ca6be7122e0ece20985a1862553a1b225c0
Author: Alex Deucher <alex@botch2.(none)>
Date: Sat Sep 22 17:56:50 2007 -0400
Revert "RADEON: fix crash when Xv window is outside of either crtc"
This reverts commit 9109e62e3be7f96b41b534ab517fdf1baf458806.
This breaks ABI. better fix to come.
diff --git a/src/radeon_video.c b/src/radeon_video.c
index bbd743b..271f7fe 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -215,8 +215,7 @@ radeon_clip_video_helper(ScrnInfoPtr pScrn,
REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1);
crtc_region = &crtc_region_local;
REGION_INTERSECT (pScreen, crtc_region, crtc_region, reg);
- } else
- return FALSE;
+ }
*crtc_ret = crtc;
}
commit d6e1d9be1cd5786a24ed4bb8e45fa7e04df56622
Author: Alex Deucher <alex@botch2.(none)>
Date: Sat Sep 22 16:14:06 2007 -0400
RADEON: Don't make the entity as shareable
This should prevent people from mistakenly trying to run
zaphod mode
diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index c697f65..207e537 100644
--- a/src/radeon_probe.c
+++ b/src/radeon_probe.c
@@ -314,7 +314,7 @@ RADEONProbe(DriverPtr drv, int flags)
DevUnion *pPriv;
RADEONEntPtr pRADEONEnt;
- xf86SetEntitySharable(usedChips[i]);
+ /*xf86SetEntitySharable(usedChips[i]);*/
if (gRADEONEntityIndex == -1)
gRADEONEntityIndex = xf86AllocateEntityPrivateIndex();
commit 81114af1cdddc0b10d076f2e38c7a00c1223cc48
Author: Alex Deucher <alex@botch2.(none)>
Date: Sat Sep 22 15:51:23 2007 -0400
RADEON: preliminary support for mac mini
Option "MacModel" "mini"
may not be 100% correct yet
diff --git a/man/radeon.man b/man/radeon.man
index 8217262..35dd701 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -404,9 +404,11 @@ Used to specify Mac models for connector tables and quirks. Only valid
.br
ibook \-\- ibooks
.br
-powerbook-duallink \-\- Powerbooks with dual link DVI
+powerbook-duallink \-\- Powerbooks with external DVI
.br
-powerbook \-\- Powerbooks with single link DVI
+powerbook \-\- Powerbooks with integrated DVI
+.br
+mini \-\- Mac Mini
.br
The default value is
.B undefined.
diff --git a/src/radeon.h b/src/radeon.h
index 4c586f6..cec06e9 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -429,7 +429,8 @@ typedef enum {
typedef enum {
RADEON_MAC_IBOOK = 0x00000001,
RADEON_MAC_POWERBOOK_DL = 0x00000002,
- RADEON_MAC_POWERBOOK = 0x00000004
+ RADEON_MAC_POWERBOOK = 0x00000004,
+ RADEON_MAC_MINI = 0x00000008
} RADEONMacModel;
#endif
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 3e58d41..346fdc4 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2544,6 +2544,19 @@ static Bool RADEONSetupAppleConnectors(ScrnInfoPtr pScrn)
info->BiosConnector[2].DDCType = DDC_NONE_DETECTED;
info->BiosConnector[2].valid = TRUE;
return TRUE;
+ case RADEON_MAC_MINI:
+ info->BiosConnector[0].DDCType = DDC_CRT2;
+ info->BiosConnector[0].DACType = DAC_TVDAC;
+ info->BiosConnector[0].TMDSType = TMDS_EXT;
+ info->BiosConnector[0].ConnectorType = CONNECTOR_DVI_I;
+ info->BiosConnector[0].valid = TRUE;
+
+ info->BiosConnector[1].ConnectorType = CONNECTOR_STV;
+ info->BiosConnector[1].DACType = DAC_TVDAC;
+ info->BiosConnector[1].TMDSType = TMDS_NONE;
+ info->BiosConnector[1].DDCType = DDC_NONE_DETECTED;
+ info->BiosConnector[1].valid = TRUE;
+ return TRUE;
default:
return FALSE;
}
@@ -2689,6 +2702,8 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
info->MacModel = RADEON_MAC_POWERBOOK_DL;
else if (!strncmp("powerbook", optstr, strlen("powerbook")))
info->MacModel = RADEON_MAC_POWERBOOK;
+ else if (!strncmp("mini", optstr, strlen("mini")))
+ info->MacModel = RADEON_MAC_MINI;
else {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid Mac Model: %s\n", optstr);
return FALSE;
commit 6c482e453bc8156886294d0c1b8f3f1b3dcf4b36
Author: Alex Deucher <alex@botch2.(none)>
Date: Sat Sep 22 15:11:20 2007 -0400
RADEON: Fix RMX on LVDS
LVDS + RMX doesn't seem to like having the crtc values tweaked.
diff --git a/src/radeon_output.c b/src/radeon_output.c
index d2e2363..3e58d41 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -679,15 +679,17 @@ radeon_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
adjusted_mode->Flags |= RADEON_USE_RMX;
if (adjusted_mode->Flags & RADEON_USE_RMX) {
- adjusted_mode->CrtcHTotal = mode->CrtcHDisplay + radeon_output->HBlank;
- adjusted_mode->CrtcHSyncStart = mode->CrtcHDisplay + radeon_output->HOverPlus;
- adjusted_mode->CrtcHSyncEnd = mode->CrtcHSyncStart + radeon_output->HSyncWidth;
- adjusted_mode->CrtcVTotal = mode->CrtcVDisplay + radeon_output->VBlank;
- adjusted_mode->CrtcVSyncStart = mode->CrtcVDisplay + radeon_output->VOverPlus;
- adjusted_mode->CrtcVSyncEnd = mode->CrtcVSyncStart + radeon_output->VSyncWidth;
- adjusted_mode->Clock = radeon_output->DotClock;
radeon_output->Flags |= RADEON_USE_RMX;
- adjusted_mode->Flags = radeon_output->Flags;
+ if (radeon_output->MonType == MT_DFP) {
+ adjusted_mode->CrtcHTotal = mode->CrtcHDisplay + radeon_output->HBlank;
+ adjusted_mode->CrtcHSyncStart = mode->CrtcHDisplay + radeon_output->HOverPlus;
+ adjusted_mode->CrtcHSyncEnd = mode->CrtcHSyncStart + radeon_output->HSyncWidth;
+ adjusted_mode->CrtcVTotal = mode->CrtcVDisplay + radeon_output->VBlank;
+ adjusted_mode->CrtcVSyncStart = mode->CrtcVDisplay + radeon_output->VOverPlus;
+ adjusted_mode->CrtcVSyncEnd = mode->CrtcVSyncStart + radeon_output->VSyncWidth;
+ adjusted_mode->Clock = radeon_output->DotClock;
+ adjusted_mode->Flags = radeon_output->Flags;
+ }
} else
radeon_output->Flags &= ~RADEON_USE_RMX;
commit 9109e62e3be7f96b41b534ab517fdf1baf458806
Author: Michel Dänzer <daenzer@debian.org>
Date: Sat Sep 22 14:19:10 2007 -0400
RADEON: fix crash when Xv window is outside of either crtc
Should fix bug 12175
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 271f7fe..bbd743b 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -215,7 +215,8 @@ radeon_clip_video_helper(ScrnInfoPtr pScrn,
REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1);
crtc_region = &crtc_region_local;
REGION_INTERSECT (pScreen, crtc_region, crtc_region, reg);
- }
+ } else
+ return FALSE;
*crtc_ret = crtc;
}
commit d2ce4a5003ce1291ea2327b2c00a0b24408fe26c
Author: Alex Deucher <alex@botch2.(none)>
Date: Sat Sep 22 10:41:55 2007 -0400
RADEON: RMX updates
- add option to turn off RMX
- turn off RMX by default on DVI
- add infrastructure to support more RMX modes
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 8b7ae08..d2e2363 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -648,13 +648,17 @@ radeon_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
return MODE_CLOCK_RANGE;
}
- if (radeon_output->type != OUTPUT_LVDS)
- return MODE_OK;
-
- if (pMode->HDisplay > radeon_output->PanelXRes ||
- pMode->VDisplay > radeon_output->PanelYRes)
- return MODE_PANEL;
-
+ if (radeon_output->type == OUTPUT_LVDS) {
+ if (radeon_output->rmx_type == RMX_OFF) {
+ if (pMode->HDisplay != radeon_output->PanelXRes ||
+ pMode->VDisplay != radeon_output->PanelYRes)
+ return MODE_PANEL;
+ }
+ if (pMode->HDisplay > radeon_output->PanelXRes ||
+ pMode->VDisplay > radeon_output->PanelYRes)
+ return MODE_PANEL;
+ }
+
return MODE_OK;
}
@@ -664,7 +668,8 @@ radeon_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
{
RADEONOutputPrivatePtr radeon_output = output->driver_private;
- if (radeon_output->MonType == MT_LCD || radeon_output->MonType == MT_DFP) {
+ if ((radeon_output->MonType == MT_LCD || radeon_output->MonType == MT_DFP)
+ && radeon_output->rmx_type != RMX_OFF) {
xf86CrtcPtr crtc = output->crtc;
RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
@@ -1675,7 +1680,7 @@ radeon_create_resources(xf86OutputPtr output)
}
- /* RMX control - fullscreen, centered, keep ratio */
+ /* RMX control - fullscreen, centered, keep ratio, off */
/* actually more of a crtc property as only crtc1 has rmx */
if (radeon_output->type == OUTPUT_LVDS ||
radeon_output->type == OUTPUT_DVI) {
@@ -1688,7 +1693,10 @@ radeon_create_resources(xf86OutputPtr output)
"RRConfigureOutputProperty error, %d\n", err);
}
/* Set the current value of the property */
- s = "full";
+ if (radeon_output->type == OUTPUT_LVDS)
+ s = "full";
+ else
+ s = "off";
err = RRChangeOutputProperty(output->randr_output, rmx_atom,
XA_STRING, 8, PropModeReplace, strlen(s), (pointer)s,
FALSE, FALSE);
@@ -1869,24 +1877,24 @@ radeon_set_property(xf86OutputPtr output, Atom property,
radeon_output->load_detection = val;
} else if (property == rmx_atom) {
- xf86CrtcPtr crtc = output->crtc;
- RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
- if (radeon_crtc->crtc_id == 0) {
- const char *s;
- if (value->type != XA_STRING || value->format != 8)
- return FALSE;
- s = (char*)value->data;
- if (value->size == strlen("full") && !strncmp("full", s, strlen("full"))) {
- return TRUE;
- } else if (value->size == strlen("aspect") && !strncmp("aspect", s, strlen("aspect"))) {
- return TRUE;
- } else if (value->size == strlen("center") && !strncmp("center", s, strlen("center"))) {
- return TRUE;
- }
- return FALSE;
- } else {
- return FALSE;
- }
+ const char *s;
+ if (value->type != XA_STRING || value->format != 8)
+ return FALSE;
+ s = (char*)value->data;
+ if (value->size == strlen("full") && !strncmp("full", s, strlen("full"))) {
+ radeon_output->rmx_type = RMX_FULL;
+ return TRUE;
+ } else if (value->size == strlen("aspect") && !strncmp("aspect", s, strlen("aspect"))) {
+ radeon_output->rmx_type = RMX_ASPECT;
+ return TRUE;
+ } else if (value->size == strlen("center") && !strncmp("center", s, strlen("center"))) {
+ radeon_output->rmx_type = RMX_CENTER;
+ return TRUE;
+ } else if (value->size == strlen("off") && !strncmp("off", s, strlen("off"))) {
+ radeon_output->rmx_type = RMX_OFF;
+ return TRUE;
+ }
+ return FALSE;
} else if (property == tmds_pll_atom) {
const char *s;
if (value->type != XA_STRING || value->format != 8)
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index bc6f0b9..ec895e4 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -122,6 +122,14 @@ typedef enum
DVI_ANALOG
} RADEONDviType;
+typedef enum
+{
+ RMX_OFF,
+ RMX_FULL,
+ RMX_CENTER,
+ RMX_ASPECT
+} RADEONRMXType;
+
typedef struct {
CARD32 freq;
CARD32 value;
@@ -196,6 +204,7 @@ typedef struct _RADEONOutputPrivateRec {
int PanelPwrDly;
int DotClock;
RADEONTMDSPll tmds_pll[4];
+ RADEONRMXType rmx_type;
/* TV out */
TVStd default_tvStd;
TVStd tvStd;
commit f95b9ab729376083bf0d12987ee260ec2aba721e
Author: Alex Deucher <alex@botch2.(none)>
Date: Fri Sep 21 00:12:37 2007 -0400
RADEON: remove more old cruft
diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index 687e388..9c12ecb 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -125,11 +125,6 @@ static DisplayModePtr RADEONFPNativeMode(xf86OutputPtr output)
new->next = NULL;
new->prev = NULL;
- pScrn->display->virtualX =
- pScrn->virtualX = MAX(pScrn->virtualX, radeon_output->PanelXRes);
- pScrn->display->virtualY =
- pScrn->virtualY = MAX(pScrn->virtualY, radeon_output->PanelYRes);
-
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"No valid mode specified, force to native mode\n");
}
commit 5a6f74103f0ec0d451d0e2573442efe5922848af
Author: Maciej Cencora <m.cencora@gmail.com>
Date: Thu Sep 20 23:56:08 2007 -0400
RADEON: fix video in on RV380 (tested on X600 VIVO)
diff --git a/src/radeon_vip.c b/src/radeon_vip.c
index abcba06..7ee4ab5 100644
--- a/src/radeon_vip.c
+++ b/src/radeon_vip.c
@@ -331,6 +331,13 @@ void RADEONVIP_reset(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
OUTREG(RADEON_VIPH_BM_CHUNK, 0x0);
OUTREG(RADEON_TEST_DEBUG_CNTL, INREG(RADEON_TEST_DEBUG_CNTL) & (~RADEON_TEST_DEBUG_CNTL__TEST_DEBUG_OUT_EN));
break;
+ case CHIP_FAMILY_RV380:
+ OUTREG(RADEON_VIPH_CONTROL, 0x003F000D); /* slowest, timeout in 16 phases */
+ OUTREG(RADEON_VIPH_TIMEOUT_STAT, (INREG(RADEON_VIPH_TIMEOUT_STAT) & 0xFFFFFF00) | RADEON_VIPH_TIMEOUT_STAT__VIPH_REGR_DIS);
+ OUTREG(RADEON_VIPH_DV_LAT, 0x444400FF); /* set timeslice */
+ OUTREG(RADEON_VIPH_BM_CHUNK, 0x0);
+ OUTREG(RADEON_TEST_DEBUG_CNTL, INREG(RADEON_TEST_DEBUG_CNTL) & (~RADEON_TEST_DEBUG_CNTL__TEST_DEBUG_OUT_EN));
+ break;
default:
OUTREG(RADEON_VIPH_CONTROL, 0x003F0004); /* slowest, timeout in 16 phases */
OUTREG(RADEON_VIPH_TIMEOUT_STAT, (INREG(RADEON_VIPH_TIMEOUT_STAT) & 0xFFFFFF00) | RADEON_VIPH_TIMEOUT_STAT__VIPH_REGR_DIS);
commit c72a365386e19f9257db041d44b09ad499cc9f6a
Author: Alex Deucher <alex@botch2.(none)>
Date: Thu Sep 20 23:49:57 2007 -0400
RADEON: fix up dvo support (still no external chip init)
diff --git a/src/radeon_display.c b/src/radeon_display.c
index fa80e10..7f599e6 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -289,6 +289,7 @@ void RADEONDisableDisplays(ScrnInfoPtr pScrn) {
/* FP 2 */
tmp = INREG(RADEON_FP2_GEN_CNTL);
+ tmp |= RADEON_FP2_BLANK_EN;
tmp &= ~(RADEON_FP2_ON | RADEON_FP2_DVO_EN);
OUTREG(RADEON_FP2_GEN_CNTL, tmp);
@@ -355,10 +356,12 @@ void RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable)
save->fp_gen_cntl |= (RADEON_FP_FPON | RADEON_FP_TMDS_EN);
} else if (radeon_output->TMDSType == TMDS_EXT) {
tmp = INREG(RADEON_FP2_GEN_CNTL);
+ tmp &= ~RADEON_FP2_BLANK_EN;
tmp |= (RADEON_FP2_ON | RADEON_FP2_DVO_EN);
OUTREG(RADEON_FP2_GEN_CNTL, tmp);
save->fp2_gen_cntl |= (RADEON_FP2_ON | RADEON_FP2_DVO_EN);
- }
+ save->fp2_gen_cntl &= ~RADEON_FP2_BLANK_EN;
+ }
} else if (radeon_output->MonType == MT_LCD) {
tmp = INREG(RADEON_LVDS_GEN_CNTL);
tmp |= (RADEON_LVDS_ON | RADEON_LVDS_BLON);
@@ -406,9 +409,11 @@ void RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable)
save->fp_gen_cntl &= ~(RADEON_FP_FPON | RADEON_FP_TMDS_EN);
} else if (radeon_output->TMDSType == TMDS_EXT) {
tmp = INREG(RADEON_FP2_GEN_CNTL);
+ tmp |= RADEON_FP2_BLANK_EN;
tmp &= ~(RADEON_FP2_ON | RADEON_FP2_DVO_EN);
OUTREG(RADEON_FP2_GEN_CNTL, tmp);
save->fp2_gen_cntl &= ~(RADEON_FP2_ON | RADEON_FP2_DVO_EN);
+ save->fp2_gen_cntl |= RADEON_FP2_BLANK_EN;
}
} else if (radeon_output->MonType == MT_LCD) {
unsigned long tmpPixclksCntl = INPLL(pScrn, RADEON_PIXCLKS_CNTL);
diff --git a/src/radeon_output.c b/src/radeon_output.c
index f9a21bb..8b7ae08 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -766,7 +766,7 @@ static void RADEONInitFP2Registers(xf86OutputPtr output, RADEONSavePtr save,
DisplayModePtr mode, BOOL IsPrimary)
{
ScrnInfoPtr pScrn = output->scrn;
- RADEONInfoPtr info = RADEONPTR(pScrn);
+ RADEONInfoPtr info = RADEONPTR(pScrn);
if (pScrn->rgbBits == 8)
@@ -776,26 +776,23 @@ static void RADEONInitFP2Registers(xf86OutputPtr output, RADEONSavePtr save,
save->fp2_gen_cntl = info->SavedReg.fp2_gen_cntl &
~RADEON_FP2_PANEL_FORMAT;/* 18 bit format, */
- save->fp2_gen_cntl &= ~(RADEON_FP2_ON | RADEON_FP2_DVO_EN);
+ save->fp2_gen_cntl &= ~(RADEON_FP2_ON |
+ RADEON_FP2_DVO_EN |
+ RADEON_FP2_DVO_RATE_SEL_SDR);
if (IsPrimary) {
if ((info->ChipFamily == CHIP_FAMILY_R200) || IS_R300_VARIANT) {
- save->fp2_gen_cntl &= ~(R200_FP2_SOURCE_SEL_MASK |
- RADEON_FP2_DVO_EN |
- RADEON_FP2_DVO_RATE_SEL_SDR);
- if (mode->Flags & RADEON_USE_RMX)
- save->fp2_gen_cntl |= R200_FP2_SOURCE_SEL_RMX;
+ save->fp2_gen_cntl &= ~R200_FP2_SOURCE_SEL_MASK;
+ if (mode->Flags & RADEON_USE_RMX)
+ save->fp2_gen_cntl |= R200_FP2_SOURCE_SEL_RMX;
} else {
- save->fp2_gen_cntl &= ~(RADEON_FP2_SRC_SEL_CRTC2 |
- RADEON_FP2_DVO_RATE_SEL_SDR);
- }
+ save->fp2_gen_cntl &= ~RADEON_FP2_SRC_SEL_CRTC2;
+ }
} else {
if ((info->ChipFamily == CHIP_FAMILY_R200) || IS_R300_VARIANT) {
- save->fp2_gen_cntl &= ~(R200_FP2_SOURCE_SEL_MASK |
- RADEON_FP2_DVO_RATE_SEL_SDR);
+ save->fp2_gen_cntl &= ~R200_FP2_SOURCE_SEL_MASK;
save->fp2_gen_cntl |= R200_FP2_SOURCE_SEL_CRTC2;
} else {
- save->fp2_gen_cntl &= ~(RADEON_FP2_DVO_RATE_SEL_SDR);
save->fp2_gen_cntl |= RADEON_FP2_SRC_SEL_CRTC2;
}
}
commit 5e4d98470b6412a686883c554e7eb7badbe78c4d
Author: Alex Deucher <alex@botch2.(none)>
Date: Thu Sep 20 23:22:48 2007 -0400
RADEON: round 3 on the PLLs. should fix the LVDS issues
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 8f6e8f0..3b8454f 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -4662,9 +4662,7 @@ void RADEONRestorePLLRegisters(ScrnInfoPtr pScrn,
RADEON_VCLK_SRC_SEL_PPLLCLK,
~(RADEON_VCLK_SRC_SEL_MASK));
- usleep(50000);
-
- OUTPLL(pScrn, RADEON_VCLK_ECP_CNTL, restore->vclk_ecp_cntl);
+ /*OUTPLL(pScrn, RADEON_VCLK_ECP_CNTL, restore->vclk_ecp_cntl);*/
ErrorF("finished PLL1\n");
@@ -4739,8 +4737,6 @@ void RADEONRestorePLL2Registers(ScrnInfoPtr pScrn,
RADEON_PIX2CLK_SRC_SEL_P2PLLCLK,
~(RADEON_PIX2CLK_SRC_SEL_MASK));
- usleep(5000);
-
OUTPLL(pScrn, RADEON_PIXCLKS_CNTL, restore->pixclks_cntl);
ErrorF("finished PLL2\n");
Reply to: