drm/i915/dp-aux: switch to intel_de_* register accessors in display code
Avoid direct uncore use in display code. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/262a0cf647b37e27a1c7776d3816e1b4ef959a91.1670433372.git.jani.nikula@intel.com
This commit is contained in:
parent
f10a5f3372
commit
f1a15a8937
|
@ -6,6 +6,7 @@
|
|||
#include "i915_drv.h"
|
||||
#include "i915_reg.h"
|
||||
#include "i915_trace.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp_aux.h"
|
||||
#include "intel_pps.h"
|
||||
|
@ -42,7 +43,7 @@ intel_dp_aux_wait_done(struct intel_dp *intel_dp)
|
|||
u32 status;
|
||||
bool done;
|
||||
|
||||
#define C (((status = intel_uncore_read_notrace(&i915->uncore, ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0)
|
||||
#define C (((status = intel_de_read_notrace(i915, ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0)
|
||||
done = wait_event_timeout(i915->display.gmbus.wait_queue, C,
|
||||
msecs_to_jiffies_timeout(timeout_ms));
|
||||
|
||||
|
@ -191,7 +192,6 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
|||
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||
struct drm_i915_private *i915 =
|
||||
to_i915(dig_port->base.base.dev);
|
||||
struct intel_uncore *uncore = &i915->uncore;
|
||||
enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
|
||||
bool is_tc_port = intel_phy_is_tc(i915, phy);
|
||||
i915_reg_t ch_ctl, ch_data[5];
|
||||
|
@ -235,7 +235,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
|||
|
||||
/* Try to wait for any previous AUX channel activity */
|
||||
for (try = 0; try < 3; try++) {
|
||||
status = intel_uncore_read_notrace(uncore, ch_ctl);
|
||||
status = intel_de_read_notrace(i915, ch_ctl);
|
||||
if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
|
||||
break;
|
||||
msleep(1);
|
||||
|
@ -244,7 +244,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
|||
trace_i915_reg_rw(false, ch_ctl, status, sizeof(status), true);
|
||||
|
||||
if (try == 3) {
|
||||
const u32 status = intel_uncore_read(uncore, ch_ctl);
|
||||
const u32 status = intel_de_read(i915, ch_ctl);
|
||||
|
||||
if (status != intel_dp->aux_busy_last_status) {
|
||||
drm_WARN(&i915->drm, 1,
|
||||
|
@ -274,21 +274,18 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
|||
for (try = 0; try < 5; try++) {
|
||||
/* Load the send data into the aux channel data registers */
|
||||
for (i = 0; i < send_bytes; i += 4)
|
||||
intel_uncore_write(uncore,
|
||||
ch_data[i >> 2],
|
||||
intel_de_write(i915, ch_data[i >> 2],
|
||||
intel_dp_aux_pack(send + i,
|
||||
send_bytes - i));
|
||||
|
||||
/* Send the command and wait for it to complete */
|
||||
intel_uncore_write(uncore, ch_ctl, send_ctl);
|
||||
intel_de_write(i915, ch_ctl, send_ctl);
|
||||
|
||||
status = intel_dp_aux_wait_done(intel_dp);
|
||||
|
||||
/* Clear done status and any errors */
|
||||
intel_uncore_write(uncore,
|
||||
ch_ctl,
|
||||
status |
|
||||
DP_AUX_CH_CTL_DONE |
|
||||
intel_de_write(i915, ch_ctl,
|
||||
status | DP_AUX_CH_CTL_DONE |
|
||||
DP_AUX_CH_CTL_TIME_OUT_ERROR |
|
||||
DP_AUX_CH_CTL_RECEIVE_ERROR);
|
||||
|
||||
|
@ -361,7 +358,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
|||
recv_bytes = recv_size;
|
||||
|
||||
for (i = 0; i < recv_bytes; i += 4)
|
||||
intel_dp_aux_unpack(intel_uncore_read(uncore, ch_data[i >> 2]),
|
||||
intel_dp_aux_unpack(intel_de_read(i915, ch_data[i >> 2]),
|
||||
recv + i, recv_bytes - i);
|
||||
|
||||
ret = recv_bytes;
|
||||
|
|
Loading…
Reference in New Issue