Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Vinod Govindapillai <vinod.govindapillai@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: vinod.govindapillai@intel.com, ville.syrjala@intel.com,
	jani.saarinen@intel.com
Subject: Re: [PATCH 1/8] drm/i915/display: update intel_enabled_dbuf_slices_mask to use intel_display
Date: Tue, 05 Nov 2024 10:52:58 +0200	[thread overview]
Message-ID: <8734k6hxjp.fsf@intel.com> (raw)
In-Reply-To: <20241105071600.235338-2-vinod.govindapillai@intel.com>

On Tue, 05 Nov 2024, Vinod Govindapillai <vinod.govindapillai@intel.com> wrote:
> Update intel_enabled_dbuf_slices_mask to use intel_display instead
> of drm_i915_private object. This is a prepratory patch for the next
> patch in the series, where all intel_de_read calls in skl_watermarks.c
> are updated to use intel_display instead of drm_i915_private.
>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display_power.c      | 2 +-
>  drivers/gpu/drm/i915/display/intel_display_power_well.c | 2 +-
>  drivers/gpu/drm/i915/display/skl_watermark.c            | 9 +++++----
>  drivers/gpu/drm/i915/display/skl_watermark.h            | 3 ++-
>  4 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c b/drivers/gpu/drm/i915/display/intel_display_power.c
> index 2766fd9208b0..62e0faffca40 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_power.c
> @@ -1090,7 +1090,7 @@ static void gen9_dbuf_enable(struct drm_i915_private *dev_priv)
>  	u8 slices_mask;
>  
>  	dev_priv->display.dbuf.enabled_slices =
> -		intel_enabled_dbuf_slices_mask(dev_priv);
> +		intel_enabled_dbuf_slices_mask(&dev_priv->display);

Please add a local struct intel_display *display variable and pass that
to intel_enabled_dbuf_slices_mask().

The point is, all of the i915/dev_priv references need to go, and if you
add &dev_priv->display, this line needs to be updated again.

