From patchwork Thu Sep 5 18:18:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11133739 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC46414B4 for ; Thu, 5 Sep 2019 18:18:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F9AE206BA for ; Thu, 5 Sep 2019 18:18:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F9AE206BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05AB56E0F8; Thu, 5 Sep 2019 18:18:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id CFDE56E0E6 for ; Thu, 5 Sep 2019 18:18:43 +0000 (UTC) Received: by mail-ed1-x541.google.com with SMTP id i8so3536986edn.13 for ; Thu, 05 Sep 2019 11:18:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=obFAoJjwX5LVICOlIHTt1Y/s9EsFMUSE1s849zGP32Q=; b=EcSToqVhQJIuaaUC3H9j7lBYJ4fA+Iruo6aAWi6HB7yxs0ecnEv3oZTqSKdyfSp6j5 mPHJQFW9Tte0FvrObfkc26PeKpwuOUj1SJRz7lQfsfTyqNkR+BIPfFFVlZIw6NbXlAav S5k4og2aIcC/XBrYkSYaF3Pij3bqne+VPUbDxumP7XSBwWsAzNhzVY2sXZHu/CF1Kc6r 9Y+tW7FO1JXcPTAEP4YjQVFhROI9MFeZlOXhO+wz6ekrG796IBnTsAJ2R4+MbtvN6kWH uyiYOCZjvhkk1wGAidcsMWsupXOJADoAfKu3Us8DwyWqc8xm9/8uVq+WJRM2VAQEbqJ4 v0qw== X-Gm-Message-State: APjAAAUebpZyJ3e89UFzRI6pREI3QBINZHvsbcQTiLPlSfqkkQbSsNbh onJuS4tL3clXoTf6N85rWMWVWt5GXUM= X-Google-Smtp-Source: APXvYqyzaG6Yf4kQ2QY6XayOtQGL5hNQW9zxGYl73+F4ofPJ6wblCKH7JO8eJ2dauX6xy0MRG8TzBg== X-Received: by 2002:aa7:d8c8:: with SMTP id k8mr5400533eds.8.1567707522004; Thu, 05 Sep 2019 11:18:42 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id v8sm305107ejk.29.2019.09.05.11.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 11:18:41 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH] drm/atomic: Take the atomic toys away from X Date: Thu, 5 Sep 2019 20:18:34 +0200 Message-Id: <20190905181834.6234-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190903190642.32588-1-daniel.vetter@ffwll.ch> References: <20190903190642.32588-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=obFAoJjwX5LVICOlIHTt1Y/s9EsFMUSE1s849zGP32Q=; b=fCjtWKHVKfNPVHweI4Dr39tiJQOVJ5Csyxs7DuVOxRDIxrjpp2gtRtuxU0N4SsSRj2 cX52YmzJXNLBuI2D5qMYuo7im9kxNTogPs6pUJAlilJzDMBFSPWDmOF6lG518UPHrTUi hY81BqfZm6U1jwMN/BEPNL6bmMMme8hJhthkc= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Daniel Vetter , =?utf-8?q?Michel_D=C3=A4nzer?= , stable@vger.kernel.org, Nicholas Kazlauskas , Daniel Vetter , Sean Paul , Intel Graphics Development Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 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 --- 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..56aa8bbb3a8c 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 (strstr(current->comm, "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;