[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALeDE9NsdNDf+S9kYqsJGftjj+mS8sZPexMJUvtNqbc7CTjrqA@mail.gmail.com>
Date: Sun, 16 May 2021 13:31:16 +0100
From: Peter Robinson <pbrobinson@...il.com>
To: Javier Martinez Canillas <javierm@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Thomas Zimmermann <tzimmermann@...e.de>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>,
Heiko Stübner <heiko@...ech.de>,
Sandy Huang <hjc@...k-chips.com>,
dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH v2] drm/rockchip: remove existing generic drivers to take
over the device
On Sun, May 16, 2021 at 8:48 AM Javier Martinez Canillas
<javierm@...hat.com> wrote:
>
> 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 <javierm@...hat.com>
Tested-by: Peter Robinson <pbrobinson@...il.com>
Tested on Pinebook Pro (eDP), Rock960 (HDMI) and Firefly3399.
> ---
>
> 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 <linux/console.h>
> #include <linux/iommu.h>
>
> +#include <drm/drm_aperture.h>
> #include <drm/drm_drv.h>
> #include <drm/drm_fb_helper.h>
> #include <drm/drm_gem_cma_helper.h>
> @@ -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);
> --
> 2.31.1
>
Powered by blists - more mailing lists