From: Suraj Kandpal <suraj.kandpal@intel.com>
To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: ankit.k.nautiyal@intel.com, chaitanya.kumar.borah@intel.com,
dnyaneshwar.bhadane@intel.com,
Suraj Kandpal <suraj.kandpal@intel.com>
Subject: [PATCH 2/2] drm/i915/ddi: Optimize mtl_port_buf_ctl_program
Date: Fri, 3 Jan 2025 10:47:05 +0530 [thread overview]
Message-ID: <20250103051705.145161-3-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20250103051705.145161-1-suraj.kandpal@intel.com>
A small optimization and cleanup for mtl_port_buf_ctl_program function
which lets use intel_de_rmw instead of a intel_de_read and
intel_de_write.
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
drivers/gpu/drm/i915/display/intel_ddi.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 5e944cae116a..c3c8a1d255a1 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2537,13 +2537,10 @@ static void mtl_port_buf_ctl_program(struct intel_encoder *encoder,
struct intel_display *display = to_intel_display(encoder);
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
enum port port = encoder->port;
- u32 val;
+ u32 val = 0;
- val = intel_de_read(display, XELPDP_PORT_BUF_CTL1(i915, port));
- val &= ~XELPDP_PORT_WIDTH_MASK;
val |= XELPDP_PORT_WIDTH(mtl_get_port_width(crtc_state->lane_count));
- val &= ~XELPDP_PORT_BUF_PORT_DATA_WIDTH_MASK;
if (intel_dp_is_uhbr(crtc_state))
val |= XELPDP_PORT_BUF_PORT_DATA_40BIT;
else
@@ -2552,7 +2549,9 @@ static void mtl_port_buf_ctl_program(struct intel_encoder *encoder,
if (dig_port->lane_reversal)
val |= XELPDP_PORT_REVERSAL;
- intel_de_write(display, XELPDP_PORT_BUF_CTL1(display, port), val);
+ intel_de_rmw(display, XELPDP_PORT_BUF_CTL1(display, port),
+ XELPDP_PORT_WIDTH_MASK | XELPDP_PORT_BUF_PORT_DATA_WIDTH_MASK,
+ val);
}
static void mtl_port_buf_ctl_io_selection(struct intel_encoder *encoder)
--
2.34.1
next prev parent reply other threads:[~2025-01-03 5:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-03 5:17 [PATCH 0/2] Clean and Optimise mtl_ddi_prepare_link_retrain Suraj Kandpal
2025-01-03 5:17 ` [PATCH 1/2] drm/i915/dp: Use intel_display instead of drm_i915_private Suraj Kandpal
2025-01-03 10:08 ` Jani Nikula
2025-01-03 5:17 ` Suraj Kandpal [this message]
2025-01-03 10:08 ` [PATCH 2/2] drm/i915/ddi: Optimize mtl_port_buf_ctl_program Jani Nikula
2025-01-03 6:21 ` ✓ CI.Patch_applied: success for Clean and Optimise mtl_ddi_prepare_link_retrain Patchwork
2025-01-03 6:21 ` ✓ CI.checkpatch: " Patchwork
2025-01-03 6:23 ` ✓ CI.KUnit: " Patchwork
2025-01-03 6:41 ` ✓ CI.Build: " Patchwork
2025-01-03 6:43 ` ✓ CI.Hooks: " Patchwork
2025-01-03 6:45 ` ✓ CI.checksparse: " Patchwork
2025-01-03 7:17 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-01-03 8:50 ` ✗ Xe.CI.Full: " 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=20250103051705.145161-3-suraj.kandpal@intel.com \
--to=suraj.kandpal@intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=chaitanya.kumar.borah@intel.com \
--cc=dnyaneshwar.bhadane@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
/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