Skip to contentSkip to conversation

drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:1328:3-5: WARNING: possible condition with no effect (if == else) (fwd)

PATCH In review Julia Lawall 2 participants 2 messages Mar 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 3/17 drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:1328:3-5: WARNING: possible condition with no effect (if == else) (fwd)

The if on line 1327 only exists to allow the comment in the else case. Perhaps check on whether it is really useful.

The lines also look quite long. Perhaps this could be cleaned up as well.

julia

---------- Forwarded message ----------
Date: Fri, 3 Mar 2017 05:06:14 +0800
From: kbuild test robot <[email protected]>
To: [email protected]
Cc: Julia Lawall <[email protected]>
Subject: [radeon-alex:amd-staging-4.9 3/17]

    drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:1328:3-5:
    WARNING: possible condition with no effect (if == else)
tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-4.9
head:   677efd69b448d24dd74e0dfb1d74fb6408c9df81
commit: 9ca8070c97b1eb2b948f065fdbccc15b6e8be639 [3/17] drm/amd/display: rename bandwidth_calcs.c to dce_calcs.c (v2)

:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:1328:3-5: WARNING: possible condition with no effect (if == else)

git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
git remote update radeon-alex
git checkout 9ca8070c97b1eb2b948f065fdbccc15b6e8be639
vim +1328 drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c

bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1312  			data->cpuc_state_change_enable = bw_def_no;
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1313  		}
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1314  	}
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1315  	else {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1316  		data->cpup_state_change_enable = bw_def_no;
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1317  		data->cpuc_state_change_enable = bw_def_no;
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1318  	}
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1319  	/*nb p-state change enable*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1320  	/*for dram speed/p-state change to be possible for a yclk(pclk) and sclk level there has to be positive margin and the dispclk required has to be*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1321  	/*below the maximum.*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1322  	/*the dram speed/p-state change margin is the minimum for all surfaces of the maximum latency hiding minus the dram speed/p-state change latency,*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1323  	/*minus the dmif burst time, minus the source line transfer time*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1324  	/*the maximum latency hiding is the minimum latency hiding plus one source line used for de-tiling in the line buffer, plus half the urgent latency*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1325  	/*if stutter and dram clock state change are gated before cursor then the cursor latency hiding does not limit stutter or dram clock state change*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1326  	for (i = 0; i <= maximum_number_of_surfaces - 1; i++) {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1327  		if (data->enable[i]) {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25 @1328  			if ((dceip->graphics_lb_nodownscaling_multi_line_prefetching == 1)) {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1329  				data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], bw_mul(bw_frc_to_fixed(8, 10), data->total_dmifmc_urgent_latency));
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1330  			}
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1331  			else {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1332  				/*maximum_latency_hiding(i) = minimum_latency_hiding(i) + 1 / vsr(i) * h_total(i) / pixel_rate(i) + 0.5 * total_dmifmc_urgent_latency*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1333  				data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], bw_mul(bw_frc_to_fixed(8, 10), data->total_dmifmc_urgent_latency));
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1334  			}
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1335  			data->maximum_latency_hiding_with_cursor[i] = bw_min2(data->maximum_latency_hiding[i], data->cursor_latency_hiding[i]);
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1336  		}

:::::: The code at line 1328 was first introduced by commit
:::::: bad4c165a6986a131cdd1455507ba3857baaa561 drm/amd/dc: Add dc display driver

:::::: TO: Harry Wentland <[email protected]> :::::: CC: Alex Deucher <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw
Quoted 4 lines · Julia Lawall

The if on line 1327 only exists to allow the comment in the else case. Perhaps check on whether it is really useful.

The lines also look quite long. Perhaps this could be cleaned up as well.

This file is machine generated by the hardware team as bandwidth formulas are tweaked and updated.

Alex

Quoted 58 lines

julia

---------- Forwarded message ----------
Date: Fri, 3 Mar 2017 05:06:14 +0800
From: kbuild test robot <[email protected]>
To: [email protected]
Cc: Julia Lawall <[email protected]>
Subject: [radeon-alex:amd-staging-4.9 3/17]

    drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:1328:3-5:
    WARNING: possible condition with no effect (if == else)
tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-4.9
head:   677efd69b448d24dd74e0dfb1d74fb6408c9df81
commit: 9ca8070c97b1eb2b948f065fdbccc15b6e8be639 [3/17] drm/amd/display: rename bandwidth_calcs.c to dce_calcs.c (v2)

:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:1328:3-5: WARNING: possible condition with no effect (if == else)

git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
git remote update radeon-alex
git checkout 9ca8070c97b1eb2b948f065fdbccc15b6e8be639
vim +1328 drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c

bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1312                         data->cpuc_state_change_enable = bw_def_no;
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1313                 }
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1314         }
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1315         else {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1316                 data->cpup_state_change_enable = bw_def_no;
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1317                 data->cpuc_state_change_enable = bw_def_no;
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1318         }
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1319         /*nb p-state change enable*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1320         /*for dram speed/p-state change to be possible for a yclk(pclk) and sclk level there has to be positive margin and the dispclk required has to be*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1321         /*below the maximum.*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1322         /*the dram speed/p-state change margin is the minimum for all surfaces of the maximum latency hiding minus the dram speed/p-state change latency,*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1323         /*minus the dmif burst time, minus the source line transfer time*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1324         /*the maximum latency hiding is the minimum latency hiding plus one source line used for de-tiling in the line buffer, plus half the urgent latency*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1325         /*if stutter and dram clock state change are gated before cursor then the cursor latency hiding does not limit stutter or dram clock state change*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1326         for (i = 0; i <= maximum_number_of_surfaces - 1; i++) {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1327                 if (data->enable[i]) {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25 @1328                         if ((dceip->graphics_lb_nodownscaling_multi_line_prefetching == 1)) {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1329                                 data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], bw_mul(bw_frc_to_fixed(8, 10), data->total_dmifmc_urgent_latency));
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1330                         }
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1331                         else {
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1332                                 /*maximum_latency_hiding(i) = minimum_latency_hiding(i) + 1 / vsr(i) * h_total(i) / pixel_rate(i) + 0.5 * total_dmifmc_urgent_latency*/
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1333                                 data->maximum_latency_hiding[i] = bw_add(data->minimum_latency_hiding[i], bw_mul(bw_frc_to_fixed(8, 10), data->total_dmifmc_urgent_latency));
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1334                         }
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1335                         data->maximum_latency_hiding_with_cursor[i] = bw_min2(data->maximum_latency_hiding[i], data->cursor_latency_hiding[i]);
bad4c165 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c Harry Wentland 2015-11-25  1336                 }

:::::: The code at line 1328 was first introduced by commit
:::::: bad4c165a6986a131cdd1455507ba3857baaa561 drm/amd/dc: Add dc display driver

:::::: TO: Harry Wentland <[email protected]> :::::: CC: Alex Deucher <[email protected]>

Quoted 7 lines

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel