summaryrefslogtreecommitdiff
path: root/src/sil164
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2006-12-18 15:57:44 -0800
committerEric Anholt <eric@anholt.net>2006-12-18 15:57:44 -0800
commiteedef7adc53dd8337d27c02551c5778fb43bae05 (patch)
tree67c1cc6c6d44dc76b625efda733fc2d6050daa0c /src/sil164
parent8983845f91cacf8110c70121e0f5f293fe443e6d (diff)
Add a detect() function for DVO chips, and implement it on sil164.
Diffstat (limited to 'src/sil164')
-rw-r--r--src/sil164/Makefile.am2
-rw-r--r--src/sil164/sil164.c21
2 files changed, 22 insertions, 1 deletions
diff --git a/src/sil164/Makefile.am b/src/sil164/Makefile.am
index bb84d036..d4c0cbd2 100644
--- a/src/sil164/Makefile.am
+++ b/src/sil164/Makefile.am
@@ -3,7 +3,7 @@
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
# _ladir passes a dummy rpath to libtool so the thing will actually link
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
-AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@
+AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ -I../
sil164_la_LTLIBRARIES = sil164.la
sil164_la_LDFLAGS = -module -avoid-version
diff --git a/src/sil164/sil164.c b/src/sil164/sil164.c
index 497336cc..453ed044 100644
--- a/src/sil164/sil164.c
+++ b/src/sil164/sil164.c
@@ -26,12 +26,18 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86Resources.h"
#include "compiler.h"
#include "miscstruct.h"
#include "xf86i2c.h"
+#include "i830_xf86Crtc.h"
#define DPMS_SERVER
#include <X11/extensions/dpms.h>
@@ -117,6 +123,20 @@ out:
return NULL;
}
+static xf86OutputStatus
+sil164_detect(I2CDevPtr d)
+{
+ SIL164Ptr sil = SILPTR(d);
+ CARD8 reg9;
+
+ sil164ReadByte(sil, SIL164_REG9, &reg9);
+
+ if (reg9 & SIL164_9_HTPLG)
+ return XF86OutputStatusConnected;
+ else
+ return XF86OutputStatusDisconnected;
+}
+
static ModeStatus
sil164_mode_valid(I2CDevPtr d, DisplayModePtr mode)
{
@@ -215,6 +235,7 @@ sil164_restore(I2CDevPtr d)
I830I2CVidOutputRec SIL164VidOutput = {
.init = sil164_init,
+ .detect = sil164_detect,
.mode_valid = sil164_mode_valid,
.mode_set = sil164_mode_set,
.dpms = sil164_dpms,