drivers/gpu/drm/i915/display/intel_crtc.c:333 __intel_crtc_init() warn: 'primary' can also be NULL
kernel test robot <[email protected]> Sun, 26 Jul 2026 21:02:25 +0800
| Newsgroups | dev.linux.lists.oe-kbuild |
|---|---|
| Message-ID | <[email protected]> |
BCC: [email protected] CC: [email protected] CC: [email protected] TO: Jani Nikula <[email protected]> CC: Chaitanya Kumar Borah <[email protected]> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = master head: 0ce37745d4bfbc493f718169c3974898ffec8ee7 commit: 668e88877a9ba73182ad686e871e8678a7dbca61 drm/i915/crtc: move crtc i= nitialization loop to intel_crtc.c date: 8 months ago :::::: branch date: 34 hours ago :::::: commit date: 8 months ago config: alpha-randconfig-r071-20260726 (https://download.01.org/0day-ci/arc= hive/20260726/[email protected]/config) compiler: alpha-linux-gcc (GCC) 10.5.0 smatch: v0.5.0-9187-g5189e3fb If you fix the issue in a separate patch/commit (i.e. not just a new versio= n of the same patch/commit), kindly add following tags | Fixes: 668e88877a9b ("drm/i915/crtc: move crtc initialization loop to int= el_crtc.c") | Reported-by: kernel test robot <[email protected]> | Reported-by: Dan Carpenter <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/ smatch warnings: drivers/gpu/drm/i915/display/intel_crtc.c:333 __intel_crtc_init() warn: 'pr= imary' can also be NULL drivers/gpu/drm/i915/display/intel_crtc.c:348 __intel_crtc_init() warn: 'pl= ane' can also be NULL vim +/primary +333 drivers/gpu/drm/i915/display/intel_crtc.c fbf756c31cca38 Dave Airlie 2021-01-14 310 =20 668e88877a9ba7 Jani Nikula 2025-12-04 311 static int __intel_crtc_init(= struct intel_display *display, enum pipe pipe) fbf756c31cca38 Dave Airlie 2021-01-14 312 { fbf756c31cca38 Dave Airlie 2021-01-14 313 struct intel_plane *primary,= *cursor; fbf756c31cca38 Dave Airlie 2021-01-14 314 const struct drm_crtc_funcs = *funcs; fbf756c31cca38 Dave Airlie 2021-01-14 315 struct intel_crtc *crtc; fbf756c31cca38 Dave Airlie 2021-01-14 316 int sprite, ret; fbf756c31cca38 Dave Airlie 2021-01-14 317 =20 fbf756c31cca38 Dave Airlie 2021-01-14 318 crtc =3D intel_crtc_alloc(); fbf756c31cca38 Dave Airlie 2021-01-14 319 if (IS_ERR(crtc)) fbf756c31cca38 Dave Airlie 2021-01-14 320 return PTR_ERR(crtc); fbf756c31cca38 Dave Airlie 2021-01-14 321 =20 fbf756c31cca38 Dave Airlie 2021-01-14 322 crtc->pipe =3D pipe; b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 323 crtc->num_scalers = =3D DISPLAY_RUNTIME_INFO(display)->num_scalers[pipe]; fbf756c31cca38 Dave Airlie 2021-01-14 324 =20 b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 325 if (DISPLAY_VER(di= splay) >=3D 9) a2ed9f84524795 Ville Syrj=C3=A4l=C3=A4 2025-02-06 326 primary =3D skl_u= niversal_plane_create(display, pipe, PLANE_1); 46d12f911821f7 Dave Airlie 2021-02-05 327 else 880ed2d84db9a1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 328 primary =3D intel= _primary_plane_create(display, pipe); fbf756c31cca38 Dave Airlie 2021-01-14 329 if (IS_ERR(primary)) { fbf756c31cca38 Dave Airlie 2021-01-14 330 ret =3D PTR_ERR(primary); fbf756c31cca38 Dave Airlie 2021-01-14 331 goto fail; fbf756c31cca38 Dave Airlie 2021-01-14 332 } fbf756c31cca38 Dave Airlie 2021-01-14 @333 crtc->plane_ids_mask |=3D BI= T(primary->id); fbf756c31cca38 Dave Airlie 2021-01-14 334 =20 f414bb4f717ad5 Jani Nikula 2025-02-12 335 intel_init_fifo_underrun_rep= orting(display, crtc, false); 66560f33059ebe Ville Syrj=C3=A4l=C3=A4 2023-01-25 336 =20 b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 337 for_each_sprite(di= splay, pipe, sprite) { fbf756c31cca38 Dave Airlie 2021-01-14 338 struct intel_plane *plane; fbf756c31cca38 Dave Airlie 2021-01-14 339 =20 a76a2be26df373 Jani Nikula 2025-05-06 340 if (DISPLAY_VER(display) >= =3D 9) a2ed9f84524795 Ville Syrj=C3=A4l=C3=A4 2025-02-06 341 plane =3D skl_un= iversal_plane_create(display, pipe, PLANE_2 + sprite); 46d12f911821f7 Dave Airlie 2021-02-05 342 else 9665025b57796f Ville Syrj=C3=A4l=C3=A4 2025-02-06 343 plane =3D intel_= sprite_plane_create(display, pipe, sprite); fbf756c31cca38 Dave Airlie 2021-01-14 344 if (IS_ERR(plane)) { fbf756c31cca38 Dave Airlie 2021-01-14 345 ret =3D PTR_ERR(plane); fbf756c31cca38 Dave Airlie 2021-01-14 346 goto fail; fbf756c31cca38 Dave Airlie 2021-01-14 347 } fbf756c31cca38 Dave Airlie 2021-01-14 @348 crtc->plane_ids_mask |=3D B= IT(plane->id); fbf756c31cca38 Dave Airlie 2021-01-14 349 } fbf756c31cca38 Dave Airlie 2021-01-14 350 =20 69e79a3a3208fb Ville Syrj=C3=A4l=C3=A4 2025-02-06 351 cursor =3D intel_c= ursor_plane_create(display, pipe); fbf756c31cca38 Dave Airlie 2021-01-14 352 if (IS_ERR(cursor)) { fbf756c31cca38 Dave Airlie 2021-01-14 353 ret =3D PTR_ERR(cursor); fbf756c31cca38 Dave Airlie 2021-01-14 354 goto fail; fbf756c31cca38 Dave Airlie 2021-01-14 355 } fbf756c31cca38 Dave Airlie 2021-01-14 356 crtc->plane_ids_mask |=3D BI= T(cursor->id); fbf756c31cca38 Dave Airlie 2021-01-14 357 =20 b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 358 if (HAS_GMCH(displ= ay)) { b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 359 if (display->plat= form.cherryview || b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 360 display->plat= form.valleyview || b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 361 display->plat= form.g4x) fbf756c31cca38 Dave Airlie 2021-01-14 362 funcs =3D &g4x_crtc_funcs; b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 363 else if (DISPLAY_= VER(display) =3D=3D 4) fbf756c31cca38 Dave Airlie 2021-01-14 364 funcs =3D &i965_crtc_funcs; b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 365 else if (display-= >platform.i945gm || b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 366 display->platfo= rm.i915gm) fbf756c31cca38 Dave Airlie 2021-01-14 367 funcs =3D &i915gm_crtc_fun= cs; b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 368 else if (DISPLAY_= VER(display) =3D=3D 3) fbf756c31cca38 Dave Airlie 2021-01-14 369 funcs =3D &i915_crtc_funcs; fbf756c31cca38 Dave Airlie 2021-01-14 370 else fbf756c31cca38 Dave Airlie 2021-01-14 371 funcs =3D &i8xx_crtc_funcs; fbf756c31cca38 Dave Airlie 2021-01-14 372 } else { b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 373 if (DISPLAY_VER(d= isplay) >=3D 8) fbf756c31cca38 Dave Airlie 2021-01-14 374 funcs =3D &bdw_crtc_funcs; fbf756c31cca38 Dave Airlie 2021-01-14 375 else fbf756c31cca38 Dave Airlie 2021-01-14 376 funcs =3D &ilk_crtc_funcs; fbf756c31cca38 Dave Airlie 2021-01-14 377 } fbf756c31cca38 Dave Airlie 2021-01-14 378 =20 b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 379 ret =3D drm_crtc_i= nit_with_planes(display->drm, &crtc->base, fbf756c31cca38 Dave Airlie 2021-01-14 380 &primary->base, &cursor-= >base, fbf756c31cca38 Dave Airlie 2021-01-14 381 funcs, "pipe %c", pipe_n= ame(pipe)); fbf756c31cca38 Dave Airlie 2021-01-14 382 if (ret) fbf756c31cca38 Dave Airlie 2021-01-14 383 goto fail; fbf756c31cca38 Dave Airlie 2021-01-14 384 =20 b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 385 if (DISPLAY_VER(di= splay) >=3D 11) fbf756c31cca38 Dave Airlie 2021-01-14 386 drm_crtc_create_scaling_fil= ter_property(&crtc->base, fbf756c31cca38 Dave Airlie 2021-01-14 387 BIT(DRM_SCALING_FILTER_= DEFAULT) | fbf756c31cca38 Dave Airlie 2021-01-14 388 BIT(DRM_SCALING_FILTER_= NEAREST_NEIGHBOR)); fbf756c31cca38 Dave Airlie 2021-01-14 389 =20 a2b1d9ecaa755c Ville Syrj=C3=A4l=C3=A4 2022-10-04 390 intel_color_crtc_i= nit(crtc); a2b1d9ecaa755c Ville Syrj=C3=A4l=C3=A4 2022-10-04 391 intel_drrs_crtc_in= it(crtc); fbf756c31cca38 Dave Airlie 2021-01-14 392 intel_crtc_crc_init(crtc); fbf756c31cca38 Dave Airlie 2021-01-14 393 =20 2bbc6fcaf8c58a Ville Syrj=C3=A4l=C3=A4 2021-10-21 394 cpu_latency_qos_ad= d_request(&crtc->vblank_pm_qos, PM_QOS_DEFAULT_VALUE); 2bbc6fcaf8c58a Ville Syrj=C3=A4l=C3=A4 2021-10-21 395 =20 b2479f7231d8b1 Ville Syrj=C3=A4l=C3=A4 2025-02-06 396 drm_WARN_ON(displa= y->drm, drm_crtc_index(&crtc->base) !=3D crtc->pipe); fbf756c31cca38 Dave Airlie 2021-01-14 397 =20 1552691f960a9e Nemesa Garg 2025-11-26 398 if (HAS_CASF(display) && crt= c->num_scalers >=3D 2) 7460b69f1d61e8 Nemesa Garg 2025-10-28 399 drm_crtc_create_sharpness_s= trength_property(&crtc->base); 7460b69f1d61e8 Nemesa Garg 2025-10-28 400 =20 fbf756c31cca38 Dave Airlie 2021-01-14 401 return 0; fbf756c31cca38 Dave Airlie 2021-01-14 402 =20 fbf756c31cca38 Dave Airlie 2021-01-14 403 fail: fbf756c31cca38 Dave Airlie 2021-01-14 404 intel_crtc_free(crtc); fbf756c31cca38 Dave Airlie 2021-01-14 405 =20 fbf756c31cca38 Dave Airlie 2021-01-14 406 return ret; fbf756c31cca38 Dave Airlie 2021-01-14 407 } d471008b00c1a0 Dave Airlie 2021-02-05 408 =20 :::::: The code at line 333 was first introduced by commit :::::: fbf756c31cca387510f4950bdd9704162e8196da drm/i915: refactor some crt= c code out of intel display. (v2) :::::: TO: Dave Airlie <[email protected]> :::::: CC: Jani Nikula <[email protected]> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki