Re: [PATCH] drm/msm: Avoid dirtyfb stalls on video mode displays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rob,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on drm-intel/for-linux-next drm-tip/drm-tip v5.17-rc5 next-20220223]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Rob-Clark/drm-msm-Avoid-dirtyfb-stalls-on-video-mode-displays/20220220-185344
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: mips-randconfig-r021-20220224 (https://download.01.org/0day-ci/archive/20220224/202202241211.iXHxUcF2-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
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 mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/0day-ci/linux/commit/e5d737074c502ff040a67f7fe1f8a9e2a308dec9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Rob-Clark/drm-msm-Avoid-dirtyfb-stalls-on-video-mode-displays/20220220-185344
        git checkout e5d737074c502ff040a67f7fe1f8a9e2a308dec9
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/gpu/drm/msm/

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

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/msm/msm_fb.c:47:27: warning: unused variable 'plane_state'
   struct drm_plane_state
   ^
   fatal error: error in backend: Nested variants found in inline asm string: ' .set push
   .set mips64r2
   .if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/atomic.h", .line = 156, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
   1: ll $1, $2 # atomic_fetch_sub
   subu $0, $1, $3
   sc $0, $2
   beqz $0, 1b
   .set pop
   move $0, $1
   '
   PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
   Stack dump:
   0. Program arguments: clang -Wp,-MMD,drivers/gpu/drm/msm/.msm_fb.o.d -nostdinc -Iarch/mips/include -I./arch/mips/include/generated -Iinclude -I./include -Iarch/mips/include/uapi -I./arch/mips/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -DVMLINUX_LOAD_ADDRESS=0xffffffff84000000 -DLINKER_LOAD_ADDRESS=0x84000000 -DDATAOFFSET=0 -Qunused-arguments -fmacro-prefix-map== -DKBUILD_EXTRA_WARN1 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 --target=mipsel-linux -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float -ffreestanding -EL -fno-stack-check -march=mips32 -Wa,--trap -DTOOLCHAIN_SUPPORTS_VIRT -Iarch/mips/include/asm/mach-ralink -Iarch/mips/include/asm/mach-ralink/mt7620 -Iarch/mips/include/asm/mach-generic -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-address-of-packed-member -Os -Wframe-larger-than=1024 -fno-stack-protector -Wimplicit-fallthrough -Wno-gnu -mno-global-merge -Wno-unused-but-set-variable -Wno-unused-const-variable -ftrivial-auto-var-init=pattern -fno-stack-clash-protection -pg -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wcast-function-type -Wno-array-bounds -fno-strict-overflow -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -Wextra -Wunused -Wno-unused-parameter -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wmissing-include-dirs -Wunused-but-set-variable -Wunused-const-variable -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -I drivers/gpu/drm/msm -I drivers/gpu/drm/msm/disp/dpu1 -I drivers/gpu/drm/msm -I ./drivers/gpu/drm/msm -ffunction-sections -fdata-sections -DKBUILD_MODFILE="drivers/gpu/drm/msm/msm" -DKBUILD_BASENAME="msm_fb" -DKBUILD_MODNAME="msm" -D__KBUILD_MODNAME=kmod_msm -c -o drivers/gpu/drm/msm/msm_fb.o drivers/gpu/drm/msm/msm_fb.c
   1. <eof> parser at end of file
   2. Code generation
   3. Running pass 'Function Pass Manager' on module 'drivers/gpu/drm/msm/msm_fb.c'.
   4. Running pass 'Mips Assembly Printer' on function '@msm_framebuffer_create'
   #0 0x000055e0318e4d7f Signals.cpp:0:0
   #1 0x000055e0318e2c5c llvm::sys::CleanupOnSignal(unsigned long) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x348ec5c)
   #2 0x000055e031822fd7 llvm::CrashRecoveryContext::HandleExit(int) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x33cefd7)
   #3 0x000055e0318db30e llvm::sys::Process::Exit(int, bool) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x348730e)
   #4 0x000055e02f506ccb (/opt/cross/clang-d271fc04d5/bin/clang-15+0x10b2ccb)
   #5 0x000055e031829a8c llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x33d5a8c)
   #6 0x000055e0325335c0 llvm::AsmPrinter::emitInlineAsm(llvm::MachineInstr const (/opt/cross/clang-d271fc04d5/bin/clang-15+0x40df5c0)
   #7 0x000055e03252f4f4 llvm::AsmPrinter::emitFunctionBody() (/opt/cross/clang-d271fc04d5/bin/clang-15+0x40db4f4)
   #8 0x000055e02ff70887 llvm::MipsAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x1b1c887)
   #9 0x000055e030c2d54d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.53) MachineFunctionPass.cpp:0:0
   #10 0x000055e031074807 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x2c20807)
   #11 0x000055e031074981 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x2c20981)
   #12 0x000055e0310754ff llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x2c214ff)
   #13 0x000055e031bff147 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x37ab147)
   #14 0x000055e03284d693 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x43f9693)
   #15 0x000055e0333286e9 clang::ParseAST(clang::Sema&, bool, bool) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x4ed46e9)
   #16 0x000055e03284c4cf clang::CodeGenAction::ExecuteAction() (/opt/cross/clang-d271fc04d5/bin/clang-15+0x43f84cf)
   #17 0x000055e03224f561 clang::FrontendAction::Execute() (/opt/cross/clang-d271fc04d5/bin/clang-15+0x3dfb561)
   #18 0x000055e0321e5faa clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x3d91faa)
   #19 0x000055e032313cbb (/opt/cross/clang-d271fc04d5/bin/clang-15+0x3ebfcbb)
   #20 0x000055e02f50827c cc1_main(llvm::ArrayRef<char char (/opt/cross/clang-d271fc04d5/bin/clang-15+0x10b427c)
   #21 0x000055e02f504f4b ExecuteCC1Tool(llvm::SmallVectorImpl<char driver.cpp:0:0
   #22 0x000055e03207ed95 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const::'lambda'()>(long) Job.cpp:0:0
   #23 0x000055e031822e93 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x33cee93)
   #24 0x000055e03207f68e clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const (.part.216) Job.cpp:0:0
   #25 0x000055e032054267 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const (/opt/cross/clang-d271fc04d5/bin/clang-15+0x3c00267)
   #26 0x000055e032054c47 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) const (/opt/cross/clang-d271fc04d5/bin/clang-15+0x3c00c47)
   #27 0x000055e03205e2f9 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) (/opt/cross/clang-d271fc04d5/bin/clang-15+0x3c0a2f9)
   #28 0x000055e02f42d63f main (/opt/cross/clang-d271fc04d5/bin/clang-15+0xfd963f)
   #29 0x00007f8e07c7ed0a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d0a)
   #30 0x000055e02f504a6a _start (/opt/cross/clang-d271fc04d5/bin/clang-15+0x10b0a6a)
   clang-15: error: clang frontend command failed with exit code 70 (use -v to see invocation)
   clang version 15.0.0 (git://gitmirror/llvm_project d271fc04d5b97b12e6b797c6067d3c96a8d7470e)
   Target: mipsel-unknown-linux
   Thread model: posix
   InstalledDir: /opt/cross/clang-d271fc04d5/bin
   clang-15: note: diagnostic msg:
   Makefile arch drivers fs include kernel nr_bisected scripts source usr


vim +/plane_state +47 drivers/gpu/drm/msm/msm_fb.c

    23	
    24	static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
    25			const struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos);
    26	
    27	static int msm_framebuffer_dirtyfb(struct drm_framebuffer *fb,
    28					   struct drm_file *file_priv, unsigned int flags,
    29					   unsigned int color, struct drm_clip_rect *clips,
    30					   unsigned int num_clips)
    31	{
    32		struct msm_drm_private *priv = fb->dev->dev_private;
    33		struct drm_modeset_acquire_ctx ctx;
    34		struct drm_plane *plane;
    35		bool needs_flush = false;
    36		int ret = 0;
    37	
    38		/*
    39		 * When called from ioctl, we are interruptible, but not when called
    40		 * internally (ie. defio worker)
    41		 */
    42		drm_modeset_acquire_init(&ctx,
    43			file_priv ? DRM_MODESET_ACQUIRE_INTERRUPTIBLE : 0);
    44	
    45	retry:
    46		drm_for_each_plane(plane, fb->dev) {
  > 47			struct drm_plane_state *plane_state;
    48			struct drm_crtc *crtc;
    49	
    50			ret = drm_modeset_lock(&plane->mutex, &ctx);
    51			if (ret)
    52				goto out;
    53	
    54			if (plane->state->fb != fb) {
    55				drm_modeset_unlock(&plane->mutex);
    56				continue;
    57			}
    58	
    59			crtc = plane->state->crtc;
    60	
    61			ret = drm_modeset_lock(&crtc->mutex, &ctx);
    62			if (ret)
    63				goto out;
    64	
    65			if (priv->kms->funcs->needs_dirtyfb(crtc)) {
    66				needs_flush = true;
    67				break;
    68			}
    69		}
    70	
    71	out:
    72		if (ret == -EDEADLK) {
    73			ret = drm_modeset_backoff(&ctx);
    74			if (!ret)
    75				goto retry;
    76		}
    77	
    78		drm_modeset_drop_locks(&ctx);
    79		drm_modeset_acquire_fini(&ctx);
    80	
    81		if (needs_flush) {
    82			ret = drm_atomic_helper_dirtyfb(fb, file_priv, flags,
    83							color, clips, num_clips);
    84		}
    85	
    86		return ret;
    87	}
    88	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux