diff options
author | Nikola Cornij <nikola.cornij@amd.com> | 2018-05-09 13:11:35 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-29 15:01:48 -0400 |
commit | c733e40c74457ad6aa56cc8b3318e829b8274bef (patch) | |
tree | ffad632fec9a61b8bf577891c4a26cc5ac1cc488 | |
parent | 794550c6eaf791bfd2e8d70e11aa56fdd6361725 (diff) |
drm/amd/display: Read DP_SINK_COUNT_ESI range on HPD for DP 1.4
DP 1.4 compliance now requires that registers at DP_SINK_COUNT_ESI range
(0x2002-0x2003, 0x200c-0x200f) are read instead of DP_SINK_COUNT range
(0x200-0x2005.
Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index 3fcb67cbc6cc..7857cb42b3e6 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | |||
@@ -1630,17 +1630,42 @@ static enum dc_status read_hpd_rx_irq_data( | |||
1630 | struct dc_link *link, | 1630 | struct dc_link *link, |
1631 | union hpd_irq_data *irq_data) | 1631 | union hpd_irq_data *irq_data) |
1632 | { | 1632 | { |
1633 | static enum dc_status retval; | ||
1634 | |||
1633 | /* The HW reads 16 bytes from 200h on HPD, | 1635 | /* The HW reads 16 bytes from 200h on HPD, |
1634 | * but if we get an AUX_DEFER, the HW cannot retry | 1636 | * but if we get an AUX_DEFER, the HW cannot retry |
1635 | * and this causes the CTS tests 4.3.2.1 - 3.2.4 to | 1637 | * and this causes the CTS tests 4.3.2.1 - 3.2.4 to |
1636 | * fail, so we now explicitly read 6 bytes which is | 1638 | * fail, so we now explicitly read 6 bytes which is |
1637 | * the req from the above mentioned test cases. | 1639 | * the req from the above mentioned test cases. |
1640 | * | ||
1641 | * For DP 1.4 we need to read those from 2002h range. | ||
1638 | */ | 1642 | */ |
1639 | return core_link_read_dpcd( | 1643 | if (link->dpcd_caps.dpcd_rev.raw < DPCD_REV_14) |
1640 | link, | 1644 | retval = core_link_read_dpcd( |
1641 | DP_SINK_COUNT, | 1645 | link, |
1642 | irq_data->raw, | 1646 | DP_SINK_COUNT, |
1643 | sizeof(union hpd_irq_data)); | 1647 | irq_data->raw, |
1648 | sizeof(union hpd_irq_data)); | ||
1649 | else { | ||
1650 | /* Read 2 bytes at this location,... */ | ||
1651 | retval = core_link_read_dpcd( | ||
1652 | link, | ||
1653 | DP_SINK_COUNT_ESI, | ||
1654 | irq_data->raw, | ||
1655 | 2); | ||
1656 | |||
1657 | if (retval != DC_OK) | ||
1658 | return retval; | ||
1659 | |||
1660 | /* ... then read remaining 4 at the other location */ | ||
1661 | retval = core_link_read_dpcd( | ||
1662 | link, | ||
1663 | DP_LANE0_1_STATUS_ESI, | ||
1664 | &irq_data->raw[2], | ||
1665 | 4); | ||
1666 | } | ||
1667 | |||
1668 | return retval; | ||
1644 | } | 1669 | } |
1645 | 1670 | ||
1646 | static bool allow_hpd_rx_irq(const struct dc_link *link) | 1671 | static bool allow_hpd_rx_irq(const struct dc_link *link) |