From 27134c6697c1b76ab05b058dc378b3b126c40b63 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sat, 17 Oct 2015 09:43:24 -0500 Subject: [PATCH] intel_extreme: Dump more info on ports found. Build fixes. --- .../accelerants/intel_extreme/Ports.cpp | 8 +++--- src/add-ons/accelerants/intel_extreme/Ports.h | 8 +++--- .../accelerants/intel_extreme/accelerant.cpp | 26 ++++++++++++++++++- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/add-ons/accelerants/intel_extreme/Ports.cpp b/src/add-ons/accelerants/intel_extreme/Ports.cpp index 1e84aed113..29d5524a49 100644 --- a/src/add-ons/accelerants/intel_extreme/Ports.cpp +++ b/src/add-ons/accelerants/intel_extreme/Ports.cpp @@ -83,7 +83,7 @@ Port::GetEDID(edid1_info* edid, bool forceRead) return fEDIDState; } - TRACE("%s: using register %" B_PRIx32 "\n", PortName(), ddcRegister); + TRACE("%s: using register %" B_PRIxADDR "\n", PortName(), ddcRegister); i2c_bus bus; bus.cookie = (void*)ddcRegister; @@ -184,7 +184,7 @@ AnalogPort::IsConnected() } -uint32 +addr_t AnalogPort::_DDCRegister() { // always fixed @@ -218,7 +218,7 @@ LVDSPort::IsConnected() } -uint32 +addr_t LVDSPort::_DDCRegister() { // always fixed @@ -245,7 +245,7 @@ DigitalPort::IsConnected() } -uint32 +addr_t DigitalPort::_DDCRegister() { switch (PortIndex()) { diff --git a/src/add-ons/accelerants/intel_extreme/Ports.h b/src/add-ons/accelerants/intel_extreme/Ports.h index 41cb757415..69994dbe65 100644 --- a/src/add-ons/accelerants/intel_extreme/Ports.h +++ b/src/add-ons/accelerants/intel_extreme/Ports.h @@ -64,7 +64,7 @@ static status_t _SetI2CSignals(void* cookie, int clock, int data); private: -virtual uint32 _DDCRegister() = 0; +virtual addr_t _DDCRegister() = 0; port_index fPortIndex; char* fPortName; @@ -84,7 +84,7 @@ virtual uint32 Type() const virtual bool IsConnected(); protected: -virtual uint32 _DDCRegister(); +virtual addr_t _DDCRegister(); }; @@ -98,7 +98,7 @@ virtual uint32 Type() const virtual bool IsConnected(); protected: -virtual uint32 _DDCRegister(); +virtual addr_t _DDCRegister(); }; @@ -114,7 +114,7 @@ virtual uint32 Type() const virtual bool IsConnected(); protected: -virtual uint32 _DDCRegister(); +virtual addr_t _DDCRegister(); }; diff --git a/src/add-ons/accelerants/intel_extreme/accelerant.cpp b/src/add-ons/accelerants/intel_extreme/accelerant.cpp index f71392bdad..c5a4d64d0c 100644 --- a/src/add-ons/accelerants/intel_extreme/accelerant.cpp +++ b/src/add-ons/accelerants/intel_extreme/accelerant.cpp @@ -181,6 +181,29 @@ uninit_common(void) } +static void +dump_ports() +{ + if (gInfo->port_count == 0) { + TRACE("%s: No ports connected\n", __func__); + return; + } + + TRACE("%s: Connected ports: (port_count: %d)\n", __func__, + gInfo->port_count); + + for (uint32 i = 0; i < gInfo->port_count; i++) { + Port* port = gInfo->ports[i]; + if (!port) { + TRACE("port %d: INVALID ALLOC!\n", i); + continue; + } + TRACE("port %d: %s %s\n", i, port->PortName(), + port->IsConnected() ? "connected" : "disconnected"); + } +} + + static bool has_connected_port(port_index portIndex, uint32 type) { @@ -302,7 +325,8 @@ intel_init_accelerant(int device) } else delete analogPort; - TRACE("connected ports detected: %" B_PRIu32 "\n", gInfo->port_count); + // On TRACE, dump ports and states + dump_ports(); status = create_mode_list(); if (status != B_OK) {