<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div dir="ltr">
<div dir="ltr">Hi Dan,</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Sure I will add patch fix and suggested tags.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Regards,</div>
<div dir="ltr">Mitul</div>
<div id="ms-outlook-mobile-signature" dir="ltr">
<div></div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Dan Carpenter <dan.carpenter@linaro.org><br>
<b>Sent:</b> Wednesday, January 8, 2025 2:15:02 PM<br>
<b>To:</b> oe-kbuild@lists.linux.dev <oe-kbuild@lists.linux.dev>; Golani, Mitulkumar Ajitkumar <mitulkumar.ajitkumar.golani@intel.com>; intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org><br>
<b>Cc:</b> lkp <lkp@intel.com>; oe-kbuild-all@lists.linux.dev <oe-kbuild-all@lists.linux.dev>; intel-xe@lists.freedesktop.org <intel-xe@lists.freedesktop.org>; Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>; Nikula, Jani <jani.nikula@intel.com><br>
<b>Subject:</b> Re: [PATCH v3 3/5] drm/i915/scaler: Compute scaling factors for pipe scaler</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Mitul,<br>
<br>
kernel test robot noticed the following build warnings:<br>
<br>
<a href="https://git-scm.com/docs/git-format-patch#_base_tree_information]">https://git-scm.com/docs/git-format-patch#_base_tree_information]</a><br>
<br>
url: <a href="https://github.com/intel-lab-lkp/linux/commits/Mitul-Golani/drm-i915-scaler-Add-and-compute-scaling-factors/20250107-005708">
https://github.com/intel-lab-lkp/linux/commits/Mitul-Golani/drm-i915-scaler-Add-and-compute-scaling-factors/20250107-005708</a><br>
base: git://anongit.freedesktop.org/drm-intel for-linux-next<br>
patch link: <a href="https://lore.kernel.org/r/20250106165111.1672722-4-mitulkumar.ajitkumar.golani%40intel.com">
https://lore.kernel.org/r/20250106165111.1672722-4-mitulkumar.ajitkumar.golani%40intel.com</a><br>
patch subject: [PATCH v3 3/5] drm/i915/scaler: Compute scaling factors for pipe scaler<br>
config: x86_64-randconfig-161-20250107 (<a href="https://download.01.org/0day-ci/archive/20250108/202501080440.Cxe0ZHXJ-lkp@intel.com/config">https://download.01.org/0day-ci/archive/20250108/202501080440.Cxe0ZHXJ-lkp@intel.com/config</a>)<br>
compiler: clang version 19.1.3 (<a href=""></a>https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)<br>
<br>
If you fix the issue in a separate patch/commit (i.e. not just a new version of<br>
the same patch/commit), kindly add following tags<br>
| Reported-by: kernel test robot <lkp@intel.com><br>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org><br>
| Closes: <a href="https://lore.kernel.org/r/202501080440.Cxe0ZHXJ-lkp@intel.com/">
https://lore.kernel.org/r/202501080440.Cxe0ZHXJ-lkp@intel.com/</a><br>
<br>
smatch warnings:<br>
drivers/gpu/drm/i915/display/skl_scaler.c:451 intel_atomic_setup_scaler() error: uninitialized symbol 'hscale'.<br>
drivers/gpu/drm/i915/display/skl_scaler.c:452 intel_atomic_setup_scaler() error: uninitialized symbol 'vscale'.<br>
<br>
vim +/hscale +451 drivers/gpu/drm/i915/display/skl_scaler.c<br>
<br>
61e24d4de0edbc Mitul Golani 2025-01-06 312 static int intel_atomic_setup_scaler(struct intel_crtc_state *crtc_state,<br>
7488f64e89b02f Ville Syrjälä 2024-11-07 313 int num_scalers_need, struct intel_crtc *crtc,<br>
8976b18249407d Ville Syrjälä 2023-04-18 314 const char *name, int idx,<br>
8976b18249407d Ville Syrjälä 2023-04-18 315 struct intel_plane_state *plane_state,<br>
8976b18249407d Ville Syrjälä 2023-04-18 316 int *scaler_id)<br>
8976b18249407d Ville Syrjälä 2023-04-18 317 {<br>
3360d4d6d42ab3 Ville Syrjälä 2024-11-07 318 struct intel_display *display = to_intel_display(crtc);<br>
61e24d4de0edbc Mitul Golani 2025-01-06 319 struct intel_crtc_scaler_state *scaler_state =<br>
61e24d4de0edbc Mitul Golani 2025-01-06 320 &crtc_state->scaler_state;<br>
7488f64e89b02f Ville Syrjälä 2024-11-07 321 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);<br>
8976b18249407d Ville Syrjälä 2023-04-18 322 u32 mode;<br>
7c369018e87617 Mitul Golani 2025-01-06 323 int hscale, vscale;<br>
8976b18249407d Ville Syrjälä 2023-04-18 324 <br>
ecf2afc59c1ea3 Ville Syrjälä 2024-11-07 325 if (*scaler_id < 0)<br>
ecf2afc59c1ea3 Ville Syrjälä 2024-11-07 326 *scaler_id = intel_allocate_scaler(scaler_state, crtc);<br>
8976b18249407d Ville Syrjälä 2023-04-18 327 <br>
3360d4d6d42ab3 Ville Syrjälä 2024-11-07 328 if (drm_WARN(display->drm, *scaler_id < 0,<br>
8976b18249407d Ville Syrjälä 2023-04-18 329 "Cannot find scaler for %s:%d\n", name, idx))<br>
8976b18249407d Ville Syrjälä 2023-04-18 330 return -EINVAL;<br>
8976b18249407d Ville Syrjälä 2023-04-18 331 <br>
8976b18249407d Ville Syrjälä 2023-04-18 332 /* set scaler mode */<br>
8976b18249407d Ville Syrjälä 2023-04-18 333 if (plane_state && plane_state->hw.fb &&<br>
8976b18249407d Ville Syrjälä 2023-04-18 334 plane_state->hw.fb->format->is_yuv &&<br>
8976b18249407d Ville Syrjälä 2023-04-18 335 plane_state->hw.fb->format->num_planes > 1) {<br>
8976b18249407d Ville Syrjälä 2023-04-18 336 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);<br>
8976b18249407d Ville Syrjälä 2023-04-18 337 <br>
3360d4d6d42ab3 Ville Syrjälä 2024-11-07 338 if (DISPLAY_VER(display) == 9) {<br>
8976b18249407d Ville Syrjälä 2023-04-18 339 mode = SKL_PS_SCALER_MODE_NV12;<br>
8976b18249407d Ville Syrjälä 2023-04-18 340 } else if (icl_is_hdr_plane(dev_priv, plane->id)) {<br>
8976b18249407d Ville Syrjälä 2023-04-18 341 /*<br>
8976b18249407d Ville Syrjälä 2023-04-18 342 * On gen11+'s HDR planes we only use the scaler for<br>
8976b18249407d Ville Syrjälä 2023-04-18 343 * scaling. They have a dedicated chroma upsampler, so<br>
8976b18249407d Ville Syrjälä 2023-04-18 344 * we don't need the scaler to upsample the UV plane.<br>
8976b18249407d Ville Syrjälä 2023-04-18 345 */<br>
8976b18249407d Ville Syrjälä 2023-04-18 346 mode = PS_SCALER_MODE_NORMAL;<br>
8976b18249407d Ville Syrjälä 2023-04-18 347 } else {<br>
8976b18249407d Ville Syrjälä 2023-04-18 348 struct intel_plane *linked =<br>
8976b18249407d Ville Syrjälä 2023-04-18 349 plane_state->planar_linked_plane;<br>
8976b18249407d Ville Syrjälä 2023-04-18 350 <br>
8976b18249407d Ville Syrjälä 2023-04-18 351 mode = PS_SCALER_MODE_PLANAR;<br>
8976b18249407d Ville Syrjälä 2023-04-18 352 <br>
8976b18249407d Ville Syrjälä 2023-04-18 353 if (linked)<br>
ebb4e2b03acc3a Ville Syrjälä 2023-04-26 354 mode |= PS_BINDING_Y_PLANE(linked->id);<br>
8976b18249407d Ville Syrjälä 2023-04-18 355 }<br>
3360d4d6d42ab3 Ville Syrjälä 2024-11-07 356 } else if (DISPLAY_VER(display) >= 10) {<br>
8976b18249407d Ville Syrjälä 2023-04-18 357 mode = PS_SCALER_MODE_NORMAL;<br>
7488f64e89b02f Ville Syrjälä 2024-11-07 358 } else if (num_scalers_need == 1 && crtc->num_scalers > 1) {<br>
8976b18249407d Ville Syrjälä 2023-04-18 359 /*<br>
8976b18249407d Ville Syrjälä 2023-04-18 360 * when only 1 scaler is in use on a pipe with 2 scalers<br>
8976b18249407d Ville Syrjälä 2023-04-18 361 * scaler 0 operates in high quality (HQ) mode.<br>
8976b18249407d Ville Syrjälä 2023-04-18 362 * In this case use scaler 0 to take advantage of HQ mode<br>
8976b18249407d Ville Syrjälä 2023-04-18 363 */<br>
3de26c81e9ae4a Ville Syrjälä 2024-11-07 364 scaler_state->scalers[*scaler_id].in_use = false;<br>
8976b18249407d Ville Syrjälä 2023-04-18 365 *scaler_id = 0;<br>
3de26c81e9ae4a Ville Syrjälä 2024-11-07 366 scaler_state->scalers[0].in_use = true;<br>
8976b18249407d Ville Syrjälä 2023-04-18 367 mode = SKL_PS_SCALER_MODE_HQ;<br>
8976b18249407d Ville Syrjälä 2023-04-18 368 } else {<br>
8976b18249407d Ville Syrjälä 2023-04-18 369 mode = SKL_PS_SCALER_MODE_DYN;<br>
8976b18249407d Ville Syrjälä 2023-04-18 370 }<br>
8976b18249407d Ville Syrjälä 2023-04-18 371 <br>
8976b18249407d Ville Syrjälä 2023-04-18 372 if (plane_state && plane_state->hw.fb) {<br>
8976b18249407d Ville Syrjälä 2023-04-18 373 const struct drm_framebuffer *fb = plane_state->hw.fb;<br>
8976b18249407d Ville Syrjälä 2023-04-18 374 const struct drm_rect *src = &plane_state->uapi.src;<br>
8976b18249407d Ville Syrjälä 2023-04-18 375 const struct drm_rect *dst = &plane_state->uapi.dst;<br>
7c369018e87617 Mitul Golani 2025-01-06 376 int max_vscale, max_hscale;<br>
8976b18249407d Ville Syrjälä 2023-04-18 377 <br>
8976b18249407d Ville Syrjälä 2023-04-18 378 /*<br>
8976b18249407d Ville Syrjälä 2023-04-18 379 * FIXME: When two scalers are needed, but only one of<br>
8976b18249407d Ville Syrjälä 2023-04-18 380 * them needs to downscale, we should make sure that<br>
8976b18249407d Ville Syrjälä 2023-04-18 381 * the one that needs downscaling support is assigned<br>
8976b18249407d Ville Syrjälä 2023-04-18 382 * as the first scaler, so we don't reject downscaling<br>
8976b18249407d Ville Syrjälä 2023-04-18 383 * unnecessarily.<br>
8976b18249407d Ville Syrjälä 2023-04-18 384 */<br>
8976b18249407d Ville Syrjälä 2023-04-18 385 <br>
3360d4d6d42ab3 Ville Syrjälä 2024-11-07 386 if (DISPLAY_VER(display) >= 14) {<br>
8976b18249407d Ville Syrjälä 2023-04-18 387 /*<br>
8976b18249407d Ville Syrjälä 2023-04-18 388 * On versions 14 and up, only the first<br>
8976b18249407d Ville Syrjälä 2023-04-18 389 * scaler supports a vertical scaling factor<br>
8976b18249407d Ville Syrjälä 2023-04-18 390 * of more than 1.0, while a horizontal<br>
8976b18249407d Ville Syrjälä 2023-04-18 391 * scaling factor of 3.0 is supported.<br>
8976b18249407d Ville Syrjälä 2023-04-18 392 */<br>
8976b18249407d Ville Syrjälä 2023-04-18 393 max_hscale = 0x30000 - 1;<br>
8976b18249407d Ville Syrjälä 2023-04-18 394 if (*scaler_id == 0)<br>
8976b18249407d Ville Syrjälä 2023-04-18 395 max_vscale = 0x30000 - 1;<br>
8976b18249407d Ville Syrjälä 2023-04-18 396 else<br>
8976b18249407d Ville Syrjälä 2023-04-18 397 max_vscale = 0x10000;<br>
8976b18249407d Ville Syrjälä 2023-04-18 398 <br>
3360d4d6d42ab3 Ville Syrjälä 2024-11-07 399 } else if (DISPLAY_VER(display) >= 10 ||<br>
8976b18249407d Ville Syrjälä 2023-04-18 400 !intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier)) {<br>
8976b18249407d Ville Syrjälä 2023-04-18 401 max_hscale = 0x30000 - 1;<br>
8976b18249407d Ville Syrjälä 2023-04-18 402 max_vscale = 0x30000 - 1;<br>
8976b18249407d Ville Syrjälä 2023-04-18 403 } else {<br>
8976b18249407d Ville Syrjälä 2023-04-18 404 max_hscale = 0x20000 - 1;<br>
8976b18249407d Ville Syrjälä 2023-04-18 405 max_vscale = 0x20000 - 1;<br>
8976b18249407d Ville Syrjälä 2023-04-18 406 }<br>
8976b18249407d Ville Syrjälä 2023-04-18 407 <br>
8976b18249407d Ville Syrjälä 2023-04-18 408 /*<br>
8976b18249407d Ville Syrjälä 2023-04-18 409 * FIXME: We should change the if-else block above to<br>
8976b18249407d Ville Syrjälä 2023-04-18 410 * support HQ vs dynamic scaler properly.<br>
8976b18249407d Ville Syrjälä 2023-04-18 411 */<br>
8976b18249407d Ville Syrjälä 2023-04-18 412 <br>
8976b18249407d Ville Syrjälä 2023-04-18 413 /* Check if required scaling is within limits */<br>
8976b18249407d Ville Syrjälä 2023-04-18 414 hscale = drm_rect_calc_hscale(src, dst, 1, max_hscale);<br>
8976b18249407d Ville Syrjälä 2023-04-18 415 vscale = drm_rect_calc_vscale(src, dst, 1, max_vscale);<br>
8976b18249407d Ville Syrjälä 2023-04-18 416 <br>
8976b18249407d Ville Syrjälä 2023-04-18 417 if (hscale < 0 || vscale < 0) {<br>
3360d4d6d42ab3 Ville Syrjälä 2024-11-07 418 drm_dbg_kms(display->drm,<br>
8976b18249407d Ville Syrjälä 2023-04-18 419 "Scaler %d doesn't support required plane scaling\n",<br>
8976b18249407d Ville Syrjälä 2023-04-18 420 *scaler_id);<br>
8976b18249407d Ville Syrjälä 2023-04-18 421 drm_rect_debug_print("src: ", src, true);<br>
8976b18249407d Ville Syrjälä 2023-04-18 422 drm_rect_debug_print("dst: ", dst, false);<br>
8976b18249407d Ville Syrjälä 2023-04-18 423 <br>
8976b18249407d Ville Syrjälä 2023-04-18 424 return -EINVAL;<br>
8976b18249407d Ville Syrjälä 2023-04-18 425 }<br>
7c369018e87617 Mitul Golani 2025-01-06 426 }<br>
7c369018e87617 Mitul Golani 2025-01-06 427 <br>
7c369018e87617 Mitul Golani 2025-01-06 428 if (crtc_state->pch_pfit.enabled) {<br>
7c369018e87617 Mitul Golani 2025-01-06 429 struct drm_rect src;<br>
7c369018e87617 Mitul Golani 2025-01-06 430 <br>
7c369018e87617 Mitul Golani 2025-01-06 431 drm_rect_init(&src, 0, 0,<br>
7c369018e87617 Mitul Golani 2025-01-06 432 drm_rect_width(&crtc_state->pipe_src) << 16,<br>
7c369018e87617 Mitul Golani 2025-01-06 433 drm_rect_height(&crtc_state->pipe_src) << 16);<br>
7c369018e87617 Mitul Golani 2025-01-06 434 <br>
7c369018e87617 Mitul Golani 2025-01-06 435 hscale = drm_rect_calc_hscale(&src, &crtc_state->pch_pfit.dst,<br>
7c369018e87617 Mitul Golani 2025-01-06 436 0, INT_MAX);<br>
7c369018e87617 Mitul Golani 2025-01-06 437 vscale = drm_rect_calc_vscale(&src, &crtc_state->pch_pfit.dst,<br>
7c369018e87617 Mitul Golani 2025-01-06 438 0, INT_MAX);<br>
7c369018e87617 Mitul Golani 2025-01-06 439 <br>
7c369018e87617 Mitul Golani 2025-01-06 440 if (hscale < 0 || vscale < 0) {<br>
7c369018e87617 Mitul Golani 2025-01-06 441 drm_dbg_kms(display->drm,<br>
7c369018e87617 Mitul Golani 2025-01-06 442 "Scaler %d doesn't support required pipe scaling\n",<br>
7c369018e87617 Mitul Golani 2025-01-06 443 *scaler_id);<br>
7c369018e87617 Mitul Golani 2025-01-06 444 drm_rect_debug_print("src: ", &src, true);<br>
7c369018e87617 Mitul Golani 2025-01-06 445 drm_rect_debug_print("dst: ", &crtc_state->pch_pfit.dst, false);<br>
7c369018e87617 Mitul Golani 2025-01-06 446 <br>
7c369018e87617 Mitul Golani 2025-01-06 447 return -EINVAL;<br>
7c369018e87617 Mitul Golani 2025-01-06 448 }<br>
7c369018e87617 Mitul Golani 2025-01-06 449 }<br>
0641adb4624b5e Mitul Golani 2025-01-06 450 <br>
0641adb4624b5e Mitul Golani 2025-01-06 @451 scaler_state->scalers[*scaler_id].hscale = hscale;<br>
0641adb4624b5e Mitul Golani 2025-01-06 @452 scaler_state->scalers[*scaler_id].vscale = vscale;<br>
<br>
vscale and hscale are initialized if crtc_state->pch_pfit.enabled or<br>
plane_state->hw.fb is true, but otherwise they aren't.<br>
<br>
<br>
8976b18249407d Ville Syrjälä 2023-04-18 453 <br>
3360d4d6d42ab3 Ville Syrjälä 2024-11-07 454 drm_dbg_kms(display->drm, "Attached scaler id %u.%u to %s:%d\n",<br>
7488f64e89b02f Ville Syrjälä 2024-11-07 455 crtc->pipe, *scaler_id, name, idx);<br>
8976b18249407d Ville Syrjälä 2023-04-18 456 scaler_state->scalers[*scaler_id].mode = mode;<br>
8976b18249407d Ville Syrjälä 2023-04-18 457 <br>
8976b18249407d Ville Syrjälä 2023-04-18 458 return 0;<br>
8976b18249407d Ville Syrjälä 2023-04-18 459 }<br>
<br>
-- <br>
0-DAY CI Kernel Test Service<br>
<a href="https://github.com/intel/lkp-tests/wiki">https://github.com/intel/lkp-tests/wiki</a><br>
<br>
</div>
</span></font></div>
</body>
</html>