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: 11354067 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 899F81398 for ; Tue, 28 Jan 2020 10:46:17 +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 680622467E for ; Tue, 28 Jan 2020 10:46:17 +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 680622467E 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 6E5CF6EDA6; Tue, 28 Jan 2020 10:46:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@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 3F0026EDA4 for ; Tue, 28 Jan 2020 10:46:10 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id k11so750623wrd.9 for ; Tue, 28 Jan 2020 02:46:10 -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=hk17KNQBHxQHaH4Y8N2azcC0WxM0MswpgciWMzt9TWdMwXMcfuB+h0W1wkp03kR55f 85+oYowMs0X2VHHr2TaHoJL1d3f65YmmWUj/iarPzibrAtOEhmJDWipnpxadOTIe9N7J 56T1WDxhSviIbkpFwN9GHYuDNdCPMJl1Lvbwz//uYwTDaZ5COjgBgYPBiwOl+Fh29oP/ 8YZ14L8zbkXTN/MOyLl2iK6qJMccIBnItj8pcw6n1OAolWNvGpIcTui3rFK0FIy//N2b hgbYk7r/hTo9LDamr79Umlb0ruHEC23VrMJ0/hhznVHopX1wDsxCu+SgSnCqTjago0YW JeXg== X-Gm-Message-State: APjAAAUSicQFQlZe9ynBxVLByurcpwa8ikR/3uzAxUm7JSPj/khNMSYM mRsb+BjWSHuCop1/Tfy6Q9VOoZFRk0bpYA== 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 Subject: [PATCH 2/4] drm/fbdev-helper: don't force restores 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 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 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);