From patchwork Tue Jan 28 10:45:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11354069 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 A69C4138C for ; Tue, 28 Jan 2020 10:46:19 +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 854992467E for ; Tue, 28 Jan 2020 10:46:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="BAiWCTEO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 854992467E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CEB46EDA3; Tue, 28 Jan 2020 10:46:13 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id E9CC56EDA3 for ; Tue, 28 Jan 2020 10:46:09 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id c9so15426101wrw.8 for ; Tue, 28 Jan 2020 02:46:09 -0800 (PST) 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=baki1vCJvM2v3crbwdgabrMZmLroFbPipGWf/F9DPkM=; b=BAiWCTEObaKIuh8+JWUrK2bwBptK1jX1Hmq/PW8QpijKcpspYFPUcIqSxqK4Jti6Ht cjec6tEU+lVj5RaQnIjMbG/VrKcqBnHtj9C7tzkPb6EFIrUPnlSqRkNS1cvOvD1mtoO8 nBu6AtkYF5olIksg+IFSYtKIh90uxF+0b7AnM= 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=baki1vCJvM2v3crbwdgabrMZmLroFbPipGWf/F9DPkM=; b=BR1n1AIIHMgTsSvZK2is1jIvSGmvC48SX4CwohsTnBTkjxyDStkhQTg6S0XofKa+M/ 8MB0xfpLDjHRAVNGtZJXaypOibpamgE7JqwY1J6Cw0R39Ysu7f0Yng1bD/WiaJQsxPPl r6eY12ibTnJ+ViiRZ3G1Z3J5QHvYeOd9Mmro+F06TBlhHr2W3Q6+gRcYasEfLkUXuWBL kQiuU3+Yb+UsqRWVKu++VjcxgeAy76v3IwZceV8VML9Q5fJyVwltiQNCYYUUxhUm7Qay kXNSr/r/j0a2CT0c+YDYnbFF+85C2RKPQE8b8B3U4pQIE4I7V3TtmHaF4Spe/PLT7dW+ bqxw== X-Gm-Message-State: APjAAAXIerXoIEfiBdxTsEqJHerDOXGI39NYxDq+f6/I81UgC3uC2BS8 q5JIBdyhZzQ5YVHjc0E72/TeCLOF+AZ9AQ== X-Google-Smtp-Source: APXvYqwVDH5D6FAHnolZbExqwIdEDjZiV8ek5G727CsRCIQQiJdWe7XEjZK76ClzxtaqRGxXrT6unw== X-Received: by 2002:adf:9144:: with SMTP id j62mr28136380wrj.168.1580208368491; Tue, 28 Jan 2020 02:46:08 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id o1sm24998733wrn.84.2020.01.28.02.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2020 02:46:07 -0800 (PST) From: Daniel Vetter To: DRI Development Date: Tue, 28 Jan 2020 11:45:59 +0100 Message-Id: <20200128104602.1459802-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200128104602.1459802-1-daniel.vetter@ffwll.ch> References: <20200128104602.1459802-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/4] drm/fbdev-helper: don't force restores X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , =?utf-8?q?Nor?= =?utf-8?q?alf_Tr=C3=B8nnes?= , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Instead check for master status, in case we've raced. This is the last exception to the general rule that we restore fbcon only when there's no master active. Compositors are supposed to drop their master status before they switch to a different console back to text mode (or just switch to text mode directly, without a vt switch). This is known to break some subtests of kms_fbcon_fbt in igt, but they're just wrong - it does a graphics/text mode switch for the vt without updating the master status. Also add a comment to the drm_client->restore hook that this is expected going forward from all clients (there's currently just one). v2: Also drop the force in pan_display Cc: Noralf Trønnes Signed-off-by: Daniel Vetter Reviewed-by: Noralf Trønnes --- drivers/gpu/drm/drm_fb_helper.c | 14 ++------------ include/drm/drm_client.h | 5 +++++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 4c7cbce7bae7..926187a82255 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -250,17 +250,7 @@ int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper) return 0; mutex_lock(&fb_helper->lock); - /* - * TODO: - * We should bail out here if there is a master by dropping _force. - * Currently these igt tests fail if we do that: - * - kms_fbcon_fbt@psr - * - kms_fbcon_fbt@psr-suspend - * - * So first these tests need to be fixed so they drop master or don't - * have an fd open. - */ - ret = drm_client_modeset_commit_force(&fb_helper->client); + ret = drm_client_modeset_commit(&fb_helper->client); do_delayed = fb_helper->delayed_hotplug; if (do_delayed) @@ -1357,7 +1347,7 @@ static int pan_display_atomic(struct fb_var_screeninfo *var, pan_set(fb_helper, var->xoffset, var->yoffset); - ret = drm_client_modeset_commit_force(&fb_helper->client); + ret = drm_client_modeset_commit(&fb_helper->client); if (!ret) { info->var.xoffset = var->xoffset; info->var.yoffset = var->yoffset; diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h index 5cf2c5dd8b1e..d01d311023ac 100644 --- a/include/drm/drm_client.h +++ b/include/drm/drm_client.h @@ -44,6 +44,11 @@ struct drm_client_funcs { * returns zero gets the privilege to restore and no more clients are * called. This callback is not called after @unregister has been called. * + * Note that the core does not guarantee exclusion against concurrent + * drm_open(). Clients need to ensure this themselves, for example by + * using drm_master_internal_acquire() and + * drm_master_internal_release(). + * * This callback is optional. */ int (*restore)(struct drm_client_dev *client);