All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 05/20] drm/meson: Use drm_fbdev_generic_setup()
Date: Thu, 13 Sep 2018 16:55:14 +0200	[thread overview]
Message-ID: <20180913145514.GJ11082@phenom.ffwll.local> (raw)
In-Reply-To: <80174fa8-0b02-4ccd-b5be-863fb6ce7afc@baylibre.com>

On Thu, Sep 13, 2018 at 04:26:53PM +0200, Neil Armstrong wrote:
> Hi Daniel,
> 
> On 13/09/2018 15:21, Daniel Vetter wrote:
> > On Wed, Sep 12, 2018 at 01:06:07PM +0200, Noralf Trønnes wrote:
> >>
> >> Den 12.09.2018 12.57, skrev Noralf Trønnes:
> >>> (Cc: Daniel Vetter)
> >>>
> >>
> >> Somehow that CC was dropped somewhere after leaving email client.
> >> Trying once more.
> > 
> > Yeah I just made myself unpopular. If you want SMEM_START, then you need
> > to carry a local patch now. virt_to_pfn on the vmap should work. It's
> > about 2 lines, including the change to drop HIDE_SMEM_START.
> 
> Would it be totally unacceptable to add such 2 line :
> - enabled by a specific config depending on EXPERT and narrowed to specific platforms
> - printing a big fat pr_warning_once when used
> - with a big fat comment specifying when this code will be dropped and why we should not activate it

module_param_debug auto-taints your kernel, I'd just go with that. Plus
CONFIG_EXPERT (or CONFIG_BROKEN).

But yes, I think that's something I'll happily ack. Must be acked by Dave
(and perhaps a few others too), since defacto this means we now suddenly
care about closed source blobs. I'd say get someone from amd and a few of
the driver maintainers on board with this (nouveau, Eric, Rob, Lucas,
...), to make sure it really represents community consensus.

Cheers, Daniel

