diff options
author | Adam Jackson <ajax@redhat.com> | 2008-11-03 15:09:28 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-11-03 15:09:58 -0500 |
commit | 44abaa0ea8e5e3bbe833fa73e6d011618bb6d7e7 (patch) | |
tree | 6d856ebca57b01a15f485c7be3190bf94c9d5ebc /src | |
parent | 937b7ac2a259cf504a19dcf62a58b1db1afb8eb9 (diff) |
Fix HDMI output setup on DIG1/DIG2.
The only reliable way to detect an HDMI sink is to check for the
appropriate EDID extension block, so this will only work right on
servers with xf86DoEEDID(). RANDR 1.2 will call this internally for
us if it exists, but pre-1.6 servers are out of luck.
Diffstat (limited to 'src')
-rw-r--r-- | src/atombios_output.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/atombios_output.c b/src/atombios_output.c index 49de04fe..81187ae1 100644 --- a/src/atombios_output.c +++ b/src/atombios_output.c @@ -375,6 +375,20 @@ atombios_output_digital_setup(xf86OutputPtr output, int device, DisplayModePtr m } static int +atombios_maybe_hdmi_mode(xf86OutputPtr output) +{ +#ifndef EDID_COMPLETE_RAWDATA + /* there's no getting this right unless we have complete EDID */ + return ATOM_ENCODER_MODE_HDMI; +#else + if (output && xf86MonitorIsHDMI(output->MonInfo)) + return ATOM_ENCODER_MODE_HDMI; + + return ATOM_ENCODER_MODE_DVI; +#endif +} + +static int atombios_output_dig1_setup(xf86OutputPtr output, DisplayModePtr mode) { RADEONOutputPrivatePtr radeon_output = output->driver_private; @@ -405,7 +419,7 @@ atombios_output_dig1_setup(xf86OutputPtr output, DisplayModePtr mode) if (OUTPUT_IS_DVI) disp_data.ucEncoderMode = ATOM_ENCODER_MODE_DVI; else if (radeon_output->type == OUTPUT_HDMI) - disp_data.ucEncoderMode = ATOM_ENCODER_MODE_HDMI; + disp_data.ucEncoderMode = atombios_maybe_hdmi_mode(output); else if (radeon_output->type == OUTPUT_DP) disp_data.ucEncoderMode = ATOM_ENCODER_MODE_DP; else if (radeon_output->type == OUTPUT_LVDS) @@ -514,7 +528,7 @@ atombios_output_dig2_setup(xf86OutputPtr output, DisplayModePtr mode) if (OUTPUT_IS_DVI) disp_data.ucEncoderMode = ATOM_ENCODER_MODE_DVI; else if (radeon_output->type == OUTPUT_HDMI) - disp_data.ucEncoderMode = ATOM_ENCODER_MODE_HDMI; + disp_data.ucEncoderMode = atombios_maybe_hdmi_mode(output); else if (radeon_output->type == OUTPUT_DP) disp_data.ucEncoderMode = ATOM_ENCODER_MODE_DP; else if (radeon_output->type == OUTPUT_LVDS) @@ -858,7 +872,8 @@ atombios_set_output_crtc_source(xf86OutputPtr output) if (OUTPUT_IS_DVI) crtc_src_param2.ucEncodeMode = ATOM_ENCODER_MODE_DVI; else if (radeon_output->type == OUTPUT_HDMI) - crtc_src_param2.ucEncodeMode = ATOM_ENCODER_MODE_HDMI; + crtc_src_param2.ucEncodeMode = + atombios_maybe_hdmi_mode(output); else if (radeon_output->type == OUTPUT_DP) crtc_src_param2.ucEncodeMode = ATOM_ENCODER_MODE_DP; } else if (radeon_output->MonType == MT_LCD) { |