tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: f843795727e4f5612c612cd178db1557978da742 commit: 8799c0be89ebb99a16098bdf618f49f817bef76a [12412/13063] drm/amd/display: Fix vblank refcount in vrr transition config: arm64-buildonly-randconfig-r006-20221012 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=8799c0be89ebb99a16098bdf618f49f817bef76a git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 8799c0be89ebb99a16098bdf618f49f817bef76a # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/drm/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All error/warnings (new ones prefixed by >>): >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7973:6: warning: variable 'crtc_disable_count' set but not used [-Wunused-but-set-variable] int crtc_disable_count = 0; ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7969:7: warning: unused variable 'wait_for_vblank' [-Wunused-variable] bool wait_for_vblank = true; ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7968:16: warning: unused variable 'flags' [-Wunused-variable] unsigned long flags; ^ >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8317:2: error: expected identifier or '(' for_each_new_crtc_in_state(state, crtc, new_crtc_state, j) ^ include/drm/drm_atomic.h:864:2: note: expanded from macro 'for_each_new_crtc_in_state' for ((__i) = 0; \ ^ >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8317:2: error: expected identifier or '(' include/drm/drm_atomic.h:867:3: note: expanded from macro 'for_each_new_crtc_in_state' for_each_if ((__state)->crtcs[__i].ptr && \ ^ include/drm/drm_util.h:63:53: note: expanded from macro 'for_each_if' #define for_each_if(condition) if (!(condition)) {} else ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8322:2: error: expected identifier or '(' for_each_new_crtc_in_state(state, crtc, new_crtc_state, j) { ^ include/drm/drm_atomic.h:864:2: note: expanded from macro 'for_each_new_crtc_in_state' for ((__i) = 0; \ ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8322:2: error: expected identifier or '(' include/drm/drm_atomic.h:867:3: note: expanded from macro 'for_each_new_crtc_in_state' for_each_if ((__state)->crtcs[__i].ptr && \ ^ include/drm/drm_util.h:63:53: note: expanded from macro 'for_each_if' #define for_each_if(condition) if (!(condition)) {} else ^ >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8331:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] amdgpu_dm_commit_audio(dev, state); ^ int >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8331:25: error: a parameter list without types is only allowed in a function definition amdgpu_dm_commit_audio(dev, state); ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8334:2: error: expected identifier or '(' for (i = 0; i < dm->num_of_edps; i++) { ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8344:2: error: expected identifier or '(' spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags); ^ include/linux/spinlock.h:377:43: note: expanded from macro 'spin_lock_irqsave' #define spin_lock_irqsave(lock, flags) \ ^ >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8344:2: error: while loop outside of a function include/linux/spinlock.h:380:3: note: expanded from macro 'spin_lock_irqsave' } while (0) ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8345:2: error: expected identifier or '(' for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { ^ include/drm/drm_atomic.h:864:2: note: expanded from macro 'for_each_new_crtc_in_state' for ((__i) = 0; \ ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8345:2: error: expected identifier or '(' include/drm/drm_atomic.h:867:3: note: expanded from macro 'for_each_new_crtc_in_state' for_each_if ((__state)->crtcs[__i].ptr && \ ^ include/drm/drm_util.h:63:53: note: expanded from macro 'for_each_if' #define for_each_if(condition) if (!(condition)) {} else ^ >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8352:25: error: expected parameter declarator spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); ^ >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8352:25: error: expected ')' drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8352:24: note: to match this '(' spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8352:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); ^ int >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8352:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); ^ void >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8352:2: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a previous declaration [-Werror,-Wdeprecated-non-prototype] spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); ^ include/linux/spinlock.h:402:29: note: conflicting prototype is here static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) ^ >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8352:2: error: conflicting types for 'spin_unlock_irqrestore' spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); ^ include/linux/spinlock.h:402:29: note: previous definition is here static __always_inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) ^ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8355:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] drm_atomic_helper_commit_hw_done(state); ^ int drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8355:35: error: a parameter list without types is only allowed in a function definition drm_atomic_helper_commit_hw_done(state); ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 3 warnings and 20 errors generated. vim +/spin_unlock_irqrestore +8352 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c 585d450c76d1d5 Aurabindo Pillai 2020-08-12 8278 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8279 if (new_crtc_state->active && 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8280 (!old_crtc_state->active || 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8281 drm_atomic_crtc_needs_modeset(new_crtc_state))) { 585d450c76d1d5 Aurabindo Pillai 2020-08-12 8282 dc_stream_retain(dm_new_crtc_state->stream); 585d450c76d1d5 Aurabindo Pillai 2020-08-12 8283 acrtc->dm_irq_params.stream = dm_new_crtc_state->stream; 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8284 manage_dm_interrupts(adev, acrtc, true); 8799c0be89ebb9 Yunxiang Li 2022-09-21 8285 } 8799c0be89ebb9 Yunxiang Li 2022-09-21 8286 /* Handle vrr on->off / off->on transitions */ 8799c0be89ebb9 Yunxiang Li 2022-09-21 8287 amdgpu_dm_handle_vrr_transition(dm_old_crtc_state, dm_new_crtc_state); e2881d6d0a2653 Rodrigo Siqueira 2021-01-07 8288 24eb937416fde5 Rodrigo Siqueira 2021-01-07 8289 #ifdef CONFIG_DEBUG_FS 8799c0be89ebb9 Yunxiang Li 2022-09-21 8290 if (new_crtc_state->active && 8799c0be89ebb9 Yunxiang Li 2022-09-21 8291 (!old_crtc_state->active || 8799c0be89ebb9 Yunxiang Li 2022-09-21 8292 drm_atomic_crtc_needs_modeset(new_crtc_state))) { 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8293 /** 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8294 * Frontend may have changed so reapply the CRC capture 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8295 * settings for the stream. 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8296 */ 8e7b6fee9b03d6 Wayne Lin 2021-02-09 8297 if (amdgpu_dm_is_valid_crc_source(cur_crc_src)) { 86bc221918925a Wayne Lin 2021-03-02 8298 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) d98af2725d42e8 Wayne Lin 2021-04-27 8299 if (amdgpu_dm_crc_window_is_activated(crtc)) { d98af2725d42e8 Wayne Lin 2021-04-27 8300 spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags); d98af2725d42e8 Wayne Lin 2021-04-27 8301 acrtc->dm_irq_params.crc_window.update_win = true; d98af2725d42e8 Wayne Lin 2021-04-27 8302 acrtc->dm_irq_params.crc_window.skip_frame_cnt = 2; d98af2725d42e8 Wayne Lin 2021-04-27 8303 spin_lock_irq(&crc_rd_wrk->crc_rd_work_lock); d98af2725d42e8 Wayne Lin 2021-04-27 8304 crc_rd_wrk->crtc = crtc; d98af2725d42e8 Wayne Lin 2021-04-27 8305 spin_unlock_irq(&crc_rd_wrk->crc_rd_work_lock); d98af2725d42e8 Wayne Lin 2021-04-27 8306 spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); d98af2725d42e8 Wayne Lin 2021-04-27 8307 } 86bc221918925a Wayne Lin 2021-03-02 8308 #endif bbc49fc0326be4 Wayne Lin 2021-04-28 8309 if (amdgpu_dm_crtc_configure_crc_source( bbc49fc0326be4 Wayne Lin 2021-04-28 8310 crtc, dm_new_crtc_state, cur_crc_src)) bbc49fc0326be4 Wayne Lin 2021-04-28 8311 DRM_DEBUG_DRIVER("Failed to configure crc source"); 8799c0be89ebb9 Yunxiang Li 2022-09-21 8312 } 24eb937416fde5 Rodrigo Siqueira 2021-01-07 8313 #endif 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8314 } 8fe684e97c86e3 Nicholas Kazlauskas 2020-07-13 8315 } e7b07ceef2a650 Harry Wentland 2017-08-10 8316 420cd472082697 David Francis 2019-03-01 @8317 for_each_new_crtc_in_state(state, crtc, new_crtc_state, j) 4d85f45c73a22b Daniel Vetter 2019-09-03 8318 if (new_crtc_state->async_flip) 420cd472082697 David Francis 2019-03-01 8319 wait_for_vblank = false; 420cd472082697 David Francis 2019-03-01 8320 e7b07ceef2a650 Harry Wentland 2017-08-10 8321 /* update planes when needed per crtc*/ 5cc6dcbd45a60b Leo (Sunpeng Li 2017-10-12 8322) for_each_new_crtc_in_state(state, crtc, new_crtc_state, j) { 54d76575246798 Leo (Sunpeng Li 2017-10-12 8323) dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); e7b07ceef2a650 Harry Wentland 2017-08-10 8324 54d76575246798 Leo (Sunpeng Li 2017-10-12 8325) if (dm_new_crtc_state->stream) eb3dc8978596a0 Nicholas Kazlauskas 2018-11-22 8326 amdgpu_dm_commit_planes(state, dc_state, dev, 420cd472082697 David Francis 2019-03-01 8327 dm, crtc, wait_for_vblank); e7b07ceef2a650 Harry Wentland 2017-08-10 8328 } e7b07ceef2a650 Harry Wentland 2017-08-10 8329 6ce8f316673f61 Nicholas Kazlauskas 2019-07-11 8330 /* Update audio instances for each connector. */ 6ce8f316673f61 Nicholas Kazlauskas 2019-07-11 @8331 amdgpu_dm_commit_audio(dev, state); 6ce8f316673f61 Nicholas Kazlauskas 2019-07-11 8332 7230362c78d441 Alex Deucher 2020-12-10 8333 /* restore the backlight level */ 7fd13baeb7a3a4 Alex Deucher 2021-07-08 8334 for (i = 0; i < dm->num_of_edps; i++) { 7fd13baeb7a3a4 Alex Deucher 2021-07-08 8335 if (dm->backlight_dev[i] && 4052287a75eb3f Shirish S 2022-03-11 8336 (dm->actual_brightness[i] != dm->brightness[i])) 7fd13baeb7a3a4 Alex Deucher 2021-07-08 8337 amdgpu_dm_backlight_set_level(dm, i, dm->brightness[i]); 7fd13baeb7a3a4 Alex Deucher 2021-07-08 8338 } 83a3439ddb28e1 Hans de Goede 2022-06-20 8339 e7b07ceef2a650 Harry Wentland 2017-08-10 8340 /* e7b07ceef2a650 Harry Wentland 2017-08-10 8341 * send vblank event on all events not handled in flip and e7b07ceef2a650 Harry Wentland 2017-08-10 8342 * mark consumed event for drm_atomic_helper_commit_hw_done e7b07ceef2a650 Harry Wentland 2017-08-10 8343 */ 4a580877bdcb83 Luben Tuikov 2020-08-24 @8344 spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags); 0bc9706db3a35b Leo (Sunpeng Li 2017-10-12 8345) for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { e7b07ceef2a650 Harry Wentland 2017-08-10 8346 0bc9706db3a35b Leo (Sunpeng Li 2017-10-12 8347) if (new_crtc_state->event) 0bc9706db3a35b Leo (Sunpeng Li 2017-10-12 8348) drm_send_event_locked(dev, &new_crtc_state->event->base); e7b07ceef2a650 Harry Wentland 2017-08-10 8349 0bc9706db3a35b Leo (Sunpeng Li 2017-10-12 8350) new_crtc_state->event = NULL; e7b07ceef2a650 Harry Wentland 2017-08-10 8351 } 4a580877bdcb83 Luben Tuikov 2020-08-24 @8352 spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); e7b07ceef2a650 Harry Wentland 2017-08-10 8353 29c8f23425e070 Leo Li 2019-01-07 8354 /* Signal HW programming completion */ 29c8f23425e070 Leo Li 2019-01-07 8355 drm_atomic_helper_commit_hw_done(state); e7b07ceef2a650 Harry Wentland 2017-08-10 8356 e7b07ceef2a650 Harry Wentland 2017-08-10 8357 if (wait_for_vblank) 320a127437e5d3 Andrey Grodzovsky 2017-11-14 8358 drm_atomic_helper_wait_for_flip_done(dev, state); e7b07ceef2a650 Harry Wentland 2017-08-10 8359 e7b07ceef2a650 Harry Wentland 2017-08-10 8360 drm_atomic_helper_cleanup_planes(dev, state); 97028037a38ae4 Lyude Paul 2018-06-04 8361 5f6fab247c7f20 Alex Deucher 2020-12-04 8362 /* return the stolen vga memory back to VRAM */ 5f6fab247c7f20 Alex Deucher 2020-12-04 8363 if (!adev->mman.keep_stolen_vga_memory) 5f6fab247c7f20 Alex Deucher 2020-12-04 8364 amdgpu_bo_free_kernel(&adev->mman.stolen_vga_memory, NULL, NULL); 5f6fab247c7f20 Alex Deucher 2020-12-04 8365 amdgpu_bo_free_kernel(&adev->mman.stolen_extended_memory, NULL, NULL); 5f6fab247c7f20 Alex Deucher 2020-12-04 8366 1f6010a96273c3 David Francis 2018-08-15 8367 /* 1f6010a96273c3 David Francis 2018-08-15 8368 * Finally, drop a runtime PM reference for each newly disabled CRTC, 97028037a38ae4 Lyude Paul 2018-06-04 8369 * so we can put the GPU into runtime suspend if we're not driving any 97028037a38ae4 Lyude Paul 2018-06-04 8370 * displays anymore 97028037a38ae4 Lyude Paul 2018-06-04 8371 */ fe2a19652918a5 Lyude Paul 2018-06-21 8372 for (i = 0; i < crtc_disable_count; i++) 97028037a38ae4 Lyude Paul 2018-06-04 8373 pm_runtime_put_autosuspend(dev->dev); fe2a19652918a5 Lyude Paul 2018-06-21 8374 pm_runtime_mark_last_busy(dev->dev); eb3dc8978596a0 Nicholas Kazlauskas 2018-11-22 8375 eb3dc8978596a0 Nicholas Kazlauskas 2018-11-22 8376 if (dc_state_temp) eb3dc8978596a0 Nicholas Kazlauskas 2018-11-22 8377 dc_release_state(dc_state_temp); e7b07ceef2a650 Harry Wentland 2017-08-10 8378 } e7b07ceef2a650 Harry Wentland 2017-08-10 8379 :::::: The code at line 8352 was first introduced by commit :::::: 4a580877bdcb837e7a3754ae20798dcfccb44e80 drm/amdgpu: Get DRM dev from adev by inline-f :::::: TO: Luben Tuikov :::::: CC: Alex Deucher -- 0-DAY CI Kernel Test Service https://01.org/lkp