summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2025-02-12 18:43:29 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2025-02-15 09:29:18 +0200
commit778be378be2a0e0528dd1ea44ed3dc9804950fc3 (patch)
treef826e5564b553e114c3bc43c815c71157c2c3dce
parentc324dbd23149b86686b20a822c3fc75c9eddfff4 (diff)
downloadlinux-778be378be2a0e0528dd1ea44ed3dc9804950fc3.tar.gz
linux-778be378be2a0e0528dd1ea44ed3dc9804950fc3.zip
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
-rw-r--r--drivers/gpu/drm/i915/display/intel_display.c30
-rw-r--r--drivers/gpu/drm/i915/display/skl_universal_plane.c32
-rw-r--r--drivers/gpu/drm/i915/display/skl_universal_plane.h3
3 files changed, 41 insertions, 24 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index bb32c295667b..251fcce42694 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -123,7 +123,6 @@
#include "intel_wm.h"
#include "skl_scaler.h"
#include "skl_universal_plane.h"
-#include "skl_universal_plane_regs.h"
#include "skl_watermark.h"
#include "vlv_dpio_phy_regs.h"
#include "vlv_dsi.h"
@@ -4430,33 +4429,16 @@ static void link_nv12_planes(struct intel_crtc_state *crtc_state,
crtc_state->rel_data_rate[y_plane->id] = crtc_state->rel_data_rate_y[uv_plane->id];
/* Copy parameters to Y plane */
- y_plane_state->ctl = uv_plane_state->ctl | PLANE_CTL_YUV420_Y_PLANE;
- y_plane_state->color_ctl = uv_plane_state->color_ctl;
- y_plane_state->view = uv_plane_state->view;
- y_plane_state->decrypt = uv_plane_state->decrypt;
-
intel_plane_copy_hw_state(y_plane_state, uv_plane_state);
y_plane_state->uapi.src = uv_plane_state->uapi.src;
y_plane_state->uapi.dst = uv_plane_state->uapi.dst;
- if (icl_is_hdr_plane(display, uv_plane->id)) {
- switch (y_plane->id) {
- case PLANE_7:
- uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_7_ICL;
- break;
- case PLANE_6:
- uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_6_ICL;
- break;
- case PLANE_5:
- uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_5_RKL;
- break;
- case PLANE_4:
- uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_4_RKL;
- break;
- default:
- MISSING_CASE(y_plane->id);
- }
- }
+ y_plane_state->ctl = uv_plane_state->ctl;
+ y_plane_state->color_ctl = uv_plane_state->color_ctl;
+ y_plane_state->view = uv_plane_state->view;
+ y_plane_state->decrypt = uv_plane_state->decrypt;
+
+ icl_link_nv12_planes(uv_plane_state, y_plane_state);
}
static void unlink_nv12_plane(struct intel_crtc_state *crtc_state,
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 4b8732ae65aa..110f66dd5cf0 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -2327,6 +2327,38 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,
return 0;
}
+void icl_link_nv12_planes(struct intel_plane_state *uv_plane_state,
+ struct intel_plane_state *y_plane_state)
+{
+ struct intel_display *display = to_intel_display(uv_plane_state);
+ struct intel_plane *uv_plane = to_intel_plane(uv_plane_state->uapi.plane);
+ struct intel_plane *y_plane = to_intel_plane(y_plane_state->uapi.plane);
+
+ drm_WARN_ON(display->drm, icl_is_nv12_y_plane(display, uv_plane->id));
+ drm_WARN_ON(display->drm, !icl_is_nv12_y_plane(display, y_plane->id));
+
+ y_plane_state->ctl |= PLANE_CTL_YUV420_Y_PLANE;
+
+ if (icl_is_hdr_plane(display, uv_plane->id)) {
+ switch (y_plane->id) {
+ case PLANE_7:
+ uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_7_ICL;
+ break;
+ case PLANE_6:
+ uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_6_ICL;
+ break;
+ case PLANE_5:
+ uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_5_RKL;
+ break;
+ case PLANE_4:
+ uv_plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_4_RKL;
+ break;
+ default:
+ MISSING_CASE(y_plane->id);
+ }
+ }
+}
+
static enum intel_fbc_id skl_fbc_id_for_pipe(enum pipe pipe)
{
return pipe - PIPE_A + INTEL_FBC_A;
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.h b/drivers/gpu/drm/i915/display/skl_universal_plane.h
index 0ce240e9ca5a..5e2451c21eeb 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.h
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.h
@@ -32,6 +32,9 @@ int skl_format_to_fourcc(int format, bool rgb_order, bool alpha);
int skl_calc_main_surface_offset(const struct intel_plane_state *plane_state,
int *x, int *y, u32 *offset);
+void icl_link_nv12_planes(struct intel_plane_state *uv_plane_state,
+ struct intel_plane_state *y_plane_state);
+
bool icl_is_nv12_y_plane(struct intel_display *display,
enum plane_id plane_id);
u8 icl_hdr_plane_mask(void);