From 7d1d968fdc8de1e0ab0be916a1f3a4a398af47aa Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 25 Jun 2009 13:49:18 -0400 Subject: Cosmetic cleanup to digital output detection No functional change, but this logic would need extending anyway for DisplayID, so unify it now. --- src/radeon_output.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/radeon_output.c b/src/radeon_output.c index e307bf0e..40c0699f 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -209,6 +209,12 @@ radeon_set_active_device(xf86OutputPtr output) } } +static Bool +monitor_is_digital(xf86MonPtr MonInfo) +{ + return (MonInfo->rawData[0x14] & 0x80) != 0; +} + static RADEONMonitorType radeon_ddc_connected(xf86OutputPtr output) { @@ -235,7 +241,7 @@ radeon_ddc_connected(xf86OutputPtr output) case CONNECTOR_DVI_D: case CONNECTOR_HDMI_TYPE_A: if (radeon_output->shared_ddc) { - if (MonInfo->rawData[0x14] & 0x80) /* if it's digital and DVI/HDMI/etc. */ + if (monitor_is_digital(MonInfo)) MonType = MT_DFP; else MonType = MT_NONE; @@ -250,7 +256,7 @@ radeon_ddc_connected(xf86OutputPtr output) MonType = MT_DFP; case CONNECTOR_HDMI_TYPE_B: case CONNECTOR_DVI_I: - if (MonInfo->rawData[0x14] & 0x80) /* if it's digital and DVI */ + if (monitor_is_digital(MonInfo)) MonType = MT_DFP; else MonType = MT_CRT; @@ -259,7 +265,7 @@ radeon_ddc_connected(xf86OutputPtr output) case CONNECTOR_DVI_A: default: if (radeon_output->shared_ddc) { - if (MonInfo->rawData[0x14] & 0x80) /* if it's digital and VGA */ + if (monitor_is_digital(MonInfo)) MonType = MT_NONE; else MonType = MT_CRT; -- cgit v1.2.3