diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-01-23 12:08:57 -0500 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-03-05 13:48:25 -0500 |
commit | 81af63a4af82e739aaa391d1fbb97e02c58ea6a1 (patch) | |
tree | aea5f65acb5f736351943e2f1199c71b07a85e1b | |
parent | bf817d0cf719d07d642837de00160ad03ec5fe9a (diff) |
drm: Don't pass clip to drm_atomic_helper_check_plane_state()
Move the plane clip rectangle handling into
drm_atomic_helper_check_plane_state(). Drivers no longer
have to worry about such mundane details.
v2: Convert armada, rcar, and sun4i as well
v3: Resolve simple_kms_helper conflict
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Brian Starkey <brian.starkey@arm.com>
Cc: Mali DP Maintainers <malidp@foss.arm.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: CK Hu <ck.hu@mediatek.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
Cc: Sinclair Yeh <syeh@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Archit Taneja <architt@codeaurora.org> #msm
Link: https://patchwork.freedesktop.org/patch/msgid/20180123170857.13818-5-ville.syrjala@linux.intel.com
Acked-by: Liviu Dudau <liviu.dudau@arm.com> #hdlcd,malidp
Acked-by: Philipp Zabel <p.zabel@pengutronix.de> #imx,mtk
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com> #vmwgfx
Acked-by: Neil Armstrong <narmstrong@baylibre.com> #meson
Acked-by: Shawn Guo <shawnguo@kernel.org> #zte
22 files changed, 28 insertions, 145 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 877647ef35a9..cf5cbd63ecdf 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c | |||
@@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = { | |||
229 | static int hdlcd_plane_atomic_check(struct drm_plane *plane, | 229 | static int hdlcd_plane_atomic_check(struct drm_plane *plane, |
230 | struct drm_plane_state *state) | 230 | struct drm_plane_state *state) |
231 | { | 231 | { |
232 | struct drm_rect clip = { 0 }; | ||
233 | struct drm_crtc_state *crtc_state; | 232 | struct drm_crtc_state *crtc_state; |
234 | u32 src_h = state->src_h >> 16; | 233 | u32 src_h = state->src_h >> 16; |
235 | 234 | ||
@@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, | |||
249 | return -EINVAL; | 248 | return -EINVAL; |
250 | } | 249 | } |
251 | 250 | ||
252 | if (crtc_state->enable) | 251 | return drm_atomic_helper_check_plane_state(state, crtc_state, |
253 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
254 | &clip.x2, &clip.y2); | ||
255 | |||
256 | return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
257 | DRM_PLANE_HELPER_NO_SCALING, | 252 | DRM_PLANE_HELPER_NO_SCALING, |
258 | DRM_PLANE_HELPER_NO_SCALING, | 253 | DRM_PLANE_HELPER_NO_SCALING, |
259 | false, true); | 254 | false, true); |
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 2885d69af456..ee32361c87ac 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c | |||
@@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, | |||
141 | struct drm_crtc_state *crtc_state = | 141 | struct drm_crtc_state *crtc_state = |
142 | drm_atomic_get_existing_crtc_state(state->state, state->crtc); | 142 | drm_atomic_get_existing_crtc_state(state->state, state->crtc); |
143 | struct malidp_crtc_state *mc; | 143 | struct malidp_crtc_state *mc; |
144 | struct drm_rect clip = { 0 }; | ||
145 | u32 src_w, src_h; | 144 | u32 src_w, src_h; |
146 | int ret; | 145 | int ret; |
147 | 146 | ||
148 | if (!crtc_state) | 147 | if (!crtc_state) |
149 | return -EINVAL; | 148 | return -EINVAL; |
150 | 149 | ||
151 | if (crtc_state->enable) | 150 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, |
152 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
153 | &clip.x2, &clip.y2); | ||
154 | |||
155 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
156 | 0, INT_MAX, true, true); | 151 | 0, INT_MAX, true, true); |
157 | if (ret) | 152 | if (ret) |
158 | return ret; | 153 | return ret; |
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index fdc34ad4ca62..03eeee11dd5b 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c | |||
@@ -1203,15 +1203,11 @@ static int armada_drm_primary_update(struct drm_plane *plane, | |||
1203 | struct drm_crtc_state crtc_state = { | 1203 | struct drm_crtc_state crtc_state = { |
1204 | .crtc = crtc, | 1204 | .crtc = crtc, |
1205 | .enable = crtc->enabled, | 1205 | .enable = crtc->enabled, |
1206 | .mode = crtc->mode, | ||
1206 | }; | 1207 | }; |
1207 | struct drm_rect clip = {}; | ||
1208 | int ret; | 1208 | int ret; |
1209 | 1209 | ||
1210 | if (crtc->enabled) | 1210 | ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, 0, |
1211 | drm_mode_get_hv_timing(&crtc->mode, | ||
1212 | &clip.x2, &clip.y2); | ||
1213 | |||
1214 | ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0, | ||
1215 | INT_MAX, true, false); | 1211 | INT_MAX, true, false); |
1216 | if (ret) | 1212 | if (ret) |
1217 | return ret; | 1213 | return ret; |
diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 4f2a7a6e0fd3..c391955009d6 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c | |||
@@ -208,19 +208,15 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, | |||
208 | struct drm_crtc_state crtc_state = { | 208 | struct drm_crtc_state crtc_state = { |
209 | .crtc = crtc, | 209 | .crtc = crtc, |
210 | .enable = crtc->enabled, | 210 | .enable = crtc->enabled, |
211 | .mode = crtc->mode, | ||
211 | }; | 212 | }; |
212 | struct drm_rect clip = {}; | ||
213 | int ret; | 213 | int ret; |
214 | 214 | ||
215 | trace_armada_ovl_plane_update(plane, crtc, fb, | 215 | trace_armada_ovl_plane_update(plane, crtc, fb, |
216 | crtc_x, crtc_y, crtc_w, crtc_h, | 216 | crtc_x, crtc_y, crtc_w, crtc_h, |
217 | src_x, src_y, src_w, src_h); | 217 | src_x, src_y, src_w, src_h); |
218 | 218 | ||
219 | if (crtc->enabled) | 219 | ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, 0, |
220 | drm_mode_get_hv_timing(&crtc->mode, | ||
221 | &clip.x2, &clip.y2); | ||
222 | |||
223 | ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0, | ||
224 | INT_MAX, true, false); | 220 | INT_MAX, true, false); |
225 | if (ret) | 221 | if (ret) |
226 | return ret; | 222 | return ret; |
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index ae3cbfe9e01c..00c78c1c9681 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); | |||
699 | * drm_atomic_helper_check_plane_state() - Check plane state for validity | 699 | * drm_atomic_helper_check_plane_state() - Check plane state for validity |
700 | * @plane_state: plane state to check | 700 | * @plane_state: plane state to check |
701 | * @crtc_state: crtc state to check | 701 | * @crtc_state: crtc state to check |
702 | * @clip: integer clipping coordinates | ||
703 | * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point | 702 | * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point |
704 | * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point | 703 | * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point |
705 | * @can_position: is it legal to position the plane such that it | 704 | * @can_position: is it legal to position the plane such that it |
@@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); | |||
719 | */ | 718 | */ |
720 | int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, | 719 | int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, |
721 | const struct drm_crtc_state *crtc_state, | 720 | const struct drm_crtc_state *crtc_state, |
722 | const struct drm_rect *clip, | ||
723 | int min_scale, | 721 | int min_scale, |
724 | int max_scale, | 722 | int max_scale, |
725 | bool can_position, | 723 | bool can_position, |
@@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, | |||
729 | struct drm_rect *src = &plane_state->src; | 727 | struct drm_rect *src = &plane_state->src; |
730 | struct drm_rect *dst = &plane_state->dst; | 728 | struct drm_rect *dst = &plane_state->dst; |
731 | unsigned int rotation = plane_state->rotation; | 729 | unsigned int rotation = plane_state->rotation; |
730 | struct drm_rect clip = {}; | ||
732 | int hscale, vscale; | 731 | int hscale, vscale; |
733 | 732 | ||
734 | WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); | 733 | WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); |
@@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, | |||
764 | return -ERANGE; | 763 | return -ERANGE; |
765 | } | 764 | } |
766 | 765 | ||
767 | plane_state->visible = drm_rect_clip_scaled(src, dst, clip, hscale, vscale); | 766 | if (crtc_state->enable) |
767 | drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2); | ||
768 | |||
769 | plane_state->visible = drm_rect_clip_scaled(src, dst, &clip, hscale, vscale); | ||
768 | 770 | ||
769 | drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation); | 771 | drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation); |
770 | 772 | ||
@@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, | |||
778 | */ | 780 | */ |
779 | return 0; | 781 | return 0; |
780 | 782 | ||
781 | if (!can_position && !drm_rect_equals(dst, clip)) { | 783 | if (!can_position && !drm_rect_equals(dst, &clip)) { |
782 | DRM_DEBUG_KMS("Plane must cover entire CRTC\n"); | 784 | DRM_DEBUG_KMS("Plane must cover entire CRTC\n"); |
783 | drm_rect_debug_print("dst: ", dst, false); | 785 | drm_rect_debug_print("dst: ", dst, false); |
784 | drm_rect_debug_print("clip: ", clip, false); | 786 | drm_rect_debug_print("clip: ", &clip, false); |
785 | return -EINVAL; | 787 | return -EINVAL; |
786 | } | 788 | } |
787 | 789 | ||
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index f1be8cd4e387..f88f68161519 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c | |||
@@ -106,7 +106,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc, | |||
106 | * @fb: framebuffer to flip onto plane | 106 | * @fb: framebuffer to flip onto plane |
107 | * @src: source coordinates in 16.16 fixed point | 107 | * @src: source coordinates in 16.16 fixed point |
108 | * @dst: integer destination coordinates | 108 | * @dst: integer destination coordinates |
109 | * @clip: integer clipping coordinates | ||
110 | * @rotation: plane rotation | 109 | * @rotation: plane rotation |
111 | * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point | 110 | * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point |
112 | * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point | 111 | * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point |
@@ -131,7 +130,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, | |||
131 | struct drm_framebuffer *fb, | 130 | struct drm_framebuffer *fb, |
132 | struct drm_rect *src, | 131 | struct drm_rect *src, |
133 | struct drm_rect *dst, | 132 | struct drm_rect *dst, |
134 | const struct drm_rect *clip, | ||
135 | unsigned int rotation, | 133 | unsigned int rotation, |
136 | int min_scale, | 134 | int min_scale, |
137 | int max_scale, | 135 | int max_scale, |
@@ -157,11 +155,12 @@ int drm_plane_helper_check_update(struct drm_plane *plane, | |||
157 | struct drm_crtc_state crtc_state = { | 155 | struct drm_crtc_state crtc_state = { |
158 | .crtc = crtc, | 156 | .crtc = crtc, |
159 | .enable = crtc->enabled, | 157 | .enable = crtc->enabled, |
158 | .mode = crtc->mode, | ||
160 | }; | 159 | }; |
161 | int ret; | 160 | int ret; |
162 | 161 | ||
163 | ret = drm_atomic_helper_check_plane_state(&plane_state, &crtc_state, | 162 | ret = drm_atomic_helper_check_plane_state(&plane_state, &crtc_state, |
164 | clip, min_scale, max_scale, | 163 | min_scale, max_scale, |
165 | can_position, | 164 | can_position, |
166 | can_update_disabled); | 165 | can_update_disabled); |
167 | if (ret) | 166 | if (ret) |
@@ -239,16 +238,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, | |||
239 | .x2 = crtc_x + crtc_w, | 238 | .x2 = crtc_x + crtc_w, |
240 | .y2 = crtc_y + crtc_h, | 239 | .y2 = crtc_y + crtc_h, |
241 | }; | 240 | }; |
242 | const struct drm_rect clip = { | ||
243 | .x2 = crtc->mode.hdisplay, | ||
244 | .y2 = crtc->mode.vdisplay, | ||
245 | }; | ||
246 | struct drm_connector **connector_list; | 241 | struct drm_connector **connector_list; |
247 | int num_connectors, ret; | 242 | int num_connectors, ret; |
248 | bool visible; | 243 | bool visible; |
249 | 244 | ||
250 | ret = drm_plane_helper_check_update(plane, crtc, fb, | 245 | ret = drm_plane_helper_check_update(plane, crtc, fb, |
251 | &src, &dest, &clip, | 246 | &src, &dest, |
252 | DRM_MODE_ROTATE_0, | 247 | DRM_MODE_ROTATE_0, |
253 | DRM_PLANE_HELPER_NO_SCALING, | 248 | DRM_PLANE_HELPER_NO_SCALING, |
254 | DRM_PLANE_HELPER_NO_SCALING, | 249 | DRM_PLANE_HELPER_NO_SCALING, |
diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c index 6808f732f285..987a353c7f72 100644 --- a/drivers/gpu/drm/drm_simple_kms_helper.c +++ b/drivers/gpu/drm/drm_simple_kms_helper.c | |||
@@ -128,7 +128,6 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = { | |||
128 | static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, | 128 | static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, |
129 | struct drm_plane_state *plane_state) | 129 | struct drm_plane_state *plane_state) |
130 | { | 130 | { |
131 | struct drm_rect clip = { 0 }; | ||
132 | struct drm_simple_display_pipe *pipe; | 131 | struct drm_simple_display_pipe *pipe; |
133 | struct drm_crtc_state *crtc_state; | 132 | struct drm_crtc_state *crtc_state; |
134 | int ret; | 133 | int ret; |
@@ -138,7 +137,6 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, | |||
138 | &pipe->crtc); | 137 | &pipe->crtc); |
139 | 138 | ||
140 | ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, | 139 | ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, |
141 | &clip, | ||
142 | DRM_PLANE_HELPER_NO_SCALING, | 140 | DRM_PLANE_HELPER_NO_SCALING, |
143 | DRM_PLANE_HELPER_NO_SCALING, | 141 | DRM_PLANE_HELPER_NO_SCALING, |
144 | false, true); | 142 | false, true); |
@@ -148,8 +146,6 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, | |||
148 | if (!plane_state->visible) | 146 | if (!plane_state->visible) |
149 | return 0; | 147 | return 0; |
150 | 148 | ||
151 | drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2); | ||
152 | |||
153 | if (!pipe->funcs || !pipe->funcs->check) | 149 | if (!pipe->funcs || !pipe->funcs->check) |
154 | return 0; | 150 | return 0; |
155 | 151 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2dceb4cc5f30..250597e6f580 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -9360,18 +9360,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, | |||
9360 | struct intel_plane_state *plane_state) | 9360 | struct intel_plane_state *plane_state) |
9361 | { | 9361 | { |
9362 | const struct drm_framebuffer *fb = plane_state->base.fb; | 9362 | const struct drm_framebuffer *fb = plane_state->base.fb; |
9363 | struct drm_rect clip = {}; | ||
9364 | int src_x, src_y; | 9363 | int src_x, src_y; |
9365 | u32 offset; | 9364 | u32 offset; |
9366 | int ret; | 9365 | int ret; |
9367 | 9366 | ||
9368 | if (crtc_state->base.enable) | ||
9369 | drm_mode_get_hv_timing(&crtc_state->base.mode, | ||
9370 | &clip.x2, &clip.y2); | ||
9371 | |||
9372 | ret = drm_atomic_helper_check_plane_state(&plane_state->base, | 9367 | ret = drm_atomic_helper_check_plane_state(&plane_state->base, |
9373 | &crtc_state->base, | 9368 | &crtc_state->base, |
9374 | &clip, | ||
9375 | DRM_PLANE_HELPER_NO_SCALING, | 9369 | DRM_PLANE_HELPER_NO_SCALING, |
9376 | DRM_PLANE_HELPER_NO_SCALING, | 9370 | DRM_PLANE_HELPER_NO_SCALING, |
9377 | true, true); | 9371 | true, true); |
@@ -12806,7 +12800,6 @@ intel_check_primary_plane(struct intel_plane *plane, | |||
12806 | int min_scale = DRM_PLANE_HELPER_NO_SCALING; | 12800 | int min_scale = DRM_PLANE_HELPER_NO_SCALING; |
12807 | int max_scale = DRM_PLANE_HELPER_NO_SCALING; | 12801 | int max_scale = DRM_PLANE_HELPER_NO_SCALING; |
12808 | bool can_position = false; | 12802 | bool can_position = false; |
12809 | struct drm_rect clip = {}; | ||
12810 | int ret; | 12803 | int ret; |
12811 | 12804 | ||
12812 | if (INTEL_GEN(dev_priv) >= 9) { | 12805 | if (INTEL_GEN(dev_priv) >= 9) { |
@@ -12818,13 +12811,8 @@ intel_check_primary_plane(struct intel_plane *plane, | |||
12818 | can_position = true; | 12811 | can_position = true; |
12819 | } | 12812 | } |
12820 | 12813 | ||
12821 | if (crtc_state->base.enable) | ||
12822 | drm_mode_get_hv_timing(&crtc_state->base.mode, | ||
12823 | &clip.x2, &clip.y2); | ||
12824 | |||
12825 | ret = drm_atomic_helper_check_plane_state(&state->base, | 12814 | ret = drm_atomic_helper_check_plane_state(&state->base, |
12826 | &crtc_state->base, | 12815 | &crtc_state->base, |
12827 | &clip, | ||
12828 | min_scale, max_scale, | 12816 | min_scale, max_scale, |
12829 | can_position, true); | 12817 | can_position, true); |
12830 | if (ret) | 12818 | if (ret) |
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index 150628293c51..d7e3583e608e 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c | |||
@@ -351,7 +351,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, | |||
351 | struct drm_framebuffer *old_fb = old_state->fb; | 351 | struct drm_framebuffer *old_fb = old_state->fb; |
352 | unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba; | 352 | unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba; |
353 | bool can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY); | 353 | bool can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY); |
354 | struct drm_rect clip = {}; | ||
355 | int hsub, vsub; | 354 | int hsub, vsub; |
356 | int ret; | 355 | int ret; |
357 | 356 | ||
@@ -367,11 +366,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, | |||
367 | if (WARN_ON(!crtc_state)) | 366 | if (WARN_ON(!crtc_state)) |
368 | return -EINVAL; | 367 | return -EINVAL; |
369 | 368 | ||
370 | if (crtc_state->enable) | 369 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, |
371 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
372 | &clip.x2, &clip.y2); | ||
373 | |||
374 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
375 | DRM_PLANE_HELPER_NO_SCALING, | 370 | DRM_PLANE_HELPER_NO_SCALING, |
376 | DRM_PLANE_HELPER_NO_SCALING, | 371 | DRM_PLANE_HELPER_NO_SCALING, |
377 | can_position, true); | 372 | can_position, true); |
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index b5c6eec9a584..2f4b0ffee598 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c | |||
@@ -91,7 +91,6 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, | |||
91 | { | 91 | { |
92 | struct drm_framebuffer *fb = state->fb; | 92 | struct drm_framebuffer *fb = state->fb; |
93 | struct drm_crtc_state *crtc_state; | 93 | struct drm_crtc_state *crtc_state; |
94 | struct drm_rect clip = { 0, }; | ||
95 | 94 | ||
96 | if (!fb) | 95 | if (!fb) |
97 | return 0; | 96 | return 0; |
@@ -108,11 +107,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, | |||
108 | if (IS_ERR(crtc_state)) | 107 | if (IS_ERR(crtc_state)) |
109 | return PTR_ERR(crtc_state); | 108 | return PTR_ERR(crtc_state); |
110 | 109 | ||
111 | if (crtc_state->enable) | 110 | return drm_atomic_helper_check_plane_state(state, crtc_state, |
112 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
113 | &clip.x2, &clip.y2); | ||
114 | |||
115 | return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
116 | DRM_PLANE_HELPER_NO_SCALING, | 111 | DRM_PLANE_HELPER_NO_SCALING, |
117 | DRM_PLANE_HELPER_NO_SCALING, | 112 | DRM_PLANE_HELPER_NO_SCALING, |
118 | true, true); | 113 | true, true); |
diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index 3801bee1f9e6..c78a3a59f58c 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c | |||
@@ -49,7 +49,6 @@ static int meson_plane_atomic_check(struct drm_plane *plane, | |||
49 | struct drm_plane_state *state) | 49 | struct drm_plane_state *state) |
50 | { | 50 | { |
51 | struct drm_crtc_state *crtc_state; | 51 | struct drm_crtc_state *crtc_state; |
52 | struct drm_rect clip = { 0, }; | ||
53 | 52 | ||
54 | if (!state->crtc) | 53 | if (!state->crtc) |
55 | return 0; | 54 | return 0; |
@@ -58,11 +57,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane, | |||
58 | if (IS_ERR(crtc_state)) | 57 | if (IS_ERR(crtc_state)) |
59 | return PTR_ERR(crtc_state); | 58 | return PTR_ERR(crtc_state); |
60 | 59 | ||
61 | if (crtc_state->enable) | 60 | return drm_atomic_helper_check_plane_state(state, crtc_state, |
62 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
63 | &clip.x2, &clip.y2); | ||
64 | |||
65 | return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
66 | DRM_PLANE_HELPER_NO_SCALING, | 61 | DRM_PLANE_HELPER_NO_SCALING, |
67 | DRM_PLANE_HELPER_NO_SCALING, | 62 | DRM_PLANE_HELPER_NO_SCALING, |
68 | true, true); | 63 | true, true); |
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index 98d4d7331767..44fc9fe4737a 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | |||
@@ -286,7 +286,6 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, | |||
286 | uint32_t max_width, max_height; | 286 | uint32_t max_width, max_height; |
287 | bool out_of_bounds = false; | 287 | bool out_of_bounds = false; |
288 | uint32_t caps = 0; | 288 | uint32_t caps = 0; |
289 | struct drm_rect clip = {}; | ||
290 | int min_scale, max_scale; | 289 | int min_scale, max_scale; |
291 | int ret; | 290 | int ret; |
292 | 291 | ||
@@ -323,11 +322,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, | |||
323 | min_scale = FRAC_16_16(1, 8); | 322 | min_scale = FRAC_16_16(1, 8); |
324 | max_scale = FRAC_16_16(8, 1); | 323 | max_scale = FRAC_16_16(8, 1); |
325 | 324 | ||
326 | if (crtc_state->enable) | 325 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, |
327 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
328 | &clip.x2, &clip.y2); | ||
329 | |||
330 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
331 | min_scale, max_scale, | 326 | min_scale, max_scale, |
332 | true, true); | 327 | true, true); |
333 | if (ret) | 328 | if (ret) |
@@ -471,7 +466,6 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, | |||
471 | { | 466 | { |
472 | struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); | 467 | struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state); |
473 | struct drm_crtc_state *crtc_state; | 468 | struct drm_crtc_state *crtc_state; |
474 | struct drm_rect clip = {}; | ||
475 | int min_scale, max_scale; | 469 | int min_scale, max_scale; |
476 | int ret; | 470 | int ret; |
477 | 471 | ||
@@ -502,11 +496,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, | |||
502 | min_scale = FRAC_16_16(1, 8); | 496 | min_scale = FRAC_16_16(1, 8); |
503 | max_scale = FRAC_16_16(8, 1); | 497 | max_scale = FRAC_16_16(8, 1); |
504 | 498 | ||
505 | if (crtc_state->enable) | 499 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, |
506 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
507 | &clip.x2, &clip.y2); | ||
508 | |||
509 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
510 | min_scale, max_scale, | 500 | min_scale, max_scale, |
511 | true, true); | 501 | true, true); |
512 | if (ret) | 502 | if (ret) |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 1f55b3d80a56..6af3bc483c84 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -1143,15 +1143,9 @@ static int | |||
1143 | nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, | 1143 | nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, |
1144 | struct nv50_head_atom *asyh) | 1144 | struct nv50_head_atom *asyh) |
1145 | { | 1145 | { |
1146 | struct drm_rect clip = {}; | ||
1147 | int ret; | 1146 | int ret; |
1148 | 1147 | ||
1149 | if (asyh->state.enable) | ||
1150 | drm_mode_get_hv_timing(&asyh->state.mode, | ||
1151 | &clip.x2, &clip.y2); | ||
1152 | |||
1153 | ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, | 1148 | ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, |
1154 | &clip, | ||
1155 | DRM_PLANE_HELPER_NO_SCALING, | 1149 | DRM_PLANE_HELPER_NO_SCALING, |
1156 | DRM_PLANE_HELPER_NO_SCALING, | 1150 | DRM_PLANE_HELPER_NO_SCALING, |
1157 | true, true); | 1151 | true, true); |
@@ -1435,18 +1429,12 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, | |||
1435 | struct nv50_head_atom *asyh) | 1429 | struct nv50_head_atom *asyh) |
1436 | { | 1430 | { |
1437 | const struct drm_framebuffer *fb = asyw->state.fb; | 1431 | const struct drm_framebuffer *fb = asyw->state.fb; |
1438 | struct drm_rect clip = {}; | ||
1439 | int ret; | 1432 | int ret; |
1440 | 1433 | ||
1441 | if (!fb->format->depth) | 1434 | if (!fb->format->depth) |
1442 | return -EINVAL; | 1435 | return -EINVAL; |
1443 | 1436 | ||
1444 | if (asyh->state.enable) | ||
1445 | drm_mode_get_hv_timing(&asyh->state.mode, | ||
1446 | &clip.x2, &clip.y2); | ||
1447 | |||
1448 | ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, | 1437 | ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state, |
1449 | &clip, | ||
1450 | DRM_PLANE_HELPER_NO_SCALING, | 1438 | DRM_PLANE_HELPER_NO_SCALING, |
1451 | DRM_PLANE_HELPER_NO_SCALING, | 1439 | DRM_PLANE_HELPER_NO_SCALING, |
1452 | false, true); | 1440 | false, true); |
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index 5687a94d4cb1..68556bd9dad2 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c | |||
@@ -572,7 +572,6 @@ int __rcar_du_plane_atomic_check(struct drm_plane *plane, | |||
572 | { | 572 | { |
573 | struct drm_device *dev = plane->dev; | 573 | struct drm_device *dev = plane->dev; |
574 | struct drm_crtc_state *crtc_state; | 574 | struct drm_crtc_state *crtc_state; |
575 | struct drm_rect clip = {}; | ||
576 | int ret; | 575 | int ret; |
577 | 576 | ||
578 | if (!state->crtc) { | 577 | if (!state->crtc) { |
@@ -589,11 +588,7 @@ int __rcar_du_plane_atomic_check(struct drm_plane *plane, | |||
589 | if (IS_ERR(crtc_state)) | 588 | if (IS_ERR(crtc_state)) |
590 | return PTR_ERR(crtc_state); | 589 | return PTR_ERR(crtc_state); |
591 | 590 | ||
592 | if (crtc_state->enable) | 591 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, |
593 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
594 | &clip.x2, &clip.y2); | ||
595 | |||
596 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
597 | DRM_PLANE_HELPER_NO_SCALING, | 592 | DRM_PLANE_HELPER_NO_SCALING, |
598 | DRM_PLANE_HELPER_NO_SCALING, | 593 | DRM_PLANE_HELPER_NO_SCALING, |
599 | true, true); | 594 | true, true); |
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 9f72762532bf..998e65d76bf8 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c | |||
@@ -630,7 +630,6 @@ static int vop_plane_atomic_check(struct drm_plane *plane, | |||
630 | struct vop_win *vop_win = to_vop_win(plane); | 630 | struct vop_win *vop_win = to_vop_win(plane); |
631 | const struct vop_win_data *win = vop_win->data; | 631 | const struct vop_win_data *win = vop_win->data; |
632 | int ret; | 632 | int ret; |
633 | struct drm_rect clip = {}; | ||
634 | int min_scale = win->phy->scl ? FRAC_16_16(1, 8) : | 633 | int min_scale = win->phy->scl ? FRAC_16_16(1, 8) : |
635 | DRM_PLANE_HELPER_NO_SCALING; | 634 | DRM_PLANE_HELPER_NO_SCALING; |
636 | int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : | 635 | int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : |
@@ -643,11 +642,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, | |||
643 | if (WARN_ON(!crtc_state)) | 642 | if (WARN_ON(!crtc_state)) |
644 | return -EINVAL; | 643 | return -EINVAL; |
645 | 644 | ||
646 | if (crtc_state->enable) | 645 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, |
647 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
648 | &clip.x2, &clip.y2); | ||
649 | |||
650 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
651 | min_scale, max_scale, | 646 | min_scale, max_scale, |
652 | true, true); | 647 | true, true); |
653 | if (ret) | 648 | if (ret) |
diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index 2f0ccd50b54d..9a540330cb79 100644 --- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c | |||
@@ -211,7 +211,6 @@ static int sun8i_ui_layer_atomic_check(struct drm_plane *plane, | |||
211 | struct drm_crtc *crtc = state->crtc; | 211 | struct drm_crtc *crtc = state->crtc; |
212 | struct drm_crtc_state *crtc_state; | 212 | struct drm_crtc_state *crtc_state; |
213 | int min_scale, max_scale; | 213 | int min_scale, max_scale; |
214 | struct drm_rect clip = {}; | ||
215 | 214 | ||
216 | if (!crtc) | 215 | if (!crtc) |
217 | return 0; | 216 | return 0; |
@@ -220,10 +219,6 @@ static int sun8i_ui_layer_atomic_check(struct drm_plane *plane, | |||
220 | if (WARN_ON(!crtc_state)) | 219 | if (WARN_ON(!crtc_state)) |
221 | return -EINVAL; | 220 | return -EINVAL; |
222 | 221 | ||
223 | if (crtc_state->enable) | ||
224 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
225 | &clip.x2, &clip.y2); | ||
226 | |||
227 | min_scale = DRM_PLANE_HELPER_NO_SCALING; | 222 | min_scale = DRM_PLANE_HELPER_NO_SCALING; |
228 | max_scale = DRM_PLANE_HELPER_NO_SCALING; | 223 | max_scale = DRM_PLANE_HELPER_NO_SCALING; |
229 | 224 | ||
@@ -232,7 +227,7 @@ static int sun8i_ui_layer_atomic_check(struct drm_plane *plane, | |||
232 | max_scale = SUN8I_UI_SCALER_SCALE_MAX; | 227 | max_scale = SUN8I_UI_SCALER_SCALE_MAX; |
233 | } | 228 | } |
234 | 229 | ||
235 | return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | 230 | return drm_atomic_helper_check_plane_state(state, crtc_state, |
236 | min_scale, max_scale, | 231 | min_scale, max_scale, |
237 | true, true); | 232 | true, true); |
238 | } | 233 | } |
diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index eb3bf2d7291a..5877f8ef5895 100644 --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c | |||
@@ -239,7 +239,6 @@ static int sun8i_vi_layer_atomic_check(struct drm_plane *plane, | |||
239 | struct drm_crtc *crtc = state->crtc; | 239 | struct drm_crtc *crtc = state->crtc; |
240 | struct drm_crtc_state *crtc_state; | 240 | struct drm_crtc_state *crtc_state; |
241 | int min_scale, max_scale; | 241 | int min_scale, max_scale; |
242 | struct drm_rect clip = {}; | ||
243 | 242 | ||
244 | if (!crtc) | 243 | if (!crtc) |
245 | return 0; | 244 | return 0; |
@@ -248,10 +247,6 @@ static int sun8i_vi_layer_atomic_check(struct drm_plane *plane, | |||
248 | if (WARN_ON(!crtc_state)) | 247 | if (WARN_ON(!crtc_state)) |
249 | return -EINVAL; | 248 | return -EINVAL; |
250 | 249 | ||
251 | if (crtc_state->enable) | ||
252 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
253 | &clip.x2, &clip.y2); | ||
254 | |||
255 | min_scale = DRM_PLANE_HELPER_NO_SCALING; | 250 | min_scale = DRM_PLANE_HELPER_NO_SCALING; |
256 | max_scale = DRM_PLANE_HELPER_NO_SCALING; | 251 | max_scale = DRM_PLANE_HELPER_NO_SCALING; |
257 | 252 | ||
@@ -260,7 +255,7 @@ static int sun8i_vi_layer_atomic_check(struct drm_plane *plane, | |||
260 | max_scale = SUN8I_VI_SCALER_SCALE_MAX; | 255 | max_scale = SUN8I_VI_SCALER_SCALE_MAX; |
261 | } | 256 | } |
262 | 257 | ||
263 | return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | 258 | return drm_atomic_helper_check_plane_state(state, crtc_state, |
264 | min_scale, max_scale, | 259 | min_scale, max_scale, |
265 | true, true); | 260 | true, true); |
266 | } | 261 | } |
diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c index 7267a01e6f08..a056fbf83b53 100644 --- a/drivers/gpu/drm/tegra/plane.c +++ b/drivers/gpu/drm/tegra/plane.c | |||
@@ -82,7 +82,6 @@ int tegra_plane_state_add(struct tegra_plane *plane, | |||
82 | { | 82 | { |
83 | struct drm_crtc_state *crtc_state; | 83 | struct drm_crtc_state *crtc_state; |
84 | struct tegra_dc_state *tegra; | 84 | struct tegra_dc_state *tegra; |
85 | struct drm_rect clip = {}; | ||
86 | int err; | 85 | int err; |
87 | 86 | ||
88 | /* Propagate errors from allocation or locking failures. */ | 87 | /* Propagate errors from allocation or locking failures. */ |
@@ -90,12 +89,8 @@ int tegra_plane_state_add(struct tegra_plane *plane, | |||
90 | if (IS_ERR(crtc_state)) | 89 | if (IS_ERR(crtc_state)) |
91 | return PTR_ERR(crtc_state); | 90 | return PTR_ERR(crtc_state); |
92 | 91 | ||
93 | if (crtc_state->enable) | ||
94 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
95 | &clip.x2, &clip.y2); | ||
96 | |||
97 | /* Check plane state for visibility and calculate clipping bounds */ | 92 | /* Check plane state for visibility and calculate clipping bounds */ |
98 | err = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | 93 | err = drm_atomic_helper_check_plane_state(state, crtc_state, |
99 | 0, INT_MAX, true, true); | 94 | 0, INT_MAX, true, true); |
100 | if (err < 0) | 95 | if (err < 0) |
101 | return err; | 96 | return err; |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 1107d6d03506..34ecc27fc30a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
@@ -443,17 +443,12 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, | |||
443 | { | 443 | { |
444 | struct drm_crtc_state *crtc_state = NULL; | 444 | struct drm_crtc_state *crtc_state = NULL; |
445 | struct drm_framebuffer *new_fb = state->fb; | 445 | struct drm_framebuffer *new_fb = state->fb; |
446 | struct drm_rect clip = {}; | ||
447 | int ret; | 446 | int ret; |
448 | 447 | ||
449 | if (state->crtc) | 448 | if (state->crtc) |
450 | crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); | 449 | crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); |
451 | 450 | ||
452 | if (crtc_state && crtc_state->enable) | 451 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, |
453 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
454 | &clip.x2, &clip.y2); | ||
455 | |||
456 | ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, | ||
457 | DRM_PLANE_HELPER_NO_SCALING, | 452 | DRM_PLANE_HELPER_NO_SCALING, |
458 | DRM_PLANE_HELPER_NO_SCALING, | 453 | DRM_PLANE_HELPER_NO_SCALING, |
459 | false, true); | 454 | false, true); |
diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c index 8e1f34274e24..94545adac50d 100644 --- a/drivers/gpu/drm/zte/zx_plane.c +++ b/drivers/gpu/drm/zte/zx_plane.c | |||
@@ -55,7 +55,6 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, | |||
55 | struct drm_framebuffer *fb = plane_state->fb; | 55 | struct drm_framebuffer *fb = plane_state->fb; |
56 | struct drm_crtc *crtc = plane_state->crtc; | 56 | struct drm_crtc *crtc = plane_state->crtc; |
57 | struct drm_crtc_state *crtc_state; | 57 | struct drm_crtc_state *crtc_state; |
58 | struct drm_rect clip = {}; | ||
59 | int min_scale = FRAC_16_16(1, 8); | 58 | int min_scale = FRAC_16_16(1, 8); |
60 | int max_scale = FRAC_16_16(8, 1); | 59 | int max_scale = FRAC_16_16(8, 1); |
61 | 60 | ||
@@ -75,12 +74,8 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, | |||
75 | if (!plane_state->crtc) | 74 | if (!plane_state->crtc) |
76 | return -EINVAL; | 75 | return -EINVAL; |
77 | 76 | ||
78 | if (crtc_state->enable) | ||
79 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
80 | &clip.x2, &clip.y2); | ||
81 | |||
82 | return drm_atomic_helper_check_plane_state(plane_state, crtc_state, | 77 | return drm_atomic_helper_check_plane_state(plane_state, crtc_state, |
83 | &clip, min_scale, max_scale, | 78 | min_scale, max_scale, |
84 | true, true); | 79 | true, true); |
85 | } | 80 | } |
86 | 81 | ||
@@ -291,7 +286,6 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, | |||
291 | struct drm_framebuffer *fb = plane_state->fb; | 286 | struct drm_framebuffer *fb = plane_state->fb; |
292 | struct drm_crtc *crtc = plane_state->crtc; | 287 | struct drm_crtc *crtc = plane_state->crtc; |
293 | struct drm_crtc_state *crtc_state; | 288 | struct drm_crtc_state *crtc_state; |
294 | struct drm_rect clip = {}; | ||
295 | 289 | ||
296 | if (!crtc || !fb) | 290 | if (!crtc || !fb) |
297 | return 0; | 291 | return 0; |
@@ -309,12 +303,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, | |||
309 | if (!plane_state->crtc) | 303 | if (!plane_state->crtc) |
310 | return -EINVAL; | 304 | return -EINVAL; |
311 | 305 | ||
312 | if (crtc_state->enable) | ||
313 | drm_mode_get_hv_timing(&crtc_state->mode, | ||
314 | &clip.x2, &clip.y2); | ||
315 | |||
316 | return drm_atomic_helper_check_plane_state(plane_state, crtc_state, | 306 | return drm_atomic_helper_check_plane_state(plane_state, crtc_state, |
317 | &clip, | ||
318 | DRM_PLANE_HELPER_NO_SCALING, | 307 | DRM_PLANE_HELPER_NO_SCALING, |
319 | DRM_PLANE_HELPER_NO_SCALING, | 308 | DRM_PLANE_HELPER_NO_SCALING, |
320 | false, true); | 309 | false, true); |
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h index 4842ee9485ce..26aaba58d6ce 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h | |||
@@ -40,7 +40,6 @@ int drm_atomic_helper_check_modeset(struct drm_device *dev, | |||
40 | struct drm_atomic_state *state); | 40 | struct drm_atomic_state *state); |
41 | int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, | 41 | int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, |
42 | const struct drm_crtc_state *crtc_state, | 42 | const struct drm_crtc_state *crtc_state, |
43 | const struct drm_rect *clip, | ||
44 | int min_scale, | 43 | int min_scale, |
45 | int max_scale, | 44 | int max_scale, |
46 | bool can_position, | 45 | bool can_position, |
diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h index 8aa49c0ecd4d..28d7ce620729 100644 --- a/include/drm/drm_plane_helper.h +++ b/include/drm/drm_plane_helper.h | |||
@@ -43,7 +43,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, | |||
43 | struct drm_framebuffer *fb, | 43 | struct drm_framebuffer *fb, |
44 | struct drm_rect *src, | 44 | struct drm_rect *src, |
45 | struct drm_rect *dest, | 45 | struct drm_rect *dest, |
46 | const struct drm_rect *clip, | ||
47 | unsigned int rotation, | 46 | unsigned int rotation, |
48 | int min_scale, | 47 | int min_scale, |
49 | int max_scale, | 48 | int max_scale, |