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 <imir...@alum.mit.edu>
References: https://gitlab.freedesktop.org/xorg/xserver/issues/629
References: https://gitlab.freedesktop.org/xorg/xserver/merge_requests/180
References: abbc0697d5fb ("drm/fb: revert the i915 Actually configure untiled 
displays from master")
Cc: Maarten Lankhorst <maarten.lankho...@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankho...@linux.intel.com> (v1)
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlaus...@amd.com> (v1)
Cc: Michel Dänzer <mic...@daenzer.net>
Cc: Alex Deucher <alexdeuc...@gmail.com>
Cc: Adam Jackson <a...@redhat.com>
Acked-by: Adam Jackson <a...@redhat.com>
Cc: Sean Paul <s...@poorly.run>
Cc: David Airlie <airl...@linux.ie>
Cc: Rob Clark <robdcl...@gmail.com>
Acked-by: Rob Clark <robdcl...@gmail.com>
Cc: sta...@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vet...@intel.com>
---
 drivers/gpu/drm/drm_ioctl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 2c120c58f72d..1cd5cc492df1 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -336,7 +336,12 @@ drm_setclientcap(struct drm_device *dev, void *data, 
struct drm_file *file_priv)
        case DRM_CLIENT_CAP_ATOMIC:
                if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
                        return -EOPNOTSUPP;
-               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;
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to