[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200508123039.718403889@linuxfoundation.org>
Date: Fri, 8 May 2020 14:35:45 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Ilia Mirkin <imirkin@...m.mit.edu>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Michel Dänzer <michel@...nzer.net>,
Alex Deucher <alexdeucher@...il.com>,
Adam Jackson <ajax@...hat.com>, Sean Paul <sean@...rly.run>,
David Airlie <airlied@...ux.ie>,
Rob Clark <robdclark@...il.com>,
Daniel Vetter <daniel.vetter@...el.com>,
Yves-Alexis Perez <corsac@...ian.org>,
Nicholas Kazlauskas <nicholas.kazlauskas@....com>
Subject: [PATCH 4.19 32/32] drm/atomic: Take the atomic toys away from X
From: Daniel Vetter <daniel.vetter@...ll.ch>
commit 26b1d3b527e7bf3e24b814d617866ac5199ce68d upstream.
The -modesetting ddx has a totally broken idea of how atomic works:
- doesn't disable old connectors, assuming they get auto-disable like
with the legacy setcrtc
- assumes ASYNC_FLIP is wired through for the atomic ioctl
- not a single call to TEST_ONLY
Iow the implementation is a 1:1 translation of legacy ioctls to
atomic, which is a) broken b) pointless.
We already have bugs in both i915 and amdgpu-DC where this prevents us
from enabling neat features.
If anyone ever cares about atomic in X we can easily add a new atomic
level (req->value == 2) for X to get back the shiny toys.
Since these broken versions of -modesetting have been shipping,
there's really no other way to get out of this bind.
v2:
- add an informational dmesg output (Rob, Ajax)
- reorder after the DRIVER_ATOMIC check to avoid useless noise (Ilia)
- allow req->value > 2 so that X can do another attempt at atomic in
the future
v3: Go with paranoid, insist that the X should be first (suggested by
Rob)
Cc: Ilia Mirkin <imirkin@...m.mit.edu>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com> (v1)
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@....com> (v1)
Cc: Michel Dänzer <michel@...nzer.net>
Cc: Alex Deucher <alexdeucher@...il.com>
Cc: Adam Jackson <ajax@...hat.com>
Acked-by: Adam Jackson <ajax@...hat.com>
Cc: Sean Paul <sean@...rly.run>
Cc: David Airlie <airlied@...ux.ie>
Cc: Rob Clark <robdclark@...il.com>
Acked-by: Rob Clark <robdclark@...il.com>
Cc: stable@...r.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@...el.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190905185318.31363-1-daniel.vetter@ffwll.ch
Cc: Yves-Alexis Perez <corsac@...ian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/gpu/drm/drm_ioctl.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -321,7 +321,12 @@ drm_setclientcap(struct drm_device *dev,
case DRM_CLIENT_CAP_ATOMIC:
if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
return -EINVAL;
- if (req->value > 1)
+ /* The modesetting DDX has a totally broken idea of atomic. */
+ if (current->comm[0] == 'X' && req->value == 1) {
+ pr_info("broken atomic modeset userspace detected, disabling atomic\n");
+ return -EOPNOTSUPP;
+ }
+ if (req->value > 2)
return -EINVAL;
file_priv->atomic = req->value;
file_priv->universal_planes = req->value;
Powered by blists - more mailing lists