mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 22:14:36 -04:00
drm/i915: Convert skl_univeral_plane.c to struct intel_display
struct intel_display will replace struct drm_i915_private as the main thing for display code. Convert the skl+ universal plane code to use it. Note that we still have two straggles in the form on HAS_FLAT_CCS() and the pxp stuff. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250206185533.32306-11-ville.syrjala@linux.intel.com
This commit is contained in:
@@ -319,7 +319,7 @@ int intel_crtc_init(struct intel_display *display, enum pipe pipe)
|
||||
crtc->num_scalers = DISPLAY_RUNTIME_INFO(display)->num_scalers[pipe];
|
||||
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
primary = skl_universal_plane_create(dev_priv, pipe, PLANE_1);
|
||||
primary = skl_universal_plane_create(display, pipe, PLANE_1);
|
||||
else
|
||||
primary = intel_primary_plane_create(display, pipe);
|
||||
if (IS_ERR(primary)) {
|
||||
@@ -334,7 +334,7 @@ int intel_crtc_init(struct intel_display *display, enum pipe pipe)
|
||||
struct intel_plane *plane;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 9)
|
||||
plane = skl_universal_plane_create(dev_priv, pipe, PLANE_2 + sprite);
|
||||
plane = skl_universal_plane_create(display, pipe, PLANE_2 + sprite);
|
||||
else
|
||||
plane = intel_sprite_plane_create(display, pipe, sprite);
|
||||
if (IS_ERR(plane)) {
|
||||
|
||||
@@ -4438,6 +4438,7 @@ static int icl_add_linked_planes(struct intel_atomic_state *state)
|
||||
static int icl_check_nv12_planes(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
@@ -4479,7 +4480,7 @@ static int icl_check_nv12_planes(struct intel_atomic_state *state,
|
||||
continue;
|
||||
|
||||
for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, linked) {
|
||||
if (!icl_is_nv12_y_plane(dev_priv, linked->id))
|
||||
if (!icl_is_nv12_y_plane(display, linked->id))
|
||||
continue;
|
||||
|
||||
if (crtc_state->active_planes & BIT(linked->id))
|
||||
@@ -4524,7 +4525,7 @@ static int icl_check_nv12_planes(struct intel_atomic_state *state,
|
||||
linked_state->uapi.src = plane_state->uapi.src;
|
||||
linked_state->uapi.dst = plane_state->uapi.dst;
|
||||
|
||||
if (icl_is_hdr_plane(dev_priv, plane->id)) {
|
||||
if (icl_is_hdr_plane(display, plane->id)) {
|
||||
if (linked->id == PLANE_7)
|
||||
plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_7_ICL;
|
||||
else if (linked->id == PLANE_6)
|
||||
|
||||
@@ -279,14 +279,14 @@ int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state)
|
||||
int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
|
||||
struct intel_plane_state *plane_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane_state);
|
||||
struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
|
||||
struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
|
||||
struct drm_framebuffer *fb = plane_state->hw.fb;
|
||||
bool force_detach = !fb || !plane_state->uapi.visible;
|
||||
bool need_scaler = false;
|
||||
|
||||
/* Pre-gen11 and SDR planes always need a scaler for planar formats. */
|
||||
if (!icl_is_hdr_plane(dev_priv, plane->id) &&
|
||||
if (!icl_is_hdr_plane(display, plane->id) &&
|
||||
fb && intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier))
|
||||
need_scaler = true;
|
||||
|
||||
@@ -364,9 +364,7 @@ static int intel_atomic_setup_scaler(struct intel_crtc_state *crtc_state,
|
||||
int *scaler_id)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct intel_crtc_scaler_state *scaler_state =
|
||||
&crtc_state->scaler_state;
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state;
|
||||
u32 mode;
|
||||
int hscale = 0;
|
||||
int vscale = 0;
|
||||
@@ -386,7 +384,7 @@ static int intel_atomic_setup_scaler(struct intel_crtc_state *crtc_state,
|
||||
|
||||
if (DISPLAY_VER(display) == 9) {
|
||||
mode = SKL_PS_SCALER_MODE_NV12;
|
||||
} else if (icl_is_hdr_plane(dev_priv, plane->id)) {
|
||||
} else if (icl_is_hdr_plane(display, plane->id)) {
|
||||
/*
|
||||
* On gen11+'s HDR planes we only use the scaler for
|
||||
* scaling. They have a dedicated chroma upsampler, so
|
||||
@@ -782,7 +780,6 @@ skl_program_plane_scaler(struct intel_plane *plane,
|
||||
const struct intel_plane_state *plane_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
|
||||
const struct drm_framebuffer *fb = plane_state->hw.fb;
|
||||
enum pipe pipe = plane->pipe;
|
||||
int scaler_id = plane_state->scaler_id;
|
||||
@@ -806,7 +803,7 @@ skl_program_plane_scaler(struct intel_plane *plane,
|
||||
|
||||
/* TODO: handle sub-pixel coordinates */
|
||||
if (intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier) &&
|
||||
!icl_is_hdr_plane(dev_priv, plane->id)) {
|
||||
!icl_is_hdr_plane(display, plane->id)) {
|
||||
y_hphase = skl_scaler_calc_phase(1, hscale, false);
|
||||
y_vphase = skl_scaler_calc_phase(1, vscale, false);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,8 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_crtc;
|
||||
struct intel_display;
|
||||
struct intel_initial_plane_config;
|
||||
struct intel_plane_state;
|
||||
struct skl_ddb_entry;
|
||||
@@ -19,7 +19,7 @@ enum pipe;
|
||||
enum plane_id;
|
||||
|
||||
struct intel_plane *
|
||||
skl_universal_plane_create(struct drm_i915_private *dev_priv,
|
||||
skl_universal_plane_create(struct intel_display *display,
|
||||
enum pipe pipe, enum plane_id plane_id);
|
||||
|
||||
void skl_get_initial_plane_config(struct intel_crtc *crtc,
|
||||
@@ -32,10 +32,10 @@ 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);
|
||||
|
||||
bool icl_is_nv12_y_plane(struct drm_i915_private *dev_priv,
|
||||
bool icl_is_nv12_y_plane(struct intel_display *display,
|
||||
enum plane_id plane_id);
|
||||
u8 icl_hdr_plane_mask(void);
|
||||
bool icl_is_hdr_plane(struct drm_i915_private *dev_priv, enum plane_id plane_id);
|
||||
bool icl_is_hdr_plane(struct intel_display *display, enum plane_id plane_id);
|
||||
|
||||
u32 skl_plane_aux_dist(const struct intel_plane_state *plane_state,
|
||||
int color_plane);
|
||||
|
||||
Reference in New Issue
Block a user