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

drm/i915: Move icl+ nv12 plane register mangling into skl_universal_plane.c

Try to keep all the low level skl+ universal plane register
details inside skl_universal_plane.c instead of having them
sprinkled all over the place.

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-10-ville.syrjala@linux.intel.com

+41 -24
+6 -24
drivers/gpu/drm/i915/display/intel_display.c
··· 123 123 #include "intel_wm.h" 124 124 #include "skl_scaler.h" 125 125 #include "skl_universal_plane.h" 126 - #include "skl_universal_plane_regs.h" 127 126 #include "skl_watermark.h" 128 127 #include "vlv_dpio_phy_regs.h" 129 128 #include "vlv_dsi.h" ··· 4429 4430 crtc_state->rel_data_rate[y_plane->id] = crtc_state->rel_data_rate_y[uv_plane->id]; 4430 4431 4431 4432 /* Copy parameters to Y plane */ 4432 - y_plane_state->ctl = uv_plane_state->ctl | PLANE_CTL_YUV420_Y_PLANE; 4433 - y_plane_state->color_ctl = uv_plane_state->color_ctl; 4434 - y_plane_state->view = uv_plane_state->view; 4435 - y_plane_state->decrypt = uv_plane_state->decrypt; 4436 - 4437 4433 intel_plane_copy_hw_state(y_plane_state, uv_plane_state); 4438 4434 y_plane_state->uapi.src = uv_plane_state->uapi.src; 4439 4435 y_plane_state->uapi.dst = uv_plane_state->uapi.dst; 4440 4436 4441 - if (icl_is_hdr_plane(display, uv_plane->id)) { 4442 - switch (y_plane->id) { 4443 - case PLANE_7: 4444 - uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_7_ICL; 4445 - break; 4446 - case PLANE_6: 4447 - uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_6_ICL; 4448 - break; 4449 - case PLANE_5: 4450 - uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_5_RKL; 4451 - break; 4452 - case PLANE_4: 4453 - uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_4_RKL; 4454 - break; 4455 - default: 4456 - MISSING_CASE(y_plane->id); 4457 - } 4458 - } 4437 + y_plane_state->ctl = uv_plane_state->ctl; 4438 + y_plane_state->color_ctl = uv_plane_state->color_ctl; 4439 + y_plane_state->view = uv_plane_state->view; 4440 + y_plane_state->decrypt = uv_plane_state->decrypt; 4441 + 4442 + icl_link_nv12_planes(uv_plane_state, y_plane_state); 4459 4443 } 4460 4444 4461 4445 static void unlink_nv12_plane(struct intel_crtc_state *crtc_state,
+32
drivers/gpu/drm/i915/display/skl_universal_plane.c
··· 2327 2327 return 0; 2328 2328 } 2329 2329 2330 + void icl_link_nv12_planes(struct intel_plane_state *uv_plane_state, 2331 + struct intel_plane_state *y_plane_state) 2332 + { 2333 + struct intel_display *display = to_intel_display(uv_plane_state); 2334 + struct intel_plane *uv_plane = to_intel_plane(uv_plane_state->uapi.plane); 2335 + struct intel_plane *y_plane = to_intel_plane(y_plane_state->uapi.plane); 2336 + 2337 + drm_WARN_ON(display->drm, icl_is_nv12_y_plane(display, uv_plane->id)); 2338 + drm_WARN_ON(display->drm, !icl_is_nv12_y_plane(display, y_plane->id)); 2339 + 2340 + y_plane_state->ctl |= PLANE_CTL_YUV420_Y_PLANE; 2341 + 2342 + if (icl_is_hdr_plane(display, uv_plane->id)) { 2343 + switch (y_plane->id) { 2344 + case PLANE_7: 2345 + uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_7_ICL; 2346 + break; 2347 + case PLANE_6: 2348 + uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_6_ICL; 2349 + break; 2350 + case PLANE_5: 2351 + uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_5_RKL; 2352 + break; 2353 + case PLANE_4: 2354 + uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_4_RKL; 2355 + break; 2356 + default: 2357 + MISSING_CASE(y_plane->id); 2358 + } 2359 + } 2360 + } 2361 + 2330 2362 static enum intel_fbc_id skl_fbc_id_for_pipe(enum pipe pipe) 2331 2363 { 2332 2364 return pipe - PIPE_A + INTEL_FBC_A;
+3
drivers/gpu/drm/i915/display/skl_universal_plane.h
··· 32 32 int skl_calc_main_surface_offset(const struct intel_plane_state *plane_state, 33 33 int *x, int *y, u32 *offset); 34 34 35 + void icl_link_nv12_planes(struct intel_plane_state *uv_plane_state, 36 + struct intel_plane_state *y_plane_state); 37 + 35 38 bool icl_is_nv12_y_plane(struct intel_display *display, 36 39 enum plane_id plane_id); 37 40 u8 icl_hdr_plane_mask(void);