From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 1/9] drm/i915/display/core: use intel_de_rmw if possible
Date: Thu, 5 Jan 2023 15:21:39 -0500 [thread overview]
Message-ID: <Y7cxU0t09XEEr3Dq@intel.com> (raw)
In-Reply-To: <20230105131046.2173431-1-andrzej.hajda@intel.com>
On Thu, Jan 05, 2023 at 02:10:38PM +0100, Andrzej Hajda wrote:
> The helper makes the code more compact and readable.
>
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 22 ++++++++-----------
> .../drm/i915/display/intel_modeset_setup.c | 17 ++++++--------
> 2 files changed, 16 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index e75b9b2a0e015a..ce506c9fd6ab9f 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -293,11 +293,11 @@ static void
> skl_wa_827(struct drm_i915_private *dev_priv, enum pipe pipe, bool enable)
> {
> if (enable)
> - intel_de_write(dev_priv, CLKGATE_DIS_PSL(pipe),
> - intel_de_read(dev_priv, CLKGATE_DIS_PSL(pipe)) | DUPS1_GATING_DIS | DUPS2_GATING_DIS);
> + intel_de_rmw(dev_priv, CLKGATE_DIS_PSL(pipe),
> + 0, DUPS1_GATING_DIS | DUPS2_GATING_DIS);
> else
> - intel_de_write(dev_priv, CLKGATE_DIS_PSL(pipe),
> - intel_de_read(dev_priv, CLKGATE_DIS_PSL(pipe)) & ~(DUPS1_GATING_DIS | DUPS2_GATING_DIS));
> + intel_de_rmw(dev_priv, CLKGATE_DIS_PSL(pipe),
> + DUPS1_GATING_DIS | DUPS2_GATING_DIS, 0);
> }
>
> /* Wa_2006604312:icl,ehl */
> @@ -306,11 +306,9 @@ icl_wa_scalerclkgating(struct drm_i915_private *dev_priv, enum pipe pipe,
> bool enable)
> {
> if (enable)
> - intel_de_write(dev_priv, CLKGATE_DIS_PSL(pipe),
> - intel_de_read(dev_priv, CLKGATE_DIS_PSL(pipe)) | DPFR_GATING_DIS);
> + intel_de_rmw(dev_priv, CLKGATE_DIS_PSL(pipe), 0, DPFR_GATING_DIS);
> else
> - intel_de_write(dev_priv, CLKGATE_DIS_PSL(pipe),
> - intel_de_read(dev_priv, CLKGATE_DIS_PSL(pipe)) & ~DPFR_GATING_DIS);
> + intel_de_rmw(dev_priv, CLKGATE_DIS_PSL(pipe), DPFR_GATING_DIS, 0);
> }
>
> /* Wa_1604331009:icl,jsl,ehl */
> @@ -1852,12 +1850,10 @@ static void hsw_set_frame_start_delay(const struct intel_crtc_state *crtc_state)
> enum transcoder transcoder = crtc_state->cpu_transcoder;
> i915_reg_t reg = DISPLAY_VER(dev_priv) >= 14 ? MTL_CHICKEN_TRANS(transcoder) :
> CHICKEN_TRANS(transcoder);
> - u32 val;
>
> - val = intel_de_read(dev_priv, reg);
> - val &= ~HSW_FRAME_START_DELAY_MASK;
> - val |= HSW_FRAME_START_DELAY(crtc_state->framestart_delay - 1);
> - intel_de_write(dev_priv, reg, val);
> + intel_de_rmw(dev_priv, reg,
> + HSW_FRAME_START_DELAY_MASK,
> + HSW_FRAME_START_DELAY(crtc_state->framestart_delay - 1));
> }
>
> static void icl_ddi_bigjoiner_pre_enable(struct intel_atomic_state *state,
> diff --git a/drivers/gpu/drm/i915/display/intel_modeset_setup.c b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
> index 96395bfbd41dfb..6f6dc7c6b88b0c 100644
> --- a/drivers/gpu/drm/i915/display/intel_modeset_setup.c
> +++ b/drivers/gpu/drm/i915/display/intel_modeset_setup.c
> @@ -647,17 +647,14 @@ static void intel_early_display_was(struct drm_i915_private *i915)
> * Also known as Wa_14010480278.
> */
> if (IS_DISPLAY_VER(i915, 10, 12))
> - intel_de_write(i915, GEN9_CLKGATE_DIS_0,
> - intel_de_read(i915, GEN9_CLKGATE_DIS_0) | DARBF_GATING_DIS);
> + intel_de_rmw(i915, GEN9_CLKGATE_DIS_0, 0, DARBF_GATING_DIS);
>
> - if (IS_HASWELL(i915)) {
> - /*
> - * WaRsPkgCStateDisplayPMReq:hsw
> - * System hang if this isn't done before disabling all planes!
> - */
> - intel_de_write(i915, CHICKEN_PAR1_1,
> - intel_de_read(i915, CHICKEN_PAR1_1) | FORCE_ARB_IDLE_PLANES);
> - }
> + /*
> + * WaRsPkgCStateDisplayPMReq:hsw
> + * System hang if this isn't done before disabling all planes!
> + */
> + if (IS_HASWELL(i915))
> + intel_de_rmw(i915, CHICKEN_PAR1_1, 0, FORCE_ARB_IDLE_PLANES);
>
> if (IS_KABYLAKE(i915) || IS_COFFEELAKE(i915) || IS_COMETLAKE(i915)) {
> /* Display WA #1142:kbl,cfl,cml */
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-01-05 20:21 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-05 13:10 [Intel-gfx] [PATCH v2 1/9] drm/i915/display/core: use intel_de_rmw if possible Andrzej Hajda
2023-01-05 13:10 ` [Intel-gfx] [PATCH v2 2/9] drm/i915/display/power: " Andrzej Hajda
2023-01-05 20:27 ` Rodrigo Vivi
2023-02-16 16:27 ` Jani Nikula
2023-01-05 13:10 ` [Intel-gfx] [PATCH v2 3/9] drm/i915/display/dpll: " Andrzej Hajda
2023-01-05 20:32 ` Rodrigo Vivi
2023-01-05 13:10 ` [Intel-gfx] [PATCH v2 4/9] drm/i915/display/phys: " Andrzej Hajda
2023-01-06 15:26 ` Rodrigo Vivi
2023-01-05 13:10 ` [Intel-gfx] [PATCH v2 5/9] drm/i915/display/pch: " Andrzej Hajda
2023-01-06 15:28 ` Rodrigo Vivi
2023-01-05 13:10 ` [Intel-gfx] [PATCH v2 6/9] drm/i915/display/hdmi: " Andrzej Hajda
2023-01-06 15:35 ` Rodrigo Vivi
2023-01-09 10:51 ` Andrzej Hajda
2023-01-09 11:45 ` Jani Nikula
2023-01-05 13:10 ` [Intel-gfx] [PATCH v2 7/9] drm/i915/display/panel: use intel_de_rmw if possible in panel related code Andrzej Hajda
2023-01-09 19:22 ` Rodrigo Vivi
2023-01-05 13:10 ` [Intel-gfx] [PATCH v2 8/9] drm/i915/display/interfaces: use intel_de_rmw if possible Andrzej Hajda
2023-01-09 19:24 ` Rodrigo Vivi
2023-01-05 13:10 ` [Intel-gfx] [PATCH v2 9/9] drm/i915/display/misc: " Andrzej Hajda
2023-01-09 19:27 ` Rodrigo Vivi
2023-01-10 9:28 ` Andrzej Hajda
2023-01-10 11:36 ` [Intel-gfx] [PATCH v3] " Andrzej Hajda
2023-01-10 16:15 ` Rodrigo Vivi
2023-01-05 20:21 ` Rodrigo Vivi [this message]
2023-01-09 11:32 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v2,1/9] drm/i915/display/core: use intel_de_rmw if possible (rev2) Patchwork
2023-01-09 11:54 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-01-09 13:38 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-01-10 15:45 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [v2,1/9] drm/i915/display/core: use intel_de_rmw if possible (rev3) Patchwork
2023-01-11 12:09 ` Andrzej Hajda
2023-01-11 12:12 ` Veesam, RavitejaX
2023-02-06 12:35 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [v2,1/9] drm/i915/display/core: use intel_de_rmw if possible (rev4) Patchwork
2023-02-06 16:11 ` [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=Y7cxU0t09XEEr3Dq@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=andrzej.hajda@intel.com \
--cc=intel-gfx@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