From: Greg Kroah-Hartman Date: Fri, 8 May 2020 12:25:58 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.4.223~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=642003b59269037bfcd9e2279b24b0ddfaa97496;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: drm-atomic-take-the-atomic-toys-away-from-x.patch --- diff --git a/queue-4.19/drm-atomic-take-the-atomic-toys-away-from-x.patch b/queue-4.19/drm-atomic-take-the-atomic-toys-away-from-x.patch new file mode 100644 index 00000000000..ee936bd824b --- /dev/null +++ b/queue-4.19/drm-atomic-take-the-atomic-toys-away-from-x.patch @@ -0,0 +1,80 @@ +From 26b1d3b527e7bf3e24b814d617866ac5199ce68d Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Thu, 5 Sep 2019 20:53:18 +0200 +Subject: drm/atomic: Take the atomic toys away from X +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Daniel Vetter + +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 +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 +Reviewed-by: Maarten Lankhorst (v1) +Reviewed-by: Nicholas Kazlauskas (v1) +Cc: Michel Dänzer +Cc: Alex Deucher +Cc: Adam Jackson +Acked-by: Adam Jackson +Cc: Sean Paul +Cc: David Airlie +Cc: Rob Clark +Acked-by: Rob Clark +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20190905185318.31363-1-daniel.vetter@ffwll.ch +Cc: Yves-Alexis Perez +Signed-off-by: Greg Kroah-Hartman + +--- + 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; diff --git a/queue-4.19/series b/queue-4.19/series index 72e6bc5602f..bb69eb38965 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -29,3 +29,4 @@ alsa-hda-match-both-pci-id-and-ssid-for-driver-blacklist.patch platform-x86-gpd-pocket-fan-fix-error-message-when-temp-limits-are-out-of-range.patch mac80211-add-ieee80211_is_any_nullfunc.patch cgroup-netclassid-remove-double-cond_resched.patch +drm-atomic-take-the-atomic-toys-away-from-x.patch