>  
>  	slices_mask = BIT(DBUF_S1) | dev_priv->display.dbuf.enabled_slices;
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> index f0131dd853de..f792db191fcf 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power_well.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> @@ -973,7 +973,7 @@ static bool gen9_dc_off_power_well_enabled(struct drm_i915_private *dev_priv,
>  
>  static void gen9_assert_dbuf_enabled(struct drm_i915_private *dev_priv)
>  {
> -	u8 hw_enabled_dbuf_slices = intel_enabled_dbuf_slices_mask(dev_priv);
> +	u8 hw_enabled_dbuf_slices = intel_enabled_dbuf_slices_mask(&dev_priv->display);

Ditto.

>  	u8 enabled_dbuf_slices = dev_priv->display.dbuf.enabled_slices;
>  
>  	drm_WARN(&dev_priv->drm,
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
> index 3b0e87edbacf..d9d7238f0fb4 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -52,13 +52,13 @@ struct skl_wm_params {
>  	u32 dbuf_block_size;
>  };
>  
> -u8 intel_enabled_dbuf_slices_mask(struct drm_i915_private *i915)
> +u8 intel_enabled_dbuf_slices_mask(struct intel_display *display)
>  {
>  	u8 enabled_slices = 0;
>  	enum dbuf_slice slice;
>  
> -	for_each_dbuf_slice(i915, slice) {
> -		if (intel_de_read(i915, DBUF_CTL_S(slice)) & DBUF_POWER_STATE)
> +	for_each_dbuf_slice(display, slice) {
> +		if (intel_de_read(display, DBUF_CTL_S(slice)) & DBUF_POWER_STATE)
>  			enabled_slices |= BIT(slice);
>  	}
>  
> @@ -3126,6 +3126,7 @@ void intel_wm_state_verify(struct intel_atomic_state *state,
>  			   struct intel_crtc *crtc)
>  {
>  	struct drm_i915_private *i915 = to_i915(state->base.dev);
> +	struct intel_display *display = to_intel_display(state);

Please prefer putting the display variable first if at all possible.


>  	const struct intel_crtc_state *new_crtc_state =
>  		intel_atomic_get_new_crtc_state(state, crtc);
>  	struct skl_hw_state {
> @@ -3149,7 +3150,7 @@ void intel_wm_state_verify(struct intel_atomic_state *state,
>  
>  	skl_pipe_ddb_get_hw_state(crtc, hw->ddb, hw->ddb_y);
>  
> -	hw_enabled_slices = intel_enabled_dbuf_slices_mask(i915);
> +	hw_enabled_slices = intel_enabled_dbuf_slices_mask(display);
>  
>  	if (DISPLAY_VER(i915) >= 11 &&
>  	    hw_enabled_slices != i915->display.dbuf.enabled_slices)
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.h b/drivers/gpu/drm/i915/display/skl_watermark.h
> index e73baec94873..990793e36272 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.h
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.h
> @@ -17,11 +17,12 @@ struct intel_atomic_state;
>  struct intel_bw_state;
>  struct intel_crtc;
>  struct intel_crtc_state;
> +struct intel_display;
>  struct intel_plane;
>  struct skl_pipe_wm;
>  struct skl_wm_level;
>  
> -u8 intel_enabled_dbuf_slices_mask(struct drm_i915_private *i915);
> +u8 intel_enabled_dbuf_slices_mask(struct intel_display *display);
>  
>  void intel_sagv_pre_plane_update(struct intel_atomic_state *state);
>  void intel_sagv_post_plane_update(struct intel_atomic_state *state);

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-11-05  8:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05  7:15 [PATCH 0/8] use hw support for min/interim ddb allocation for async flip Vinod Govindapillai
2024-11-05  7:15 ` [PATCH 1/8] drm/i915/display: update intel_enabled_dbuf_slices_mask to use intel_display Vinod Govindapillai
2024-11-05  8:52   ` Jani Nikula [this message]
2024-11-05  9:07     ` Govindapillai, Vinod
2024-11-05  7:15 ` [PATCH 2/8] drm/i9i5/display: use intel_display in intel_de_read calls of skl_watermark.c Vinod Govindapillai
2024-11-05  8:58   ` Jani Nikula
2024-11-05  9:03   ` Jani Nikula
2024-11-05  7:15 ` [PATCH 3/8] drm/i915/display: update use_minimal_wm0_only to use intel_display Vinod Govindapillai
2024-11-05  9:08   ` Jani Nikula
2024-11-06 14:06     ` Ville Syrjälä
2024-11-06 15:49       ` Govindapillai, Vinod
2024-11-05  7:15 ` [PATCH 4/8] drm/i915/display: update use_min_ddb " Vinod Govindapillai
2024-11-05  7:15 ` [PATCH 5/8] drm/i915/display: update skl_plane_wm_equals " Vinod Govindapillai
2024-11-05  9:09   ` Jani Nikula
2024-11-05  7:15 ` [PATCH 6/8] drm/i915/display: update to plane_wm register access function Vinod Govindapillai
2024-11-05  7:15 ` [PATCH 7/8] drm/i915/xe3: Use hw support for min/interim ddb allocations for async flip Vinod Govindapillai
2024-11-06 22:45   ` Ville Syrjälä
2024-11-20 22:26     ` Govindapillai, Vinod
2024-11-05  7:16 ` [PATCH 8/8] drm/i915/debugfs: add dbuf alloc status as part of i915_ddb_info Vinod Govindapillai
2024-11-06 22:46   ` Ville Syrjälä
2024-11-20 22:30     ` Govindapillai, Vinod
2024-11-05  8:17 ` ✗ Fi.CI.CHECKPATCH: warning for use hw support for min/interim ddb allocation for async flip Patchwork
2024-11-05  8:17 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-05  9:11 ` ✗ Fi.CI.BAT: failure " 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=8734k6hxjp.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.saarinen@intel.com \
    --cc=ville.syrjala@intel.com \
    --cc=vinod.govindapillai@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