to_intel_display() generics can handle struct intel_plane_state, struct intel_atomic_state, and struct intel_crtc just fine. Pass them directly.
Signed-off-by: Jani Nikula <[email protected]> --- drivers/gpu/drm/i915/display/intel_fbc.c | 34 ++++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c index dd306e30d620..66d9674b4e47 100644 --- a/drivers/gpu/drm/i915/display/intel_fbc.c +++ b/drivers/gpu/drm/i915/display/intel_fbc.c @@ -215,7 +215,7 @@ static unsigned int _intel_fbc_cfb_stride(struct intel_display *display, static unsigned int intel_fbc_cfb_stride(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); unsigned int stride = intel_fbc_plane_cfb_stride(plane_state); unsigned int width = drm_rect_width(&plane_state->uapi.src) >> 16; unsigned int cpp = intel_fbc_cfb_cpp(plane_state); @@ -246,7 +246,7 @@ static unsigned int _intel_fbc_cfb_size(struct intel_display *display, static unsigned int intel_fbc_cfb_size(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); unsigned int height = drm_rect_height(&plane_state->uapi.src) >> 16; return _intel_fbc_cfb_size(display, height, intel_fbc_cfb_stride(plane_state)); @@ -254,7 +254,7 @@ static unsigned int intel_fbc_cfb_size(const struct intel_plane_state *plane_sta static u16 intel_fbc_override_cfb_stride(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); unsigned int stride_aligned = intel_fbc_cfb_stride(plane_state); unsigned int stride = intel_fbc_plane_cfb_stride(plane_state); const struct drm_framebuffer *fb = plane_state->hw.fb; @@ -1025,7 +1025,7 @@ static bool icl_fbc_stride_is_valid(const struct intel_plane_state *plane_state) static bool stride_is_valid(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); if (DISPLAY_VER(display) >= 11) return icl_fbc_stride_is_valid(plane_state); @@ -1041,7 +1041,7 @@ static bool stride_is_valid(const struct intel_plane_state *plane_state) static bool i8xx_fbc_pixel_format_is_valid(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); const struct drm_framebuffer *fb = plane_state->hw.fb; switch (fb->format->format) { @@ -1061,7 +1061,7 @@ static bool i8xx_fbc_pixel_format_is_valid(const struct intel_plane_state *plane static bool g4x_fbc_pixel_format_is_valid(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); const struct drm_framebuffer *fb = plane_state->hw.fb; switch (fb->format->format) { @@ -1140,7 +1140,7 @@ intel_fbc_is_enable_pixel_normalizer(const struct intel_plane_state *plane_state static bool pixel_format_is_valid(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); if (DISPLAY_VER(display) >= 35) return xe3p_lpd_fbc_pixel_format_is_valid(plane_state); @@ -1176,7 +1176,7 @@ static bool skl_fbc_rotation_is_valid(const struct intel_plane_state *plane_stat static bool rotation_is_valid(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); if (DISPLAY_VER(display) >= 9) return skl_fbc_rotation_is_valid(plane_state); @@ -1215,7 +1215,7 @@ static void intel_fbc_max_surface_size(struct intel_display *display, */ static bool intel_fbc_surface_size_ok(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); unsigned int effective_w, effective_h, max_w, max_h; intel_fbc_max_surface_size(display, &max_w, &max_h); @@ -1248,7 +1248,7 @@ static void intel_fbc_max_plane_size(struct intel_display *display, static bool intel_fbc_plane_size_valid(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); unsigned int w, h, max_w, max_h; intel_fbc_max_plane_size(display, &max_w, &max_h); @@ -1273,7 +1273,7 @@ static bool skl_fbc_tiling_valid(const struct intel_plane_state *plane_state) static bool tiling_is_valid(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); if (DISPLAY_VER(display) >= 9) return skl_fbc_tiling_valid(plane_state); @@ -1353,7 +1353,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_plane *plane) { - struct intel_display *display = to_intel_display(state->base.dev); + struct intel_display *display = to_intel_display(state); const struct intel_crtc_state *crtc_state = intel_atomic_get_new_crtc_state(state, crtc); const struct intel_plane_state *plane_state = @@ -1386,7 +1386,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state, static bool intel_fbc_is_fence_ok(const struct intel_plane_state *plane_state) { - struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev); + struct intel_display *display = to_intel_display(plane_state); /* * The use of a CPU fence is one of two ways to detect writes by the @@ -1493,7 +1493,7 @@ static int _intel_fbc_min_cdclk(const struct intel_crtc_state *crtc_state) static int intel_fbc_check_plane(struct intel_atomic_state *state, struct intel_plane *plane) { - struct intel_display *display = to_intel_display(state->base.dev); + struct intel_display *display = to_intel_display(state); struct intel_plane_state *plane_state = intel_atomic_get_new_plane_state(state, plane); const struct drm_framebuffer *fb = plane_state->hw.fb; @@ -1720,7 +1720,7 @@ static bool __intel_fbc_pre_update(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_plane *plane) { - struct intel_display *display = to_intel_display(state->base.dev); + struct intel_display *display = to_intel_display(state); struct intel_fbc *fbc = plane->fbc; bool need_vblank_wait = false; @@ -1933,7 +1933,7 @@ static void __intel_fbc_enable(struct intel_atomic_state *state, struct intel_crtc *crtc, struct intel_plane *plane) { - struct intel_display *display = to_intel_display(state->base.dev); + struct intel_display *display = to_intel_display(state); const struct intel_plane_state *plane_state = intel_atomic_get_new_plane_state(state, plane); struct intel_fbc *fbc = plane->fbc; @@ -1995,7 +1995,7 @@ static void __intel_fbc_enable(struct intel_atomic_state *state, */ void intel_fbc_disable(struct intel_crtc *crtc) { - struct intel_display *display = to_intel_display(crtc->base.dev); + struct intel_display *display = to_intel_display(crtc); struct intel_plane *plane; for_each_intel_plane(display->drm, plane) { -- 2.47.3
