summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/radeon_atombios.c5
-rw-r--r--src/radeon_output.c3
2 files changed, 4 insertions, 4 deletions
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index 27231cde..3da6068f 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -1533,8 +1533,7 @@ RADEONLookupGPIOLineForDDC(ScrnInfoPtr pScrn, uint8_t id)
return i2c;
}
- num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
- sizeof(ATOM_GPIO_I2C_ASSIGMENT);
+ num_indices = size / sizeof(ATOM_GPIO_I2C_ASSIGMENT);
for (i = 0; i < num_indices; i++) {
gpio = &atomDataPtr->GPIO_I2C_Info->asGPIO_Info[i];
@@ -1635,7 +1634,7 @@ radeon_lookup_hpd_id(ScrnInfoPtr pScrn, ATOM_HPD_INT_RECORD *record)
return hpd;
}
- num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) / sizeof(ATOM_GPIO_PIN_ASSIGNMENT);
+ num_indices = size / sizeof(ATOM_GPIO_PIN_ASSIGNMENT);
if (IS_DCE4_VARIANT)
reg = EVERGREEN_DC_GPIO_HPD_A;
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 283d32f4..689a5924 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1875,7 +1875,8 @@ RADEONI2CDoLock(xf86OutputPtr output, I2CBusPtr b, int lock_state)
}
/* set the pad in ddc mode */
- if (IS_DCE3_VARIANT) {
+ if (IS_DCE3_VARIANT &&
+ pRADEONI2CBus->hw_capable) {
temp = INREG(pRADEONI2CBus->mask_clk_reg);
temp &= ~(1 << 16);
OUTREG(pRADEONI2CBus->mask_clk_reg, temp);