Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2091460ybp; Thu, 10 Oct 2019 02:02:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwS/N/XYqcIRu61lyyxY9Ea+izAlpUHSo3IZ0XxxcpIu0DvLDfXjB94u2UHJVtTv9FyMr9I X-Received: by 2002:a05:6402:21d6:: with SMTP id bi22mr6942023edb.19.1570698160251; Thu, 10 Oct 2019 02:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570698160; cv=none; d=google.com; s=arc-20160816; b=RbJzQ5WQ/mtrAPtuVPJcW+GoWGre/F9tbtNAb3l1K46G5E1ke4todFgN0+c9fmugtG GeOkTQaxH2CgJ152J2tc3Nt6cwbF22MWu7/VNN1l+34z5e72m90FEsRZU0yo9gcKZ3Gy OlsuuqL/mtIPAdsJJwZGZQuET84l3XjVs+wFRuv3t59a2r+EoVLaJXg6rNnhn0/bXH5X lcjJNtClplCU3f1HgX5clxxgsXALqCleV1sW2dqxlFRNSrqkb3qQd4J4fRt0R8WISe99 J1SNJFk1OCGB4/8zUgw6bIZJAR9w4Ct3K5Pj7/xxW/VxroJM9CZe1iUCBfzMUBUzZ//k ffZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HpsoZKnhYyPidKEDnq39eeLG6CG/dC7FQ2YaEpthX14=; b=MGAmwkSsbu+g7rBVWtJiPwY6vClLA8PgC+epUcMszdsyQIj+P1C3KtYs0dAbnBVSic 1gS5BiaQmMaidvwSA72Whlw3AsLbU2KCNdcGS7R+2rtM0swx3LEQyttF2JK8Pj843Nb5 hy0cMirufG2MHgqnqcFLyyAE/nm5UiNgGCa4KAcUAv1sA3dm+kpiS3cRwGUNeQi3d4pc 4psmO89NfZjLZMcSeXmL4Uo3gphEYPkM1YMCJZLry0+tcYVAM+hw0/qVxY5IRQ8Y2fa1 UW/xozZMVRHC6Drk8nuVcK6UbLRqwCbyXCC2rrq/XFiMRmfPGXTteeowZiL/9WIjuAOf aglQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="vnF/BVoU"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gg10si2746821ejb.206.2019.10.10.02.02.17; Thu, 10 Oct 2019 02:02:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="vnF/BVoU"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388091AbfJJIkZ (ORCPT + 99 others); Thu, 10 Oct 2019 04:40:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:44454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387411AbfJJIkX (ORCPT ); Thu, 10 Oct 2019 04:40:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 58B2F21A4C; Thu, 10 Oct 2019 08:40:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696821; bh=/XgYEavpy/3HYlm+L0OW095hxFwEFZ4l1yMxKgRX3EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vnF/BVoUvbKn+ubGm8sDbwpfq9gaf0Xyc4KFD282Hot/BP4kXlk4Ea3wx72xpBGHi VuDBf9HsBFFOZ4MZ8jN/qoqcYLZP+s1pqgzF1coKNRxlvQdj5nyYM0wtnTyEwLUJZ0 HGm1Sa8yz/PSfUOdCIJ5t2k3oN4gpsrQANGYkj00= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilia Mirkin , Maarten Lankhorst , =?UTF-8?q?Michel=20D=C3=A4nzer?= , Alex Deucher , Adam Jackson , Sean Paul , David Airlie , Rob Clark , Daniel Vetter , Nicholas Kazlauskas Subject: [PATCH 5.3 064/148] drm/atomic: Take the atomic toys away from X Date: Thu, 10 Oct 2019 10:35:25 +0200 Message-Id: <20191010083615.346318040@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 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 @@ -336,7 +336,12 @@ drm_setclientcap(struct drm_device *dev, 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;