Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Rename the variables in icl_check_nv12_planes()

All the this generic 'plane' vs 'linked' stuff is hard to
follow. Rename the variables to use the y_plane vs. uv_plane
terminology to make it clear which is which.

v2: Rebase due to intel_display changes

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250212164330.16891-9-ville.syrjala@linux.intel.com

+54 -45
+54 -45
drivers/gpu/drm/i915/display/intel_display.c
··· 4406 4406 } 4407 4407 4408 4408 static void link_nv12_planes(struct intel_crtc_state *crtc_state, 4409 - struct intel_plane_state *plane_state, 4410 - struct intel_plane_state *linked_state) 4409 + struct intel_plane_state *uv_plane_state, 4410 + struct intel_plane_state *y_plane_state) 4411 4411 { 4412 - struct intel_display *display = to_intel_display(plane_state); 4413 - struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); 4414 - struct intel_plane *linked = to_intel_plane(linked_state->uapi.plane); 4412 + struct intel_display *display = to_intel_display(uv_plane_state); 4413 + struct intel_plane *uv_plane = to_intel_plane(uv_plane_state->uapi.plane); 4414 + struct intel_plane *y_plane = to_intel_plane(y_plane_state->uapi.plane); 4415 4415 4416 4416 drm_dbg_kms(display->drm, "UV plane [PLANE:%d:%s] using Y plane [PLANE:%d:%s]\n", 4417 - plane->base.base.id, plane->base.name, 4418 - linked->base.base.id, linked->base.name); 4417 + uv_plane->base.base.id, uv_plane->base.name, 4418 + y_plane->base.base.id, y_plane->base.name); 4419 4419 4420 - plane_state->planar_linked_plane = linked; 4420 + uv_plane_state->planar_linked_plane = y_plane; 4421 4421 4422 - linked_state->is_y_plane = true; 4423 - linked_state->planar_linked_plane = plane; 4422 + y_plane_state->is_y_plane = true; 4423 + y_plane_state->planar_linked_plane = uv_plane; 4424 4424 4425 - crtc_state->enabled_planes |= BIT(linked->id); 4426 - crtc_state->active_planes |= BIT(linked->id); 4427 - crtc_state->update_planes |= BIT(linked->id); 4425 + crtc_state->enabled_planes |= BIT(y_plane->id); 4426 + crtc_state->active_planes |= BIT(y_plane->id); 4427 + crtc_state->update_planes |= BIT(y_plane->id); 4428 4428 4429 - crtc_state->data_rate[linked->id] = crtc_state->data_rate_y[plane->id]; 4430 - crtc_state->rel_data_rate[linked->id] = crtc_state->rel_data_rate_y[plane->id]; 4429 + crtc_state->data_rate[y_plane->id] = crtc_state->data_rate_y[uv_plane->id]; 4430 + crtc_state->rel_data_rate[y_plane->id] = crtc_state->rel_data_rate_y[uv_plane->id]; 4431 4431 4432 4432 /* Copy parameters to Y plane */ 4433 - linked_state->ctl = plane_state->ctl | PLANE_CTL_YUV420_Y_PLANE; 4434 - linked_state->color_ctl = plane_state->color_ctl; 4435 - linked_state->view = plane_state->view; 4436 - linked_state->decrypt = plane_state->decrypt; 4433 + y_plane_state->ctl = uv_plane_state->ctl | PLANE_CTL_YUV420_Y_PLANE; 4434 + y_plane_state->color_ctl = uv_plane_state->color_ctl; 4435 + y_plane_state->view = uv_plane_state->view; 4436 + y_plane_state->decrypt = uv_plane_state->decrypt; 4437 4437 4438 - intel_plane_copy_hw_state(linked_state, plane_state); 4439 - linked_state->uapi.src = plane_state->uapi.src; 4440 - linked_state->uapi.dst = plane_state->uapi.dst; 4438 + intel_plane_copy_hw_state(y_plane_state, uv_plane_state); 4439 + y_plane_state->uapi.src = uv_plane_state->uapi.src; 4440 + y_plane_state->uapi.dst = uv_plane_state->uapi.dst; 4441 4441 4442 - if (icl_is_hdr_plane(display, plane->id)) { 4443 - if (linked->id == PLANE_7) 4444 - plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_7_ICL; 4445 - else if (linked->id == PLANE_6) 4446 - plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_6_ICL; 4447 - else if (linked->id == PLANE_5) 4448 - plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_5_RKL; 4449 - else if (linked->id == PLANE_4) 4450 - plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_4_RKL; 4451 - else 4452 - MISSING_CASE(linked->id); 4442 + if (icl_is_hdr_plane(display, uv_plane->id)) { 4443 + switch (y_plane->id) { 4444 + case PLANE_7: 4445 + uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_7_ICL; 4446 + break; 4447 + case PLANE_6: 4448 + uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_6_ICL; 4449 + break; 4450 + case PLANE_5: 4451 + uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_5_RKL; 4452 + break; 4453 + case PLANE_4: 4454 + uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_4_RKL; 4455 + break; 4456 + default: 4457 + MISSING_CASE(y_plane->id); 4458 + } 4453 4459 } 4454 4460 } 4455 4461 ··· 4488 4482 struct drm_i915_private *dev_priv = to_i915(state->base.dev); 4489 4483 struct intel_crtc_state *crtc_state = 4490 4484 intel_atomic_get_new_crtc_state(state, crtc); 4491 - struct intel_plane *plane, *linked; 4492 4485 struct intel_plane_state *plane_state; 4486 + struct intel_plane *plane; 4493 4487 int i; 4494 4488 4495 4489 if (DISPLAY_VER(dev_priv) < 11) ··· 4511 4505 return 0; 4512 4506 4513 4507 for_each_new_intel_plane_in_state(state, plane, plane_state, i) { 4514 - struct intel_plane_state *linked_state = NULL; 4508 + struct intel_plane_state *y_plane_state = NULL; 4509 + struct intel_plane *y_plane; 4515 4510 4516 - if (plane->pipe != crtc->pipe || 4517 - !(crtc_state->nv12_planes & BIT(plane->id))) 4511 + if (plane->pipe != crtc->pipe) 4518 4512 continue; 4519 4513 4520 - for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, linked) { 4521 - if (!icl_is_nv12_y_plane(display, linked->id)) 4514 + if ((crtc_state->nv12_planes & BIT(plane->id)) == 0) 4515 + continue; 4516 + 4517 + for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, y_plane) { 4518 + if (!icl_is_nv12_y_plane(display, y_plane->id)) 4522 4519 continue; 4523 4520 4524 - if (crtc_state->active_planes & BIT(linked->id)) 4521 + if (crtc_state->active_planes & BIT(y_plane->id)) 4525 4522 continue; 4526 4523 4527 - linked_state = intel_atomic_get_plane_state(state, linked); 4528 - if (IS_ERR(linked_state)) 4529 - return PTR_ERR(linked_state); 4524 + y_plane_state = intel_atomic_get_plane_state(state, y_plane); 4525 + if (IS_ERR(y_plane_state)) 4526 + return PTR_ERR(y_plane_state); 4530 4527 4531 4528 break; 4532 4529 } 4533 4530 4534 - if (!linked_state) { 4531 + if (!y_plane_state) { 4535 4532 drm_dbg_kms(&dev_priv->drm, 4536 4533 "[CRTC:%d:%s] need %d free Y planes for planar YUV\n", 4537 4534 crtc->base.base.id, crtc->base.name, ··· 4542 4533 return -EINVAL; 4543 4534 } 4544 4535 4545 - link_nv12_planes(crtc_state, plane_state, linked_state); 4536 + link_nv12_planes(crtc_state, plane_state, y_plane_state); 4546 4537 } 4547 4538 4548 4539 return 0;