dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	dri-devel@lists.freedesktop.org,
	Mikita Lipski <mikita.lipski@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/dp/mst: Replace the fixed point thing with straight calculation
Date: Wed, 25 Sep 2019 20:07:44 -0400	[thread overview]
Message-ID: <44bfc8fa3ddaa4d36542f3fa9fef412e88a0bd6b.camel@redhat.com> (raw)
In-Reply-To: <20190925141442.23236-3-ville.syrjala@linux.intel.com>

Reviewed-by: Lyude Paul <lyude@redhat.com>

Cc: Mikita Lipski - figured you'd want to know ahead of time you'll need to
update your changes to drm_dp_calc_pbn_mode() to match

On Wed, 2019-09-25 at 17:14 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Get rid of the drm_fixp_from_fraction() usage and just do the
> straightforward calculation directly.
> 
> Cc: Lyude Paul <lyude@redhat.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index d4644a3c1324..f899a4432311 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -32,7 +32,6 @@
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_dp_mst_helper.h>
>  #include <drm/drm_drv.h>
> -#include <drm/drm_fixed.h>
>  #include <drm/drm_print.h>
>  #include <drm/drm_probe_helper.h>
>  
> @@ -3840,13 +3839,6 @@ EXPORT_SYMBOL(drm_dp_check_act_status);
>   */
>  int drm_dp_calc_pbn_mode(int clock, int bpp)
>  {
> -	u64 kbps;
> -	s64 peak_kbps;
> -	u32 numerator;
> -	u32 denominator;
> -
> -	kbps = clock * bpp;
> -
>  	/*
>  	 * margin 5300ppm + 300ppm ~ 0.6% as per spec, factor is 1.006
>  	 * The unit of 54/64Mbytes/sec is an arbitrary unit chosen based on
> @@ -3857,14 +3849,8 @@ int drm_dp_calc_pbn_mode(int clock, int bpp)
>  	 * peak_kbps *= (64/54)
>  	 * peak_kbps *= 8    convert to bytes
>  	 */
> -
> -	numerator = 64 * 1006;
> -	denominator = 54 * 8 * 1000 * 1000;
> -
> -	kbps *= numerator;
> -	peak_kbps = drm_fixp_from_fraction(kbps, denominator);
> -
> -	return drm_fixp2int_ceil(peak_kbps);
> +	return DIV_ROUND_UP_ULL(mul_u32_u32(clock * bpp, 64 * 1006),
> +				8 * 54 * 1000 * 1000);
>  }
>  EXPORT_SYMBOL(drm_dp_calc_pbn_mode);
>  
-- 
Cheers,
	Lyude Paul

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-09-26  0:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 14:14 [PATCH 1/3] drm/dp/mst: Reduce nested ifs Ville Syrjala
2019-09-25 14:14 ` [PATCH 2/3] drm/dp/mst: Handle arbitrary DP_LINK_BW values Ville Syrjala
2019-09-26  0:03   ` Lyude Paul
2019-09-25 14:14 ` [PATCH 3/3] drm/dp/mst: Replace the fixed point thing with straight calculation Ville Syrjala
2019-09-26  0:07   ` Lyude Paul [this message]
2019-09-25 16:14 ` [PATCH 1/3] drm/dp/mst: Reduce nested ifs Lucas De Marchi
2019-09-25 19:10 ` Lyude Paul

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=44bfc8fa3ddaa4d36542f3fa9fef412e88a0bd6b.camel@redhat.com \
    --to=lyude@redhat.com \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mikita.lipski@amd.com \
    --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