From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/6] drm/i915: Polish intel_shared_dpll_swap_state()
Date: Mon, 1 Jul 2019 19:05:47 +0300 [thread overview]
Message-ID: <20190701160550.24205-3-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190701160550.24205-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Use swap() instead of hand rolling it in intel_shared_dpll_swap_state(),
and pass in the intel_atomic_state instead of drm_atomic_state. Makes
the code less convoluted.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 2 +-
drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 19 +++++++------------
drivers/gpu/drm/i915/display/intel_dpll_mgr.h | 3 +--
3 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 1074fde47410..0bb95b7ffda4 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -14157,7 +14157,7 @@ static int intel_atomic_commit(struct drm_device *dev,
return ret;
}
dev_priv->wm.distrust_bios_wm = false;
- intel_shared_dpll_swap_state(state);
+ intel_shared_dpll_swap_state(intel_state);
intel_atomic_track_fbs(state);
if (intel_state->modeset) {
diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
index 76a2c879efc2..236cdbe08ec9 100644
--- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
+++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
@@ -343,25 +343,20 @@ static void intel_put_dpll(struct intel_atomic_state *state,
* i.e. it also puts the current state into @state, even though there is no
* need for that at this moment.
*/
-void intel_shared_dpll_swap_state(struct drm_atomic_state *state)
+void intel_shared_dpll_swap_state(struct intel_atomic_state *state)
{
- struct drm_i915_private *dev_priv = to_i915(state->dev);
- struct intel_shared_dpll_state *shared_dpll;
- struct intel_shared_dpll *pll;
+ struct drm_i915_private *dev_priv = to_i915(state->base.dev);
+ struct intel_shared_dpll_state *shared_dpll = state->shared_dpll;
enum intel_dpll_id i;
- if (!to_intel_atomic_state(state)->dpll_set)
+ if (!state->dpll_set)
return;
- shared_dpll = to_intel_atomic_state(state)->shared_dpll;
for (i = 0; i < dev_priv->num_shared_dpll; i++) {
- struct intel_shared_dpll_state tmp;
-
- pll = &dev_priv->shared_dplls[i];
+ struct intel_shared_dpll *pll =
+ &dev_priv->shared_dplls[i];
- tmp = pll->state;
- pll->state = shared_dpll[i];
- shared_dpll[i] = tmp;
+ swap(pll->state, shared_dpll[i]);
}
}
diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.h b/drivers/gpu/drm/i915/display/intel_dpll_mgr.h
index 1668f8116908..0f9add175600 100644
--- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.h
+++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.h
@@ -36,7 +36,6 @@
(void) (&__a == &__b); \
__a > __b ? (__a - __b) : (__b - __a); })
-struct drm_atomic_state;
struct drm_device;
struct drm_i915_private;
struct intel_atomic_state;
@@ -352,7 +351,7 @@ void intel_update_active_dpll(struct intel_atomic_state *state,
void intel_prepare_shared_dpll(const struct intel_crtc_state *crtc_state);
void intel_enable_shared_dpll(const struct intel_crtc_state *crtc_state);
void intel_disable_shared_dpll(const struct intel_crtc_state *crtc_state);
-void intel_shared_dpll_swap_state(struct drm_atomic_state *state);
+void intel_shared_dpll_swap_state(struct intel_atomic_state *state);
void intel_shared_dpll_init(struct drm_device *dev);
void intel_dpll_dump_hw_state(struct drm_i915_private *dev_priv,
--
2.21.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-07-01 16:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-01 16:05 [PATCH 1/6] drm/i915: Check crtc_state->wm.need_postvbl_update before grabbing wm.mutex Ville Syrjala
2019-07-01 16:05 ` [PATCH 2/6] drm/i915: Simplify modeset_get_crtc_power_domains() arguments Ville Syrjala
2019-07-01 16:05 ` Ville Syrjala [this message]
2019-07-01 16:05 ` [PATCH 4/6] drm/i915: Polish intel_atomic_track_fbs() Ville Syrjala
2019-07-01 16:05 ` [PATCH 5/6] drm/i915: Use intel_ types in intel_{lock, modeset}_all_pipes() Ville Syrjala
2019-07-01 16:05 ` [PATCH 6/6] drm/i915: Use intel_ types in intel_atomic_commit() Ville Syrjala
2019-07-01 17:46 ` ✓ Fi.CI.BAT: success for series starting with [1/6] drm/i915: Check crtc_state->wm.need_postvbl_update before grabbing wm.mutex Patchwork
2019-07-02 21:36 ` ✓ Fi.CI.IGT: " Patchwork
2019-07-11 16:13 ` [PATCH 1/6] " Imre Deak
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=20190701160550.24205-3-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.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