Re: [PATCH] drm/gem_shmem: Use a writecombine mapping for ->vaddr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 31, 2019 at 08:46:58AM -0700, Eric Anholt wrote:
> Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> writes:
> 
> > Right now, the BO is mapped as a cached region when ->vmap() is called
> > and the underlying object is not a dmabuf.
> > Doing that makes cache management a bit more complicated (you'd need
> > to call dma_map/unmap_sg() on the ->sgt field everytime the BO is about
> > to be passed to the GPU/CPU), so let's map the BO with writecombine
> > attributes instead (as done in most drivers).
> >
> > Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
> > ---
> > Found this issue while working on panfrost perfcnt where the GPU dumps
> > perf counter values in memory and the CPU reads them back in
> > kernel-space. This patch seems to solve the unpredictable behavior I
> > had.
> >
> > I can also go for the other option (call dma_map/unmap/_sg() when
> > needed) if you think that's more appropriate.
> 
> writecombined was the intent, and this makes kernel vmap match the
> userspace mmap path.

Since I missed that obviously: Where do the shmem helpers set write
combined mode for userspace mmap?
-Daniel

> 
> Reviewed-by: Eric Anholt <eric@xxxxxxxxxx>



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


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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux