All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: mikita.lipski@amd.com
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	Nikola Cornij <nikola.cornij@amd.com>
Subject: Re: [PATCH] drm/dsc: Return unsigned long on compute offset
Date: Tue, 19 Nov 2019 16:56:49 +0200	[thread overview]
Message-ID: <20191119145649.GZ1208@intel.com> (raw)
In-Reply-To: <20191119144526.31797-1-mikita.lipski@amd.com>

On Tue, Nov 19, 2019 at 09:45:26AM -0500, mikita.lipski@amd.com wrote:
> From: Mikita Lipski <mikita.lipski@amd.com>
> 
> We shouldn't compare int with unsigned long to find the max value
> and since we are not expecting negative value returned from
> compute_offset we should make this function return unsigned long
> so we can compare the values when computing rc parameters.

Why are there other unsigned longs in dsc parameter computation
in the first place?

> 
> Cc: Nikola Cornij <nikola.cornij@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
> ---
>  drivers/gpu/drm/drm_dsc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dsc.c b/drivers/gpu/drm/drm_dsc.c
> index 74f3527f567d..ec40604ab6a2 100644
> --- a/drivers/gpu/drm/drm_dsc.c
> +++ b/drivers/gpu/drm/drm_dsc.c
> @@ -245,11 +245,11 @@ void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_payload,
>  }
>  EXPORT_SYMBOL(drm_dsc_pps_payload_pack);
>  
> -static int compute_offset(struct drm_dsc_config *vdsc_cfg, int pixels_per_group,
> +static unsigned long compute_offset(struct drm_dsc_config *vdsc_cfg, int pixels_per_group,
>  				int groups_per_line, int grpcnt)
>  {
> -	int offset = 0;
> -	int grpcnt_id = DIV_ROUND_UP(vdsc_cfg->initial_xmit_delay, pixels_per_group);
> +	unsigned long offset = 0;
> +	unsigned long grpcnt_id = DIV_ROUND_UP(vdsc_cfg->initial_xmit_delay, pixels_per_group);
>  
>  	if (grpcnt <= grpcnt_id)
>  		offset = DIV_ROUND_UP(grpcnt * pixels_per_group * vdsc_cfg->bits_per_pixel, 16);
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: mikita.lipski@amd.com
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	Nikola Cornij <nikola.cornij@amd.com>
Subject: Re: [PATCH] drm/dsc: Return unsigned long on compute offset
Date: Tue, 19 Nov 2019 16:56:49 +0200	[thread overview]
Message-ID: <20191119145649.GZ1208@intel.com> (raw)
Message-ID: <20191119145649.4sc-i5xk-CAfy4a5Is0h3LwuvQuvhiTOZoi2N4aICWg@z> (raw)
In-Reply-To: <20191119144526.31797-1-mikita.lipski@amd.com>

On Tue, Nov 19, 2019 at 09:45:26AM -0500, mikita.lipski@amd.com wrote:
> From: Mikita Lipski <mikita.lipski@amd.com>
> 
> We shouldn't compare int with unsigned long to find the max value
> and since we are not expecting negative value returned from
> compute_offset we should make this function return unsigned long
> so we can compare the values when computing rc parameters.

Why are there other unsigned longs in dsc parameter computation
in the first place?

> 
> Cc: Nikola Cornij <nikola.cornij@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
> ---
>  drivers/gpu/drm/drm_dsc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dsc.c b/drivers/gpu/drm/drm_dsc.c
> index 74f3527f567d..ec40604ab6a2 100644
> --- a/drivers/gpu/drm/drm_dsc.c
> +++ b/drivers/gpu/drm/drm_dsc.c
> @@ -245,11 +245,11 @@ void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_payload,
>  }
>  EXPORT_SYMBOL(drm_dsc_pps_payload_pack);
>  
> -static int compute_offset(struct drm_dsc_config *vdsc_cfg, int pixels_per_group,
> +static unsigned long compute_offset(struct drm_dsc_config *vdsc_cfg, int pixels_per_group,
>  				int groups_per_line, int grpcnt)
>  {
> -	int offset = 0;
> -	int grpcnt_id = DIV_ROUND_UP(vdsc_cfg->initial_xmit_delay, pixels_per_group);
> +	unsigned long offset = 0;
> +	unsigned long grpcnt_id = DIV_ROUND_UP(vdsc_cfg->initial_xmit_delay, pixels_per_group);
>  
>  	if (grpcnt <= grpcnt_id)
>  		offset = DIV_ROUND_UP(grpcnt * pixels_per_group * vdsc_cfg->bits_per_pixel, 16);
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2019-11-19 14:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 14:45 [PATCH] drm/dsc: Return unsigned long on compute offset mikita.lipski-5C7GfCeVMHo
2019-11-19 14:45 ` mikita.lipski
2019-11-19 14:45 ` mikita.lipski
2019-11-19 14:56 ` Ville Syrjälä [this message]
2019-11-19 14:56   ` Ville Syrjälä
2019-11-19 15:08   ` Mikita Lipski
2019-11-19 15:08     ` Mikita Lipski
2019-11-19 16:59     ` Cornij, Nikola
2019-11-19 16:59       ` Cornij, Nikola
     [not found]       ` <BL0PR12MB24039F7D8CC95CCCC10C3103EE4C0-b4cIHhjg/p81/3vIZPtp9gdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-11-19 17:11         ` Ville Syrjälä
2019-11-19 17:11           ` Ville Syrjälä
2019-11-19 17:11           ` Ville Syrjälä
     [not found]           ` <20191119171132.GB1208-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2019-11-19 21:09             ` Mikita Lipski
2019-11-19 21:09               ` Mikita Lipski
2019-11-19 21:09               ` Mikita Lipski
     [not found]               ` <2a61d60c-98f9-a5a2-6e7b-dc94df3fc510-5C7GfCeVMHo@public.gmane.org>
2019-11-19 21:11                 ` Mikita Lipski
2019-11-19 21:11                   ` Mikita Lipski
2019-11-19 21:11                   ` Mikita Lipski
     [not found]                   ` <362986e6-e5d4-f2d5-12bd-feb0acc06546-5C7GfCeVMHo@public.gmane.org>
2019-11-20 10:17                     ` Ville Syrjälä
2019-11-20 10:17                       ` Ville Syrjälä
2019-11-20 10:17                       ` Ville Syrjälä
2019-11-20 13:44                       ` Mikita Lipski
2019-11-20 13:44                         ` Mikita Lipski

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=20191119145649.GZ1208@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mikita.lipski@amd.com \
    --cc=nikola.cornij@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.