Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp632165pxj; Thu, 27 May 2021 08:15:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxciSoqgHB6L0MEzdCNBoAQ0ewEKNp2Mdz0xUzwcYDC9XwqY1LQAGaX+4DcFdNlR2xyAMjD X-Received: by 2002:a05:6e02:974:: with SMTP id q20mr3320750ilt.227.1622128505260; Thu, 27 May 2021 08:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622128505; cv=none; d=google.com; s=arc-20160816; b=kSIBpIyQKWiHy8tDVoEQR39S8qrgQB6bojp+Sz4B4MVTI/ePvw+dVfw4YVDf2LQpVr HTm1jIheVnmqq6c6CDsef0z1xCVnpN2bzYHR4t6uS+pCz66ww+X5prYMPybp7DpvRDGi R3NSSPlYw/r2aqr+6v+dHoWonGVy4/rcLzxpNQm3k+jsLFwo/j+cnEF4pifZg5NXuJhX fo11OTFkNW4WbYAoQski6nGaR67/8PIj9uR+ySXkeLSLfFdrBFFJ+w0IqoOOZa+Hkt/4 RudR8xT0MBBnXiaMRzzVHYX1TDH7wzoT/qBv+nfHwhu+Zyw+tvIkhudOG3t3yiJLy7XN GxtA== 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=4jmRNbCH5vhuaWhjQmj+KhpQrdNO/XzdwiRhxBxjl3o=; b=uCHgjIe1sCwEOblWW0CZFcExXBnhpqugZRnKV4AA8klAPtpezYVlfhywIPMz0Pb38a Uh79FM6mnOVTbqGG54+1yk/XWbvCDEv1D2Y5oVq7Vyd22LmQaWZnm5hjMCI0gjm2A4yO 1pJtS01vG3Dlp83G8kMzGE2dvjL2pumOcxGo+O9ZSHAyv2OWPKpzCOPnfkDwpM26jONa 1p1uNrXYMsjc3om9vnLGZrh7/StnXg1U7uSkBVnyeuE0uyv9oxX/myZLVZjdnrNtKyiT Vj2pPbCsbvphIOwhqlJAORib39wlZ0qLltj6PGrPNRtqtKTdrPVbEzsj0YovyF77al3f Ql6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f17si2625667ilc.44.2021.05.27.08.14.51; Thu, 27 May 2021 08:15:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235606AbhE0JQj (ORCPT + 99 others); Thu, 27 May 2021 05:16:39 -0400 Received: from gloria.sntech.de ([185.11.138.130]:35286 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235589AbhE0JQh (ORCPT ); Thu, 27 May 2021 05:16:37 -0400 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmC6Y-0006zN-RK; Thu, 27 May 2021 11:15:02 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: linux-kernel@vger.kernel.org, Javier Martinez Canillas Cc: Peter Robinson , Thomas Zimmermann , Javier Martinez Canillas , Daniel Vetter , David Airlie , Sandy Huang , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v2] drm/rockchip: remove existing generic drivers to take over the device Date: Thu, 27 May 2021 11:15:02 +0200 Message-ID: <4006303.q0ZmV6gNhb@diego> In-Reply-To: <20210516074833.451643-1-javierm@redhat.com> References: <20210516074833.451643-1-javierm@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Sonntag, 16. Mai 2021, 09:48:33 CEST schrieb Javier Martinez Canillas: > There are drivers that register framebuffer devices very early in the boot > process and make use of the existing framebuffer as setup by the firmware. > > If one of those drivers has registered a fbdev, then the fallback fbdev of > the DRM driver won't be bound to the framebuffer console. To avoid that, > remove any existing generic driver and take over the graphics device. > > By doing that, the fb mapped to the console is switched correctly from the > early fbdev to the one registered by the rockchip DRM driver: > > [ 40.752420] fb0: switching to rockchip-drm-fb from EFI VGA > > Signed-off-by: Javier Martinez Canillas fwiw, this looks like the right thing to do. I haven't found time to test though yet. So anyway Acked-by: Heiko Stuebner Heiko > --- > > Changes in v2: > - Move drm_aperture_remove_framebuffers() call to .bind callback (tzimmermann). > - Adapt subject line, commit message, etc accordingly. > > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > index 212bd87c0c4..b730b8d5d94 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > @@ -16,6 +16,7 @@ > #include > #include > > +#include > #include > #include > #include > @@ -114,6 +115,15 @@ static int rockchip_drm_bind(struct device *dev) > struct rockchip_drm_private *private; > int ret; > > + /* Remove existing drivers that may own the framebuffer memory. */ > + ret = drm_aperture_remove_framebuffers(false, "rockchip-drm-fb"); > + if (ret) { > + DRM_DEV_ERROR(dev, > + "Failed to remove existing framebuffers - %d.\n", > + ret); > + return ret; > + } > + > drm_dev = drm_dev_alloc(&rockchip_drm_driver, dev); > if (IS_ERR(drm_dev)) > return PTR_ERR(drm_dev); >