From: Andrzej Hajda <andrzej.hajda@intel.com>
To: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 07/11] drm/i915/dp-aux: switch to intel_de_* register accessors in display code
Date: Thu, 8 Dec 2022 11:41:17 +0100 [thread overview]
Message-ID: <6b43b1cd-790a-1e02-a03c-70c70b4c6d30@intel.com> (raw)
In-Reply-To: <262a0cf647b37e27a1c7776d3816e1b4ef959a91.1670433372.git.jani.nikula@intel.com>
On 07.12.2022 18:17, Jani Nikula wrote:
> 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>
Regards
Andrzej
> ---
> drivers/gpu/drm/i915/display/intel_dp_aux.c | 29 +++++++++------------
> 1 file changed, 13 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux.c b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> index 664bebdecea7..91c93c93e5fc 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_aux.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux.c
> @@ -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,23 +274,20 @@ 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_dp_aux_pack(send + i,
> - send_bytes - i));
> + 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 |
> - DP_AUX_CH_CTL_TIME_OUT_ERROR |
> - DP_AUX_CH_CTL_RECEIVE_ERROR);
> + 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);
>
> /*
> * DP CTS 1.2 Core Rev 1.1, 4.2.1.1 & 4.2.1.2
> @@ -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;
next prev parent reply other threads:[~2022-12-08 10:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 17:17 [Intel-gfx] [PATCH v2 00/11] drm/i915/display: switch to intel_de_* register accessors Jani Nikula
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 01/11] drm/i915/de: Add more macros to remove all direct calls to uncore Jani Nikula
2022-12-08 10:29 ` Andrzej Hajda
2022-12-08 13:14 ` Jani Nikula
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 02/11] drm/i915/de: return the old register value from intel_de_rmw() Jani Nikula
2022-12-08 10:30 ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 03/11] drm/i915/crt: drop a bunch of unnecessary register variables Jani Nikula
2022-12-08 10:35 ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 04/11] drm/i915/crt: switch to intel_de_* register accessors in display code Jani Nikula
2022-12-08 10:38 ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 05/11] drm/i915/power: " Jani Nikula
2022-12-08 10:39 ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 06/11] drm/i915/dmc: " Jani Nikula
2022-12-08 10:40 ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 07/11] drm/i915/dp-aux: " Jani Nikula
2022-12-08 10:41 ` Andrzej Hajda [this message]
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 08/11] drm/i915/gmbus: " Jani Nikula
2022-12-08 10:41 ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 09/11] drm/i915/wm: " Jani Nikula
2022-12-08 10:42 ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 10/11] drm/i915/snps: " Jani Nikula
2022-12-08 10:43 ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 11/11] drm/i915/tc: " Jani Nikula
2022-12-08 10:44 ` Andrzej Hajda
2022-12-07 19:45 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/display: switch to intel_de_* register accessors (rev2) Patchwork
2022-12-07 20:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-12-08 2:50 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6b43b1cd-790a-1e02-a03c-70c70b4c6d30@intel.com \
--to=andrzej.hajda@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox