AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* re: drm/amd/display: Introduce DML2
@ 2024-10-10 15:59 Colin King (gmail)
  2024-10-10 20:23 ` Li, Roman
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King (gmail) @ 2024-10-10 15:59 UTC (permalink / raw)
  To: Qingqing Zhuo
  Cc: Rodrigo Siqueira, Roman Li, Alex Deucher,
	linux-kernel@vger.kernel.org, amd-gfx mailing list,
	amd-gfx mailing list

Hi,

Static analysis on linux-next has found a potential issue in function 
dml_rq_dlg_get_rq_reg in 
drivers/gpu/drm/amd/display/dc/dml2/dml_display_rq_dlg_calc.c

The issue is as follows:

         if (min_meta_chunk_bytes == 0)
                 rq_regs->rq_regs_l.min_meta_chunk_size = 0;
         else
                 rq_regs->rq_regs_l.min_meta_chunk_size = 
(dml_uint_t)(dml_log2((dml_float_t) min_meta_chunk_bytes) - 6 + 1);

         if ( == 0)
                 rq_regs->rq_regs_c.min_meta_chunk_size = 0;
         else
                 rq_regs->rq_regs_c.min_meta_chunk_size = 
(dml_uint_t)(dml_log2((dml_float_t) p1_min_meta_chunk_bytes) - 6 + 1);

it appears that the second if statement is checking for 
min_meta_chunk_bytes == 0 and I think it should be in fact checking for 
p1_min_meta_chunk_bytes == 0 instead. I don't have the hardware so I 
can't test this hypothesis.

Regards,

Colin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: drm/amd/display: Introduce DML2
  2024-10-10 15:59 drm/amd/display: Introduce DML2 Colin King (gmail)
@ 2024-10-10 20:23 ` Li, Roman
  0 siblings, 0 replies; 2+ messages in thread
From: Li, Roman @ 2024-10-10 20:23 UTC (permalink / raw)
  To: Colin King (gmail), Zhuo, Lillian, Zheng, Austin
  Cc: Siqueira, Rodrigo, Deucher, Alexander,
	linux-kernel@vger.kernel.org, amd-gfx mailing list,
	amd-gfx mailing list

[Public]

Hi Colin,

It's not critical since before the check:
p1_min_meta_chunk_bytes =  min_meta_chunk_bytes;

Thanks,
Roman


> -----Original Message-----
> From: Colin King (gmail) <colin.i.king@gmail.com>
> Sent: Thursday, October 10, 2024 11:59 AM
> To: Zhuo, Lillian <Qingqing.Zhuo@amd.com>
> Cc: Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Li, Roman
> <Roman.Li@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>;
> linux-kernel@vger.kernel.org; amd-gfx mailing list <amd-
> gfx@lists.freedesktop.org>; amd-gfx mailing list <amd-gfx@lists.freedesktop.org>
> Subject: re: drm/amd/display: Introduce DML2
>
> Hi,
>
> Static analysis on linux-next has found a potential issue in function
> dml_rq_dlg_get_rq_reg in
> drivers/gpu/drm/amd/display/dc/dml2/dml_display_rq_dlg_calc.c
>
> The issue is as follows:
>
>          if (min_meta_chunk_bytes == 0)
>                  rq_regs->rq_regs_l.min_meta_chunk_size = 0;
>          else
>                  rq_regs->rq_regs_l.min_meta_chunk_size =
> (dml_uint_t)(dml_log2((dml_float_t) min_meta_chunk_bytes) - 6 + 1);
>
>          if ( == 0)
>                  rq_regs->rq_regs_c.min_meta_chunk_size = 0;
>          else
>                  rq_regs->rq_regs_c.min_meta_chunk_size =
> (dml_uint_t)(dml_log2((dml_float_t) p1_min_meta_chunk_bytes) - 6 + 1);
>
> it appears that the second if statement is checking for min_meta_chunk_bytes == 0
> and I think it should be in fact checking for p1_min_meta_chunk_bytes == 0
> instead. I don't have the hardware so I can't test this hypothesis.
>
> Regards,
>
> Colin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-14 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10 15:59 drm/amd/display: Introduce DML2 Colin King (gmail)
2024-10-10 20:23 ` Li, Roman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox