From patchwork Tue Feb 4 15:01:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11364799 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 8C63B1395 for ; Tue, 4 Feb 2020 15:02:07 +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 6B3652087E for ; Tue, 4 Feb 2020 15:02:07 +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="SmQg0aOy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B3652087E 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 56B906F38F; Tue, 4 Feb 2020 15:01:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1F9D76E84A for ; Tue, 4 Feb 2020 15:01:56 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id g1so3649583wmh.4 for ; Tue, 04 Feb 2020 07:01:56 -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=e9RykBY7CT/sd2nPUs0+4zQdEEH/jpXwer/6pk7GTG4=; b=SmQg0aOy27taLC3BlqXwfqqqQmiLtoBPxbwCfVKH/FUNeVWVH2dqLCgz99dgnbd3Zv nrOr+lXL6Xec5Wl31YcAlFJZwgLv9rFXVbm+1tfDANCsNogI16wx8fGrPMzKdF5+ZDyI BucBHusnqVkRU2zOeUJmoLylIUwrVt+N4tvec= 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=e9RykBY7CT/sd2nPUs0+4zQdEEH/jpXwer/6pk7GTG4=; b=B3g9oP8ybDnx6EXPLBiX87MXWVVvxTWm3Ya3DYIJdp6zecLH7bcjyfO6Md8zAKKZAf CogfXpCUThXEjofW2Lp+VB0mSVNBCwqyjxWKR4MgMoEhwOuvIjU6TLlJYaet4qEdAA++ +CmwWzGScdljaMa3UC7I+Br0AmlmEiASTX8zrqxQZEAsxC1gAS/nqpDTuYCzzIqkU57l 1QAtD4ZwohqDy3Tf8FmuZFYKHuCC1KUf5CBFnDXnhiv0DuP0txnwYc8k6JO4kvZEUlXx 6D13/4RCe8Wm1IAkLSz12ETYcRtxfVYXS4DOisXo1+HQYEOKCfIssTjR/ggS/ws7dmCp AIsw== X-Gm-Message-State: APjAAAXAYivA1UBEnze+unqwnJgzypZ75N12dTrNCqCR6kyXiljxk2As OSgWmTPSpKwBdfswOS2Hs0U1O9sOWpHwWw== X-Google-Smtp-Source: APXvYqz6zt4c2+mm0WkW5AroGCqmAecMZiXCq+JKLHJD3GXtrxkHjciGnp3V5kBt5RCrX3EMSNpedA== X-Received: by 2002:a1c:dc08:: with SMTP id t8mr6225767wmg.139.1580828514414; Tue, 04 Feb 2020 07:01:54 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id d9sm14428921wrx.94.2020.02.04.07.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 07:01:53 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 2/5] drm/fbdev-helper: don't force restores Date: Tue, 4 Feb 2020 16:01:43 +0100 Message-Id: <20200204150146.2006481-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200204150146.2006481-1-daniel.vetter@ffwll.ch> References: <20200204150146.2006481-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 v3: Restore the _force to pan_display, this actually means _locked in that path. Spotted by Noralf. Cc: Noralf Trønnes Reviewed-by: Noralf Trønnes Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_fb_helper.c | 12 +----------- include/drm/drm_client.h | 5 +++++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 4c7cbce7bae7..672934e0eeed 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) 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);