From 11fb9a14741746c752b0001c1b1d39a54e69657a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 18 Sep 2006 06:35:50 +1000 Subject: radeon: add tv dac adj lookup --- src/radeon.h | 2 ++ src/radeon_display.c | 41 +++++++++++++++++++++++++++++++++++------ src/radeon_driver.c | 1 + 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/radeon.h b/src/radeon.h index f711d65..247cc6f 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -809,6 +809,8 @@ typedef struct { int MaxSurfaceWidth; int MaxLines; + CARD32 tv_dac_adj; + } RADEONInfoRec, *RADEONInfoPtr; #define RADEONWaitForFifo(pScrn, entries) \ diff --git a/src/radeon_display.c b/src/radeon_display.c index ea5e5e3..ca9a72c 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -48,12 +48,7 @@ #include "radeon_version.h" #include "radeon_mergedfb.h" -#ifdef XF86DRI -#define _XF86DRI_SERVER_ -#include "radeon_dri.h" -#include "radeon_sarea.h" -#include "sarea.h" -#endif +extern int getRADEONEntityIndex(void); const char *MonTypeName[7] = { "AUTO", @@ -142,6 +137,28 @@ static const RADEONTMDSPll default_tmds_pll[CHIP_FAMILY_LAST][4] = {{15000, 0xb0155}, {0xffffffff, 0xb01cb}, {0, 0}, {0, 0}}, /*CHIP_FAMILY_RS400*/ /* FIXME: just values from rv380 used... */ }; +static const CARD32 default_tvdac_adj [CHIP_FAMILY_LAST] = +{ + 0x00000000, /* unknown */ + 0x00000000, /* legacy */ + 0x00000000, /* r100 */ + 0x00280000, /* rv100 */ + 0x00000000, /* rs100 */ + 0x00880000, /* rv200 */ + 0x00000000, /* rs200 */ + 0x00000000, /* r200 */ + 0x00770000, /* rv250 */ + 0x00290000, /* rs300 */ + 0x00560000, /* rv280 */ + 0x00780000, /* r300 */ + 0x00770000, /* r350 */ + 0x00780000, /* rv350 */ + 0x00780000, /* rv380 */ + 0x01080000, /* r420 */ + 0x01080000, /* rv410 */ /* FIXME: just values from r420 used... */ + 0x00780000, /* rs400 */ /* FIXME: just values from rv380 used... */ +}; + static void RADEONI2CGetBits(I2CBusPtr b, int *Clock, int *data) { ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; @@ -885,6 +902,18 @@ void RADEONGetPanelInfo (ScrnInfoPtr pScrn) } } +void RADEONGetTVDacAdjInfo(ScrnInfoPtr pScrn) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + + /* Todo: get this setting from BIOS */ + info->tv_dac_adj = default_tvdac_adj[info->ChipFamily]; + if (info->IsMobility) { /* some mobility chips may different */ + if (info->ChipFamily == CHIP_FAMILY_RV250) + info->tv_dac_adj = 0x00880000; + } +} + BOOL RADEONQueryConnectedMonitors(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 3fa10c5..e3d8864 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -3560,6 +3560,7 @@ static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10 if (!RADEONQueryConnectedMonitors(pScrn)) goto fail; RADEONGetClockInfo(pScrn); + RADEONGetTVDacAdjInfo(pScrn); return TRUE; fail: -- cgit v1.2.3