[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <042fe794-dec6-6d9d-5b68-6f142790f5c7@epam.com>
Date: Wed, 16 Jan 2019 06:43:29 +0000
From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@...m.com>
To: Christoph Hellwig <hch@...radead.org>,
Gerd Hoffmann <kraxel@...hat.com>
CC: Oleksandr Andrushchenko <andr2000@...il.com>,
"xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"daniel.vetter@...el.com" <daniel.vetter@...el.com>,
"jgross@...e.com" <jgross@...e.com>,
"boris.ostrovsky@...cle.com" <boris.ostrovsky@...cle.com>,
"noralf@...nnes.org" <noralf@...nnes.org>
Subject: Re: [PATCH v2] drm/xen-front: Make shmem backed display buffer
coherent
On 1/16/19 8:36 AM, Christoph Hellwig wrote:
> On Wed, Jan 16, 2019 at 07:30:02AM +0100, Gerd Hoffmann wrote:
>> Hi,
>>
>>> + if (!dma_map_sg(dev->dev, xen_obj->sgt->sgl, xen_obj->sgt->nents,
>>> + DMA_BIDIRECTIONAL)) {
>>> + ret = -EFAULT;
>>> + goto fail_free_sgt;
>>> + }
>> Hmm, so it seems the arm guys could not come up with a suggestion how to
>> solve that one in a better way. Ok, lets go with this then.
>>
>> But didn't we agree that this deserves a comment exmplaining the purpose
>> of the dma_map_sg() call is to flush caches and that there is no actual
>> DMA happening here?
> Using a dma mapping call to flush caches is complete no-go. But the
> real question is why you'd even want to flush cashes if you do not
> want a dma mapping?
>
> This whole issue keeps getting more and more confusing.
Well, I don't really do DMA here, but instead the buffers in
question are shared with other Xen domain, so effectively it
could be thought of some sort of DMA here, where the "device" is
that remote domain. If the buffers are not flushed then the
remote part sees some inconsistency which in my case results
in artifacts on screen while displaying the buffers.
When buffers are allocated via DMA API then there are no artifacts;
if buffers are allocated with shmem + DMA mapping then there are no
artifacts as well.
The only offending use-case is when I use shmem backed buffers,
but do not flush them
Powered by blists - more mailing lists