summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alex@t41p.hsd1.va.comcast.net>2007-10-10 21:54:46 -0400
committerAlex Deucher <alex@t41p.hsd1.va.comcast.net>2007-10-10 21:54:46 -0400
commit1b231d28fdda5cdc44bb9d2075d4edfd8f17e21f (patch)
tree5b83a41eb6c8777412211c0a803977a299dc3956
parent47ef583b993607bc3a372dd125c6e5228c4ec7bf (diff)
RADEON: attempt to detect lid status on legacy bios
I'm not sure how reliable this is. The lid closed bit only seems to be set if the lid is closed at boot so LVDS will default to on if you restart X with the lid closed after boot.
-rw-r--r--src/radeon_output.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 08360052..643cbc4e 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -670,9 +670,19 @@ static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr
RADEONOutputPrivatePtr radeon_output = output->driver_private;
RADEONMonitorType MonType = MT_NONE;
-
if (radeon_output->type == OUTPUT_LVDS) {
- MonType = MT_LCD;
+#if defined(__powerpc__)
+ /* not sure on ppc, OF? */
+#else
+ if (!info->IsAtomBios) {
+ /* see if the lid is closed -- only works at boot */
+ if (INREG(RADEON_BIOS_6_SCRATCH) & 0x10)
+ MonType = MT_NONE;
+ else
+ MonType = MT_LCD;
+ } else
+#endif
+ MonType = MT_LCD;
} else if (radeon_output->type == OUTPUT_DVI) {
if (radeon_output->TMDSType == TMDS_INT) {
if (INREG(RADEON_FP_GEN_CNTL) & RADEON_FP_DETECT_SENSE)