lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 07 Aug 2018 22:31:30 +0200
From:   Paul Kocialkowski <contact@...lk.fr>
To:     Daniel Vetter <daniel@...ll.ch>
Cc:     dri-devel@...ts.freedesktop.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Maxime Ripard <maxime.ripard@...tlin.com>,
        David Airlie <airlied@...ux.ie>, Chen-Yu Tsai <wens@...e.org>,
        linux-sunxi@...glegroups.com
Subject: Re: [PATCH] drm/sun4i: Avoid failing to init fbdev without any
 connector

Hi,

Le mardi 07 août 2018 à 22:18 +0200, Daniel Vetter a écrit :
> On Tue, Aug 07, 2018 at 09:39:19PM +0200, Paul Kocialkowski wrote:
> > Initializing and registering fbdev requires at least one DRM connector
> > and will fail otherwise. In order to support headless setups (for
> > instance for GPU rendering with the GBM backend, where a DRI card node
> > is required to provide GEM memory reservation), add a check on the
> > number of registered connectors before initializing fbdev.
> 
> sun4i is a pure kms driver, why exactly do you need it for gbm backed
> rendering? What exactly is rendering here, and why does it insist on a
> display card node, even if that display card node is 100% defunct?

The non-free Mali blobs provide GPU support with a GBM interface that
takes a DRM fd in order to reserve the memory it needs for its rendering
targets. This uses the GEM interface available through the DRI card node
(and there is no render node with the non-free Mali driver). Allwinner
has a minimalistic out-of-tree driver pretty much only for this purpose.

I crafted this patch when someone on IRC tried to get the out-of-tree
Mali GPU driver going with the mainline kernel in order to do rendering
in a GBM buffer, since it's apparently the only option for headless
rendering with the blob.

In my opinion, supporting the pipeline of an out-of-tree GPU driver that
only works with a non-free userspace blob is not a valid reason to do
anything. Still, it felt like adding support for the headless use-case
wouldn't hurt, whatever the underlying use case for it may be. I found
that other drivers also implement the same mechanism (perhaps for
different reasons).

Cheers,

Paul

> -Daniel
> 
> > Signed-off-by: Paul Kocialkowski <contact@...lk.fr>
> > ---
> >  drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> > index 5f29850ef8ac..19a265e4a93a 100644
> > --- a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> > +++ b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c
> > @@ -49,6 +49,8 @@ static struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers = {
> >  
> >  int sun4i_framebuffer_init(struct drm_device *drm)
> >  {
> > +	int ret;
> > +
> >  	drm_mode_config_reset(drm);
> >  
> >  	drm->mode_config.max_width = 8192;
> > @@ -57,7 +59,13 @@ int sun4i_framebuffer_init(struct drm_device *drm)
> >  	drm->mode_config.funcs = &sun4i_de_mode_config_funcs;
> >  	drm->mode_config.helper_private = &sun4i_de_mode_config_helpers;
> >  
> > -	return drm_fb_cma_fbdev_init(drm, 32, 0);
> > +	if (drm->mode_config.num_connector > 0) {
> > +		ret = drm_fb_cma_fbdev_init(drm, 32, 0);
> > +		if (ret)
> > +			return ret;
> > +	}
> > +
> > +	return 0;
> >  }
> >  
> >  void sun4i_framebuffer_free(struct drm_device *drm)
> > -- 
> > 2.18.0
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@...ts.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> 
-- 
Developer of free digital technology and hardware support.

Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