All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] drm/amd/display: Add new sources for DCN6
@ 2026-08-20  8:28 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-08-20  8:28 UTC (permalink / raw)
  To: Aurabindo Pillai; +Cc: amd-gfx, SHANMUGAM, SRINIVASAN

Hello Aurabindo Pillai,

Commit 7f7d7ea1fa51 ("drm/amd/display: Add new sources for DCN6")
from Jul 22, 2026 (linux-next), leads to the following Smatch static
checker warning:

	drivers/gpu/drm/amd/amdgpu/../display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_calcs_dchub.c:82 dcn5_calculate_byte_per_pixel_and_block_sizes()
	warn: duplicate check 'SourcePixelFormat == 17' (previous on line 77)

drivers/gpu/drm/amd/amdgpu/../display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn5_calcs_dchub.c
    45 void dcn5_calculate_byte_per_pixel_and_block_sizes(
    46         enum dml2_source_format_class SourcePixelFormat,
    47         enum dml2_swizzle_mode SurfaceTiling,
    48         unsigned int pitch_y,
    49         unsigned int pitch_c,
    50 
    51         // Output
    52         unsigned int *BytePerPixelY,
    53         unsigned int *BytePerPixelC,
    54         double *BytePerPixelDETY,
    55         double *BytePerPixelDETC,
    56         unsigned int *BlockHeight256BytesY,
    57         unsigned int *BlockHeight256BytesC,
    58         unsigned int *BlockWidth256BytesY,
    59         unsigned int *BlockWidth256BytesC,
    60         unsigned int *MacroTileHeightY,
    61         unsigned int *MacroTileHeightC,
    62         unsigned int *MacroTileWidthY,
    63         unsigned int *MacroTileWidthC,
    64         bool *surf_linear128_l,
    65         bool *surf_linear128_c)
    66 {
    67         *BytePerPixelDETY = 0;
    68         *BytePerPixelDETC = 0;
    69         *BytePerPixelY = 0;
    70         *BytePerPixelC = 0;
    71 
    72         if (SourcePixelFormat == dml2_444_64) {
    73                 *BytePerPixelDETY = 8;
    74                 *BytePerPixelDETC = 0;
    75                 *BytePerPixelY = 8;
    76                 *BytePerPixelC = 0;
    77         } else if (SourcePixelFormat == dml2_444_32 || SourcePixelFormat == dml2_rgbe || SourcePixelFormat == dml2_422_packed_10 || SourcePixelFormat == dml2_422_packed_12) {
                                                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    78                 *BytePerPixelDETY = 4;
    79                 *BytePerPixelDETC = 0;
    80                 *BytePerPixelY = 4;
    81                 *BytePerPixelC = 0;
--> 82         } else if (SourcePixelFormat == dml2_422_packed_10) {
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Dead code.

    83                 *BytePerPixelDETY = (double)(8.0 / 3);
    84                 *BytePerPixelDETC = 0;
    85                 *BytePerPixelY = 4;
    86                 *BytePerPixelC = 0;

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

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

* [bug report] drm/amd/display: Add new sources for DCN6
@ 2026-08-20  8:28 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-08-20  8:28 UTC (permalink / raw)
  To: Aurabindo Pillai; +Cc: amd-gfx, SHANMUGAM, SRINIVASAN

Hello Aurabindo Pillai,

Commit 7f7d7ea1fa51 ("drm/amd/display: Add new sources for DCN6")
from Jul 22, 2026 (linux-next), leads to the following Smatch static
checker warning:

	drivers/gpu/drm/amd/amdgpu/../display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.c:572 dcn6_calculate_flip_schedule()
	warn: duplicate check 'GPUVMEnable' (previous on line 570)

drivers/gpu/drm/amd/amdgpu/../display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn6_calcs_dchub.c
    566         DML_LOG_VERBOSE("DML::%s: VRatio = %f\n", __func__, VRatio);
    567 
    568         bool flip_enable = iflip_enable || (GPUVMEnable && (ihostvm_enable || iffbmm_enable));
    569 
    570         if (GPUVMEnable) {
                    ^^^^^^^^^^^

    571                 if (l->dual_plane) {
--> 572                         if (GPUVMEnable) {
                                    ^^^^^^^^^^^

    573                                 l->min_row_height = dpte_row_height;
    574                                 l->min_row_height_chroma = dpte_row_height_chroma;
    575                         } else {
    576                                 l->min_row_height = meta_row_height;
    577                                 l->min_row_height_chroma = meta_row_height_chroma;

Dead code.

    578                         }
    579                         l->min_row_time = math_min2(l->min_row_height * LineTime / VRatio, l->min_row_height_chroma * LineTime / VRatioChroma);
    580                 } else {
    581                         if (GPUVMEnable)
                                    ^^^^^^^^^^^

    582                                 l->min_row_height = dpte_row_height;
    583                         else
    584                                 l->min_row_height = meta_row_height;

More dead code.

    585 
    586                         l->min_row_time = l->min_row_height * LineTime / VRatio;
    587                 }
    588                 DML_LOG_VERBOSE("DML::%s: min_row_time = %f\n", __func__, l->min_row_time);
    589                 DML_ASSERT(l->min_row_time > 0);

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

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

end of thread, other threads:[~2026-08-20 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  8:28 [bug report] drm/amd/display: Add new sources for DCN6 Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2026-08-20  8:28 Dan Carpenter

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.