From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/4] drm/i915/fdi: move fdi modeset asserts to intel_fdi.c
Date: Thu, 30 Sep 2021 12:44:39 +0300 [thread overview]
Message-ID: <YVWHB94gggUJ4aOB@intel.com> (raw)
In-Reply-To: <427d27eb4e5daca208d496d6c2ffc91ed90ba714.1632992608.git.jani.nikula@intel.com>
On Thu, Sep 30, 2021 at 12:22:58PM +0300, Jani Nikula wrote:
<snip>
> diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c
> index af01d1fa761e..02d3294bad7b 100644
> --- a/drivers/gpu/drm/i915/display/intel_fdi.c
> +++ b/drivers/gpu/drm/i915/display/intel_fdi.c
> @@ -10,6 +10,97 @@
> #include "intel_fdi.h"
> #include "intel_sideband.h"
>
> +static void assert_fdi_tx(struct drm_i915_private *dev_priv,
> + enum pipe pipe, bool state)
> +{
> + bool cur_state;
> +
> + if (HAS_DDI(dev_priv)) {
> + /*
> + * DDI does not have a specific FDI_TX register.
> + *
> + * FDI is never fed from EDP transcoder
> + * so pipe->transcoder cast is fine here.
> + */
> + enum transcoder cpu_transcoder = (enum transcoder)pipe;
> + cur_state = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder)) & TRANS_DDI_FUNC_ENABLE;
> + } else {
> + cur_state = intel_de_read(dev_priv, FDI_TX_CTL(pipe)) & FDI_TX_ENABLE;
> + }
> + I915_STATE_WARN(cur_state != state,
> + "FDI TX state assertion failure (expected %s, current %s)\n",
> + onoff(state), onoff(cur_state));
> +}
> +
> +void assert_fdi_tx_enabled(struct drm_i915_private *i915, enum pipe pipe)
> +{
> + assert_fdi_tx(i915, pipe, true);
> +}
> +
> +void assert_fdi_tx_disabled(struct drm_i915_private *i915, enum pipe pipe)
> +{
> + assert_fdi_tx(i915, pipe, false);
> +}
For these wrappers I could argue that static inlines would be less
loc overall, while still wouldn't need any extra struct definitions/etc.
in the header. But not performance sensitive so from that pov static
inline is pointless.
Anyways, this approach seems fine to me. For the series
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2021-09-30 9:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 9:22 [Intel-gfx] [PATCH 0/4] drm/i915/display: move modeset asserts out of intel_display.c Jani Nikula
2021-09-30 9:22 ` [Intel-gfx] [PATCH 1/4] drm/i915/fdi: move fdi modeset asserts to intel_fdi.c Jani Nikula
2021-09-30 9:44 ` Ville Syrjälä [this message]
2021-09-30 10:24 ` Jani Nikula
2021-10-01 8:49 ` Jani Nikula
2021-09-30 9:22 ` [Intel-gfx] [PATCH 2/4] drm/i915/pps: move pps (panel) modeset asserts to intel_pps.c Jani Nikula
2021-09-30 9:23 ` [Intel-gfx] [PATCH 3/4] drm/i915/dpll: move dpll modeset asserts to intel_dpll.c Jani Nikula
2021-09-30 9:23 ` [Intel-gfx] [PATCH 4/4] drm/i915/dsi: move dsi pll modeset asserts to vlv_dsi_pll.c Jani Nikula
2021-09-30 10:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: move modeset asserts out of intel_display.c Patchwork
2021-09-30 11:10 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-09-30 13:23 ` [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=YVWHB94gggUJ4aOB@intel.com \
--to=ville.syrjala@linux.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