public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Govindapillai, Vinod" <vinod.govindapillai@intel.com>,
	"ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Syrjala, Ville" <ville.syrjala@intel.com>
Subject: Re: [Intel-gfx] [PATCH v3 2/8] drm/i915: update the QGV point frequency calculations
Date: Tue, 02 May 2023 13:03:32 +0300	[thread overview]
Message-ID: <87sfcf124r.fsf@intel.com> (raw)
In-Reply-To: <4b531301f35e856b0a44f7a002686406a6d8672f.camel@intel.com>

On Fri, 28 Apr 2023, "Govindapillai, Vinod" <vinod.govindapillai@intel.com> wrote:
> On Thu, 2023-04-27 at 18:04 +0300, Ville Syrjälä wrote:
>> On Thu, Apr 27, 2023 at 06:00:10PM +0300, Vinod Govindapillai wrote:
>> > > From MTL onwwards, pcode locks the QGV point based on peak BW of
>> > the intended QGV point passed by the driver. So the peak BW
>> > calculation must match the value expected by the pcode. Update
>> > the calculations as per the Bspec.
>> > 
>> > Bspec: 64636
>> > 
>> > Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/display/intel_bw.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> > 
>> > diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
>> > index ab405c48ca3a..25ae4e5834d3 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_bw.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_bw.c
>> > @@ -182,7 +182,7 @@ static int mtl_read_qgv_point_info(struct drm_i915_private *dev_priv,
>> >         val2 = intel_uncore_read(&dev_priv->uncore,
>> >                                  MTL_MEM_SS_INFO_QGV_POINT_HIGH(point));
>> >         dclk = REG_FIELD_GET(MTL_DCLK_MASK, val);
>> > -       sp->dclk = DIV_ROUND_UP((16667 * dclk), 1000);
>> > +       sp->dclk = (16667 * dclk + 500) / 1000;
>> 
>> Don't hand roll rounding.
>
> Hi Ville,
>
> I did not understand what you meant by this.
>
> This is as per the Bspec 64636. I am assuming, probably this is what pcode expects to get it
> compared with its internal reference qclk peak Bw. I will clarify with Art.
>
> And there is another requirement to get rid of div_round_up() of these BW calculations. Will address
> them separately.

The point is, no matter whether you need to round up or down or nearest,
you need to use the DIV_ROUND_* helpers for that, not duplicate the
logic here. No matter what bspec says.

BR,
Jani.


>
> BR
> Vinod
>> 
>> >         sp->t_rp = REG_FIELD_GET(MTL_TRP_MASK, val);
>> >         sp->t_rcd = REG_FIELD_GET(MTL_TRCD_MASK, val);
>> >  
>> > -- 
>> > 2.34.1
>> 
>

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-05-02 10:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 15:00 [Intel-gfx] [PATCH v3 0/8] mtl: add support for pmdemand Vinod Govindapillai
2023-04-27 15:00 ` [Intel-gfx] [PATCH v3 1/8] drm/i915: fix the derating percentage for MTL Vinod Govindapillai
2023-05-05  0:04   ` Matt Roper
2023-04-27 15:00 ` [Intel-gfx] [PATCH v3 2/8] drm/i915: update the QGV point frequency calculations Vinod Govindapillai
2023-04-27 15:04   ` Ville Syrjälä
2023-04-28 23:21     ` Govindapillai, Vinod
2023-05-02 10:03       ` Jani Nikula [this message]
2023-04-27 15:00 ` [Intel-gfx] [PATCH v3 3/8] drm/i915: store the peak bw per QGV point Vinod Govindapillai
2023-04-27 15:00 ` [Intel-gfx] [PATCH v3 4/8] drm/i915: extract intel_bw_check_qgv_points() Vinod Govindapillai
2023-04-27 15:00 ` [Intel-gfx] [PATCH v3 5/8] drm/i915: modify max_bw to return index to intel_bw_info Vinod Govindapillai
2023-04-27 15:00 ` [Intel-gfx] [PATCH v3 6/8] drm/i915/mtl: find best QGV point and configure sagv Vinod Govindapillai
2023-04-27 15:00 ` [Intel-gfx] [PATCH v3 7/8] drm/i915/mtl: Add support for PM DEMAND Vinod Govindapillai
2023-04-27 20:24   ` Gustavo Sousa
2023-05-11 23:24     ` Govindapillai, Vinod
2023-05-12 20:43       ` Gustavo Sousa
2023-05-22 22:39         ` Govindapillai, Vinod
2023-05-02 10:04   ` Jani Nikula
2023-05-17 13:10   ` Jani Nikula
2023-04-27 15:00 ` [Intel-gfx] [PATCH v3 8/8] drm/i915/display: provision to suppress drm_warn in intel_get_crtc_new_encoder Vinod Govindapillai
2023-04-27 18:14 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for mtl: add support for pmdemand (rev4) Patchwork
2023-04-27 18:14 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-04-27 18:23 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-04-28  0:38 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-04-27 14:25 [Intel-gfx] [PATCH v3 0/8] mtl: add support for pmdeman Vinod Govindapillai
2023-04-27 14:25 ` [Intel-gfx] [PATCH v3 2/8] drm/i915: update the QGV point frequency calculations Vinod Govindapillai
2023-04-26 13:06 [Intel-gfx] [PATCH v3 0/8] mtl: add support for pmdemand Vinod Govindapillai
2023-04-26 13:06 ` [Intel-gfx] [PATCH v3 2/8] drm/i915: update the QGV point frequency calculations Vinod Govindapillai

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=87sfcf124r.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@intel.com \
    --cc=ville.syrjala@linux.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