Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C468C2D0A3 for ; Thu, 12 Nov 2020 13:21:40 +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 161B02068D for ; Thu, 12 Nov 2020 13:21:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 161B02068D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40FE96E233; Thu, 12 Nov 2020 13:21:31 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id D748C6E223; Thu, 12 Nov 2020 13:21:29 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 83BE5AD31; Thu, 12 Nov 2020 13:21:28 +0000 (UTC) From: Thomas Zimmermann To: alexander.deucher@amd.com, christian.koenig@amd.com, airlied@linux.ie, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org Subject: [PATCH 2/7] drm/fb-helper: Add hint to enable VT switching during suspend/resume Date: Thu, 12 Nov 2020 14:21:12 +0100 Message-Id: <20201112132117.27228-3-tzimmermann@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201112132117.27228-1-tzimmermann@suse.de> References: <20201112132117.27228-1-tzimmermann@suse.de> MIME-Version: 1.0 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" Switching VTs during suspend/resume is required to reliably run radeon with generic fbdev emulation. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_fb_helper.c | 8 +++++--- include/drm/drm_mode_config.h | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index d2ba404a23b3..987cd781e62c 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -508,11 +508,11 @@ EXPORT_SYMBOL(drm_fb_helper_init); */ struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper) { - struct device *dev = fb_helper->dev->dev; + struct drm_device *dev = fb_helper->dev; struct fb_info *info; int ret; - info = framebuffer_alloc(0, dev); + info = framebuffer_alloc(0, dev->dev); if (!info) return ERR_PTR(-ENOMEM); @@ -535,7 +535,9 @@ struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper) } fb_helper->fbdev = info; - info->skip_vt_switch = true; + + if (!dev->mode_config.require_vt_switch_fbdev) + info->skip_vt_switch = true; return info; diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index ab424ddd7665..59e0796c6928 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -877,6 +877,13 @@ struct drm_mode_config { */ bool prefer_shadow_fbdev; + /** + * @require_vt_switch_fbdev: + * + * Hint to framebuffer emulation to enable VT switching on suspend/resume. + */ + bool require_vt_switch_fbdev; + /** * @quirk_addfb_prefer_xbgr_30bpp: * -- 2.29.2 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx