The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Vitaliy Shevtsov <v.shevtsov@mt-integration.ru>,
	Chaitanya Dhere <chaitanya.dhere@amd.com>
Cc: "Jun Lei" <jun.lei@amd.com>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Xinhui Pan" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Fangzhi Zuo" <jerry.zuo@amd.com>, "Aric Cyr" <aric.cyr@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH] drm/amd/display: fix type mismatch in CalculateDynamicMetadataParameters()
Date: Tue, 25 Feb 2025 17:19:37 -0700	[thread overview]
Message-ID: <58f33eb8-ae56-416a-ab23-2690160756cd@amd.com> (raw)
In-Reply-To: <20250222235818.1990-1-v.shevtsov@mt-integration.ru>



On 2/22/25 16:58, Vitaliy Shevtsov wrote:
> There is a type mismatch between what CalculateDynamicMetadataParameters()
> takes and what is passed to it. Currently this function accepts several
> args as signed long but it's called with unsigned integers. On some systems
> where long is 32 bits and one of these input params is greater than INT_MAX
> it may cause passing input params as negative values.
> 
> Fix this by changing these argument types from long to unsigned int. Also
> this will align the function's definition with similar functions in other
> dcn* drivers.
> 
> Found by Linux Verification Center (linuxtesting.org) with Svace.
> 
> Signed-off-by: Vitaliy Shevtsov <v.shevtsov@mt-integration.ru>
> ---
>   .../amd/display/dc/dml/dcn30/display_mode_vba_30.c   | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
> index cee1b351e105..c6c7ce84e260 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
> @@ -281,10 +281,10 @@ static void CalculateDynamicMetadataParameters(
>   		double DISPCLK,
>   		double DCFClkDeepSleep,
>   		double PixelClock,
> -		long HTotal,
> -		long VBlank,
> -		long DynamicMetadataTransmittedBytes,
> -		long DynamicMetadataLinesBeforeActiveRequired,
> +		unsigned int HTotal,
> +		unsigned int VBlank,
> +		unsigned int DynamicMetadataTransmittedBytes,
> +		unsigned int DynamicMetadataLinesBeforeActiveRequired,

DynamicMetadataLinesBeforeActiveRequired past to 
"CalculateDynamicMetadataParameters" are int instead of unsigned int. 
Can you confirm and try with Svace?

Thanks.


>   		int InterlaceEnable,
>   		bool ProgressiveToInterlaceUnitInOPP,
>   		double *Tsetup,
> @@ -3265,8 +3265,8 @@ static double CalculateWriteBackDelay(
>   
>   
>   static void CalculateDynamicMetadataParameters(int MaxInterDCNTileRepeaters, double DPPCLK, double DISPCLK,
> -		double DCFClkDeepSleep, double PixelClock, long HTotal, long VBlank, long DynamicMetadataTransmittedBytes,
> -		long DynamicMetadataLinesBeforeActiveRequired, int InterlaceEnable, bool ProgressiveToInterlaceUnitInOPP,
> +		double DCFClkDeepSleep, double PixelClock, unsigned int HTotal, unsigned int VBlank, unsigned int DynamicMetadataTransmittedBytes,
> +		unsigned int DynamicMetadataLinesBeforeActiveRequired, int InterlaceEnable, bool ProgressiveToInterlaceUnitInOPP,
>   		double *Tsetup, double *Tdmbf, double *Tdmec, double *Tdmsks)
>   {
>   	double TotalRepeaterDelayTime = 0;


      reply	other threads:[~2025-02-26  0:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-22 23:58 [PATCH] drm/amd/display: fix type mismatch in CalculateDynamicMetadataParameters() Vitaliy Shevtsov
2025-02-26  0:19 ` Alex Hung [this message]

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=58f33eb8-ae56-416a-ab23-2690160756cd@amd.com \
    --to=alex.hung@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aric.cyr@amd.com \
    --cc=chaitanya.dhere@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=jun.lei@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=simona@ffwll.ch \
    --cc=sunpeng.li@amd.com \
    --cc=v.shevtsov@mt-integration.ru \
    /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