Skip to content

Commit 778be37

Browse files
committed
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
1 parent c324dbd commit 778be37

3 files changed

Lines changed: 41 additions & 24 deletions

File tree

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
#include "intel_wm.h"
124124
#include "skl_scaler.h"
125125
#include "skl_universal_plane.h"
126-
#include "skl_universal_plane_regs.h"
127126
#include "skl_watermark.h"
128127
#include "vlv_dpio_phy_regs.h"
129128
#include "vlv_dsi.h"
@@ -4430,33 +4429,16 @@ static void link_nv12_planes(struct intel_crtc_state *crtc_state,
44304429
crtc_state->rel_data_rate[y_plane->id] = crtc_state->rel_data_rate_y[uv_plane->id];
44314430

44324431
/* Copy parameters to Y plane */
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-
44384432
intel_plane_copy_hw_state(y_plane_state, uv_plane_state);
44394433
y_plane_state->uapi.src = uv_plane_state->uapi.src;
44404434
y_plane_state->uapi.dst = uv_plane_state->uapi.dst;
44414435

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-
}
4459-
}
4436+
y_plane_state->ctl = uv_plane_state->ctl;
4437+
y_plane_state->color_ctl = uv_plane_state->color_ctl;
4438+
y_plane_state->view = uv_plane_state->view;
4439+
y_plane_state->decrypt = uv_plane_state->decrypt;
4440+
4441+
icl_link_nv12_planes(uv_plane_state, y_plane_state);
44604442
}
44614443

44624444
static void unlink_nv12_plane(struct intel_crtc_state *crtc_state,

drivers/gpu/drm/i915/display/skl_universal_plane.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2327,6 +2327,38 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,
23272327
return 0;
23282328
}
23292329

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+
23302362
static enum intel_fbc_id skl_fbc_id_for_pipe(enum pipe pipe)
23312363
{
23322364
return pipe - PIPE_A + INTEL_FBC_A;

drivers/gpu/drm/i915/display/skl_universal_plane.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ int skl_format_to_fourcc(int format, bool rgb_order, bool alpha);
3232
int skl_calc_main_surface_offset(const struct intel_plane_state *plane_state,
3333
int *x, int *y, u32 *offset);
3434

35+
void icl_link_nv12_planes(struct intel_plane_state *uv_plane_state,
36+
struct intel_plane_state *y_plane_state);
37+
3538
bool icl_is_nv12_y_plane(struct intel_display *display,
3639
enum plane_id plane_id);
3740
u8 icl_hdr_plane_mask(void);

0 commit comments

Comments
 (0)