Add lookup of encoder id -> name for debugging

This commit is contained in:
Alexander von Gluck IV 2011-12-02 20:22:25 -06:00
parent 2944d7dab8
commit bdd1989348
3 changed files with 52 additions and 1 deletions

View File

@ -710,7 +710,8 @@ debug_connectors()
ERROR("Connector #%" B_PRIu32 ")\n", id);
ERROR(" + connector: %s\n", get_connector_name(connectorType));
ERROR(" + encoder: %s\n", get_encoder_name(encoderType));
ERROR(" + encoder id: %" B_PRIu16 "\n", encoderID);
ERROR(" + encoder id: %" B_PRIu16 " (%s)\n", encoderID,
encoder_name_lookup(encoderID));
ERROR(" + gpio id: %" B_PRIu16 "\n", gpioID);
ERROR(" + gpio valid: %s\n",
gGPIOInfo[gpioID]->valid ? "true" : "false");

View File

@ -1118,6 +1118,55 @@ encoder_output_lock(bool lock)
}
static const char *encoder_name_matrix[36] = {
"NONE",
"Internal Radeon LVDS",
"Internal Radeon TMDS1",
"Internal Radeon TMDS2",
"Internal Radeon DAC1",
"Internal Radeon DAC2 (TV)",
"Internal Radeon SDVOA",
"Internal Radeon SDVOB",
"External 3rd party SI170B",
"External 3rd party CH7303",
"External 3rd party CH7301",
"Internal Radeon DVO1",
"External 3rd party SDVOA",
"External 3rd party SDVOB",
"External 3rd party TITFP513",
"Internal LVTM1",
"External 3rd party VT1623",
"External HDMI SI1930",
"Internal HDMI",
"Internal Kaleidoscope TMDS1",
"Internal Kaleidoscope DVO1",
"Internal Kaleidoscope DAC1",
"Internal Kaleidoscope DAC2",
"External Kaleidoscope SI178",
"MVPU FPGA",
"Internal Kaleidoscope DDI",
"External Kaleidoscope VT1625",
"External Kaleidoscope HDMI SI1932",
"External Kaleidoscope DP AN9801",
"External Kaleidoscope DP DP501",
"Internal Kaleidoscope UNIPHY",
"Internal Kaleidoscope LVTMA",
"Internal Kaleidoscope UNIPHY1",
"Internal Kaleidoscope UNIPHY2",
"External Travis Bridge",
"External Nutmeg Bridge"
};
const char*
encoder_name_lookup(uint32 encoderID) {
if (encoderID <= sizeof(encoder_name_matrix))
return encoder_name_matrix[encoderID];
else
return "Unknown";
}
uint32
encoder_object_lookup(uint32 encoderFlags, uint8 dacID)
{

View File

@ -22,6 +22,7 @@ void encoder_output_lock(bool lock);
void encoder_crtc_scratch(uint8 crtcID);
void encoder_dpms_scratch(uint8 crtcID, bool power);
void encoder_dpms_set(uint8 crtcID, uint8 encoderID, int mode);
const char* encoder_name_lookup(uint32 encoderID);
uint32 encoder_object_lookup(uint32 encoderFlags, uint8 dacID);
uint32 encoder_type_lookup(uint32 encoderID, uint32 connectorFlags);
bool encoder_is_external(uint32 encoderID);