drm/amd/display: Check UnboundedRequestEnabled's value
authorAlex Hung <alex.hung@amd.com>
Fri, 7 Jun 2024 03:23:39 +0000 (21:23 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Jun 2024 16:46:14 +0000 (12:46 -0400)
CalculateSwathAndDETConfiguration_params_st's UnboundedRequestEnabled
is a pointer (i.e. dml_bool_t *UnboundedRequestEnabled), and thus
if (p->UnboundedRequestEnabled) checks its address, not bool value.

This fixes 1 REVERSE_INULL issue reported by Coverity.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c

index 791f1725b62b8a0a82c66ccd79709b7662a37e1f..547dfcc80fde47dc116e333ed07e977905b2c7d4 100644 (file)
@@ -4283,7 +4283,7 @@ static void CalculateSwathAndDETConfiguration(struct display_mode_lib_scratch_st
        }
 
        *p->compbuf_reserved_space_64b = 2 * p->PixelChunkSizeInKByte * 1024 / 64;
-       if (p->UnboundedRequestEnabled) {
+       if (*p->UnboundedRequestEnabled) {
                *p->compbuf_reserved_space_64b = dml_max(*p->compbuf_reserved_space_64b,
                                (dml_float_t)(p->ROBBufferSizeInKByte * 1024/64)
                                - (dml_float_t)(RoundedUpSwathSizeBytesY[SurfaceDoingUnboundedRequest] * TTUFIFODEPTH / MAXIMUMCOMPRESSION/64));