Commit 7b3cb17a authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/i915: Perform automated conversions for plane uapi/hw split, base -> hw.

Split up plane_state->base to hw. This is done using the following patch:

@@
struct intel_plane_state *T;
identifier x =~ "^(crtc|fb|alpha|pixel_blend_mode|rotation|color_encoding|color_range)$";
@@
-T->base.x
+T->hw.x
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191031112610.27608-9-maarten.lankhorst@linux.intel.com
parent a456f65f
...@@ -283,9 +283,9 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta ...@@ -283,9 +283,9 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta
return; return;
/* set scaler mode */ /* set scaler mode */
if (plane_state && plane_state->base.fb && if (plane_state && plane_state->hw.fb &&
plane_state->base.fb->format->is_yuv && plane_state->hw.fb->format->is_yuv &&
plane_state->base.fb->format->num_planes > 1) { plane_state->hw.fb->format->num_planes > 1) {
struct intel_plane *plane = to_intel_plane(plane_state->base.plane); struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
if (IS_GEN(dev_priv, 9) && if (IS_GEN(dev_priv, 9) &&
!IS_GEMINILAKE(dev_priv)) { !IS_GEMINILAKE(dev_priv)) {
......
...@@ -118,7 +118,7 @@ intel_plane_destroy_state(struct drm_plane *plane, ...@@ -118,7 +118,7 @@ intel_plane_destroy_state(struct drm_plane *plane,
unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state, unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state) const struct intel_plane_state *plane_state)
{ {
const struct drm_framebuffer *fb = plane_state->base.fb; const struct drm_framebuffer *fb = plane_state->hw.fb;
unsigned int cpp; unsigned int cpp;
if (!plane_state->base.visible) if (!plane_state->base.visible)
...@@ -144,7 +144,7 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state, ...@@ -144,7 +144,7 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state,
struct drm_i915_private *dev_priv = to_i915(plane->base.dev); struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
const struct intel_plane_state *plane_state = const struct intel_plane_state *plane_state =
intel_atomic_get_new_plane_state(state, plane); intel_atomic_get_new_plane_state(state, plane);
struct intel_crtc *crtc = to_intel_crtc(plane_state->base.crtc); struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc);
struct intel_crtc_state *crtc_state; struct intel_crtc_state *crtc_state;
if (!plane_state->base.visible || !plane->min_cdclk) if (!plane_state->base.visible || !plane->min_cdclk)
...@@ -182,7 +182,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ ...@@ -182,7 +182,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
struct intel_plane_state *new_plane_state) struct intel_plane_state *new_plane_state)
{ {
struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane); struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane);
const struct drm_framebuffer *fb = new_plane_state->base.fb; const struct drm_framebuffer *fb = new_plane_state->hw.fb;
int ret; int ret;
new_crtc_state->active_planes &= ~BIT(plane->id); new_crtc_state->active_planes &= ~BIT(plane->id);
...@@ -192,7 +192,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ ...@@ -192,7 +192,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
new_crtc_state->min_cdclk[plane->id] = 0; new_crtc_state->min_cdclk[plane->id] = 0;
new_plane_state->base.visible = false; new_plane_state->base.visible = false;
if (!new_plane_state->base.crtc && !old_plane_state->base.crtc) if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc)
return 0; return 0;
ret = plane->check_plane(new_crtc_state, new_plane_state); ret = plane->check_plane(new_crtc_state, new_plane_state);
......
...@@ -662,7 +662,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, ...@@ -662,7 +662,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc,
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
struct intel_fbc *fbc = &dev_priv->fbc; struct intel_fbc *fbc = &dev_priv->fbc;
struct intel_fbc_state_cache *cache = &fbc->state_cache; struct intel_fbc_state_cache *cache = &fbc->state_cache;
struct drm_framebuffer *fb = plane_state->base.fb; struct drm_framebuffer *fb = plane_state->hw.fb;
cache->vma = NULL; cache->vma = NULL;
cache->flags = 0; cache->flags = 0;
...@@ -671,7 +671,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, ...@@ -671,7 +671,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc,
if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
cache->crtc.hsw_bdw_pixel_rate = crtc_state->pixel_rate; cache->crtc.hsw_bdw_pixel_rate = crtc_state->pixel_rate;
cache->plane.rotation = plane_state->base.rotation; cache->plane.rotation = plane_state->hw.rotation;
/* /*
* Src coordinates are already rotated by 270 degrees for * Src coordinates are already rotated by 270 degrees for
* the 90/270 degree plane rotation cases (to match the * the 90/270 degree plane rotation cases (to match the
...@@ -684,7 +684,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, ...@@ -684,7 +684,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc,
cache->plane.adjusted_y = plane_state->color_plane[0].y; cache->plane.adjusted_y = plane_state->color_plane[0].y;
cache->plane.y = plane_state->base.src.y1 >> 16; cache->plane.y = plane_state->base.src.y1 >> 16;
cache->plane.pixel_blend_mode = plane_state->base.pixel_blend_mode; cache->plane.pixel_blend_mode = plane_state->hw.pixel_blend_mode;
if (!cache->plane.visible) if (!cache->plane.visible)
return; return;
...@@ -1047,7 +1047,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv, ...@@ -1047,7 +1047,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
* to pipe or plane A. */ * to pipe or plane A. */
for_each_new_intel_plane_in_state(state, plane, plane_state, i) { for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
struct intel_crtc_state *crtc_state; struct intel_crtc_state *crtc_state;
struct intel_crtc *crtc = to_intel_crtc(plane_state->base.crtc); struct intel_crtc *crtc = to_intel_crtc(plane_state->hw.crtc);
if (!plane->has_fbc) if (!plane->has_fbc)
continue; continue;
......
...@@ -669,7 +669,7 @@ static void update_colorkey(struct intel_overlay *overlay, ...@@ -669,7 +669,7 @@ static void update_colorkey(struct intel_overlay *overlay,
flags |= DST_KEY_ENABLE; flags |= DST_KEY_ENABLE;
if (state->base.visible) if (state->base.visible)
format = state->base.fb->format->format; format = state->hw.fb->format->format;
switch (format) { switch (format) {
case DRM_FORMAT_C8: case DRM_FORMAT_C8:
......
This diff is collapsed.
...@@ -801,7 +801,7 @@ static bool intel_wm_plane_visible(const struct intel_crtc_state *crtc_state, ...@@ -801,7 +801,7 @@ static bool intel_wm_plane_visible(const struct intel_crtc_state *crtc_state,
* around this problem with the watermark code. * around this problem with the watermark code.
*/ */
if (plane->id == PLANE_CURSOR) if (plane->id == PLANE_CURSOR)
return plane_state->base.fb != NULL; return plane_state->hw.fb != NULL;
else else
return plane_state->base.visible; return plane_state->base.visible;
} }
...@@ -1088,7 +1088,7 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state, ...@@ -1088,7 +1088,7 @@ static u16 g4x_compute_wm(const struct intel_crtc_state *crtc_state,
if (!intel_wm_plane_visible(crtc_state, plane_state)) if (!intel_wm_plane_visible(crtc_state, plane_state))
return 0; return 0;
cpp = plane_state->base.fb->format->cpp[0]; cpp = plane_state->hw.fb->format->cpp[0];
/* /*
* Not 100% sure which way ELK should go here as the * Not 100% sure which way ELK should go here as the
...@@ -1308,8 +1308,8 @@ static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state) ...@@ -1308,8 +1308,8 @@ static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
for_each_oldnew_intel_plane_in_state(state, plane, for_each_oldnew_intel_plane_in_state(state, plane,
old_plane_state, old_plane_state,
new_plane_state, i) { new_plane_state, i) {
if (new_plane_state->base.crtc != &crtc->base && if (new_plane_state->hw.crtc != &crtc->base &&
old_plane_state->base.crtc != &crtc->base) old_plane_state->hw.crtc != &crtc->base)
continue; continue;
if (g4x_raw_plane_wm_compute(crtc_state, new_plane_state)) if (g4x_raw_plane_wm_compute(crtc_state, new_plane_state))
...@@ -1593,7 +1593,7 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state, ...@@ -1593,7 +1593,7 @@ static u16 vlv_compute_wm_level(const struct intel_crtc_state *crtc_state,
if (!intel_wm_plane_visible(crtc_state, plane_state)) if (!intel_wm_plane_visible(crtc_state, plane_state))
return 0; return 0;
cpp = plane_state->base.fb->format->cpp[0]; cpp = plane_state->hw.fb->format->cpp[0];
clock = adjusted_mode->crtc_clock; clock = adjusted_mode->crtc_clock;
htotal = adjusted_mode->crtc_htotal; htotal = adjusted_mode->crtc_htotal;
width = crtc_state->pipe_src_w; width = crtc_state->pipe_src_w;
...@@ -1829,8 +1829,8 @@ static int vlv_compute_pipe_wm(struct intel_crtc_state *crtc_state) ...@@ -1829,8 +1829,8 @@ static int vlv_compute_pipe_wm(struct intel_crtc_state *crtc_state)
for_each_oldnew_intel_plane_in_state(state, plane, for_each_oldnew_intel_plane_in_state(state, plane,
old_plane_state, old_plane_state,
new_plane_state, i) { new_plane_state, i) {
if (new_plane_state->base.crtc != &crtc->base && if (new_plane_state->hw.crtc != &crtc->base &&
old_plane_state->base.crtc != &crtc->base) old_plane_state->hw.crtc != &crtc->base)
continue; continue;
if (vlv_raw_plane_wm_compute(crtc_state, new_plane_state)) if (vlv_raw_plane_wm_compute(crtc_state, new_plane_state))
...@@ -2475,7 +2475,7 @@ static u32 ilk_compute_pri_wm(const struct intel_crtc_state *crtc_state, ...@@ -2475,7 +2475,7 @@ static u32 ilk_compute_pri_wm(const struct intel_crtc_state *crtc_state,
if (!intel_wm_plane_visible(crtc_state, plane_state)) if (!intel_wm_plane_visible(crtc_state, plane_state))
return 0; return 0;
cpp = plane_state->base.fb->format->cpp[0]; cpp = plane_state->hw.fb->format->cpp[0];
method1 = ilk_wm_method1(crtc_state->pixel_rate, cpp, mem_value); method1 = ilk_wm_method1(crtc_state->pixel_rate, cpp, mem_value);
...@@ -2507,7 +2507,7 @@ static u32 ilk_compute_spr_wm(const struct intel_crtc_state *crtc_state, ...@@ -2507,7 +2507,7 @@ static u32 ilk_compute_spr_wm(const struct intel_crtc_state *crtc_state,
if (!intel_wm_plane_visible(crtc_state, plane_state)) if (!intel_wm_plane_visible(crtc_state, plane_state))
return 0; return 0;
cpp = plane_state->base.fb->format->cpp[0]; cpp = plane_state->hw.fb->format->cpp[0];
method1 = ilk_wm_method1(crtc_state->pixel_rate, cpp, mem_value); method1 = ilk_wm_method1(crtc_state->pixel_rate, cpp, mem_value);
method2 = ilk_wm_method2(crtc_state->pixel_rate, method2 = ilk_wm_method2(crtc_state->pixel_rate,
...@@ -2533,7 +2533,7 @@ static u32 ilk_compute_cur_wm(const struct intel_crtc_state *crtc_state, ...@@ -2533,7 +2533,7 @@ static u32 ilk_compute_cur_wm(const struct intel_crtc_state *crtc_state,
if (!intel_wm_plane_visible(crtc_state, plane_state)) if (!intel_wm_plane_visible(crtc_state, plane_state))
return 0; return 0;
cpp = plane_state->base.fb->format->cpp[0]; cpp = plane_state->hw.fb->format->cpp[0];
return ilk_wm_method2(crtc_state->pixel_rate, return ilk_wm_method2(crtc_state->pixel_rate,
crtc_state->hw.adjusted_mode.crtc_htotal, crtc_state->hw.adjusted_mode.crtc_htotal,
...@@ -2551,7 +2551,7 @@ static u32 ilk_compute_fbc_wm(const struct intel_crtc_state *crtc_state, ...@@ -2551,7 +2551,7 @@ static u32 ilk_compute_fbc_wm(const struct intel_crtc_state *crtc_state,
if (!intel_wm_plane_visible(crtc_state, plane_state)) if (!intel_wm_plane_visible(crtc_state, plane_state))
return 0; return 0;
cpp = plane_state->base.fb->format->cpp[0]; cpp = plane_state->hw.fb->format->cpp[0];
return ilk_wm_fbc(pri_val, drm_rect_width(&plane_state->base.dst), cpp); return ilk_wm_fbc(pri_val, drm_rect_width(&plane_state->base.dst), cpp);
} }
...@@ -4091,7 +4091,7 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *crtc_state, ...@@ -4091,7 +4091,7 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *crtc_state,
int color_plane) int color_plane)
{ {
struct intel_plane *plane = to_intel_plane(plane_state->base.plane); struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
const struct drm_framebuffer *fb = plane_state->base.fb; const struct drm_framebuffer *fb = plane_state->hw.fb;
u32 data_rate; u32 data_rate;
u32 width = 0, height = 0; u32 width = 0, height = 0;
uint_fixed_16_16_t down_scale_amount; uint_fixed_16_16_t down_scale_amount;
...@@ -4612,7 +4612,7 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *crtc_state, ...@@ -4612,7 +4612,7 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state, const struct intel_plane_state *plane_state,
struct skl_wm_params *wp, int color_plane) struct skl_wm_params *wp, int color_plane)
{ {
const struct drm_framebuffer *fb = plane_state->base.fb; const struct drm_framebuffer *fb = plane_state->hw.fb;
int width; int width;
/* /*
...@@ -4624,7 +4624,7 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *crtc_state, ...@@ -4624,7 +4624,7 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *crtc_state,
return skl_compute_wm_params(crtc_state, width, return skl_compute_wm_params(crtc_state, width,
fb->format, fb->modifier, fb->format, fb->modifier,
plane_state->base.rotation, plane_state->hw.rotation,
skl_adjusted_plane_pixel_rate(crtc_state, plane_state), skl_adjusted_plane_pixel_rate(crtc_state, plane_state),
wp, color_plane); wp, color_plane);
} }
...@@ -4903,7 +4903,7 @@ static int skl_build_plane_wm(struct intel_crtc_state *crtc_state, ...@@ -4903,7 +4903,7 @@ static int skl_build_plane_wm(struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state) const struct intel_plane_state *plane_state)
{ {
struct intel_plane *plane = to_intel_plane(plane_state->base.plane); struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
const struct drm_framebuffer *fb = plane_state->base.fb; const struct drm_framebuffer *fb = plane_state->hw.fb;
enum plane_id plane_id = plane->id; enum plane_id plane_id = plane->id;
int ret; int ret;
...@@ -4936,7 +4936,7 @@ static int icl_build_plane_wm(struct intel_crtc_state *crtc_state, ...@@ -4936,7 +4936,7 @@ static int icl_build_plane_wm(struct intel_crtc_state *crtc_state,
return 0; return 0;
if (plane_state->planar_linked_plane) { if (plane_state->planar_linked_plane) {
const struct drm_framebuffer *fb = plane_state->base.fb; const struct drm_framebuffer *fb = plane_state->hw.fb;
enum plane_id y_plane_id = plane_state->planar_linked_plane->id; enum plane_id y_plane_id = plane_state->planar_linked_plane->id;
WARN_ON(!intel_wm_plane_visible(crtc_state, plane_state)); WARN_ON(!intel_wm_plane_visible(crtc_state, plane_state));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment