summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_atomic_helper.c
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2023-12-04 14:13:48 +0100
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2023-12-04 20:33:05 +0100
commit1c0a80f160965c88f16e73ff69015db2f044c486 (patch)
tree535c48f7b9736f1e8d460078f4d53ece2e1cd24b /drivers/gpu/drm/drm_atomic_helper.c
parentdrm/bridge: migrate bridge_chains to per-encoder file (diff)
downloadlinux-1c0a80f160965c88f16e73ff69015db2f044c486.tar.xz
linux-1c0a80f160965c88f16e73ff69015db2f044c486.zip
Revert "drm/atomic: Loosen FB atomic checks"
This reverts commit f1e75da5364e780905d9cd6043f9c74cdcf84073. Although the Solid Fill planes patchset got all reviews and acknowledgements, it doesn't fulfill requirements for the new uABI. It has neither corresponding open-source userspace implementation nor the IGT tests coverage. Reverting this patchset until userspace obligations are fulfilled. Acked-by: Simon Ser <contact@emersion.fr> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20231204131455.19023-2-dmitry.baryshkov@linaro.org
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index dc048988e3f3..c3f677130def 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -861,6 +861,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
bool can_position,
bool can_update_disabled)
{
+ struct drm_framebuffer *fb = plane_state->fb;
struct drm_rect *src = &plane_state->src;
struct drm_rect *dst = &plane_state->dst;
unsigned int rotation = plane_state->rotation;
@@ -872,7 +873,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
*src = drm_plane_state_src(plane_state);
*dst = drm_plane_state_dest(plane_state);
- if (!drm_plane_has_visible_data(plane_state)) {
+ if (!fb) {
plane_state->visible = false;
return 0;
}
@@ -889,31 +890,25 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
return -EINVAL;
}
- /* Check that selected pixel source is valid */
- if (plane_state->pixel_source == DRM_PLANE_PIXEL_SOURCE_FB && plane_state->fb) {
- struct drm_framebuffer *fb = plane_state->fb;
- drm_rect_rotate(src, fb->width << 16, fb->height << 16, rotation);
+ drm_rect_rotate(src, fb->width << 16, fb->height << 16, rotation);
- /* Check scaling */
- hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale);
- vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale);
+ /* Check scaling */
+ hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale);
+ vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale);
+ if (hscale < 0 || vscale < 0) {
+ drm_dbg_kms(plane_state->plane->dev,
+ "Invalid scaling of plane\n");
+ drm_rect_debug_print("src: ", &plane_state->src, true);
+ drm_rect_debug_print("dst: ", &plane_state->dst, false);
+ return -ERANGE;
+ }
- if (hscale < 0 || vscale < 0) {
- drm_dbg_kms(plane_state->plane->dev,
- "Invalid scaling of plane\n");
- drm_rect_debug_print("src: ", &plane_state->src, true);
- drm_rect_debug_print("dst: ", &plane_state->dst, false);
- return -ERANGE;
- }
+ if (crtc_state->enable)
+ drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2);
- if (crtc_state->enable)
- drm_mode_get_hv_timing(&crtc_state->mode, &clip.x2, &clip.y2);
+ plane_state->visible = drm_rect_clip_scaled(src, dst, &clip);
- plane_state->visible = drm_rect_clip_scaled(src, dst, &clip);
- drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation);
- } else if (drm_plane_solid_fill_enabled(plane_state)) {
- plane_state->visible = true;
- }
+ drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, rotation);
if (!plane_state->visible)
/*