dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: narmstrong@baylibre.com, daniel.vetter@ffwll.ch,
	liviu.dudau@arm.com, dri-devel@lists.freedesktop.org,
	thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com,
	daniel.vetter@intel.com, marex@denx.de,
	boris.brezillon@free-electrons.com, abrodkin@synopsys.com,
	linux@armlinux.org.uk, z.liuxinliang@hisilicon.com,
	kong.kongxinwei@hisilicon.com, tomi.valkeinen@ti.com,
	airlied@redhat.com, puck.chen@hisilicon.com, jsarha@ti.com,
	vincent.abriou@st.com, alison.wang@freescale.com,
	sw0312.kim@samsung.com, philippe.cornu@st.com,
	yannick.fertre@st.com, kyungmin.park@samsung.com,
	zourongrong@gmail.com, maxime.ripard@free-electrons.com,
	shawnguo@kernel.org, kraxel@redhat.com
Subject: Re: [PATCH v3 1/2] drm/gem: drm_gem_dumb_map_offset(): reject dma-buf
Date: Fri, 18 Aug 2017 13:34:45 -0700	[thread overview]
Message-ID: <87shgopqca.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <20170818201730.62slltrw4fwlj5qe@phenom.ffwll.local>


[-- Attachment #1.1: Type: text/plain, Size: 2100 bytes --]

Daniel Vetter <daniel@ffwll.ch> writes:

> On Fri, Aug 18, 2017 at 10:41:21AM -0700, Eric Anholt wrote:
>> Noralf Trønnes <noralf@tronnes.org> writes:
>> > Den 18.08.2017 09.46, skrev Daniel Vetter:
>> >> On Thu, Aug 17, 2017 at 06:21:30PM +0200, Noralf Trønnes wrote:
>> >>> Reject mapping an imported dma-buf since is's an invalid use-case.
>> >>>
>> >>> Cc: Philipp Zabel <p.zabel@pengutronix.de>
>> >>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> >>> Cc: Sean Paul <seanpaul@chromium.org>
>> >>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> >>> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
>> >> I think acks from someone using mali would be good too. amdgpu already has
>> >> such checks, so I think on the desktop side we're ok.
>> >>
>> >> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> >>
>> >> But I think this one here definitely needs a few more acks. I could break
>> >> uabi if we're unlucky, so let's not rush it.
>> >
>> > Ok, I've CC'ed the affected parties to increase the odds that they look
>> > at this. These are the drivers using drm_gem_dumb_map_offset()
>> > (hopefully I got the list right):
>> 
>> If I understand the affected path right, this would break the PL111+VC4
>> combination: PL111 makes (dumb) buffers for scanout, and VC4 imports
>> them and uses them for rendering.  A vc4 glReadPixels of the window
>> system buffer would map it and fail.
>
> It only rejects the map call on dumb buffers, and mmap on imported dma-buf
> tends to not really work well, or at least break a few abstractions. Are
> you sure this works currently?

OK, that's right -- vc4 would be doing its "native" map call (the same
code), not dumb map.

Furthermore, I had it backwards (I had written things both ways at
different points, iirc).  We have VC4 making the buffers and PL111
dma-buf importing them.  I don't see X11 mapping those buffers if glamor
is enabled, so this should be OK for vc4.

GBM's dumb mapping looks safe to me.  X11 does some dumb maps, but I
don't think any of those would be on imports.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-08-18 20:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 16:21 [PATCH v3 0/2] drm/dumb-buffers: Add defaults for .dumb_map_offset and .dumb_destroy Noralf Trønnes
2017-08-17 16:21 ` [PATCH v3 1/2] drm/gem: drm_gem_dumb_map_offset(): reject dma-buf Noralf Trønnes
2017-08-17 17:56   ` Laurent Pinchart
2017-08-17 18:30     ` Chris Wilson
2017-08-17 19:01       ` Laurent Pinchart
2017-08-17 19:09         ` Chris Wilson
2017-08-17 19:40           ` Laurent Pinchart
2017-08-17 20:01             ` Chris Wilson
2017-08-17 22:35               ` Laurent Pinchart
2017-08-18  7:45                 ` Daniel Vetter
2017-08-18  8:01                   ` Laurent Pinchart
2017-08-18  8:21                     ` Chris Wilson
2017-08-18  7:46   ` Daniel Vetter
2017-08-18 16:13     ` Noralf Trønnes
2017-08-18 17:41       ` Eric Anholt
2017-08-18 20:17         ` Daniel Vetter
2017-08-18 20:34           ` Eric Anholt [this message]
2017-08-18 21:01             ` Daniel Vetter
2017-08-18 23:37               ` Eric Anholt
2017-08-24 10:04       ` Brian Starkey
2017-08-25 13:34         ` Daniel Vetter
2017-08-29 16:03           ` Brian Starkey
2017-08-30  7:44             ` Daniel Vetter
2017-08-30  8:38               ` Brian Starkey
2017-09-02 12:42       ` Noralf Trønnes
2017-08-21  5:26   ` Thierry Reding
2017-08-17 16:21 ` [PATCH v3 2/2] drm/armada: Use .dumb_map_offset and .dumb_destroy defaults Noralf Trønnes
2017-08-18  7:47   ` Daniel Vetter
2017-08-30  8:25     ` Daniel Vetter

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=87shgopqca.fsf@eliezer.anholt.net \
    --to=eric@anholt.net \
    --cc=abrodkin@synopsys.com \
    --cc=airlied@redhat.com \
    --cc=alison.wang@freescale.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=kraxel@redhat.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux@armlinux.org.uk \
    --cc=liviu.dudau@arm.com \
    --cc=marex@denx.de \
    --cc=maxime.ripard@free-electrons.com \
    --cc=narmstrong@baylibre.com \
    --cc=philippe.cornu@st.com \
    --cc=puck.chen@hisilicon.com \
    --cc=shawnguo@kernel.org \
    --cc=sw0312.kim@samsung.com \
    --cc=thierry.reding@gmail.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=vincent.abriou@st.com \
    --cc=yannick.fertre@st.com \
    --cc=z.liuxinliang@hisilicon.com \
    --cc=zourongrong@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox