mbox series

[v3,0/2] Default to cachable mappings for GEM SHMEM

Message ID 20201117133156.26822-1-tzimmermann@suse.de (mailing list archive)
Headers show
Series Default to cachable mappings for GEM SHMEM | expand

Message

Thomas Zimmermann Nov. 17, 2020, 1:31 p.m. UTC
By default, SHMEM GEM helpers map pages using writecombine. Only a few
drivers require this setting. Others revert it to default mappings
flags. Some could benefit from caching, but don't care.

Unify the behaviour by switching the SHMEM GEM code to use cached
mappings (i.e., PAGE_KERNEL actually); just like regular shmem memory
does. The 3 drivers that require write combining explicitly select it
during GEM object creation.

The exception is dma-buf imported pages, which are always mapped
using writecombine mode.

v3:
	* fix dereferencing of an uninitialized pointer (Dan, kernel
	  test robot)
v2:
	* recreate patches on top of latest SHMEM helpers
	* update lima, panfrost, v3d (Daniel, Rob)
	* udl has been updated before separately.

Thomas Zimmermann (2):
  drm/shmem-helper: Use cached mappings by default
  drm/shmem-helper: Removed drm_gem_shmem_create_object_cached()

 drivers/gpu/drm/drm_gem_shmem_helper.c  | 40 +++++--------------------
 drivers/gpu/drm/lima/lima_gem.c         |  2 +-
 drivers/gpu/drm/mgag200/mgag200_drv.c   |  1 -
 drivers/gpu/drm/panfrost/panfrost_gem.c |  2 +-
 drivers/gpu/drm/udl/udl_drv.c           |  2 --
 drivers/gpu/drm/v3d/v3d_bo.c            |  2 +-
 drivers/gpu/drm/virtio/virtgpu_object.c |  1 -
 drivers/gpu/drm/vkms/vkms_drv.c         |  1 -
 include/drm/drm_gem_shmem_helper.h      |  7 ++---
 9 files changed, 13 insertions(+), 45 deletions(-)

--
2.29.2

Comments

Maxime Ripard Nov. 23, 2020, 9:18 a.m. UTC | #1
On Tue, Nov 17, 2020 at 02:31:54PM +0100, Thomas Zimmermann wrote:
> By default, SHMEM GEM helpers map pages using writecombine. Only a few
> drivers require this setting. Others revert it to default mappings
> flags. Some could benefit from caching, but don't care.
> 
> Unify the behaviour by switching the SHMEM GEM code to use cached
> mappings (i.e., PAGE_KERNEL actually); just like regular shmem memory
> does. The 3 drivers that require write combining explicitly select it
> during GEM object creation.
> 
> The exception is dma-buf imported pages, which are always mapped
> using writecombine mode.


For the whole series:
Acked-by: Maxime Ripard <mripard@kernel.org>

Maxime