Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-21 Thread Oleksandr Andrushchenko
On 12/20/18 8:38 PM, Christoph Hellwig wrote: On Thu, Dec 20, 2018 at 07:35:15PM +0100, Daniel Vetter wrote: Err, with streaming DMA buffer sharing is trivial. The coherent DMA allocator is what causes all kinds of horrible hacks that can't actually work on various platforms. Hm, I thought

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Christoph Hellwig
On Thu, Dec 20, 2018 at 07:35:15PM +0100, Daniel Vetter wrote: > > Err, with streaming DMA buffer sharing is trivial. The coherent DMA > > allocator is what causes all kinds of horrible hacks that can't actually > > work on various platforms. > > Hm, I thought the streaming dma api is the one

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Daniel Vetter
On Thu, Dec 20, 2018 at 7:33 PM Christoph Hellwig wrote: > > On Thu, Dec 20, 2018 at 07:29:37PM +0100, Daniel Vetter wrote: > > What we most definitely not want to end up with though is actually > > streaming dma, because with that all the zero copy buffer sharing > > tricks become pointless.

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Christoph Hellwig
On Thu, Dec 20, 2018 at 07:29:37PM +0100, Daniel Vetter wrote: > What we most definitely not want to end up with though is actually > streaming dma, because with that all the zero copy buffer sharing > tricks become pointless. There's pretty epic amounts of hacks to work > around this, I have no

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Daniel Vetter
On Thu, Dec 20, 2018 at 6:39 PM Christoph Hellwig wrote: > > On Thu, Dec 20, 2018 at 05:49:39PM +0200, Oleksandr Andrushchenko wrote: > > This is the only patch [1], no series. And at the moment I think > > there is nothing to review as I am not sure how to deal with those > > shmem pages: this

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Christoph Hellwig
On Thu, Dec 20, 2018 at 05:49:39PM +0200, Oleksandr Andrushchenko wrote: > This is the only patch [1], no series. And at the moment I think > there is nothing to review as I am not sure how to deal with those > shmem pages: this patch is rather to start a discussion on how shmem > pages can be

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Oleksandr Andrushchenko
On 12/20/18 5:36 PM, Christoph Hellwig wrote: On Tue, Dec 18, 2018 at 08:20:22PM +0100, Noralf Trønnes wrote: + if (!dma_map_sg(dev->dev, xen_obj->sgt->sgl, xen_obj->sgt->nents, + DMA_BIDIRECTIONAL)) { Are you using the DMA streaming API as a way to flush the

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Christoph Hellwig
On Wed, Dec 19, 2018 at 02:14:52PM +0100, Gerd Hoffmann wrote: > > > > > +    if (!dma_map_sg(dev->dev, xen_obj->sgt->sgl, xen_obj->sgt->nents, > > > > +    DMA_BIDIRECTIONAL)) { > > > > > > > > > Are you using the DMA streaming API as a way to flush the caches? > > Yes > > > Does this

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Christoph Hellwig
On Tue, Dec 18, 2018 at 08:20:22PM +0100, Noralf Trønnes wrote: > > + if (!dma_map_sg(dev->dev, xen_obj->sgt->sgl, xen_obj->sgt->nents, > > + DMA_BIDIRECTIONAL)) { > > > Are you using the DMA streaming API as a way to flush the caches? This looks rather broken. Please send

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 6:14 PM, Noralf Trønnes wrote: Den 19.12.2018 09.18, skrev Oleksandr Andrushchenko: On 12/18/18 9:20 PM, Noralf Trønnes wrote: Den 27.11.2018 11.32, skrev Oleksandr Andrushchenko: From: Oleksandr Andrushchenko When GEM backing storage is allocated with drm_gem_get_pages the

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 4:10 PM, Gerd Hoffmann wrote: Hi, Sure this actually helps? It's below 4G in guest physical address space, so it can be backed by pages which are actually above 4G in host physical address space ... Yes, you are right here. This is why I wrote about the IOMMU and other

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-19 Thread Noralf Trønnes
Den 19.12.2018 09.18, skrev Oleksandr Andrushchenko: On 12/18/18 9:20 PM, Noralf Trønnes wrote: Den 27.11.2018 11.32, skrev Oleksandr Andrushchenko: From: Oleksandr Andrushchenko When GEM backing storage is allocated with drm_gem_get_pages the backing pages may be cached, thus making it

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-19 Thread Gerd Hoffmann
Hi, > > Sure this actually helps? It's below 4G in guest physical address > > space, so it can be backed by pages which are actually above 4G in host > > physical address space ... > > Yes, you are right here. This is why I wrote about the IOMMU > and other conditions. E.g. you can have a

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-19 Thread Oleksandr Andrushchenko
On 12/19/18 3:14 PM, Gerd Hoffmann wrote: Hi, +    mapping = xen_obj->base.filp->f_mapping; +    mapping_set_gfp_mask(mapping, GFP_USER | __GFP_DMA32); Let's see if I understand what you're doing: Here you say that the pages should be DMA accessible for devices that can only see 4GB.

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-19 Thread Gerd Hoffmann
Hi, > > > +    mapping = xen_obj->base.filp->f_mapping; > > > +    mapping_set_gfp_mask(mapping, GFP_USER | __GFP_DMA32); > > Let's see if I understand what you're doing: > > > > Here you say that the pages should be DMA accessible for devices that can > > only see 4GB. > > Yes, your

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-19 Thread Oleksandr Andrushchenko
On 12/18/18 9:20 PM, Noralf Trønnes wrote: Den 27.11.2018 11.32, skrev Oleksandr Andrushchenko: From: Oleksandr Andrushchenko When GEM backing storage is allocated with drm_gem_get_pages the backing pages may be cached, thus making it possible that the backend sees only partial content of

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-18 Thread Noralf Trønnes
Den 27.11.2018 11.32, skrev Oleksandr Andrushchenko: From: Oleksandr Andrushchenko When GEM backing storage is allocated with drm_gem_get_pages the backing pages may be cached, thus making it possible that the backend sees only partial content of the buffer which may lead to screen artifacts.

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-17 Thread Oleksandr Andrushchenko
On 12/14/18 10:35 AM, Daniel Vetter wrote: On Fri, Dec 14, 2018 at 09:09:45AM +0200, Oleksandr Andrushchenko wrote: On 12/13/18 5:48 PM, Daniel Vetter wrote: On Thu, Dec 13, 2018 at 12:17:54PM +0200, Oleksandr Andrushchenko wrote: Daniel, could you please comment? Cross-revieweing someone

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-14 Thread Daniel Vetter
On Fri, Dec 14, 2018 at 09:09:45AM +0200, Oleksandr Andrushchenko wrote: > On 12/13/18 5:48 PM, Daniel Vetter wrote: > > On Thu, Dec 13, 2018 at 12:17:54PM +0200, Oleksandr Andrushchenko wrote: > > > Daniel, could you please comment? > > Cross-revieweing someone else's stuff would scale better, >

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-13 Thread Oleksandr Andrushchenko
On 12/13/18 5:48 PM, Daniel Vetter wrote: On Thu, Dec 13, 2018 at 12:17:54PM +0200, Oleksandr Andrushchenko wrote: Daniel, could you please comment? Cross-revieweing someone else's stuff would scale better, fair enough I don't think I'll get around to anything before next year. I put you

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-13 Thread Daniel Vetter
On Thu, Dec 13, 2018 at 12:17:54PM +0200, Oleksandr Andrushchenko wrote: > Daniel, could you please comment? Cross-revieweing someone else's stuff would scale better, I don't think I'll get around to anything before next year. -Daniel > > Thank you > > On 11/27/18 12:32 PM, Oleksandr

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-13 Thread Oleksandr Andrushchenko
Daniel, could you please comment? Thank you On 11/27/18 12:32 PM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko When GEM backing storage is allocated with drm_gem_get_pages the backing pages may be cached, thus making it possible that the backend sees only partial content of

[PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-11-27 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko When GEM backing storage is allocated with drm_gem_get_pages the backing pages may be cached, thus making it possible that the backend sees only partial content of the buffer which may lead to screen artifacts. Make sure that the frontend's memory is coherent and