intel_crt.c revision 1450
830N/A * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. 919N/A * Copyright (c) 2006-2007, 2013, Intel Corporation 919N/A * Permission is hereby granted, free of charge, to any person obtaining a 830N/A * copy of this software and associated documentation files (the "Software"), 919N/A * to deal in the Software without restriction, including without limitation 919N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense, 919N/A * and/or sell copies of the Software, and to permit persons to whom the 830N/A * Software is furnished to do so, subject to the following conditions: 919N/A * The above copyright notice and this permission notice (including the next 919N/A * paragraph) shall be included in all copies or substantial portions of the 919N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 919N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 830N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 830N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 830N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 830N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 830N/A * DEALINGS IN THE SOFTWARE. 830N/A * Eric Anholt <eric@anholt.net> 830N/A/* Here's the desired hotplug mode */ 830N/A /* DPMS state is stored in the connector, which we need in the /* Note: The caller is required to filter out dpms modes not supported by the /* PCH platforms and VLV only support on/off. */ /* Only need to change hw state when actually enabled */ /* We need the pipe to run for anything but OFF. */ /* We call connector dpms manually below in case pipe dpms doesn't * change due to cloning. */ /* From off to on, enable the pipe first. */ /* The FDI receiver on LPT only supports 8bpc and only has 2 lanes. */ /* LPT FDI RX only supports 8bpc. */ /* For CPT allow 3 pipe config, for others just use A or B */ ;
/* Those bits don't exist here */ /* The first time through, trigger an explicit detection cycle */ /* Check the status to see if both blue and green are on now */ /* Check the status to see if both blue and green are on now */ /* FIXME: debug force function and remove */ * Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect CRT presence. * \return true if CRT is connected. * \return false if CRT is disconnected. * On 4 series desktop, CRT detect sequence need to be done twice * to get a reliable result. for (i = 0; i <
tries ; i++) {
/* turn on the FORCE_DETECT */ /* wait for FORCE_DETECT to go off */ /* clear the interrupt we just generated, if any */ /* and put the bits back */ DRM_DEBUG_KMS(
"CRT GMBUS EDID read failed, retry using GPIO bit-banging\n");
/* local version of intel_ddc_get_modes() to use intel_crt_get_edid() */ * This may be a DVI-I connector with a shared DDC * link between analog and digital outputs, so we * have to check the EDID input spec of the attached device. DRM_DEBUG_KMS(
"CRT not detected via DDC:0x50 [EDID reports a digital panel]\n");
DRM_DEBUG_KMS(
"CRT not detected via DDC:0x50 [no valid EDID found]\n");
/* Set the border color to purple. */ /* Wait for next Vblank to substitue * border color for Color info */ * If there isn't any border, add some. /* sample in the vertical border, selecting the larger one */ * Wait for the border to be displayed * Watch ST00 for an entire scanline /* Read the ST00 VGA status register */ /* restore vblank if necessary */ * If more than 3/4 of the scanline detected a monitor, * then it is assumed to be present. This works even on i830, * where there isn't any way to force the border color across /* Restore previous settings */ /* We can not rely on the HPD pin always being correctly wired * up, for example many KVM do not pass it through, and so * only trust an assertion that the monitor is connected. /* Load detection is broken on HPD capable machines. Whoever wants a * broken monitor (without edid) to work behind a broken kvm (that fails * to have the right resistors for HP detection) needs to fix this up. * For now just bail out. */ /* for pre-945g platforms use load detect */ /* OSOL_i915: drm_sysfs_connector_remove(connector); */ /* Try to probe digital port for output in DVI-I -> VGA mode. */ * Routines for controlling stuff on the analog port /* Skip machines without VGA that falsely report hotplug events */ /* OSOL_i915: drm_sysfs_connector_add(connector); */ * Configure the automatic hotplug detection stuff * TODO: find a proper way to discover whether we need to set the the * polarity and link reversal bits or not, instead of relying on the