summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkadiusz Miskiewicz <arekm@maven.pl>2007-12-21 18:10:17 -0500
committerAlex Deucher <alex@botch2.(none)>2007-12-21 18:10:17 -0500
commit2b6e8e2b8f74e94560de89693ecbc7260536591e (patch)
tree06537ec722a51d0ee92cf386d2416ab1e2be0c6f
parent4c6f60e3b19ac55ab1255c79df03b1df5950864e (diff)
RADEON: various cleanups
-rw-r--r--src/atombios_crtc.c8
-rw-r--r--src/legacy_output.c3
-rw-r--r--src/radeon.h6
-rw-r--r--src/radeon_atombios.c4
-rw-r--r--src/radeon_atombios.h11
-rw-r--r--src/radeon_bios.c4
-rw-r--r--src/radeon_crtc.c14
-rw-r--r--src/radeon_driver.c16
-rw-r--r--src/radeon_output.c14
9 files changed, 45 insertions, 35 deletions
diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index e7ad4a97..ebfadd67 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -99,6 +99,7 @@ atombios_blank_crtc(atomBiosHandlePtr atomBIOS, int crtc, int state)
return ATOM_NOT_IMPLEMENTED;
}
+#if 0
static void
atombios_crtc_enable(xf86CrtcPtr crtc, int enable)
{
@@ -109,6 +110,7 @@ atombios_crtc_enable(xf86CrtcPtr crtc, int enable)
//TODOavivo_wait_idle(avivo);
}
+#endif
void
atombios_crtc_dpms(xf86CrtcPtr crtc, int mode)
@@ -185,11 +187,11 @@ atombios_crtc_set_pll(xf86CrtcPtr crtc, DisplayModePtr mode)
}
xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO,
- "crtc(%d) Clock: mode %d, PLL %u\n",
- radeon_crtc->crtc_id, mode->Clock, sclock * 10);
+ "crtc(%d) Clock: mode %d, PLL %lu\n",
+ radeon_crtc->crtc_id, mode->Clock, (long unsigned int)sclock * 10);
xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO,
"crtc(%d) PLL : refdiv %u, fbdiv 0x%X(%u), pdiv %u\n",
- radeon_crtc->crtc_id, ref_div, fb_div, fb_div, post_div);
+ radeon_crtc->crtc_id, (unsigned int)ref_div, (unsigned int)fb_div, (unsigned int)fb_div, (unsigned int)post_div);
atombios_get_command_table_version(info->atomBIOS, index, &major, &minor);
diff --git a/src/legacy_output.c b/src/legacy_output.c
index 9caebddd..694e7c78 100644
--- a/src/legacy_output.c
+++ b/src/legacy_output.c
@@ -847,9 +847,6 @@ RADEONEnableDisplay(xf86OutputPtr output, BOOL bEnable)
void
legacy_output_dpms(xf86OutputPtr output, int mode)
{
- ScrnInfoPtr pScrn = output->scrn;
- RADEONInfoPtr info = RADEONPTR(pScrn);
-
switch(mode) {
case DPMSModeOn:
RADEONEnableDisplay(output, TRUE);
diff --git a/src/radeon.h b/src/radeon.h
index c376cdba..4a10860c 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -880,6 +880,8 @@ extern void
radeon_crtc_set_cursor_colors (xf86CrtcPtr crtc, int bg, int fg);
extern void
radeon_crtc_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image);
+extern void
+radeon_crtc_load_lut(xf86CrtcPtr crtc);
extern void RADEONAdjustCrtcRegistersForTV(ScrnInfoPtr pScrn, RADEONSavePtr save,
DisplayModePtr mode, xf86OutputPtr output);
@@ -894,6 +896,10 @@ extern void RADEONInitTVRegisters(xf86OutputPtr output, RADEONSavePtr save,
extern void RADEONRestoreTVRegisters(ScrnInfoPtr pScrn, RADEONSavePtr restore);
+extern void RADEONComputePLL(RADEONPLLPtr pll, unsigned long freq, CARD32 *chosen_dot_clock_freq,
+ CARD32 *chosen_feedback_div, CARD32 *chosen_reference_div,
+ CARD32 *chosen_post_div, int flags);
+
#ifdef XF86DRI
#ifdef USE_XAA
extern void RADEONAccelInitCP(ScreenPtr pScreen, XAAInfoRecPtr a);
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index a04598d8..ae327533 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1512,7 +1512,7 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
} else if (ci.sucI2cId.sbfAccess.bfI2C_LineMux) {
/* add support for GPIO line */
ErrorF("Unsupported SW GPIO - device %d: gpio line: 0x%x\n",
- i, RADEONLookupGPIOLineForDDC(pScrn, ci.sucI2cId.sbfAccess.bfI2C_LineMux));
+ i, (unsigned int)RADEONLookupGPIOLineForDDC(pScrn, ci.sucI2cId.sbfAccess.bfI2C_LineMux));
info->BiosConnector[i].ddc_line = 0;
} else {
info->BiosConnector[i].ddc_line = 0;
@@ -1591,7 +1591,7 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn)
for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) {
if (info->BiosConnector[i].valid) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Port%d: DDCType-0x%x, DACType-%d, TMDSType-%d, ConnectorType-%d, hpd_mask-0x%x\n",
- i, info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
+ i, (unsigned int)info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
info->BiosConnector[i].TMDSType, info->BiosConnector[i].ConnectorType,
info->BiosConnector[i].hpd_mask);
}
diff --git a/src/radeon_atombios.h b/src/radeon_atombios.h
index 33925a52..bfac93e7 100644
--- a/src/radeon_atombios.h
+++ b/src/radeon_atombios.h
@@ -110,6 +110,17 @@ extern AtomBiosResult
RHDAtomBiosFunc(int scrnIndex, atomBiosHandlePtr handle,
AtomBiosRequestID id, AtomBiosArgPtr data);
+extern Bool
+RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn);
+extern Bool
+RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn);
+
+extern int
+atombios_external_tmds_setup(xf86OutputPtr output, DisplayModePtr mode);
+
+extern void
+atombios_get_command_table_version(atomBiosHandlePtr atomBIOS, int index, int *major, int *minor);
+
# include "xf86int10.h"
# ifdef ATOM_BIOS_PARSER
# define INT8 INT8
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index 1a4f99da..92531827 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -305,7 +305,7 @@ static Bool RADEONGetATOMConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
if (info->BiosConnector[i].valid) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Port%d: DDCType-0x%x, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
- i, info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
+ i, (unsigned int)info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
info->BiosConnector[i].TMDSType, info->BiosConnector[i].ConnectorType);
}
}
@@ -494,7 +494,7 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
if (info->BiosConnector[i].valid) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Port%d: DDCType-0x%x, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
- i, info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
+ i, (unsigned int)info->BiosConnector[i].ddc_line, info->BiosConnector[i].DACType,
info->BiosConnector[i].TMDSType, info->BiosConnector[i].ConnectorType);
}
}
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index 9034cf50..2f9034a7 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -86,9 +86,6 @@ radeon_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode,
static void
radeon_crtc_mode_prepare(xf86CrtcPtr crtc)
{
- ScrnInfoPtr pScrn = crtc->scrn;
- RADEONInfoPtr info = RADEONPTR(pScrn);
-
radeon_crtc_dpms(crtc, DPMSModeOff);
}
@@ -178,10 +175,10 @@ RADEONComputePLL(RADEONPLLPtr pll,
}
}
- ErrorF("best_freq: %u\n", best_freq);
- ErrorF("best_feedback_div: %u\n", best_feedback_div);
- ErrorF("best_ref_div: %u\n", best_ref_div);
- ErrorF("best_post_div: %u\n", best_post_div);
+ ErrorF("best_freq: %u\n", (unsigned int)best_freq);
+ ErrorF("best_feedback_div: %u\n", (unsigned int)best_feedback_div);
+ ErrorF("best_ref_div: %u\n", (unsigned int)best_ref_div);
+ ErrorF("best_post_div: %u\n", (unsigned int)best_post_div);
*chosen_dot_clock_freq = best_freq / 10000;
*chosen_feedback_div = best_feedback_div;
@@ -207,9 +204,6 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
static void
radeon_crtc_mode_commit(xf86CrtcPtr crtc)
{
- ScrnInfoPtr pScrn = crtc->scrn;
- RADEONInfoPtr info = RADEONPTR(pScrn);
-
radeon_crtc_dpms(crtc, DPMSModeOn);
}
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index b9a05f36..9c6c0e45 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -144,6 +144,8 @@ extern void
RADEONSaveFPRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
extern void
RADEONSaveDACRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
+extern void
+RADEONSaveTVRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save);
#ifdef USE_XAA
#ifdef XF86DRI
@@ -1191,7 +1193,6 @@ static Bool RADEONProbePLLParameters(ScrnInfoPtr pScrn)
static void RADEONGetClockInfo(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR (pScrn);
- RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
RADEONPLLPtr pll = &info->pll;
double min_dotclock;
@@ -1468,7 +1469,7 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
if (info->ChipFamily >= CHIP_FAMILY_R600) {
info->mc_fb_location = (aper0_base >> 24) |
(((aper0_base + mem_size - 1) & 0xff000000U) >> 8);
- ErrorF("mc fb loc is %08x\n", info->mc_fb_location);
+ ErrorF("mc fb loc is %08x\n", (unsigned int)info->mc_fb_location);
} else {
info->mc_fb_location = (aper0_base >> 16) |
((aper0_base + mem_size - 1) & 0xffff0000U);
@@ -2607,10 +2608,8 @@ static void RADEONPreInitBIOS(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
static void RADEONFixZaphodOutputs(ScrnInfoPtr pScrn)
{
- RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
RADEONInfoPtr info = RADEONPTR(pScrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
- int i;
if (info->IsPrimary) {
xf86OutputDestroy(config->output[0]);
@@ -2627,7 +2626,6 @@ static void RADEONFixZaphodOutputs(ScrnInfoPtr pScrn)
static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
- RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
RADEONInfoPtr info = RADEONPTR(pScrn);
int i;
int mask;
@@ -3672,7 +3670,7 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn,
"RADEONRestoreMemMapRegisters() : \n");
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
" MC_FB_LOCATION : 0x%08x 0x%08x\n",
- (unsigned)restore->mc_fb_location, mc_fb_loc);
+ (unsigned)restore->mc_fb_location, (unsigned int)mc_fb_loc);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
" MC_AGP_LOCATION : 0x%08x\n",
(unsigned)restore->mc_agp_location);
@@ -3789,7 +3787,7 @@ void RADEONRestoreMemMapRegisters(ScrnInfoPtr pScrn,
"Timeout trying to update memory controller settings !\n");
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"MC_STATUS = 0x%08x (on entry = 0x%08x)\n",
- INREG(RADEON_MC_STATUS), (unsigned int)old_mc_status);
+ (unsigned int)INREG(RADEON_MC_STATUS), (unsigned int)old_mc_status);
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"You will probably crash now ... \n");
/* Nothing we can do except maybe try to kill the server,
@@ -3891,10 +3889,10 @@ static void RADEONAdjustMemMapRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save)
"DRI init changed memory map, adjusting ...\n");
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
" MC_FB_LOCATION was: 0x%08lx is: 0x%08lx\n",
- info->mc_fb_location, fb);
+ (long unsigned int)info->mc_fb_location, (long unsigned int)fb);
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
" MC_AGP_LOCATION was: 0x%08lx is: 0x%08lx\n",
- info->mc_agp_location, agp);
+ (long unsigned int)info->mc_agp_location, (long unsigned int)agp);
info->mc_fb_location = fb;
info->mc_agp_location = agp;
if (info->ChipFamily >= CHIP_FAMILY_R600)
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 84b1dd9d..10369d9e 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -198,7 +198,7 @@ void RADEONPrintPortMap(ScrnInfoPtr pScrn)
ConnectorTypeName[radeon_output->ConnectorType],
DACTypeName[radeon_output->DACType+1],
TMDSTypeName[radeon_output->TMDSType+1],
- radeon_output->ddc_line);
+ (unsigned int)radeon_output->ddc_line);
}
}
@@ -232,7 +232,7 @@ avivo_display_ddc_connected(ScrnInfoPtr pScrn, xf86OutputPtr output)
} else MonType = MT_NONE;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "DDC Type: 0x%x, Detected Monitor Type: %d\n", radeon_output->ddc_line, MonType);
+ "DDC Type: 0x%x, Detected Monitor Type: %d\n", (unsigned int)radeon_output->ddc_line, MonType);
return MonType;
}
@@ -332,7 +332,7 @@ RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, xf86OutputPtr output)
} else MonType = MT_NONE;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "DDC Type: 0x%x, Detected Monitor Type: %d\n", radeon_output->ddc_line, MonType);
+ "DDC Type: 0x%x, Detected Monitor Type: %d\n", (unsigned int)radeon_output->ddc_line, MonType);
return MonType;
}
@@ -1196,6 +1196,7 @@ void RADEONSetOutputType(ScrnInfoPtr pScrn, RADEONOutputPrivatePtr radeon_output
radeon_output->type = output;
}
+#if 0
static
Bool AVIVOI2CReset(ScrnInfoPtr pScrn)
{
@@ -1207,6 +1208,7 @@ Bool AVIVOI2CReset(ScrnInfoPtr pScrn)
OUTREG(AVIVO_I2C_STOP, 0x0);
return TRUE;
}
+#endif
static
Bool AVIVOI2CDoLock(ScrnInfoPtr pScrn, int lock_state, int gpio_reg)
@@ -1669,7 +1671,7 @@ void RADEONInitConnector(xf86OutputPtr output)
RADEONOutputPrivatePtr radeon_output = output->driver_private;
char stmp[16];
char *name;
- sprintf(stmp, "DDC_0x%x", radeon_output->ddc_line);
+ sprintf(stmp, "DDC_0x%x", (unsigned int)radeon_output->ddc_line);
name = xnfalloc(strlen(stmp) + 1);
strcpy(name, stmp);
@@ -2224,11 +2226,11 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
info->BiosConnector[0].valid = TRUE;
info->BiosConnector[1].valid = TRUE;
if (sscanf(optstr, "%u,%d,%d,%u,%u,%d,%d,%u",
- &info->BiosConnector[0].ddc_line,
+ (unsigned int *)&info->BiosConnector[0].ddc_line,
&info->BiosConnector[0].DACType,
&info->BiosConnector[0].TMDSType,
&info->BiosConnector[0].ConnectorType,
- &info->BiosConnector[1].ddc_line,
+ (unsigned int *)&info->BiosConnector[1].ddc_line,
&info->BiosConnector[1].DACType,
&info->BiosConnector[1].TMDSType,
&info->BiosConnector[1].ConnectorType) != 8) {