Message ID | 2c28c0a137854d39b6bc997a21bd6d2db1f7a0a5.1687423204.git.geert+renesas@glider.be |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4946664vqr; Thu, 22 Jun 2023 02:57:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5eqsUPQmHk3DQxKcn078ZCPSflhMETDT7qVNKZC5ZNOWRQvE14ferB3WV1wswNwgMRbKbU X-Received: by 2002:a05:6808:639a:b0:3a0:6044:b9c2 with SMTP id ec26-20020a056808639a00b003a06044b9c2mr801199oib.44.1687427850574; Thu, 22 Jun 2023 02:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687427850; cv=none; d=google.com; s=arc-20160816; b=cDuz6PDMBesBf9fJzccc7Zixg/QtquN1VpVxP83YriHEl3x9Ou624UKyszWsG2jHiY ruLMkWannIPahkobrJTwL7aXWGGiGta/2lL3q/LH3PItQOnvcwhixb8f2CxDc+K5W8Zg 9+Akv04XZ3QE+KRNdMyxah1jq/xWQw+Wkec37dSgGrCLYR8SAe7IydbmizLSeJiMxNVc tYpEHXTKiCYTh2hkatwsVAVxAtYkQCOkIbIHX9wvbUxCfWVDKbqqk3PyeGxOrUjlOsWQ EucJrxIYgwtIi3cixq0JS6MNIlxU933GFgyy7wfUSXKnsMwHhxBBfloHf5sjzDJCUKe2 VRNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zp6IXdF2AvtjdpslXPET89JATt3nze1fWlacLhWzo1g=; b=ezsUAC2Z+pyz6ezOaLxCwJq+3E3gbU4pqEQIoj1DwdjDfpPfGXNRgYRMdoQ0d+TVh3 yWPLTyK5BzRbc1E84umSj2VJI1E5QBEQloQtEdXRS4vjFsOTrqMAiPebvT7hrfplMswc fXLiYtwz72h7ug3WAUutWGFrZOuEjgSMaWsh7txCPD2xRvlv+2ygiF74yNVLJ/aoYCgf yy+8B4LNgX/a+VEDs4d5FYLak78LG8r4VnJjW8B5RPMn+Khb84cxJ00zh/UXGJCh742L hrxQymiTaYdZj1ip9f8ViIdvjsXdHbwDSnPBpkLbq1OhroBYZ1VRaeC6xPthrUwrhWE8 E+wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ke16-20020a170903341000b001b3c8ef5c75si5724068plb.89.2023.06.22.02.57.17; Thu, 22 Jun 2023 02:57:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232395AbjFVJb3 (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Thu, 22 Jun 2023 05:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232356AbjFVJ3w (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Jun 2023 05:29:52 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B29734EDC for <linux-kernel@vger.kernel.org>; Thu, 22 Jun 2023 02:22:48 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:991a:a831:ea4b:6058]) by baptiste.telenet-ops.be with bizsmtp id C9Nj2A0191yfRTD019Njqu; Thu, 22 Jun 2023 11:22:44 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1qCGWY-000BxN-6R; Thu, 22 Jun 2023 11:22:43 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1qCGWZ-003Vy7-PR; Thu, 22 Jun 2023 11:22:43 +0200 From: Geert Uytterhoeven <geert+renesas@glider.be> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Thomas Zimmermann <tzimmermann@suse.de>, Magnus Damm <magnus.damm@gmail.com> Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert+renesas@glider.be> Subject: [PATCH 32/39] drm: renesas: shmobile: Shutdown the display on remove Date: Thu, 22 Jun 2023 11:21:44 +0200 Message-Id: <2c28c0a137854d39b6bc997a21bd6d2db1f7a0a5.1687423204.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: <cover.1687423204.git.geert+renesas@glider.be> References: <cover.1687423204.git.geert+renesas@glider.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769396345525174297?= X-GMAIL-MSGID: =?utf-8?q?1769396345525174297?= |
Series |
drm: renesas: shmobile: Atomic conversion + DT support
|
|
Commit Message
Geert Uytterhoeven
June 22, 2023, 9:21 a.m. UTC
When the device is unbound from the driver, the display may be active.
Make sure it gets shut down.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 2 ++
1 file changed, 2 insertions(+)
Comments
Hi Geert, Thank you for the patch. On Thu, Jun 22, 2023 at 11:21:44AM +0200, Geert Uytterhoeven wrote: > When the device is unbound from the driver, the display may be active. > Make sure it gets shut down. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > --- > drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > index a29c0c1093725b6e..636f1888b815579b 100644 > --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > @@ -16,6 +16,7 @@ > #include <linux/pm_runtime.h> > #include <linux/slab.h> > > +#include <drm/drm_crtc_helper.h> > #include <drm/drm_drv.h> > #include <drm/drm_fbdev_generic.h> > #include <drm/drm_gem_dma_helper.h> > @@ -145,6 +146,7 @@ static int shmob_drm_remove(struct platform_device *pdev) > struct drm_device *ddev = &sdev->ddev; > > drm_dev_unregister(ddev); > + drm_helper_force_disable_all(ddev); I assume this will be turned into drm_atomic_helper_shutdown() later. Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > drm_kms_helper_poll_fini(ddev); > return 0; > }
Hi On 2023/6/22 17:21, Geert Uytterhoeven wrote: > When the device is unbound from the driver, the display may be active. > Make sure it gets shut down. would you mind to give a short description why this is necessary. > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > index a29c0c1093725b6e..636f1888b815579b 100644 > --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > @@ -16,6 +16,7 @@ > #include <linux/pm_runtime.h> > #include <linux/slab.h> > > +#include <drm/drm_crtc_helper.h> > #include <drm/drm_drv.h> > #include <drm/drm_fbdev_generic.h> > #include <drm/drm_gem_dma_helper.h> > @@ -145,6 +146,7 @@ static int shmob_drm_remove(struct platform_device *pdev) > struct drm_device *ddev = &sdev->ddev; > > drm_dev_unregister(ddev); > + drm_helper_force_disable_all(ddev); Is it that the DRM core recommend us to use drm_atomic_helper_disable_all() ? > drm_kms_helper_poll_fini(ddev); > return 0; > }
Hi Sui, On Tue, Jun 27, 2023 at 4:57 PM Sui Jingfeng <suijingfeng@loongson.cn> wrote: > On 2023/6/22 17:21, Geert Uytterhoeven wrote: > > When the device is unbound from the driver, the display may be active. > > Make sure it gets shut down. > > would you mind to give a short description why this is necessary. That's a good comment. It turned out that this is not really necessary here, but to avoid a regression with "[PATCH 34/39] drm: renesas: shmobile: Atomic conversion part 1", where it is needed to call drm_atomic_helper_shutdown(). As the comments for drm_atomic_helper_shutdown() says it is the atomic version of drm_helper_force_disable_all(), I figured I had to introduce a call to the latter first, before doing the atomic conversion. Does that make sense? > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > > +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c > > @@ -16,6 +16,7 @@ > > #include <linux/pm_runtime.h> > > #include <linux/slab.h> > > > > +#include <drm/drm_crtc_helper.h> > > #include <drm/drm_drv.h> > > #include <drm/drm_fbdev_generic.h> > > #include <drm/drm_gem_dma_helper.h> > > @@ -145,6 +146,7 @@ static int shmob_drm_remove(struct platform_device *pdev) > > struct drm_device *ddev = &sdev->ddev; > > > > drm_dev_unregister(ddev); > > + drm_helper_force_disable_all(ddev); > > Is it that the DRM core recommend us to use > drm_atomic_helper_disable_all() ? Well, drm_atomic_helper_shutdown() is a convenience wrapper around drm_atomic_helper_disable_all()... But we can't call any atomic helpers yet, before the conversion to atomic modesetting. > > > drm_kms_helper_poll_fini(ddev); > > return 0; > > } Gr{oetje,eeting}s, Geert
diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c index a29c0c1093725b6e..636f1888b815579b 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c @@ -16,6 +16,7 @@ #include <linux/pm_runtime.h> #include <linux/slab.h> +#include <drm/drm_crtc_helper.h> #include <drm/drm_drv.h> #include <drm/drm_fbdev_generic.h> #include <drm/drm_gem_dma_helper.h> @@ -145,6 +146,7 @@ static int shmob_drm_remove(struct platform_device *pdev) struct drm_device *ddev = &sdev->ddev; drm_dev_unregister(ddev); + drm_helper_force_disable_all(ddev); drm_kms_helper_poll_fini(ddev); return 0; }