[bug report] drm/amd/display: Add new sources for DCN6

Dan Carpenter <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.