Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-03-01 Thread Qiang Yu
On Thu, Feb 27, 2020 at 9:21 PM Gerd Hoffmann wrote: > > Hi, > > > > So I'd like to push patches 1+2 to -fixes and sort everything else later > > > in -next. OK? > > > > OK with me. > > Done. > > >> [ context: why shmem helpers use pgprot_writecombine + pgprot_decrypted? > >>we get

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-28 Thread Gerd Hoffmann
On Fri, Feb 28, 2020 at 10:54:54AM +0100, Thomas Hellström (VMware) wrote: > On 2/28/20 10:49 AM, Gerd Hoffmann wrote: > >Hi, > > > > > > Not clue about the others (lima, tiny, panfrost, v3d). Maybe they use > > > > write-combine just because this is what they got by default from > > > > drm_

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-28 Thread VMware
On 2/28/20 10:49 AM, Gerd Hoffmann wrote: Hi, Not clue about the others (lima, tiny, panfrost, v3d). Maybe they use write-combine just because this is what they got by default from drm_gem_mmap_obj(). Maybe they actually need that. Trying to Cc: maintainters (and drop stable@). virtio-gpu

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-28 Thread Gerd Hoffmann
Hi, > > Not clue about the others (lima, tiny, panfrost, v3d). Maybe they use > > write-combine just because this is what they got by default from > > drm_gem_mmap_obj(). Maybe they actually need that. Trying to Cc: > > maintainters (and drop stable@). > > virtio-gpu needs it, otherwise the

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-27 Thread VMware
On 2/27/20 2:44 PM, Thomas Hellström (VMware) wrote: Hi, On 2/27/20 2:21 PM, Gerd Hoffmann wrote:    Hi, So I'd like to push patches 1+2 to -fixes and sort everything else later in -next.  OK? OK with me. Done. [ context: why shmem helpers use pgprot_writecombine + pgprot_decrypted?    

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-27 Thread VMware
Hi, On 2/27/20 2:21 PM, Gerd Hoffmann wrote: Hi, So I'd like to push patches 1+2 to -fixes and sort everything else later in -next. OK? OK with me. Done. [ context: why shmem helpers use pgprot_writecombine + pgprot_decrypted? we get conflicting mappings because of that, li

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-27 Thread Gerd Hoffmann
Hi, > > So I'd like to push patches 1+2 to -fixes and sort everything else later > > in -next. OK? > > OK with me. Done. >> [ context: why shmem helpers use pgprot_writecombine + pgprot_decrypted? >>we get conflicting mappings because of that, linear kernel >>map vs.

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-27 Thread VMware
On 2/27/20 11:56 AM, Gerd Hoffmann wrote: Hi, I think it might be safe for some integrated graphics where the driver maintainers can guarantee that it's safe on all particular processors used with that driver, but then IMO it should be moved out to those drivers. Other drivers needing write

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-27 Thread Gerd Hoffmann
Hi, > I think it might be safe for some integrated graphics where the driver > maintainers can guarantee that it's safe on all particular processors used > with that driver, but then IMO it should be moved out to those drivers. > > Other drivers needing write-combine shouldn't really use shmem.

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-27 Thread VMware
On 2/27/20 8:53 AM, Gerd Hoffmann wrote: Hi, + if (!shmem->map_cached) + prot = pgprot_writecombine(prot); shmem->vaddr = vmap(shmem->pages, obj->size >> PAGE_SHIFT, - VM_MAP, pgprot_writecombine(PAGE_KERNE

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-26 Thread Gerd Hoffmann
Hi, > > + if (!shmem->map_cached) > > + prot = pgprot_writecombine(prot); > > shmem->vaddr = vmap(shmem->pages, obj->size >> PAGE_SHIFT, > > - VM_MAP, pgprot_writecombine(PAGE_KERNEL)); > > + VM_M

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-26 Thread VMware
On 2/27/20 1:02 AM, Chia-I Wu wrote: On Wed, Feb 26, 2020 at 10:25 AM Thomas Hellström (VMware) wrote: Hi, Gerd, #define to_drm_gem_shmem_obj(obj) \ diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index a421a2eed48a..aad9324dcf4f 100644 --- a/

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-26 Thread Chia-I Wu
On Wed, Feb 26, 2020 at 10:25 AM Thomas Hellström (VMware) wrote: > > Hi, Gerd, > > While looking at this patchset I came across some stuff that seems > strange but that was merged in a previous patchset. > > (please refer to > https://lists.freedesktop.org/archives/dri-devel/2018-September/190001

Re: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-26 Thread VMware
Hi, Gerd, While looking at this patchset I came across some stuff that seems strange but that was merged in a previous patchset. (please refer to https://lists.freedesktop.org/archives/dri-devel/2018-September/190001.html. Forgive me if I've missed any discussion leading up to this). On 2

RE: [PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-26 Thread Guillaume Gardet
rst > ; Maxime Ripard ; > David Airlie ; Daniel Vetter ; open list > ker...@vger.kernel.org> > Subject: [PATCH v5 1/3] drm/shmem: add support for per object caching flags. > > Add map_cached bool to drm_gem_shmem_object, to request cached mappings > on a per-object base.

[PATCH v5 1/3] drm/shmem: add support for per object caching flags.

2020-02-26 Thread Gerd Hoffmann
Add map_cached bool to drm_gem_shmem_object, to request cached mappings on a per-object base. Check the flag before adding writecombine to pgprot bits. Cc: sta...@vger.kernel.org Signed-off-by: Gerd Hoffmann --- include/drm/drm_gem_shmem_helper.h | 5 + drivers/gpu/drm/drm_gem_shmem_he