<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p></p>
<pre class="x_content" style="overflow:auto; font-family:Menlo,Monaco,Consolas,"Courier New",monospace; font-size:13px; padding:9.5px; margin-top:0px; margin-bottom:10px; line-height:14.3px; word-break:break-all; border:0px; border-radius:0px"><span class="x_quote" style=""><font color="#333333">></font></span><span class="x_quote" style="color:rgb(0,127,0)">> Add correspondent helpers to be able to get old/new bandwidth</span><font color="#333333">
</font><span class="x_quote" style="color:rgb(0,127,0)">>> global state object.</span><font color="#333333">
</font><span class="x_quote" style="color:rgb(0,127,0)">>> </span><font color="#333333">
</font><span class="x_quote" style="color:rgb(0,127,0)">>> v2: - Fixed typo in function call</span><font color="#333333">
</font><span class="x_quote" style="color:rgb(0,127,0)">>> v3: - Changed new functions naming to use convention proposed</span><font color="#333333">
</font><span class="x_quote" style="color:rgb(0,127,0)">>> by Jani Nikula, i.e intel_bw_* in intel_bw.c file.</span><font color="#333333">
>Still nak on the rename.</font></pre>
<pre class="x_content" style="overflow:auto; font-family:Menlo,Monaco,Consolas,"Courier New",monospace; font-size:13px; padding:9.5px; margin-top:0px; margin-bottom:10px; line-height:14.3px; word-break:break-all; border:0px; border-radius:0px"><font color="#333333">Cool. Discuss it with Jani Nikula then, to have at least some common strategy on how to be picky on me.</font></pre>
<pre class="x_content" style="overflow:auto; font-family:Menlo,Monaco,Consolas,"Courier New",monospace; font-size:13px; padding:9.5px; margin-top:0px; margin-bottom:10px; line-height:14.3px; word-break:break-all; border:0px; border-radius:0px"></pre>
<p></p>
<div id="x_Signature">
<div style="font-family:Tahoma; font-size:13px"><font size="2"><span style="font-size:10pt">Best Regards,<br>
<br>
Lisovskiy Stanislav <br>
</span></font></div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Ville Syrjälä <ville.syrjala@linux.intel.com><br>
<b>Sent:</b> Wednesday, March 11, 2020 6:08:54 PM<br>
<b>To:</b> Lisovskiy, Stanislav<br>
<b>Cc:</b> intel-gfx@lists.freedesktop.org; Ausmus, James; Saarinen, Jani; Roper, Matthew D<br>
<b>Subject:</b> Re: [PATCH v19 3/8] drm/i915: Add intel_bw_get_*_state helpers</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On Mon, Mar 09, 2020 at 06:11:59PM +0200, Stanislav Lisovskiy wrote:<br>
> Add correspondent helpers to be able to get old/new bandwidth<br>
> global state object.<br>
> <br>
> v2: - Fixed typo in function call<br>
> v3: - Changed new functions naming to use convention proposed<br>
> by Jani Nikula, i.e intel_bw_* in intel_bw.c file.<br>
<br>
Still nak on the rename.<br>
<br>
> <br>
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com><br>
> ---<br>
> drivers/gpu/drm/i915/display/intel_bw.c | 33 ++++++++++++++++++++++---<br>
> drivers/gpu/drm/i915/display/intel_bw.h | 9 +++++++<br>
> 2 files changed, 39 insertions(+), 3 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c<br>
> index 58b264bc318d..bdad7476dc7b 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_bw.c<br>
> +++ b/drivers/gpu/drm/i915/display/intel_bw.c<br>
> @@ -374,8 +374,35 @@ static unsigned int intel_bw_data_rate(struct drm_i915_private *dev_priv,<br>
> return data_rate;<br>
> }<br>
> <br>
> -static struct intel_bw_state *<br>
> -intel_atomic_get_bw_state(struct intel_atomic_state *state)<br>
> +struct intel_bw_state *<br>
> +intel_bw_get_old_state(struct intel_atomic_state *state)<br>
> +{<br>
> + struct drm_i915_private *dev_priv = to_i915(state->base.dev);<br>
> + struct intel_global_state *bw_state;<br>
> +<br>
> + bw_state = intel_atomic_get_old_global_obj_state(state, &dev_priv->bw_obj);<br>
> + if (IS_ERR(bw_state))<br>
> + return ERR_CAST(bw_state);<br>
> +<br>
> + return to_intel_bw_state(bw_state);<br>
> +}<br>
> +<br>
> +struct intel_bw_state *<br>
> +intel_bw_get_new_state(struct intel_atomic_state *state)<br>
> +{<br>
> + struct drm_i915_private *dev_priv = to_i915(state->base.dev);<br>
> + struct intel_global_state *bw_state;<br>
> +<br>
> + bw_state = intel_atomic_get_new_global_obj_state(state, &dev_priv->bw_obj);<br>
> +<br>
> + if (IS_ERR(bw_state))<br>
> + return ERR_CAST(bw_state);<br>
> +<br>
> + return to_intel_bw_state(bw_state);<br>
> +}<br>
> +<br>
> +struct intel_bw_state *<br>
> +intel_bw_get_state(struct intel_atomic_state *state)<br>
> {<br>
> struct drm_i915_private *dev_priv = to_i915(state->base.dev);<br>
> struct intel_global_state *bw_state;<br>
> @@ -420,7 +447,7 @@ int intel_bw_atomic_check(struct intel_atomic_state *state)<br>
> old_active_planes == new_active_planes)<br>
> continue;<br>
> <br>
> - bw_state = intel_atomic_get_bw_state(state);<br>
> + bw_state = intel_bw_get_state(state);<br>
> if (IS_ERR(bw_state))<br>
> return PTR_ERR(bw_state);<br>
> <br>
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.h b/drivers/gpu/drm/i915/display/intel_bw.h<br>
> index a8aa7624c5aa..b5f61463922f 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_bw.h<br>
> +++ b/drivers/gpu/drm/i915/display/intel_bw.h<br>
> @@ -24,6 +24,15 @@ struct intel_bw_state {<br>
> <br>
> #define to_intel_bw_state(x) container_of((x), struct intel_bw_state, base)<br>
> <br>
> +struct intel_bw_state *<br>
> +intel_bw_get_old_state(struct intel_atomic_state *state);<br>
> +<br>
> +struct intel_bw_state *<br>
> +intel_bw_get_new_state(struct intel_atomic_state *state);<br>
> +<br>
> +struct intel_bw_state *<br>
> +intel_bw_get_state(struct intel_atomic_state *state);<br>
> +<br>
> void intel_bw_init_hw(struct drm_i915_private *dev_priv);<br>
> int intel_bw_init(struct drm_i915_private *dev_priv);<br>
> int intel_bw_atomic_check(struct intel_atomic_state *state);<br>
> -- <br>
> 2.24.1.485.gad05a3d8e5<br>
<br>
-- <br>
Ville Syrjälä<br>
Intel<br>
</div>
</span></font>
</body>
</html>