radeon_hd: display_info struct style cleanup
* No functional change
This commit is contained in:
@@ -159,12 +159,12 @@ typedef struct {
|
|||||||
bool powered;
|
bool powered;
|
||||||
uint32 connectorIndex; // matches connector id in connector_info
|
uint32 connectorIndex; // matches connector id in connector_info
|
||||||
register_info* regs;
|
register_info* regs;
|
||||||
bool found_ranges;
|
bool foundRanges;
|
||||||
uint32 vfreq_max;
|
uint32 vfreqMax;
|
||||||
uint32 vfreq_min;
|
uint32 vfreqMin;
|
||||||
uint32 hfreq_max;
|
uint32 hfreqMax;
|
||||||
uint32 hfreq_min;
|
uint32 hfreqMin;
|
||||||
edid1_info edid_info;
|
edid1_info edidData;
|
||||||
display_mode preferredMode;
|
display_mode preferredMode;
|
||||||
} display_info;
|
} display_info;
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ init_registers(register_info* regs, uint8 crtcID)
|
|||||||
status_t
|
status_t
|
||||||
detect_crt_ranges(uint32 crtid)
|
detect_crt_ranges(uint32 crtid)
|
||||||
{
|
{
|
||||||
edid1_info* edid = &gDisplay[crtid]->edid_info;
|
edid1_info* edid = &gDisplay[crtid]->edidData;
|
||||||
|
|
||||||
// Scan each display EDID description for monitor ranges
|
// Scan each display EDID description for monitor ranges
|
||||||
for (uint32 index = 0; index < EDID1_NUM_DETAILED_MONITOR_DESC; index++) {
|
for (uint32 index = 0; index < EDID1_NUM_DETAILED_MONITOR_DESC; index++) {
|
||||||
@@ -228,10 +228,10 @@ detect_crt_ranges(uint32 crtid)
|
|||||||
if (monitor->monitor_desc_type
|
if (monitor->monitor_desc_type
|
||||||
== EDID1_MONITOR_RANGES) {
|
== EDID1_MONITOR_RANGES) {
|
||||||
edid1_monitor_range range = monitor->data.monitor_range;
|
edid1_monitor_range range = monitor->data.monitor_range;
|
||||||
gDisplay[crtid]->vfreq_min = range.min_v; /* in Hz */
|
gDisplay[crtid]->vfreqMin = range.min_v; /* in Hz */
|
||||||
gDisplay[crtid]->vfreq_max = range.max_v;
|
gDisplay[crtid]->vfreqMax = range.max_v;
|
||||||
gDisplay[crtid]->hfreq_min = range.min_h; /* in kHz */
|
gDisplay[crtid]->hfreqMin = range.min_h; /* in kHz */
|
||||||
gDisplay[crtid]->hfreq_max = range.max_h;
|
gDisplay[crtid]->hfreqMax = range.max_h;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -247,7 +247,7 @@ detect_displays()
|
|||||||
for (uint32 id = 0; id < MAX_DISPLAY; id++) {
|
for (uint32 id = 0; id < MAX_DISPLAY; id++) {
|
||||||
gDisplay[id]->attached = false;
|
gDisplay[id]->attached = false;
|
||||||
gDisplay[id]->powered = false;
|
gDisplay[id]->powered = false;
|
||||||
gDisplay[id]->found_ranges = false;
|
gDisplay[id]->foundRanges = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 displayIndex = 0;
|
uint32 displayIndex = 0;
|
||||||
@@ -280,7 +280,7 @@ detect_displays()
|
|||||||
__func__, id);
|
__func__, id);
|
||||||
// Lets try bit-banging edid from connector
|
// Lets try bit-banging edid from connector
|
||||||
gDisplay[displayIndex]->attached =
|
gDisplay[displayIndex]->attached =
|
||||||
connector_read_edid(id, &gDisplay[displayIndex]->edid_info);
|
connector_read_edid(id, &gDisplay[displayIndex]->edidData);
|
||||||
|
|
||||||
if (gConnector[id]->encoder.type == VIDEO_ENCODER_TVDAC
|
if (gConnector[id]->encoder.type == VIDEO_ENCODER_TVDAC
|
||||||
|| gConnector[id]->encoder.type == VIDEO_ENCODER_DAC) {
|
|| gConnector[id]->encoder.type == VIDEO_ENCODER_DAC) {
|
||||||
@@ -308,11 +308,11 @@ detect_displays()
|
|||||||
|
|
||||||
if (gDisplay[displayIndex]->preferredMode.virtual_width > 0) {
|
if (gDisplay[displayIndex]->preferredMode.virtual_width > 0) {
|
||||||
// Found a single preferred mode
|
// Found a single preferred mode
|
||||||
gDisplay[displayIndex]->found_ranges = false;
|
gDisplay[displayIndex]->foundRanges = false;
|
||||||
} else {
|
} else {
|
||||||
// Use edid data and pull ranges
|
// Use edid data and pull ranges
|
||||||
if (detect_crt_ranges(displayIndex) == B_OK)
|
if (detect_crt_ranges(displayIndex) == B_OK)
|
||||||
gDisplay[displayIndex]->found_ranges = true;
|
gDisplay[displayIndex]->foundRanges = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
displayIndex++;
|
displayIndex++;
|
||||||
@@ -330,7 +330,7 @@ detect_displays()
|
|||||||
gDisplay[0]->connectorIndex = id;
|
gDisplay[0]->connectorIndex = id;
|
||||||
init_registers(gDisplay[0]->regs, 0);
|
init_registers(gDisplay[0]->regs, 0);
|
||||||
if (detect_crt_ranges(0) == B_OK)
|
if (detect_crt_ranges(0) == B_OK)
|
||||||
gDisplay[0]->found_ranges = true;
|
gDisplay[0]->foundRanges = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -362,9 +362,9 @@ debug_displays()
|
|||||||
ERROR(" + connector type: %s\n", get_connector_name(connectorType));
|
ERROR(" + connector type: %s\n", get_connector_name(connectorType));
|
||||||
ERROR(" + encoder type: %s\n", get_encoder_name(encoderType));
|
ERROR(" + encoder type: %s\n", get_encoder_name(encoderType));
|
||||||
ERROR(" + limits: Vert Min/Max: %" B_PRIu32 "/%" B_PRIu32"\n",
|
ERROR(" + limits: Vert Min/Max: %" B_PRIu32 "/%" B_PRIu32"\n",
|
||||||
gDisplay[id]->vfreq_min, gDisplay[id]->vfreq_max);
|
gDisplay[id]->vfreqMin, gDisplay[id]->vfreqMax);
|
||||||
ERROR(" + limits: Horz Min/Max: %" B_PRIu32 "/%" B_PRIu32"\n",
|
ERROR(" + limits: Horz Min/Max: %" B_PRIu32 "/%" B_PRIu32"\n",
|
||||||
gDisplay[id]->hfreq_min, gDisplay[id]->hfreq_max);
|
gDisplay[id]->hfreqMin, gDisplay[id]->hfreqMax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACE("==========================================\n");
|
TRACE("==========================================\n");
|
||||||
@@ -400,7 +400,7 @@ display_get_encoder_mode(uint32 connectorIndex)
|
|||||||
if (crtc == -1) {
|
if (crtc == -1) {
|
||||||
ERROR("%s: BUG: executed on connector without crtc!\n", __func__);
|
ERROR("%s: BUG: executed on connector without crtc!\n", __func__);
|
||||||
} else {
|
} else {
|
||||||
edid1_info* edid = &gDisplay[crtc]->edid_info;
|
edid1_info* edid = &gDisplay[crtc]->edidData;
|
||||||
edidDigital = edid->display.input_type ? true : false;
|
edidDigital = edid->display.input_type ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ radeon_get_edid_info(void* info, size_t size, uint32* edid_version)
|
|||||||
|
|
||||||
memcpy(info, &gInfo->shared_info->edid_info, sizeof(struct edid1_info));
|
memcpy(info, &gInfo->shared_info->edid_info, sizeof(struct edid1_info));
|
||||||
// VESA
|
// VESA
|
||||||
//memcpy(info, &gDisplay[0]->edid_info, sizeof(struct edid1_info));
|
//memcpy(info, &gDisplay[0]->edidData, sizeof(struct edid1_info));
|
||||||
// BitBanged display 0
|
// BitBanged display 0
|
||||||
|
|
||||||
*edid_version = EDID_VERSION_1;
|
*edid_version = EDID_VERSION_1;
|
||||||
@@ -306,12 +306,12 @@ is_mode_supported(display_mode* mode)
|
|||||||
|
|
||||||
// if we have edid info, check frequency adginst crt reported valid ranges
|
// if we have edid info, check frequency adginst crt reported valid ranges
|
||||||
if (gInfo->shared_info->has_edid
|
if (gInfo->shared_info->has_edid
|
||||||
&& gDisplay[crtid]->found_ranges) {
|
&& gDisplay[crtid]->foundRanges) {
|
||||||
|
|
||||||
// validate horizontal frequency range
|
// validate horizontal frequency range
|
||||||
uint32 hfreq = mode->timing.pixel_clock / mode->timing.h_total;
|
uint32 hfreq = mode->timing.pixel_clock / mode->timing.h_total;
|
||||||
if (hfreq > gDisplay[crtid]->hfreq_max + 1
|
if (hfreq > gDisplay[crtid]->hfreqMax + 1
|
||||||
|| hfreq < gDisplay[crtid]->hfreq_min - 1) {
|
|| hfreq < gDisplay[crtid]->hfreqMin - 1) {
|
||||||
//TRACE("!!! mode below falls outside of hfreq range!\n");
|
//TRACE("!!! mode below falls outside of hfreq range!\n");
|
||||||
sane = false;
|
sane = false;
|
||||||
}
|
}
|
||||||
@@ -319,8 +319,8 @@ is_mode_supported(display_mode* mode)
|
|||||||
// validate vertical frequency range
|
// validate vertical frequency range
|
||||||
uint32 vfreq = mode->timing.pixel_clock / ((mode->timing.v_total
|
uint32 vfreq = mode->timing.pixel_clock / ((mode->timing.v_total
|
||||||
* mode->timing.h_total) / 1000);
|
* mode->timing.h_total) / 1000);
|
||||||
if (vfreq > gDisplay[crtid]->vfreq_max + 1
|
if (vfreq > gDisplay[crtid]->vfreqMax + 1
|
||||||
|| vfreq < gDisplay[crtid]->vfreq_min - 1) {
|
|| vfreq < gDisplay[crtid]->vfreqMin - 1) {
|
||||||
//TRACE("!!! mode below falls outside of vfreq range!\n");
|
//TRACE("!!! mode below falls outside of vfreq range!\n");
|
||||||
sane = false;
|
sane = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user