From e8c1e7b9d0dc0542dc2a5e6c7dce1a84403ceba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 17 Nov 2009 17:36:08 +0100 Subject: [PATCH] Add RHD_CARD_FLAG_FORCEBL flag forcing on chip backlight control usage --- src/rhd_card.h | 5 +++-- src/rhd_dig.c | 7 ++++++- src/rhd_id.c | 1 + src/rhd_lvtma.c | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/rhd_card.h b/src/rhd_card.h index d854931..f8aabab 100644 --- a/src/rhd_card.h +++ b/src/rhd_card.h @@ -37,10 +37,11 @@ struct rhdConnectorInfo { /* Some card specific flags, where and when needed */ enum rhdCardFlag { - RHD_CARD_FLAG_NONE = 0, + RHD_CARD_FLAG_NONE = 0, RHD_CARD_FLAG_DMS59 = 1, /* DMS59 connector is only reported as two DVI-I */ RHD_CARD_FLAG_HPDSWAP = 2, /* some cards have broken connector tables */ - RHD_CARD_FLAG_HPDOFF = 4 /* some have *very* broken connector tables */ + RHD_CARD_FLAG_HPDOFF = 4, /* some have *very* broken connector tables */ + RHD_CARD_FLAG_FORCEBL = 8 /* some cards don't have backlight bit enabled */ }; struct rhdCard { diff --git a/src/rhd_dig.c b/src/rhd_dig.c index 3458d4b..0c5f5c2 100644 --- a/src/rhd_dig.c +++ b/src/rhd_dig.c @@ -47,6 +47,7 @@ #include "rhd_atombios.h" #include "rhd_atomout.h" #endif +#include "rhd_card.h" #define FMT2_OFFSET 0x800 #define DIG1_OFFSET 0x000 @@ -184,7 +185,9 @@ LVDSGetBacklight(struct rhdOutput *Output) CARD32 level; level = RHDRegRead(Output, RV620_LVTMA_BL_MOD_CNTL); - if ((level & 0x01) != 0x01) return -1; + if (!(level & 0x01)) { + return 0xFF; + } return (level >> LVTMA_BL_MOD_LEVEL_SHIFT) & 0xFF; } @@ -1342,6 +1345,8 @@ GetLVDSInfo(RHDPtr rhdPtr, struct DIGPrivate *Private) tmp = RHDRegRead(rhdPtr, RV620_LVTMA_BL_MOD_CNTL); if (tmp & LVTMA_BL_MOD_EN) Private->BlLevel = ( tmp >> LVTMA_BL_MOD_LEVEL_SHIFT ) & 0xff; + else if (rhdPtr->Card && rhdPtr->Card->flags & RHD_CARD_FLAG_FORCEBL) + Private->BlLevel = 255; else Private->BlLevel = -1; diff --git a/src/rhd_id.c b/src/rhd_id.c index 5f436d9..068424e 100644 --- a/src/rhd_id.c +++ b/src/rhd_id.c @@ -916,6 +916,7 @@ rhdCards[] = /* 0x958C : RV630 : ATI FireGL V5600 */ /* 0x958D : RV630 : ATI FireGL V3600 */ /* 0x958E : RV630 : ATI Radeon HD 2600 LE */ + { 0x95C4, 0x104D, 0x9035, "ATI Radeon HD 3470", RHD_CARD_FLAG_FORCEBL, ID_CONNECTORINFO_EMPTY, DEVINFO_EMPTY }, { 0x95C5, 0x1043, 0x01F4, "ASUS EAH3450", RHD_CARD_FLAG_HPDOFF, ID_CONNECTORINFO_EMPTY, DEVINFO_EMPTY }, { 0x95C5, 0x1787, 0x2252, "PowerColor HD 3450", RHD_CARD_FLAG_HPDOFF, ID_CONNECTORINFO_EMPTY, DEVINFO_EMPTY }, { 0x9610, 0x105B, 0x0E0F, "Foxconn A7GM-S (RS780)", RHD_CARD_FLAG_HPDOFF, ID_CONNECTORINFO_EMPTY, DEVINFO_EMPTY }, diff --git a/src/rhd_lvtma.c b/src/rhd_lvtma.c index a4aeb9e..cb94f8e 100644 --- a/src/rhd_lvtma.c +++ b/src/rhd_lvtma.c @@ -53,6 +53,7 @@ #include "rhd_atombios.h" #include "rhd_atomout.h" #endif +#include "rhd_card.h" /* * First of all, make it more managable to code for both R500 and R600, as @@ -641,6 +642,8 @@ LVDSInfoRetrieve(RHDPtr rhdPtr) tmp = RHDRegRead(rhdPtr, LVTMA_BL_MOD_CNTL); if (tmp & 0x1) Private->BlLevel = (tmp >> 8) & 0xff; + else if (rhdPtr->Card && rhdPtr->Card->flags & RHD_CARD_FLAG_FORCEBL) + Private->BlLevel = 255; else Private->BlLevel = -1; /* Backlight control seems to be done some other way */ -- 1.6.4.2