diff mbox series

[CI,10/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> hw.

Message ID 20191029072229.27092-10-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [CI,01/12] drm/i915: Introduce intel_atomic_get_plane_state_after_check(), v2. | expand

Commit Message

Maarten Lankhorst Oct. 29, 2019, 7:22 a.m. UTC
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: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_atomic.c   |   6 +-
 .../gpu/drm/i915/display/intel_atomic_plane.c |   6 +-
 drivers/gpu/drm/i915/display/intel_display.c  | 133 +++++++++---------
 drivers/gpu/drm/i915/display/intel_fbc.c      |   8 +-
 drivers/gpu/drm/i915/display/intel_overlay.c  |   2 +-
 drivers/gpu/drm/i915/display/intel_sprite.c   |  90 ++++++------
 drivers/gpu/drm/i915/intel_pm.c               |  32 ++---
 7 files changed, 139 insertions(+), 138 deletions(-)

Comments

Ville Syrjälä Oct. 29, 2019, 3:35 p.m. UTC | #1
On Tue, Oct 29, 2019 at 08:22:27AM +0100, Maarten Lankhorst wrote:
> 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: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Seems sane
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_atomic.c   |   6 +-
>  .../gpu/drm/i915/display/intel_atomic_plane.c |   6 +-
>  drivers/gpu/drm/i915/display/intel_display.c  | 133 +++++++++---------
>  drivers/gpu/drm/i915/display/intel_fbc.c      |   8 +-
>  drivers/gpu/drm/i915/display/intel_overlay.c  |   2 +-
>  drivers/gpu/drm/i915/display/intel_sprite.c   |  90 ++++++------
>  drivers/gpu/drm/i915/intel_pm.c               |  32 ++---
>  7 files changed, 139 insertions(+), 138 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
> index 557178906ccf..fb4126de994d 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic.c
> @@ -296,9 +296,9 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta
>  		return;
>  
>  	/* set scaler mode */
> -	if (plane_state && plane_state->base.fb &&
> -	    plane_state->base.fb->format->is_yuv &&
> -	    plane_state->base.fb->format->num_planes > 1) {
> +	if (plane_state && plane_state->hw.fb &&
> +	    plane_state->hw.fb->format->is_yuv &&
> +	    plane_state->hw.fb->format->num_planes > 1) {
>  		struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  		if (IS_GEN(dev_priv, 9) &&
>  		    !IS_GEMINILAKE(dev_priv)) {
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index 987f7545d45f..cac1d6ae67f6 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -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,
>  				   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;
>  
>  	if (!plane_state->base.visible)
> @@ -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 *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;
>  
>  	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_
>  	new_crtc_state->min_cdclk[plane->id] = 0;
>  	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;
>  
>  	ret = plane->check_plane(new_crtc_state, new_plane_state);
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index cd9d68245f53..fbbe6f752716 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -2215,7 +2215,7 @@ u32 intel_fb_xy_to_linear(int x, int y,
>  			  const struct intel_plane_state *state,
>  			  int color_plane)
>  {
> -	const struct drm_framebuffer *fb = state->base.fb;
> +	const struct drm_framebuffer *fb = state->hw.fb;
>  	unsigned int cpp = fb->format->cpp[color_plane];
>  	unsigned int pitch = state->color_plane[color_plane].stride;
>  
> @@ -2316,8 +2316,8 @@ static u32 intel_plane_adjust_aligned_offset(int *x, int *y,
>  					     int color_plane,
>  					     u32 old_offset, u32 new_offset)
>  {
> -	return intel_adjust_aligned_offset(x, y, state->base.fb, color_plane,
> -					   state->base.rotation,
> +	return intel_adjust_aligned_offset(x, y, state->hw.fb, color_plane,
> +					   state->hw.rotation,
>  					   state->color_plane[color_plane].stride,
>  					   old_offset, new_offset);
>  }
> @@ -2393,8 +2393,8 @@ static u32 intel_plane_compute_aligned_offset(int *x, int *y,
>  {
>  	struct intel_plane *intel_plane = to_intel_plane(state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(intel_plane->base.dev);
> -	const struct drm_framebuffer *fb = state->base.fb;
> -	unsigned int rotation = state->base.rotation;
> +	const struct drm_framebuffer *fb = state->hw.fb;
> +	unsigned int rotation = state->hw.rotation;
>  	int pitch = state->color_plane[color_plane].stride;
>  	u32 alignment;
>  
> @@ -2581,7 +2581,7 @@ bool intel_plane_can_remap(const struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	int i;
>  
>  	/* We don't want to deal with remapping with cursors */
> @@ -2620,8 +2620,8 @@ bool intel_plane_can_remap(const struct intel_plane_state *plane_state)
>  static bool intel_plane_needs_remap(const struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	u32 stride, max_stride;
>  
>  	/*
> @@ -2812,10 +2812,10 @@ intel_plane_remap_gtt(struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	struct drm_framebuffer *fb = plane_state->base.fb;
> +	struct drm_framebuffer *fb = plane_state->hw.fb;
>  	struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
>  	struct intel_rotation_info *info = &plane_state->view.rotated;
> -	unsigned int rotation = plane_state->base.rotation;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	int i, num_planes = fb->format->num_planes;
>  	unsigned int tile_size = intel_tile_size(dev_priv);
>  	unsigned int src_x, src_y;
> @@ -2921,8 +2921,8 @@ static int
>  intel_plane_compute_gtt(struct intel_plane_state *plane_state)
>  {
>  	const struct intel_framebuffer *fb =
> -		to_intel_framebuffer(plane_state->base.fb);
> -	unsigned int rotation = plane_state->base.rotation;
> +		to_intel_framebuffer(plane_state->hw.fb);
> +	unsigned int rotation = plane_state->hw.rotation;
>  	int i, num_planes;
>  
>  	if (!fb)
> @@ -3225,7 +3225,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>  			continue;
>  
>  		if (intel_plane_ggtt_offset(state) == plane_config->base) {
> -			fb = state->base.fb;
> +			fb = state->hw.fb;
>  			drm_framebuffer_get(fb);
>  			goto valid_fb;
>  		}
> @@ -3243,11 +3243,11 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>  	return;
>  
>  valid_fb:
> -	intel_state->base.rotation = plane_config->rotation;
> +	intel_state->hw.rotation = plane_config->rotation;
>  	intel_fill_fb_ggtt_view(&intel_state->view, fb,
> -				intel_state->base.rotation);
> +				intel_state->hw.rotation);
>  	intel_state->color_plane[0].stride =
> -		intel_fb_pitch(fb, 0, intel_state->base.rotation);
> +		intel_fb_pitch(fb, 0, intel_state->hw.rotation);
>  
>  	intel_state->vma =
>  		intel_pin_and_fence_fb_obj(fb,
> @@ -3374,7 +3374,7 @@ static int icl_max_plane_height(void)
>  static bool skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state,
>  					   int main_x, int main_y, u32 main_offset)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	int hsub = fb->format->hsub;
>  	int vsub = fb->format->vsub;
>  	int aux_x = plane_state->color_plane[1].x;
> @@ -3412,8 +3412,8 @@ static bool skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state
>  static int skl_check_main_surface(struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	int x = plane_state->base.src.x1 >> 16;
>  	int y = plane_state->base.src.y1 >> 16;
>  	int w = drm_rect_width(&plane_state->base.src) >> 16;
> @@ -3508,8 +3508,8 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
>  
>  static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	int max_width = skl_max_plane_width(fb, 1, rotation);
>  	int max_height = 4096;
>  	int x = plane_state->base.src.x1 >> 17;
> @@ -3537,7 +3537,7 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
>  
>  static int skl_check_ccs_aux_surface(struct intel_plane_state *plane_state)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	int src_x = plane_state->base.src.x1 >> 16;
>  	int src_y = plane_state->base.src.y1 >> 16;
>  	int hsub = fb->format->hsub;
> @@ -3558,7 +3558,7 @@ static int skl_check_ccs_aux_surface(struct intel_plane_state *plane_state)
>  
>  int skl_check_plane_surface(struct intel_plane_state *plane_state)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	int ret;
>  
>  	ret = intel_plane_compute_gtt(plane_state);
> @@ -3597,7 +3597,7 @@ static void i9xx_plane_ratio(const struct intel_crtc_state *crtc_state,
>  			     const struct intel_plane_state *plane_state,
>  			     unsigned int *num, unsigned int *den)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	unsigned int cpp = fb->format->cpp[0];
>  
>  	/*
> @@ -3690,8 +3690,8 @@ static u32 i9xx_plane_ctl(const struct intel_crtc_state *crtc_state,
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	u32 dspcntr;
>  
>  	dspcntr = DISPLAY_PLANE_ENABLE;
> @@ -3747,7 +3747,7 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	int src_x, src_y, src_w;
>  	u32 offset;
>  	int ret;
> @@ -3784,7 +3784,7 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
>  
>  	/* HSW/BDW do this automagically in hardware */
>  	if (!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv)) {
> -		unsigned int rotation = plane_state->base.rotation;
> +		unsigned int rotation = plane_state->hw.rotation;
>  		int src_w = drm_rect_width(&plane_state->base.src) >> 16;
>  		int src_h = drm_rect_height(&plane_state->base.src) >> 16;
>  
> @@ -4037,8 +4037,8 @@ static unsigned int skl_plane_stride_mult(const struct drm_framebuffer *fb,
>  u32 skl_plane_stride(const struct intel_plane_state *plane_state,
>  		     int color_plane)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	u32 stride = plane_state->color_plane[color_plane].stride;
>  
>  	if (color_plane >= fb->format->num_planes)
> @@ -4107,10 +4107,10 @@ static u32 skl_plane_ctl_format(u32 pixel_format)
>  
>  static u32 skl_plane_ctl_alpha(const struct intel_plane_state *plane_state)
>  {
> -	if (!plane_state->base.fb->format->has_alpha)
> +	if (!plane_state->hw.fb->format->has_alpha)
>  		return PLANE_CTL_ALPHA_DISABLE;
>  
> -	switch (plane_state->base.pixel_blend_mode) {
> +	switch (plane_state->hw.pixel_blend_mode) {
>  	case DRM_MODE_BLEND_PIXEL_NONE:
>  		return PLANE_CTL_ALPHA_DISABLE;
>  	case DRM_MODE_BLEND_PREMULTI:
> @@ -4118,17 +4118,17 @@ static u32 skl_plane_ctl_alpha(const struct intel_plane_state *plane_state)
>  	case DRM_MODE_BLEND_COVERAGE:
>  		return PLANE_CTL_ALPHA_HW_PREMULTIPLY;
>  	default:
> -		MISSING_CASE(plane_state->base.pixel_blend_mode);
> +		MISSING_CASE(plane_state->hw.pixel_blend_mode);
>  		return PLANE_CTL_ALPHA_DISABLE;
>  	}
>  }
>  
>  static u32 glk_plane_color_ctl_alpha(const struct intel_plane_state *plane_state)
>  {
> -	if (!plane_state->base.fb->format->has_alpha)
> +	if (!plane_state->hw.fb->format->has_alpha)
>  		return PLANE_COLOR_ALPHA_DISABLE;
>  
> -	switch (plane_state->base.pixel_blend_mode) {
> +	switch (plane_state->hw.pixel_blend_mode) {
>  	case DRM_MODE_BLEND_PIXEL_NONE:
>  		return PLANE_COLOR_ALPHA_DISABLE;
>  	case DRM_MODE_BLEND_PREMULTI:
> @@ -4136,7 +4136,7 @@ static u32 glk_plane_color_ctl_alpha(const struct intel_plane_state *plane_state
>  	case DRM_MODE_BLEND_COVERAGE:
>  		return PLANE_COLOR_ALPHA_HW_PREMULTIPLY;
>  	default:
> -		MISSING_CASE(plane_state->base.pixel_blend_mode);
> +		MISSING_CASE(plane_state->hw.pixel_blend_mode);
>  		return PLANE_COLOR_ALPHA_DISABLE;
>  	}
>  }
> @@ -4222,8 +4222,8 @@ u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
>  	u32 plane_ctl;
>  
> @@ -4233,10 +4233,10 @@ u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
>  		plane_ctl |= skl_plane_ctl_alpha(plane_state);
>  		plane_ctl |= PLANE_CTL_PLANE_GAMMA_DISABLE;
>  
> -		if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
> +		if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
>  			plane_ctl |= PLANE_CTL_YUV_TO_RGB_CSC_FORMAT_BT709;
>  
> -		if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
> +		if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
>  			plane_ctl |= PLANE_CTL_YUV_RANGE_CORRECTION_DISABLE;
>  	}
>  
> @@ -4278,7 +4278,7 @@ u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	u32 plane_color_ctl = 0;
>  
> @@ -4286,12 +4286,12 @@ u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
>  	plane_color_ctl |= glk_plane_color_ctl_alpha(plane_state);
>  
>  	if (fb->format->is_yuv && !icl_is_hdr_plane(dev_priv, plane->id)) {
> -		if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
> +		if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
>  			plane_color_ctl |= PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709;
>  		else
>  			plane_color_ctl |= PLANE_COLOR_CSC_MODE_YUV601_TO_RGB709;
>  
> -		if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
> +		if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
>  			plane_color_ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE;
>  	} else if (fb->format->is_yuv) {
>  		plane_color_ctl |= PLANE_COLOR_INPUT_CSC_ENABLE;
> @@ -5625,7 +5625,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
>  	struct intel_plane *intel_plane =
>  		to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(intel_plane->base.dev);
> -	struct drm_framebuffer *fb = plane_state->base.fb;
> +	struct drm_framebuffer *fb = plane_state->hw.fb;
>  	int ret;
>  	bool force_detach = !fb || !plane_state->base.visible;
>  	bool need_scaler = false;
> @@ -10729,7 +10729,7 @@ static u32 intel_cursor_base(const struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	const struct drm_i915_gem_object *obj = intel_fb_obj(fb);
>  	u32 base;
>  
> @@ -10777,7 +10777,7 @@ static int intel_cursor_check_surface(struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	unsigned int rotation = plane_state->base.rotation;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	int src_x, src_y;
>  	u32 offset;
>  	int ret;
> @@ -10810,7 +10810,7 @@ static int intel_cursor_check_surface(struct intel_plane_state *plane_state)
>  
>  	/* ILK+ do this automagically in hardware */
>  	if (HAS_GMCH(dev_priv) && rotation & DRM_MODE_ROTATE_180) {
> -		const struct drm_framebuffer *fb = plane_state->base.fb;
> +		const struct drm_framebuffer *fb = plane_state->hw.fb;
>  		int src_w = drm_rect_width(&plane_state->base.src) >> 16;
>  		int src_h = drm_rect_height(&plane_state->base.src) >> 16;
>  
> @@ -10827,7 +10827,7 @@ static int intel_cursor_check_surface(struct intel_plane_state *plane_state)
>  static int intel_check_cursor(struct intel_crtc_state *crtc_state,
>  			      struct intel_plane_state *plane_state)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	int ret;
>  
>  	if (fb && fb->modifier != DRM_FORMAT_MOD_LINEAR) {
> @@ -10901,7 +10901,7 @@ static bool i845_cursor_size_ok(const struct intel_plane_state *plane_state)
>  static int i845_check_cursor(struct intel_crtc_state *crtc_state,
>  			     struct intel_plane_state *plane_state)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	int ret;
>  
>  	ret = intel_check_cursor(crtc_state, plane_state);
> @@ -11067,7 +11067,7 @@ static u32 i9xx_cursor_ctl(const struct intel_crtc_state *crtc_state,
>  		return 0;
>  	}
>  
> -	if (plane_state->base.rotation & DRM_MODE_ROTATE_180)
> +	if (plane_state->hw.rotation & DRM_MODE_ROTATE_180)
>  		cntl |= MCURSOR_ROTATE_180;
>  
>  	return cntl;
> @@ -11100,7 +11100,7 @@ static bool i9xx_cursor_size_ok(const struct intel_plane_state *plane_state)
>  	 * cursors.
>  	 */
>  	if (HAS_CUR_FBC(dev_priv) &&
> -	    plane_state->base.rotation & DRM_MODE_ROTATE_0) {
> +	    plane_state->hw.rotation & DRM_MODE_ROTATE_0) {
>  		if (height < 8 || height > width)
>  			return false;
>  	} else {
> @@ -11116,7 +11116,7 @@ static int i9xx_check_cursor(struct intel_crtc_state *crtc_state,
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	enum pipe pipe = plane->pipe;
>  	int ret;
>  
> @@ -11720,11 +11720,11 @@ static bool intel_wm_need_update(const struct intel_plane_state *cur,
>  	if (new->base.visible != cur->base.visible)
>  		return true;
>  
> -	if (!cur->base.fb || !new->base.fb)
> +	if (!cur->hw.fb || !new->hw.fb)
>  		return false;
>  
> -	if (cur->base.fb->modifier != new->base.fb->modifier ||
> -	    cur->base.rotation != new->base.rotation ||
> +	if (cur->hw.fb->modifier != new->hw.fb->modifier ||
> +	    cur->hw.rotation != new->hw.rotation ||
>  	    drm_rect_width(&new->base.src) != drm_rect_width(&cur->base.src) ||
>  	    drm_rect_height(&new->base.src) != drm_rect_height(&cur->base.src) ||
>  	    drm_rect_width(&new->base.dst) != drm_rect_width(&cur->base.dst) ||
> @@ -12356,7 +12356,7 @@ static const char *output_formats(enum intel_output_format format)
>  static void intel_dump_plane_state(const struct intel_plane_state *plane_state)
>  {
>  	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;
>  	struct drm_format_name_buf format_name;
>  
>  	if (!fb) {
> @@ -12372,7 +12372,7 @@ static void intel_dump_plane_state(const struct intel_plane_state *plane_state)
>  		      drm_get_format_name(fb->format->format, &format_name),
>  		      yesno(plane_state->base.visible));
>  	DRM_DEBUG_KMS("\trotation: 0x%x, scaler: %d\n",
> -		      plane_state->base.rotation, plane_state->scaler_id);
> +		      plane_state->hw.rotation, plane_state->scaler_id);
>  	if (plane_state->base.visible)
>  		DRM_DEBUG_KMS("\tsrc: " DRM_RECT_FP_FMT " dst: " DRM_RECT_FMT "\n",
>  			      DRM_RECT_FP_ARG(&plane_state->base.src),
> @@ -14876,8 +14876,8 @@ static void intel_atomic_track_fbs(struct intel_atomic_state *state)
>  
>  	for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state,
>  					     new_plane_state, i)
> -		intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->base.fb),
> -					to_intel_frontbuffer(new_plane_state->base.fb),
> +		intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb),
> +					to_intel_frontbuffer(new_plane_state->hw.fb),
>  					plane->frontbuffer_bit);
>  }
>  
> @@ -15046,7 +15046,7 @@ static int intel_plane_pin_fb(struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	struct drm_framebuffer *fb = plane_state->base.fb;
> +	struct drm_framebuffer *fb = plane_state->hw.fb;
>  	struct i915_vma *vma;
>  
>  	if (plane->id == PLANE_CURSOR &&
> @@ -15111,7 +15111,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
>  	struct intel_atomic_state *intel_state =
>  		to_intel_atomic_state(new_plane_state->base.state);
>  	struct drm_i915_private *dev_priv = to_i915(plane->dev);
> -	struct drm_framebuffer *fb = new_plane_state->base.fb;
> +	struct drm_framebuffer *fb = new_plane_state->hw.fb;
>  	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
>  	struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->state->fb);
>  	int ret;
> @@ -15179,12 +15179,12 @@ intel_prepare_plane_fb(struct drm_plane *plane,
>  
>  		fence = dma_resv_get_excl_rcu(obj->base.resv);
>  		if (fence) {
> -			add_rps_boost_after_vblank(new_plane_state->base.crtc,
> +			add_rps_boost_after_vblank(new_plane_state->hw.crtc,
>  						   fence);
>  			dma_fence_put(fence);
>  		}
>  	} else {
> -		add_rps_boost_after_vblank(new_plane_state->base.crtc,
> +		add_rps_boost_after_vblank(new_plane_state->hw.crtc,
>  					   new_plane_state->base.fence);
>  	}
>  
> @@ -15397,9 +15397,10 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
>  	if (ret)
>  		goto out_free;
>  
> -	intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->base.fb), ORIGIN_FLIP);
> -	intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->base.fb),
> -				to_intel_frontbuffer(new_plane_state->base.fb),
> +	intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->hw.fb),
> +				ORIGIN_FLIP);
> +	intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb),
> +				to_intel_frontbuffer(new_plane_state->hw.fb),
>  				plane->frontbuffer_bit);
>  
>  	/* Swap plane state */
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index c6cc3775f3b8..3ea8d010db6c 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -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 intel_fbc *fbc = &dev_priv->fbc;
>  	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->flags = 0;
> @@ -671,7 +671,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc,
>  	if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
>  		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
>  	 * 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,
>  	cache->plane.adjusted_y = plane_state->color_plane[0].y;
>  	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)
>  		return;
> @@ -1047,7 +1047,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
>  	 * to pipe or plane A. */
>  	for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
>  		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)
>  			continue;
> diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
> index 848ce07a8ec2..46e3d6cf5976 100644
> --- a/drivers/gpu/drm/i915/display/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/display/intel_overlay.c
> @@ -669,7 +669,7 @@ static void update_colorkey(struct intel_overlay *overlay,
>  		flags |= DST_KEY_ENABLE;
>  
>  	if (state->base.visible)
> -		format = state->base.fb->format->format;
> +		format = state->hw.fb->format->format;
>  
>  	switch (format) {
>  	case DRM_FORMAT_C8:
> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> index 5ba8faf0ccfe..b2116d123548 100644
> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> @@ -241,8 +241,8 @@ void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state)
>  int intel_plane_check_stride(const struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	u32 stride, max_stride;
>  
>  	/*
> @@ -272,10 +272,10 @@ int intel_plane_check_stride(const struct intel_plane_state *plane_state)
>  
>  int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	struct drm_rect *src = &plane_state->base.src;
>  	u32 src_x, src_y, src_w, src_h, hsub, vsub;
> -	bool rotated = drm_rotation_90_or_270(plane_state->base.rotation);
> +	bool rotated = drm_rotation_90_or_270(plane_state->hw.rotation);
>  
>  	/*
>  	 * Hardware doesn't handle subpixel coordinates.
> @@ -329,7 +329,7 @@ skl_plane_ratio(const struct intel_crtc_state *crtc_state,
>  		unsigned int *num, unsigned int *den)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  
>  	if (fb->format->cpp[0] == 8) {
>  		if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
> @@ -396,7 +396,7 @@ skl_program_scaler(struct intel_plane *plane,
>  		   const struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	enum pipe pipe = plane->pipe;
>  	int scaler_id = plane_state->scaler_id;
>  	const struct intel_scaler *scaler =
> @@ -542,10 +542,10 @@ icl_program_input_csc(struct intel_plane *plane,
>  	};
>  	const u16 *csc;
>  
> -	if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
> -		csc = input_csc_matrix[plane_state->base.color_encoding];
> +	if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
> +		csc = input_csc_matrix[plane_state->hw.color_encoding];
>  	else
> -		csc = input_csc_matrix_lr[plane_state->base.color_encoding];
> +		csc = input_csc_matrix_lr[plane_state->hw.color_encoding];
>  
>  	I915_WRITE_FW(PLANE_INPUT_CSC_COEFF(pipe, plane_id, 0), ROFF(csc[0]) |
>  		      GOFF(csc[1]));
> @@ -559,7 +559,7 @@ icl_program_input_csc(struct intel_plane *plane,
>  
>  	I915_WRITE_FW(PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 0),
>  		      PREOFF_YUV_TO_RGB_HI);
> -	if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
> +	if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
>  		I915_WRITE_FW(PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 1), 0);
>  	else
>  		I915_WRITE_FW(PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 1),
> @@ -591,8 +591,8 @@ skl_program_plane(struct intel_plane *plane,
>  	u32 src_w = drm_rect_width(&plane_state->base.src) >> 16;
>  	u32 src_h = drm_rect_height(&plane_state->base.src) >> 16;
>  	struct intel_plane *linked = plane_state->planar_linked_plane;
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	u8 alpha = plane_state->base.alpha >> 8;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	u8 alpha = plane_state->hw.alpha >> 8;
>  	u32 plane_color_ctl = 0;
>  	unsigned long irqflags;
>  	u32 keymsk, keymax;
> @@ -768,7 +768,7 @@ chv_update_csc(const struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	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;
>  	/*
>  	 * |r|   | c0 c1 c2 |   |cr|
> @@ -794,7 +794,7 @@ chv_update_csc(const struct intel_plane_state *plane_state)
>  			    0, 4096,  7601,
>  		},
>  	};
> -	const s16 *csc = csc_matrix[plane_state->base.color_encoding];
> +	const s16 *csc = csc_matrix[plane_state->hw.color_encoding];
>  
>  	/* Seems RGB data bypasses the CSC always */
>  	if (!fb->format->is_yuv)
> @@ -827,13 +827,13 @@ vlv_update_clrc(const struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	enum pipe pipe = plane->pipe;
>  	enum plane_id plane_id = plane->id;
>  	int contrast, brightness, sh_scale, sh_sin, sh_cos;
>  
>  	if (fb->format->is_yuv &&
> -	    plane_state->base.color_range == DRM_COLOR_YCBCR_LIMITED_RANGE) {
> +	    plane_state->hw.color_range == DRM_COLOR_YCBCR_LIMITED_RANGE) {
>  		/*
>  		 * Expand limited range to full range:
>  		 * Contrast is applied first and is used to expand Y range.
> @@ -867,7 +867,7 @@ vlv_plane_ratio(const struct intel_crtc_state *crtc_state,
>  		unsigned int *num, unsigned int *den)
>  {
>  	u8 active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	unsigned int cpp = fb->format->cpp[0];
>  
>  	/*
> @@ -953,8 +953,8 @@ static u32 vlv_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
>  static u32 vlv_sprite_ctl(const struct intel_crtc_state *crtc_state,
>  			  const struct intel_plane_state *plane_state)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
>  	u32 sprctl;
>  
> @@ -999,7 +999,7 @@ static u32 vlv_sprite_ctl(const struct intel_crtc_state *crtc_state,
>  		return 0;
>  	}
>  
> -	if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
> +	if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
>  		sprctl |= SP_YUV_FORMAT_BT709;
>  
>  	if (fb->modifier == I915_FORMAT_MOD_X_TILED)
> @@ -1021,7 +1021,7 @@ static void vlv_update_gamma(const struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	enum pipe pipe = plane->pipe;
>  	enum plane_id plane_id = plane->id;
>  	u16 gamma[8];
> @@ -1151,7 +1151,7 @@ static void ivb_plane_ratio(const struct intel_crtc_state *crtc_state,
>  			    unsigned int *num, unsigned int *den)
>  {
>  	u8 active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	unsigned int cpp = fb->format->cpp[0];
>  
>  	if (hweight8(active_planes) == 2) {
> @@ -1187,7 +1187,7 @@ static void ivb_plane_ratio_scaling(const struct intel_crtc_state *crtc_state,
>  				    const struct intel_plane_state *plane_state,
>  				    unsigned int *num, unsigned int *den)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	unsigned int cpp = fb->format->cpp[0];
>  
>  	switch (cpp) {
> @@ -1265,7 +1265,7 @@ static void hsw_plane_ratio(const struct intel_crtc_state *crtc_state,
>  			    unsigned int *num, unsigned int *den)
>  {
>  	u8 active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	unsigned int cpp = fb->format->cpp[0];
>  
>  	if (hweight8(active_planes) == 2) {
> @@ -1321,7 +1321,7 @@ static bool ivb_need_sprite_gamma(const struct intel_plane_state *plane_state)
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  
>  	return fb->format->cpp[0] == 8 &&
>  		(IS_IVYBRIDGE(dev_priv) || IS_HASWELL(dev_priv));
> @@ -1332,8 +1332,8 @@ static u32 ivb_sprite_ctl(const struct intel_crtc_state *crtc_state,
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
>  	u32 sprctl;
>  
> @@ -1375,10 +1375,10 @@ static u32 ivb_sprite_ctl(const struct intel_crtc_state *crtc_state,
>  	if (!ivb_need_sprite_gamma(plane_state))
>  		sprctl |= SPRITE_INT_GAMMA_DISABLE;
>  
> -	if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
> +	if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
>  		sprctl |= SPRITE_YUV_TO_RGB_CSC_FORMAT_BT709;
>  
> -	if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
> +	if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
>  		sprctl |= SPRITE_YUV_RANGE_CORRECTION_DISABLE;
>  
>  	if (fb->modifier == I915_FORMAT_MOD_X_TILED)
> @@ -1567,7 +1567,7 @@ ivb_plane_get_hw_state(struct intel_plane *plane,
>  static int g4x_sprite_min_cdclk(const struct intel_crtc_state *crtc_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 hscale, pixel_rate;
>  	unsigned int limit, decimate;
>  
> @@ -1637,8 +1637,8 @@ static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(plane_state->base.plane->dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
>  	u32 dvscntr;
>  
> @@ -1677,10 +1677,10 @@ static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
>  		return 0;
>  	}
>  
> -	if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
> +	if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
>  		dvscntr |= DVS_YUV_FORMAT_BT709;
>  
> -	if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
> +	if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
>  		dvscntr |= DVS_YUV_RANGE_CORRECTION_DISABLE;
>  
>  	if (fb->modifier == I915_FORMAT_MOD_X_TILED)
> @@ -1701,7 +1701,7 @@ static void g4x_update_gamma(const struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	enum pipe pipe = plane->pipe;
>  	u16 gamma[8];
>  	int i;
> @@ -1733,7 +1733,7 @@ static void ilk_update_gamma(const struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	enum pipe pipe = plane->pipe;
>  	u16 gamma[17];
>  	int i;
> @@ -1887,7 +1887,7 @@ static int
>  g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state,
>  			 struct intel_plane_state *plane_state)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	const struct drm_rect *src = &plane_state->base.src;
>  	const struct drm_rect *dst = &plane_state->base.dst;
>  	int src_x, src_w, src_h, crtc_w, crtc_h;
> @@ -1954,7 +1954,7 @@ g4x_sprite_check(struct intel_crtc_state *crtc_state,
>  	int max_scale = DRM_PLANE_HELPER_NO_SCALING;
>  	int ret;
>  
> -	if (intel_fb_scalable(plane_state->base.fb)) {
> +	if (intel_fb_scalable(plane_state->hw.fb)) {
>  		if (INTEL_GEN(dev_priv) < 7) {
>  			min_scale = 1;
>  			max_scale = 16 << 16;
> @@ -1998,7 +1998,7 @@ int chv_plane_check_rotation(const struct intel_plane_state *plane_state)
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	unsigned int rotation = plane_state->base.rotation;
> +	unsigned int rotation = plane_state->hw.rotation;
>  
>  	/* CHV ignores the mirror bit when the rotate bit is set :( */
>  	if (IS_CHERRYVIEW(dev_priv) &&
> @@ -2050,8 +2050,8 @@ static int skl_plane_check_fb(const struct intel_crtc_state *crtc_state,
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	struct drm_format_name_buf format_name;
>  
>  	if (!fb)
> @@ -2151,8 +2151,8 @@ static int skl_plane_check_dst_coordinates(const struct intel_crtc_state *crtc_s
>  
>  static int skl_plane_check_nv12_rotation(const struct intel_plane_state *plane_state)
>  {
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> -	unsigned int rotation = plane_state->base.rotation;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
> +	unsigned int rotation = plane_state->hw.rotation;
>  	int src_w = drm_rect_width(&plane_state->base.src) >> 16;
>  
>  	/* Display WA #1106 */
> @@ -2187,7 +2187,7 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,
>  {
>  	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
>  	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> -	const struct drm_framebuffer *fb = plane_state->base.fb;
> +	const struct drm_framebuffer *fb = plane_state->hw.fb;
>  	int min_scale = DRM_PLANE_HELPER_NO_SCALING;
>  	int max_scale = DRM_PLANE_HELPER_NO_SCALING;
>  	int ret;
> @@ -2229,7 +2229,7 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,
>  		return ret;
>  
>  	/* HW only has 8 bits pixel precision, disable plane if invisible */
> -	if (!(plane_state->base.alpha >> 8))
> +	if (!(plane_state->hw.alpha >> 8))
>  		plane_state->base.visible = false;
>  
>  	plane_state->ctl = skl_plane_ctl(crtc_state, plane_state);
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index de7703ac528d..25a8e20d2112 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -801,7 +801,7 @@ static bool intel_wm_plane_visible(const struct intel_crtc_state *crtc_state,
>  	 * around this problem with the watermark code.
>  	 */
>  	if (plane->id == PLANE_CURSOR)
> -		return plane_state->base.fb != NULL;
> +		return plane_state->hw.fb != NULL;
>  	else
>  		return plane_state->base.visible;
>  }
> @@ -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))
>  		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
> @@ -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,
>  					     old_plane_state,
>  					     new_plane_state, i) {
> -		if (new_plane_state->base.crtc != &crtc->base &&
> -		    old_plane_state->base.crtc != &crtc->base)
> +		if (new_plane_state->hw.crtc != &crtc->base &&
> +		    old_plane_state->hw.crtc != &crtc->base)
>  			continue;
>  
>  		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,
>  	if (!intel_wm_plane_visible(crtc_state, plane_state))
>  		return 0;
>  
> -	cpp = plane_state->base.fb->format->cpp[0];
> +	cpp = plane_state->hw.fb->format->cpp[0];
>  	clock = adjusted_mode->crtc_clock;
>  	htotal = adjusted_mode->crtc_htotal;
>  	width = crtc_state->pipe_src_w;
> @@ -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,
>  					     old_plane_state,
>  					     new_plane_state, i) {
> -		if (new_plane_state->base.crtc != &crtc->base &&
> -		    old_plane_state->base.crtc != &crtc->base)
> +		if (new_plane_state->hw.crtc != &crtc->base &&
> +		    old_plane_state->hw.crtc != &crtc->base)
>  			continue;
>  
>  		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,
>  	if (!intel_wm_plane_visible(crtc_state, plane_state))
>  		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);
>  
> @@ -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))
>  		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);
>  	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,
>  	if (!intel_wm_plane_visible(crtc_state, plane_state))
>  		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,
>  			      crtc_state->hw.adjusted_mode.crtc_htotal,
> @@ -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))
>  		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);
>  }
> @@ -4091,7 +4091,7 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *crtc_state,
>  			     int color_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 width = 0, height = 0;
>  	uint_fixed_16_16_t down_scale_amount;
> @@ -4612,7 +4612,7 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *crtc_state,
>  			    const struct intel_plane_state *plane_state,
>  			    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;
>  
>  	/*
> @@ -4624,7 +4624,7 @@ skl_compute_plane_wm_params(const struct intel_crtc_state *crtc_state,
>  
>  	return skl_compute_wm_params(crtc_state, width,
>  				     fb->format, fb->modifier,
> -				     plane_state->base.rotation,
> +				     plane_state->hw.rotation,
>  				     skl_adjusted_plane_pixel_rate(crtc_state, plane_state),
>  				     wp, color_plane);
>  }
> @@ -4903,7 +4903,7 @@ static int skl_build_plane_wm(struct intel_crtc_state *crtc_state,
>  			      const struct intel_plane_state *plane_state)
>  {
>  	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;
>  	int ret;
>  
> @@ -4936,7 +4936,7 @@ static int icl_build_plane_wm(struct intel_crtc_state *crtc_state,
>  		return 0;
>  
>  	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;
>  
>  		WARN_ON(!intel_wm_plane_visible(crtc_state, plane_state));
> -- 
> 2.23.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c
index 557178906ccf..fb4126de994d 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic.c
@@ -296,9 +296,9 @@  static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta
 		return;
 
 	/* set scaler mode */
-	if (plane_state && plane_state->base.fb &&
-	    plane_state->base.fb->format->is_yuv &&
-	    plane_state->base.fb->format->num_planes > 1) {
+	if (plane_state && plane_state->hw.fb &&
+	    plane_state->hw.fb->format->is_yuv &&
+	    plane_state->hw.fb->format->num_planes > 1) {
 		struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 		if (IS_GEN(dev_priv, 9) &&
 		    !IS_GEMINILAKE(dev_priv)) {
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index 987f7545d45f..cac1d6ae67f6 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -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,
 				   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;
 
 	if (!plane_state->base.visible)
@@ -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 *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;
 
 	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_
 	new_crtc_state->min_cdclk[plane->id] = 0;
 	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;
 
 	ret = plane->check_plane(new_crtc_state, new_plane_state);
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index cd9d68245f53..fbbe6f752716 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -2215,7 +2215,7 @@  u32 intel_fb_xy_to_linear(int x, int y,
 			  const struct intel_plane_state *state,
 			  int color_plane)
 {
-	const struct drm_framebuffer *fb = state->base.fb;
+	const struct drm_framebuffer *fb = state->hw.fb;
 	unsigned int cpp = fb->format->cpp[color_plane];
 	unsigned int pitch = state->color_plane[color_plane].stride;
 
@@ -2316,8 +2316,8 @@  static u32 intel_plane_adjust_aligned_offset(int *x, int *y,
 					     int color_plane,
 					     u32 old_offset, u32 new_offset)
 {
-	return intel_adjust_aligned_offset(x, y, state->base.fb, color_plane,
-					   state->base.rotation,
+	return intel_adjust_aligned_offset(x, y, state->hw.fb, color_plane,
+					   state->hw.rotation,
 					   state->color_plane[color_plane].stride,
 					   old_offset, new_offset);
 }
@@ -2393,8 +2393,8 @@  static u32 intel_plane_compute_aligned_offset(int *x, int *y,
 {
 	struct intel_plane *intel_plane = to_intel_plane(state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(intel_plane->base.dev);
-	const struct drm_framebuffer *fb = state->base.fb;
-	unsigned int rotation = state->base.rotation;
+	const struct drm_framebuffer *fb = state->hw.fb;
+	unsigned int rotation = state->hw.rotation;
 	int pitch = state->color_plane[color_plane].stride;
 	u32 alignment;
 
@@ -2581,7 +2581,7 @@  bool intel_plane_can_remap(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	int i;
 
 	/* We don't want to deal with remapping with cursors */
@@ -2620,8 +2620,8 @@  bool intel_plane_can_remap(const struct intel_plane_state *plane_state)
 static bool intel_plane_needs_remap(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	u32 stride, max_stride;
 
 	/*
@@ -2812,10 +2812,10 @@  intel_plane_remap_gtt(struct intel_plane_state *plane_state)
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	struct drm_framebuffer *fb = plane_state->base.fb;
+	struct drm_framebuffer *fb = plane_state->hw.fb;
 	struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
 	struct intel_rotation_info *info = &plane_state->view.rotated;
-	unsigned int rotation = plane_state->base.rotation;
+	unsigned int rotation = plane_state->hw.rotation;
 	int i, num_planes = fb->format->num_planes;
 	unsigned int tile_size = intel_tile_size(dev_priv);
 	unsigned int src_x, src_y;
@@ -2921,8 +2921,8 @@  static int
 intel_plane_compute_gtt(struct intel_plane_state *plane_state)
 {
 	const struct intel_framebuffer *fb =
-		to_intel_framebuffer(plane_state->base.fb);
-	unsigned int rotation = plane_state->base.rotation;
+		to_intel_framebuffer(plane_state->hw.fb);
+	unsigned int rotation = plane_state->hw.rotation;
 	int i, num_planes;
 
 	if (!fb)
@@ -3225,7 +3225,7 @@  intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 			continue;
 
 		if (intel_plane_ggtt_offset(state) == plane_config->base) {
-			fb = state->base.fb;
+			fb = state->hw.fb;
 			drm_framebuffer_get(fb);
 			goto valid_fb;
 		}
@@ -3243,11 +3243,11 @@  intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 	return;
 
 valid_fb:
-	intel_state->base.rotation = plane_config->rotation;
+	intel_state->hw.rotation = plane_config->rotation;
 	intel_fill_fb_ggtt_view(&intel_state->view, fb,
-				intel_state->base.rotation);
+				intel_state->hw.rotation);
 	intel_state->color_plane[0].stride =
-		intel_fb_pitch(fb, 0, intel_state->base.rotation);
+		intel_fb_pitch(fb, 0, intel_state->hw.rotation);
 
 	intel_state->vma =
 		intel_pin_and_fence_fb_obj(fb,
@@ -3374,7 +3374,7 @@  static int icl_max_plane_height(void)
 static bool skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state,
 					   int main_x, int main_y, u32 main_offset)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	int hsub = fb->format->hsub;
 	int vsub = fb->format->vsub;
 	int aux_x = plane_state->color_plane[1].x;
@@ -3412,8 +3412,8 @@  static bool skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state
 static int skl_check_main_surface(struct intel_plane_state *plane_state)
 {
 	struct drm_i915_private *dev_priv = to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	int x = plane_state->base.src.x1 >> 16;
 	int y = plane_state->base.src.y1 >> 16;
 	int w = drm_rect_width(&plane_state->base.src) >> 16;
@@ -3508,8 +3508,8 @@  static int skl_check_main_surface(struct intel_plane_state *plane_state)
 
 static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	int max_width = skl_max_plane_width(fb, 1, rotation);
 	int max_height = 4096;
 	int x = plane_state->base.src.x1 >> 17;
@@ -3537,7 +3537,7 @@  static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
 
 static int skl_check_ccs_aux_surface(struct intel_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	int src_x = plane_state->base.src.x1 >> 16;
 	int src_y = plane_state->base.src.y1 >> 16;
 	int hsub = fb->format->hsub;
@@ -3558,7 +3558,7 @@  static int skl_check_ccs_aux_surface(struct intel_plane_state *plane_state)
 
 int skl_check_plane_surface(struct intel_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	int ret;
 
 	ret = intel_plane_compute_gtt(plane_state);
@@ -3597,7 +3597,7 @@  static void i9xx_plane_ratio(const struct intel_crtc_state *crtc_state,
 			     const struct intel_plane_state *plane_state,
 			     unsigned int *num, unsigned int *den)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	unsigned int cpp = fb->format->cpp[0];
 
 	/*
@@ -3690,8 +3690,8 @@  static u32 i9xx_plane_ctl(const struct intel_crtc_state *crtc_state,
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	u32 dspcntr;
 
 	dspcntr = DISPLAY_PLANE_ENABLE;
@@ -3747,7 +3747,7 @@  int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	int src_x, src_y, src_w;
 	u32 offset;
 	int ret;
@@ -3784,7 +3784,7 @@  int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
 
 	/* HSW/BDW do this automagically in hardware */
 	if (!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv)) {
-		unsigned int rotation = plane_state->base.rotation;
+		unsigned int rotation = plane_state->hw.rotation;
 		int src_w = drm_rect_width(&plane_state->base.src) >> 16;
 		int src_h = drm_rect_height(&plane_state->base.src) >> 16;
 
@@ -4037,8 +4037,8 @@  static unsigned int skl_plane_stride_mult(const struct drm_framebuffer *fb,
 u32 skl_plane_stride(const struct intel_plane_state *plane_state,
 		     int color_plane)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	u32 stride = plane_state->color_plane[color_plane].stride;
 
 	if (color_plane >= fb->format->num_planes)
@@ -4107,10 +4107,10 @@  static u32 skl_plane_ctl_format(u32 pixel_format)
 
 static u32 skl_plane_ctl_alpha(const struct intel_plane_state *plane_state)
 {
-	if (!plane_state->base.fb->format->has_alpha)
+	if (!plane_state->hw.fb->format->has_alpha)
 		return PLANE_CTL_ALPHA_DISABLE;
 
-	switch (plane_state->base.pixel_blend_mode) {
+	switch (plane_state->hw.pixel_blend_mode) {
 	case DRM_MODE_BLEND_PIXEL_NONE:
 		return PLANE_CTL_ALPHA_DISABLE;
 	case DRM_MODE_BLEND_PREMULTI:
@@ -4118,17 +4118,17 @@  static u32 skl_plane_ctl_alpha(const struct intel_plane_state *plane_state)
 	case DRM_MODE_BLEND_COVERAGE:
 		return PLANE_CTL_ALPHA_HW_PREMULTIPLY;
 	default:
-		MISSING_CASE(plane_state->base.pixel_blend_mode);
+		MISSING_CASE(plane_state->hw.pixel_blend_mode);
 		return PLANE_CTL_ALPHA_DISABLE;
 	}
 }
 
 static u32 glk_plane_color_ctl_alpha(const struct intel_plane_state *plane_state)
 {
-	if (!plane_state->base.fb->format->has_alpha)
+	if (!plane_state->hw.fb->format->has_alpha)
 		return PLANE_COLOR_ALPHA_DISABLE;
 
-	switch (plane_state->base.pixel_blend_mode) {
+	switch (plane_state->hw.pixel_blend_mode) {
 	case DRM_MODE_BLEND_PIXEL_NONE:
 		return PLANE_COLOR_ALPHA_DISABLE;
 	case DRM_MODE_BLEND_PREMULTI:
@@ -4136,7 +4136,7 @@  static u32 glk_plane_color_ctl_alpha(const struct intel_plane_state *plane_state
 	case DRM_MODE_BLEND_COVERAGE:
 		return PLANE_COLOR_ALPHA_HW_PREMULTIPLY;
 	default:
-		MISSING_CASE(plane_state->base.pixel_blend_mode);
+		MISSING_CASE(plane_state->hw.pixel_blend_mode);
 		return PLANE_COLOR_ALPHA_DISABLE;
 	}
 }
@@ -4222,8 +4222,8 @@  u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
 	u32 plane_ctl;
 
@@ -4233,10 +4233,10 @@  u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
 		plane_ctl |= skl_plane_ctl_alpha(plane_state);
 		plane_ctl |= PLANE_CTL_PLANE_GAMMA_DISABLE;
 
-		if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
+		if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
 			plane_ctl |= PLANE_CTL_YUV_TO_RGB_CSC_FORMAT_BT709;
 
-		if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
+		if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
 			plane_ctl |= PLANE_CTL_YUV_RANGE_CORRECTION_DISABLE;
 	}
 
@@ -4278,7 +4278,7 @@  u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	u32 plane_color_ctl = 0;
 
@@ -4286,12 +4286,12 @@  u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
 	plane_color_ctl |= glk_plane_color_ctl_alpha(plane_state);
 
 	if (fb->format->is_yuv && !icl_is_hdr_plane(dev_priv, plane->id)) {
-		if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
+		if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
 			plane_color_ctl |= PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709;
 		else
 			plane_color_ctl |= PLANE_COLOR_CSC_MODE_YUV601_TO_RGB709;
 
-		if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
+		if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
 			plane_color_ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE;
 	} else if (fb->format->is_yuv) {
 		plane_color_ctl |= PLANE_COLOR_INPUT_CSC_ENABLE;
@@ -5625,7 +5625,7 @@  static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
 	struct intel_plane *intel_plane =
 		to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(intel_plane->base.dev);
-	struct drm_framebuffer *fb = plane_state->base.fb;
+	struct drm_framebuffer *fb = plane_state->hw.fb;
 	int ret;
 	bool force_detach = !fb || !plane_state->base.visible;
 	bool need_scaler = false;
@@ -10729,7 +10729,7 @@  static u32 intel_cursor_base(const struct intel_plane_state *plane_state)
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	const struct drm_i915_gem_object *obj = intel_fb_obj(fb);
 	u32 base;
 
@@ -10777,7 +10777,7 @@  static int intel_cursor_check_surface(struct intel_plane_state *plane_state)
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	unsigned int rotation = plane_state->base.rotation;
+	unsigned int rotation = plane_state->hw.rotation;
 	int src_x, src_y;
 	u32 offset;
 	int ret;
@@ -10810,7 +10810,7 @@  static int intel_cursor_check_surface(struct intel_plane_state *plane_state)
 
 	/* ILK+ do this automagically in hardware */
 	if (HAS_GMCH(dev_priv) && rotation & DRM_MODE_ROTATE_180) {
-		const struct drm_framebuffer *fb = plane_state->base.fb;
+		const struct drm_framebuffer *fb = plane_state->hw.fb;
 		int src_w = drm_rect_width(&plane_state->base.src) >> 16;
 		int src_h = drm_rect_height(&plane_state->base.src) >> 16;
 
@@ -10827,7 +10827,7 @@  static int intel_cursor_check_surface(struct intel_plane_state *plane_state)
 static int intel_check_cursor(struct intel_crtc_state *crtc_state,
 			      struct intel_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	int ret;
 
 	if (fb && fb->modifier != DRM_FORMAT_MOD_LINEAR) {
@@ -10901,7 +10901,7 @@  static bool i845_cursor_size_ok(const struct intel_plane_state *plane_state)
 static int i845_check_cursor(struct intel_crtc_state *crtc_state,
 			     struct intel_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	int ret;
 
 	ret = intel_check_cursor(crtc_state, plane_state);
@@ -11067,7 +11067,7 @@  static u32 i9xx_cursor_ctl(const struct intel_crtc_state *crtc_state,
 		return 0;
 	}
 
-	if (plane_state->base.rotation & DRM_MODE_ROTATE_180)
+	if (plane_state->hw.rotation & DRM_MODE_ROTATE_180)
 		cntl |= MCURSOR_ROTATE_180;
 
 	return cntl;
@@ -11100,7 +11100,7 @@  static bool i9xx_cursor_size_ok(const struct intel_plane_state *plane_state)
 	 * cursors.
 	 */
 	if (HAS_CUR_FBC(dev_priv) &&
-	    plane_state->base.rotation & DRM_MODE_ROTATE_0) {
+	    plane_state->hw.rotation & DRM_MODE_ROTATE_0) {
 		if (height < 8 || height > width)
 			return false;
 	} else {
@@ -11116,7 +11116,7 @@  static int i9xx_check_cursor(struct intel_crtc_state *crtc_state,
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	enum pipe pipe = plane->pipe;
 	int ret;
 
@@ -11720,11 +11720,11 @@  static bool intel_wm_need_update(const struct intel_plane_state *cur,
 	if (new->base.visible != cur->base.visible)
 		return true;
 
-	if (!cur->base.fb || !new->base.fb)
+	if (!cur->hw.fb || !new->hw.fb)
 		return false;
 
-	if (cur->base.fb->modifier != new->base.fb->modifier ||
-	    cur->base.rotation != new->base.rotation ||
+	if (cur->hw.fb->modifier != new->hw.fb->modifier ||
+	    cur->hw.rotation != new->hw.rotation ||
 	    drm_rect_width(&new->base.src) != drm_rect_width(&cur->base.src) ||
 	    drm_rect_height(&new->base.src) != drm_rect_height(&cur->base.src) ||
 	    drm_rect_width(&new->base.dst) != drm_rect_width(&cur->base.dst) ||
@@ -12356,7 +12356,7 @@  static const char *output_formats(enum intel_output_format format)
 static void intel_dump_plane_state(const struct intel_plane_state *plane_state)
 {
 	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;
 	struct drm_format_name_buf format_name;
 
 	if (!fb) {
@@ -12372,7 +12372,7 @@  static void intel_dump_plane_state(const struct intel_plane_state *plane_state)
 		      drm_get_format_name(fb->format->format, &format_name),
 		      yesno(plane_state->base.visible));
 	DRM_DEBUG_KMS("\trotation: 0x%x, scaler: %d\n",
-		      plane_state->base.rotation, plane_state->scaler_id);
+		      plane_state->hw.rotation, plane_state->scaler_id);
 	if (plane_state->base.visible)
 		DRM_DEBUG_KMS("\tsrc: " DRM_RECT_FP_FMT " dst: " DRM_RECT_FMT "\n",
 			      DRM_RECT_FP_ARG(&plane_state->base.src),
@@ -14876,8 +14876,8 @@  static void intel_atomic_track_fbs(struct intel_atomic_state *state)
 
 	for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state,
 					     new_plane_state, i)
-		intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->base.fb),
-					to_intel_frontbuffer(new_plane_state->base.fb),
+		intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb),
+					to_intel_frontbuffer(new_plane_state->hw.fb),
 					plane->frontbuffer_bit);
 }
 
@@ -15046,7 +15046,7 @@  static int intel_plane_pin_fb(struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	struct drm_framebuffer *fb = plane_state->base.fb;
+	struct drm_framebuffer *fb = plane_state->hw.fb;
 	struct i915_vma *vma;
 
 	if (plane->id == PLANE_CURSOR &&
@@ -15111,7 +15111,7 @@  intel_prepare_plane_fb(struct drm_plane *plane,
 	struct intel_atomic_state *intel_state =
 		to_intel_atomic_state(new_plane_state->base.state);
 	struct drm_i915_private *dev_priv = to_i915(plane->dev);
-	struct drm_framebuffer *fb = new_plane_state->base.fb;
+	struct drm_framebuffer *fb = new_plane_state->hw.fb;
 	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
 	struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->state->fb);
 	int ret;
@@ -15179,12 +15179,12 @@  intel_prepare_plane_fb(struct drm_plane *plane,
 
 		fence = dma_resv_get_excl_rcu(obj->base.resv);
 		if (fence) {
-			add_rps_boost_after_vblank(new_plane_state->base.crtc,
+			add_rps_boost_after_vblank(new_plane_state->hw.crtc,
 						   fence);
 			dma_fence_put(fence);
 		}
 	} else {
-		add_rps_boost_after_vblank(new_plane_state->base.crtc,
+		add_rps_boost_after_vblank(new_plane_state->hw.crtc,
 					   new_plane_state->base.fence);
 	}
 
@@ -15397,9 +15397,10 @@  intel_legacy_cursor_update(struct drm_plane *_plane,
 	if (ret)
 		goto out_free;
 
-	intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->base.fb), ORIGIN_FLIP);
-	intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->base.fb),
-				to_intel_frontbuffer(new_plane_state->base.fb),
+	intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->hw.fb),
+				ORIGIN_FLIP);
+	intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb),
+				to_intel_frontbuffer(new_plane_state->hw.fb),
 				plane->frontbuffer_bit);
 
 	/* Swap plane state */
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index c6cc3775f3b8..3ea8d010db6c 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -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 intel_fbc *fbc = &dev_priv->fbc;
 	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->flags = 0;
@@ -671,7 +671,7 @@  static void intel_fbc_update_state_cache(struct intel_crtc *crtc,
 	if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
 		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
 	 * 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,
 	cache->plane.adjusted_y = plane_state->color_plane[0].y;
 	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)
 		return;
@@ -1047,7 +1047,7 @@  void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
 	 * to pipe or plane A. */
 	for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
 		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)
 			continue;
diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
index 848ce07a8ec2..46e3d6cf5976 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.c
+++ b/drivers/gpu/drm/i915/display/intel_overlay.c
@@ -669,7 +669,7 @@  static void update_colorkey(struct intel_overlay *overlay,
 		flags |= DST_KEY_ENABLE;
 
 	if (state->base.visible)
-		format = state->base.fb->format->format;
+		format = state->hw.fb->format->format;
 
 	switch (format) {
 	case DRM_FORMAT_C8:
diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
index 5ba8faf0ccfe..b2116d123548 100644
--- a/drivers/gpu/drm/i915/display/intel_sprite.c
+++ b/drivers/gpu/drm/i915/display/intel_sprite.c
@@ -241,8 +241,8 @@  void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state)
 int intel_plane_check_stride(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	u32 stride, max_stride;
 
 	/*
@@ -272,10 +272,10 @@  int intel_plane_check_stride(const struct intel_plane_state *plane_state)
 
 int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	struct drm_rect *src = &plane_state->base.src;
 	u32 src_x, src_y, src_w, src_h, hsub, vsub;
-	bool rotated = drm_rotation_90_or_270(plane_state->base.rotation);
+	bool rotated = drm_rotation_90_or_270(plane_state->hw.rotation);
 
 	/*
 	 * Hardware doesn't handle subpixel coordinates.
@@ -329,7 +329,7 @@  skl_plane_ratio(const struct intel_crtc_state *crtc_state,
 		unsigned int *num, unsigned int *den)
 {
 	struct drm_i915_private *dev_priv = to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 
 	if (fb->format->cpp[0] == 8) {
 		if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
@@ -396,7 +396,7 @@  skl_program_scaler(struct intel_plane *plane,
 		   const struct intel_plane_state *plane_state)
 {
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	enum pipe pipe = plane->pipe;
 	int scaler_id = plane_state->scaler_id;
 	const struct intel_scaler *scaler =
@@ -542,10 +542,10 @@  icl_program_input_csc(struct intel_plane *plane,
 	};
 	const u16 *csc;
 
-	if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
-		csc = input_csc_matrix[plane_state->base.color_encoding];
+	if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
+		csc = input_csc_matrix[plane_state->hw.color_encoding];
 	else
-		csc = input_csc_matrix_lr[plane_state->base.color_encoding];
+		csc = input_csc_matrix_lr[plane_state->hw.color_encoding];
 
 	I915_WRITE_FW(PLANE_INPUT_CSC_COEFF(pipe, plane_id, 0), ROFF(csc[0]) |
 		      GOFF(csc[1]));
@@ -559,7 +559,7 @@  icl_program_input_csc(struct intel_plane *plane,
 
 	I915_WRITE_FW(PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 0),
 		      PREOFF_YUV_TO_RGB_HI);
-	if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
+	if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
 		I915_WRITE_FW(PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 1), 0);
 	else
 		I915_WRITE_FW(PLANE_INPUT_CSC_PREOFF(pipe, plane_id, 1),
@@ -591,8 +591,8 @@  skl_program_plane(struct intel_plane *plane,
 	u32 src_w = drm_rect_width(&plane_state->base.src) >> 16;
 	u32 src_h = drm_rect_height(&plane_state->base.src) >> 16;
 	struct intel_plane *linked = plane_state->planar_linked_plane;
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	u8 alpha = plane_state->base.alpha >> 8;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	u8 alpha = plane_state->hw.alpha >> 8;
 	u32 plane_color_ctl = 0;
 	unsigned long irqflags;
 	u32 keymsk, keymax;
@@ -768,7 +768,7 @@  chv_update_csc(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	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;
 	/*
 	 * |r|   | c0 c1 c2 |   |cr|
@@ -794,7 +794,7 @@  chv_update_csc(const struct intel_plane_state *plane_state)
 			    0, 4096,  7601,
 		},
 	};
-	const s16 *csc = csc_matrix[plane_state->base.color_encoding];
+	const s16 *csc = csc_matrix[plane_state->hw.color_encoding];
 
 	/* Seems RGB data bypasses the CSC always */
 	if (!fb->format->is_yuv)
@@ -827,13 +827,13 @@  vlv_update_clrc(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	enum pipe pipe = plane->pipe;
 	enum plane_id plane_id = plane->id;
 	int contrast, brightness, sh_scale, sh_sin, sh_cos;
 
 	if (fb->format->is_yuv &&
-	    plane_state->base.color_range == DRM_COLOR_YCBCR_LIMITED_RANGE) {
+	    plane_state->hw.color_range == DRM_COLOR_YCBCR_LIMITED_RANGE) {
 		/*
 		 * Expand limited range to full range:
 		 * Contrast is applied first and is used to expand Y range.
@@ -867,7 +867,7 @@  vlv_plane_ratio(const struct intel_crtc_state *crtc_state,
 		unsigned int *num, unsigned int *den)
 {
 	u8 active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	unsigned int cpp = fb->format->cpp[0];
 
 	/*
@@ -953,8 +953,8 @@  static u32 vlv_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
 static u32 vlv_sprite_ctl(const struct intel_crtc_state *crtc_state,
 			  const struct intel_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
 	u32 sprctl;
 
@@ -999,7 +999,7 @@  static u32 vlv_sprite_ctl(const struct intel_crtc_state *crtc_state,
 		return 0;
 	}
 
-	if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
+	if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
 		sprctl |= SP_YUV_FORMAT_BT709;
 
 	if (fb->modifier == I915_FORMAT_MOD_X_TILED)
@@ -1021,7 +1021,7 @@  static void vlv_update_gamma(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	enum pipe pipe = plane->pipe;
 	enum plane_id plane_id = plane->id;
 	u16 gamma[8];
@@ -1151,7 +1151,7 @@  static void ivb_plane_ratio(const struct intel_crtc_state *crtc_state,
 			    unsigned int *num, unsigned int *den)
 {
 	u8 active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	unsigned int cpp = fb->format->cpp[0];
 
 	if (hweight8(active_planes) == 2) {
@@ -1187,7 +1187,7 @@  static void ivb_plane_ratio_scaling(const struct intel_crtc_state *crtc_state,
 				    const struct intel_plane_state *plane_state,
 				    unsigned int *num, unsigned int *den)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	unsigned int cpp = fb->format->cpp[0];
 
 	switch (cpp) {
@@ -1265,7 +1265,7 @@  static void hsw_plane_ratio(const struct intel_crtc_state *crtc_state,
 			    unsigned int *num, unsigned int *den)
 {
 	u8 active_planes = crtc_state->active_planes & ~BIT(PLANE_CURSOR);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	unsigned int cpp = fb->format->cpp[0];
 
 	if (hweight8(active_planes) == 2) {
@@ -1321,7 +1321,7 @@  static bool ivb_need_sprite_gamma(const struct intel_plane_state *plane_state)
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 
 	return fb->format->cpp[0] == 8 &&
 		(IS_IVYBRIDGE(dev_priv) || IS_HASWELL(dev_priv));
@@ -1332,8 +1332,8 @@  static u32 ivb_sprite_ctl(const struct intel_crtc_state *crtc_state,
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
 	u32 sprctl;
 
@@ -1375,10 +1375,10 @@  static u32 ivb_sprite_ctl(const struct intel_crtc_state *crtc_state,
 	if (!ivb_need_sprite_gamma(plane_state))
 		sprctl |= SPRITE_INT_GAMMA_DISABLE;
 
-	if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
+	if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
 		sprctl |= SPRITE_YUV_TO_RGB_CSC_FORMAT_BT709;
 
-	if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
+	if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
 		sprctl |= SPRITE_YUV_RANGE_CORRECTION_DISABLE;
 
 	if (fb->modifier == I915_FORMAT_MOD_X_TILED)
@@ -1567,7 +1567,7 @@  ivb_plane_get_hw_state(struct intel_plane *plane,
 static int g4x_sprite_min_cdclk(const struct intel_crtc_state *crtc_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 hscale, pixel_rate;
 	unsigned int limit, decimate;
 
@@ -1637,8 +1637,8 @@  static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
 	u32 dvscntr;
 
@@ -1677,10 +1677,10 @@  static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
 		return 0;
 	}
 
-	if (plane_state->base.color_encoding == DRM_COLOR_YCBCR_BT709)
+	if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
 		dvscntr |= DVS_YUV_FORMAT_BT709;
 
-	if (plane_state->base.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
+	if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
 		dvscntr |= DVS_YUV_RANGE_CORRECTION_DISABLE;
 
 	if (fb->modifier == I915_FORMAT_MOD_X_TILED)
@@ -1701,7 +1701,7 @@  static void g4x_update_gamma(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	enum pipe pipe = plane->pipe;
 	u16 gamma[8];
 	int i;
@@ -1733,7 +1733,7 @@  static void ilk_update_gamma(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	enum pipe pipe = plane->pipe;
 	u16 gamma[17];
 	int i;
@@ -1887,7 +1887,7 @@  static int
 g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state,
 			 struct intel_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	const struct drm_rect *src = &plane_state->base.src;
 	const struct drm_rect *dst = &plane_state->base.dst;
 	int src_x, src_w, src_h, crtc_w, crtc_h;
@@ -1954,7 +1954,7 @@  g4x_sprite_check(struct intel_crtc_state *crtc_state,
 	int max_scale = DRM_PLANE_HELPER_NO_SCALING;
 	int ret;
 
-	if (intel_fb_scalable(plane_state->base.fb)) {
+	if (intel_fb_scalable(plane_state->hw.fb)) {
 		if (INTEL_GEN(dev_priv) < 7) {
 			min_scale = 1;
 			max_scale = 16 << 16;
@@ -1998,7 +1998,7 @@  int chv_plane_check_rotation(const struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	unsigned int rotation = plane_state->base.rotation;
+	unsigned int rotation = plane_state->hw.rotation;
 
 	/* CHV ignores the mirror bit when the rotate bit is set :( */
 	if (IS_CHERRYVIEW(dev_priv) &&
@@ -2050,8 +2050,8 @@  static int skl_plane_check_fb(const struct intel_crtc_state *crtc_state,
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	struct drm_format_name_buf format_name;
 
 	if (!fb)
@@ -2151,8 +2151,8 @@  static int skl_plane_check_dst_coordinates(const struct intel_crtc_state *crtc_s
 
 static int skl_plane_check_nv12_rotation(const struct intel_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = plane_state->base.fb;
-	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
+	unsigned int rotation = plane_state->hw.rotation;
 	int src_w = drm_rect_width(&plane_state->base.src) >> 16;
 
 	/* Display WA #1106 */
@@ -2187,7 +2187,7 @@  static int skl_plane_check(struct intel_crtc_state *crtc_state,
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
-	const struct drm_framebuffer *fb = plane_state->base.fb;
+	const struct drm_framebuffer *fb = plane_state->hw.fb;
 	int min_scale = DRM_PLANE_HELPER_NO_SCALING;
 	int max_scale = DRM_PLANE_HELPER_NO_SCALING;
 	int ret;
@@ -2229,7 +2229,7 @@  static int skl_plane_check(struct intel_crtc_state *crtc_state,
 		return ret;
 
 	/* HW only has 8 bits pixel precision, disable plane if invisible */
-	if (!(plane_state->base.alpha >> 8))
+	if (!(plane_state->hw.alpha >> 8))
 		plane_state->base.visible = false;
 
 	plane_state->ctl = skl_plane_ctl(crtc_state, plane_state);
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index de7703ac528d..25a8e20d2112 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -801,7 +801,7 @@  static bool intel_wm_plane_visible(const struct intel_crtc_state *crtc_state,
 	 * around this problem with the watermark code.
 	 */
 	if (plane->id == PLANE_CURSOR)
-		return plane_state->base.fb != NULL;
+		return plane_state->hw.fb != NULL;
 	else
 		return plane_state->base.visible;
 }
@@ -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))
 		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
@@ -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,
 					     old_plane_state,
 					     new_plane_state, i) {
-		if (new_plane_state->base.crtc != &crtc->base &&
-		    old_plane_state->base.crtc != &crtc->base)
+		if (new_plane_state->hw.crtc != &crtc->base &&
+		    old_plane_state->hw.crtc != &crtc->base)
 			continue;
 
 		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,
 	if (!intel_wm_plane_visible(crtc_state, plane_state))
 		return 0;
 
-	cpp = plane_state->base.fb->format->cpp[0];
+	cpp = plane_state->hw.fb->format->cpp[0];
 	clock = adjusted_mode->crtc_clock;
 	htotal = adjusted_mode->crtc_htotal;
 	width = crtc_state->pipe_src_w;
@@ -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,
 					     old_plane_state,
 					     new_plane_state, i) {
-		if (new_plane_state->base.crtc != &crtc->base &&
-		    old_plane_state->base.crtc != &crtc->base)
+		if (new_plane_state->hw.crtc != &crtc->base &&
+		    old_plane_state->hw.crtc != &crtc->base)
 			continue;
 
 		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,
 	if (!intel_wm_plane_visible(crtc_state, plane_state))
 		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);
 
@@ -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))
 		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);
 	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,
 	if (!intel_wm_plane_visible(crtc_state, plane_state))
 		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,
 			      crtc_state->hw.adjusted_mode.crtc_htotal,
@@ -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))
 		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);
 }
@@ -4091,7 +4091,7 @@  skl_plane_relative_data_rate(const struct intel_crtc_state *crtc_state,
 			     int color_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 width = 0, height = 0;
 	uint_fixed_16_16_t down_scale_amount;
@@ -4612,7 +4612,7 @@  skl_compute_plane_wm_params(const struct intel_crtc_state *crtc_state,
 			    const struct intel_plane_state *plane_state,
 			    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;
 
 	/*
@@ -4624,7 +4624,7 @@  skl_compute_plane_wm_params(const struct intel_crtc_state *crtc_state,
 
 	return skl_compute_wm_params(crtc_state, width,
 				     fb->format, fb->modifier,
-				     plane_state->base.rotation,
+				     plane_state->hw.rotation,
 				     skl_adjusted_plane_pixel_rate(crtc_state, plane_state),
 				     wp, color_plane);
 }
@@ -4903,7 +4903,7 @@  static int skl_build_plane_wm(struct intel_crtc_state *crtc_state,
 			      const struct intel_plane_state *plane_state)
 {
 	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;
 	int ret;
 
@@ -4936,7 +4936,7 @@  static int icl_build_plane_wm(struct intel_crtc_state *crtc_state,
 		return 0;
 
 	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;
 
 		WARN_ON(!intel_wm_plane_visible(crtc_state, plane_state));