drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c:439:14: warning: variable 'sdp_stream_enable' set but not used

From: kernel test robot
Date: Mon Sep 05 2022 - 16:53:06 EST


Hi Fangzhi,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7e18e42e4b280c85b76967a9106a13ca61c16179
commit: 83228ebb82e4fe2e5513f35d9b0b0eded3c44cbc drm/amd/display: Add DP 2.0 HPO Stream Encoder
date: 1 year ago
config: i386-buildonly-randconfig-r004-20220905 (https://download.01.org/0day-ci/archive/20220906/202209060420.Wzjr6Sj2-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83228ebb82e4fe2e5513f35d9b0b0eded3c44cbc
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 83228ebb82e4fe2e5513f35d9b0b0eded3c44cbc
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c: In function 'dcn31_hpo_dp_stream_enc_update_dp_info_packets':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c:439:14: warning: variable 'sdp_stream_enable' set but not used [-Wunused-but-set-variable]
439 | bool sdp_stream_enable = false;
| ^~~~~~~~~~~~~~~~~


vim +/sdp_stream_enable +439 drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_hpo_dp_stream_encoder.c

432
433 static void dcn31_hpo_dp_stream_enc_update_dp_info_packets(
434 struct hpo_dp_stream_encoder *enc,
435 const struct encoder_info_frame *info_frame)
436 {
437 struct dcn31_hpo_dp_stream_encoder *enc3 = DCN3_1_HPO_DP_STREAM_ENC_FROM_HPO_STREAM_ENC(enc);
438 uint32_t dmdata_packet_enabled = 0;
> 439 bool sdp_stream_enable = false;
440
441 if (info_frame->vsc.valid) {
442 enc->vpg->funcs->update_generic_info_packet(
443 enc->vpg,
444 0, /* packetIndex */
445 &info_frame->vsc);
446 sdp_stream_enable = true;
447 }
448 if (info_frame->spd.valid) {
449 enc->vpg->funcs->update_generic_info_packet(
450 enc->vpg,
451 2, /* packetIndex */
452 &info_frame->spd);
453 sdp_stream_enable = true;
454 }
455 if (info_frame->hdrsmd.valid) {
456 enc->vpg->funcs->update_generic_info_packet(
457 enc->vpg,
458 3, /* packetIndex */
459 &info_frame->hdrsmd);
460 sdp_stream_enable = true;
461 }
462 /* enable/disable transmission of packet(s).
463 * If enabled, packet transmission begins on the next frame
464 */
465 REG_UPDATE(DP_SYM32_ENC_SDP_GSP_CONTROL0, GSP_VIDEO_CONTINUOUS_TRANSMISSION_ENABLE, info_frame->vsc.valid);
466 REG_UPDATE(DP_SYM32_ENC_SDP_GSP_CONTROL2, GSP_VIDEO_CONTINUOUS_TRANSMISSION_ENABLE, info_frame->spd.valid);
467 REG_UPDATE(DP_SYM32_ENC_SDP_GSP_CONTROL3, GSP_VIDEO_CONTINUOUS_TRANSMISSION_ENABLE, info_frame->hdrsmd.valid);
468
469 /* check if dynamic metadata packet transmission is enabled */
470 REG_GET(DP_SYM32_ENC_SDP_METADATA_PACKET_CONTROL,
471 METADATA_PACKET_ENABLE, &dmdata_packet_enabled);
472
473 /* Enable secondary data path */
474 REG_UPDATE(DP_SYM32_ENC_SDP_CONTROL,
475 SDP_STREAM_ENABLE, 1);
476 }
477

--
0-DAY CI Kernel Test Service
https://01.org/lkp