> 
> Neil
> > 
> > And if consensus is that hiding SMEM_START is not a nice idea, then I'm
> > sure we can reintroduce it through some slightly unpretty backdoor, even
> > with Noralf's generic code. So not really a good reason to reject the
> > cleanup I think.
> > -Daniel
> > 
> > 
> >>> Den 12.09.2018 11.56, skrev Maxime Ripard:
> >>>> On Wed, Sep 12, 2018 at 11:48:34AM +0200, Neil Armstrong wrote:
> >>>>> Hi Noralf,
> >>>>>
> >>>>> On 08/09/2018 15:46, Noralf Trønnes wrote:
> >>>>>> The CMA helper is already using the
> >>>>>> drm_fb_helper_generic_probe part of
> >>>>>> the generic fbdev emulation. This patch makes full use of the generic
> >>>>>> fbdev emulation by using its drm_client callbacks. This means that
> >>>>>> drm_mode_config_funcs->output_poll_changed and
> >>>>>> drm_driver->lastclose are
> >>>>>> now handled by the emulation code. Additionally fbdev
> >>>>>> unregister happens
> >>>>>> automatically on drm_dev_unregister().
> >>>>>>
> >>>>>> The drm_fbdev_generic_setup() call is put after
> >>>>>> drm_dev_register() in the
> >>>>>> driver. This is done to highlight the fact that fbdev emulation is an
> >>>>>> internal client that makes use of the driver, it is not part of the
> >>>>>> driver as such. If fbdev setup fails, an error is printed,
> >>>>>> but the driver
> >>>>>> succeeds probing.
> >>>>> I can't really ack/nack this move, on one side it's great to have a
> >>>>> generic fbdev emulation instead of the old fbdev code, but on the
> >>>>> other side the Amlogic platform (like allwinner, samsung, rockchip,
> >>>>> ...)  still relies on an Fbdev variant of the libMali that uses
> >>>>> smem_start...
> >>>>>
> >>>>> I know it's dirty and fbdev based code should be legacy now, but I
> >>>>> consider it like an user-space breakage...
> >>>>>
> >>>>> I'll be happy if ARM provided it's Mali vendors a Fbdev libMali that
> >>>>> could use FBINFO_HIDE_SMEM_START and allocate BO's from the DRM
> >>>>> driver, it won't be the case and it will never be the case until the
> >>>>> Lima projects finalizes.
> >>>>>
> >>>>> So for me it's a no-go until Lima lands upstream in Linux *and* Mesa.
> >>>> My feelings exactly. If the choice is between reducing the DRM driver
> >>>> by a couple of dozens of lines or keeping the mali working, I'll pick
> >>>> the latter, every single day.
> >>>
> >>> I don't know the reasoning for blocking smem_start other than what Daniel
> >>> wrote in these commit messages:
> >>>
> >>> da6c7707caf3736c1cf968606bd97c07e79625d4
> >>> fbdev: Add FBINFO_HIDE_SMEM_START flag
> >>>
> >>>   DRM drivers really, really, really don't want random userspace to
> >>>   share buffer behind it's back, bypassing the dma-buf buffer sharing
> >>>   machanism. For that reason we've ruthlessly rejected any IOCTL
> >>>   exposing the physical address of any graphics buffer.
> >>>
> >>>   Unfortunately fbdev comes with that built-in. We could just set
> >>>   smem_start to 0, but that means we'd have to hand-roll our own fb_mmap
> >>>   implementation. For good reasons many drivers do that, but
> >>>   smem_start/length is still super convenient.
> >>>
> >>>   Hence instead just stop the leak in the ioctl, to keep fb mmap working
> >>>   as-is. A second patch will set this flag for all drm drivers.
> >>>
> >>>
> >>> 6be8f3bd2c78915a9f3a058a346ae93068d35c01
> >>> drm/fb: Stop leaking physical address
> >>>
> >>>   For buffer sharing, use dma-buf instead. We can't set smem_start to 0
> >>>   unconditionally since that's used by the fbdev mmap default
> >>>   implementation. And we have plenty of userspace which would like to
> >>>   keep that working.
> >>>
> >>>   This might break legit userspace - if it does we need to look at a
> >>>   case-by-cases basis how to handle that. Worst case I expect overrides
> >>>   for only specific drivers, since anything remotely modern should be
> >>>   using dma-buf/prime now (which is about 7 years old now for DRM
> >>>   drivers).
> >>>
> >>>   This issue was uncovered because Noralf's rework to implement a
> >>>   generic fb_probe also implements it's own fb_mmap callback. Which
> >>>   means smem_start didn't have to be set anymore, which blew up some
> >>>   blob in userspace rather badly.
> >>>
> >>>
> >>> Noralf.
> >>>
> >>> _______________________________________________
> >>> dri-devel mailing list
> >>> dri-devel@lists.freedesktop.org
> >>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> >>>
> >>
> > 
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-09-13 14:55 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-08 13:46 [PATCH 00/20] drm/cma-helper drivers: Use drm_fbdev_generic_setup() Noralf Trønnes
2018-09-08 13:46 ` [PATCH 01/20] drm/fb-helper: Improve error reporting in setup Noralf Trønnes
2018-09-25  9:46   ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 02/20] drm/arc: Use drm_fbdev_generic_setup() Noralf Trønnes
2018-09-10 12:31   ` Alexey Brodkin
2018-09-10 13:00     ` Noralf Trønnes
2018-09-28  7:34   ` Alexey Brodkin
2018-09-28 10:42     ` Noralf Trønnes
2018-10-01  7:56       ` Alexey Brodkin
2018-10-01 12:05         ` Noralf Trønnes
2018-10-01 12:06           ` Alexey Brodkin
2018-09-08 13:46 ` [PATCH 03/20] drm/fsl-dcu: " Noralf Trønnes
2018-09-27 21:08   ` Stefan Agner
2018-09-27 21:23     ` Noralf Trønnes
2018-09-28 14:11       ` Stefan Agner
2018-09-28 14:57         ` Noralf Trønnes
2018-09-28 15:00           ` Stefan Agner
2018-09-08 13:46 ` [PATCH 04/20] drm/hisilicon/kirin: " Noralf Trønnes
2018-09-08 13:46 ` [PATCH 05/20] drm/meson: " Noralf Trønnes
2018-09-12  9:48   ` Neil Armstrong
2018-09-12  9:56     ` Maxime Ripard
2018-09-12 10:57       ` Noralf Trønnes
2018-09-12 11:06         ` Noralf Trønnes
2018-09-13 13:21           ` Daniel Vetter
2018-09-13 14:26             ` Neil Armstrong
2018-09-13 14:55               ` Daniel Vetter [this message]
2018-09-14  8:23                 ` Neil Armstrong
2018-09-14  8:51                   ` Daniel Vetter
2018-09-14 16:33                   ` Noralf Trønnes
2018-09-17  7:53                     ` Neil Armstrong
2018-10-01 12:27                       ` Neil Armstrong
2018-10-03 19:24   ` Neil Armstrong
2018-10-25 15:09     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 06/20] drm/mxsfb: " Noralf Trønnes
2018-09-08 13:46 ` [PATCH 07/20] drm/rcar-du: " Noralf Trønnes
2018-09-09 14:00   ` Sam Ravnborg
2018-09-09 14:13   ` Laurent Pinchart
2018-09-10 13:02     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 08/20] drm/arm/hdlcd: " Noralf Trønnes
2018-09-11 12:17   ` Liviu Dudau
2018-09-11 12:41     ` Noralf Trønnes
2018-09-25  9:47     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 09/20] drm/arm/mali: " Noralf Trønnes
2018-09-11 12:18   ` Liviu Dudau
2018-09-25  9:47     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 10/20] drm/atmel-hlcdc: " Noralf Trønnes
2018-09-08 13:46 ` [PATCH 11/20] drm/imx: " Noralf Trønnes
2018-09-14 11:42   ` Philipp Zabel
2018-09-25  9:48     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 12/20] drm/pl111: " Noralf Trønnes
2018-09-13  0:07   ` Eric Anholt
2018-09-25  9:48     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 13/20] drm/sti: " Noralf Trønnes
2018-09-10  9:39   ` Benjamin Gaignard
2018-09-25  9:48     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 14/20] drm/stm: " Noralf Trønnes
2018-09-27 11:45   ` Yannick FERTRE
2018-10-25 15:10     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 15/20] drm/sun4i: " Noralf Trønnes
2018-09-10  7:28   ` Maxime Ripard
2018-09-10 12:57     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 16/20] drm/tilcdc: " Noralf Trønnes
2018-09-08 13:46 ` [PATCH 17/20] drm/tve200: " Noralf Trønnes
2018-09-18 22:10   ` Linus Walleij
2018-09-25  9:49     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 18/20] drm/vc4: " Noralf Trønnes
2018-09-13  0:06   ` Eric Anholt
2018-09-25  9:49     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 19/20] drm/zte: " Noralf Trønnes
2018-09-10  1:23   ` Shawn Guo
2018-09-25  9:49     ` Noralf Trønnes
2018-09-08 13:46 ` [PATCH 20/20] drm/cma-helper: Remove unused fbdev code Noralf Trønnes
2018-09-09 14:09 ` [PATCH 00/20] drm/cma-helper drivers: Use drm_fbdev_generic_setup() Sam Ravnborg
     [not found] ` <606da8a9-a402-5d2e-1f22-d287982f6abc@tronnes.org>
2018-09-11 11:40   ` Noralf Trønnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180913145514.GJ11082@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=narmstrong@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.