Patch the kernel to allow atomic modesetting on Xorg

Hello,

a few years ago, the Xorg modesetting generic driver received the “atomic” option, but this seemed to cause problems. A patch was then added to the kernel that prevented the Xorg option from being actually activated. Today, the situation is different, and two years ago, a patch was proposed to remove this limitation. I have experimented with the option and it does not produce the bugs that were highlighted then, but has visible advantages in the smoothness of animations. Currently, in Xorg, the option is disabled by default and can be activated as follows::

Section "Device"
    Identifier  "GPU"
    Driver      "modesetting"
    Option      "Atomic" "true"
EndSection

but the kernel prevents it from actually being activated. The following patch removes the limitation:

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index ca2a6e6101dc..017f31e67179 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -336,11 +336,6 @@ 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;
-		/* 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;

The patch would not create any problems because, as mentioned, atomic is disabled by default. It would simply allow those who wish to activate the option in Xorg.

Thank you for your attention.