From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/5] drm/i915: Use hweight8() for 8bit masks
Date: Fri, 23 Aug 2019 13:24:48 +0300 [thread overview]
Message-ID: <871rxcb2mn.fsf@intel.com> (raw)
In-Reply-To: <20190821173033.24123-5-ville.syrjala@linux.intel.com>
On Wed, 21 Aug 2019, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Use hweight8() instead of hweight32() for 8bit masks. Doesn't actually
> matter for us since the arch code will go for hweight32() anyway, but
> maybe we stil want to do this for documentation purposes?
hweight32 is preparing for the distant future? ;)
I don't mind either way on this one, up to you.
The series is
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_pm.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index e86503023daf..b6089545c8fa 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -1327,8 +1327,8 @@ static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
> struct intel_atomic_state *state =
> to_intel_atomic_state(crtc_state->base.state);
> struct g4x_wm_state *wm_state = &crtc_state->wm.g4x.optimal;
> - int num_active_planes = hweight32(crtc_state->active_planes &
> - ~BIT(PLANE_CURSOR));
> + int num_active_planes = hweight8(crtc_state->active_planes &
> + ~BIT(PLANE_CURSOR));
> const struct g4x_pipe_wm *raw;
> const struct intel_plane_state *old_plane_state;
> const struct intel_plane_state *new_plane_state;
> @@ -1659,7 +1659,7 @@ static int vlv_compute_fifo(struct intel_crtc_state *crtc_state)
> &crtc_state->wm.vlv.raw[VLV_WM_LEVEL_PM2];
> struct vlv_fifo_state *fifo_state = &crtc_state->wm.vlv.fifo_state;
> unsigned int active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
> - int num_active_planes = hweight32(active_planes);
> + int num_active_planes = hweight8(active_planes);
> const int fifo_size = 511;
> int fifo_extra, fifo_left = fifo_size;
> int sprite0_fifo_extra = 0;
> @@ -1848,8 +1848,8 @@ static int vlv_compute_pipe_wm(struct intel_crtc_state *crtc_state)
> struct vlv_wm_state *wm_state = &crtc_state->wm.vlv.optimal;
> const struct vlv_fifo_state *fifo_state =
> &crtc_state->wm.vlv.fifo_state;
> - int num_active_planes = hweight32(crtc_state->active_planes &
> - ~BIT(PLANE_CURSOR));
> + int num_active_planes = hweight8(crtc_state->active_planes &
> + ~BIT(PLANE_CURSOR));
> bool needs_modeset = drm_atomic_crtc_needs_modeset(&crtc_state->base);
> const struct intel_plane_state *old_plane_state;
> const struct intel_plane_state *new_plane_state;
> @@ -3761,14 +3761,14 @@ bool intel_can_enable_sagv(struct intel_atomic_state *state)
> /*
> * If there are no active CRTCs, no additional checks need be performed
> */
> - if (hweight32(state->active_pipes) == 0)
> + if (hweight8(state->active_pipes) == 0)
> return true;
>
> /*
> * SKL+ workaround: bspec recommends we disable SAGV when we have
> * more then one pipe enabled
> */
> - if (hweight32(state->active_pipes) > 1)
> + if (hweight8(state->active_pipes) > 1)
> return false;
>
> /* Since we're now guaranteed to only have one active CRTC... */
> @@ -3867,14 +3867,14 @@ skl_ddb_get_pipe_allocation_limits(struct drm_i915_private *dev_priv,
> if (WARN_ON(!state) || !crtc_state->base.active) {
> alloc->start = 0;
> alloc->end = 0;
> - *num_active = hweight32(dev_priv->active_pipes);
> + *num_active = hweight8(dev_priv->active_pipes);
> return;
> }
>
> if (intel_state->active_pipe_changes)
> - *num_active = hweight32(intel_state->active_pipes);
> + *num_active = hweight8(intel_state->active_pipes);
> else
> - *num_active = hweight32(dev_priv->active_pipes);
> + *num_active = hweight8(dev_priv->active_pipes);
>
> ddb_size = intel_get_ddb_size(dev_priv, crtc_state, total_data_rate,
> *num_active, ddb);
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-08-23 10:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-21 17:30 [PATCH 1/5] drm/i915: Use enum pipe instead of crtc index to track active pipes Ville Syrjala
2019-08-21 17:30 ` [PATCH 2/5] drm/i915: Unconfuse pipe vs. crtc->index in i915_get_crtc_scanoutpos() Ville Syrjala
2019-08-21 17:30 ` [PATCH 3/5] drm/i915: Use enum pipe consistently Ville Syrjala
2019-08-21 17:30 ` [PATCH 4/5] drm/i915: s/num_active_crtcs/num_active_pipes/ Ville Syrjala
2019-08-21 17:30 ` [PATCH 5/5] drm/i915: Use hweight8() for 8bit masks Ville Syrjala
2019-08-23 10:24 ` Jani Nikula [this message]
2019-08-21 18:30 ` ✓ Fi.CI.BAT: success for series starting with [1/5] drm/i915: Use enum pipe instead of crtc index to track active pipes Patchwork
2019-08-22 7:29 ` ✓ 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=871rxcb2mn.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.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