Re: [Nouveau] [Intel-gfx] [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-15 Thread Jani Nikula
On Wed, 09 Sep 2020, Joe Perches wrote: > diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c > b/drivers/gpu/drm/i915/display/intel_sprite.c > index 5ac0dbf0e03d..35ac539cc2b1 100644 > --- a/drivers/gpu/drm/i915/display/intel_sprite.c > +++ b/drivers/gpu/drm/i915/display/intel_sprite.c >

[Nouveau] [PATCH 17/18] dma-iommu: implement ->alloc_noncoherent

2020-09-15 Thread Christoph Hellwig
Implement the alloc_noncoherent method to provide memory that is neither coherent not contiguous. Signed-off-by: Christoph Hellwig --- drivers/iommu/dma-iommu.c | 41 +++ 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/dma-iommu.c

[Nouveau] [PATCH 12/18] sgiseeq: convert to dma_alloc_noncoherent

2020-09-15 Thread Christoph Hellwig
Use the new non-coherent DMA API including proper ownership transfers. This includes adding additional calls to dma_sync_desc_dev as the old syncing was rather ad-hoc. Thanks to Thomas Bogendoerfer for debugging the ownership transfer issues. Signed-off-by: Christoph Hellwig ---

[Nouveau] [PATCH v2 10/21] drm/omapdrm: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in omapdrm. v2: * make omap_gem_free_object() static (Tomi) Signed-off-by: Thomas Zimmermann Reviewed-by: Laurent Pinchart

Re: [Nouveau] [PATCH 07/17] 53c700: improve non-coherent DMA handling

2020-09-15 Thread Christoph Hellwig
On Mon, Sep 14, 2020 at 08:20:18AM -0700, James Bottomley wrote: > If you're going to change the macros from taking a device to taking a > hostdata structure then the descriptive argument name needs to change > ... it can't be dev anymore. I'm happy with it simply becoming 'h' if > hostdata is

[Nouveau] a saner API for allocating DMA addressable pages v3

2020-09-15 Thread Christoph Hellwig
Hi all, this series replaced the DMA_ATTR_NON_CONSISTENT flag to dma_alloc_attrs with a separate new dma_alloc_pages API, which is available on all platforms. In addition to cleaning up the convoluted code path, this ensures that other drivers that have asked for better support for non-coherent

Re: [Nouveau] [PATCH v2 00/21] Convert all remaining drivers to GEM object functions

2020-09-15 Thread Christian König
Added my rb to the amdgpu and radeon patches. Should we pick those up through the amd branches or do you want to push everything to drm-misc-next? I think the later since this should result in much merge clash. Christian. Am 15.09.20 um 16:59 schrieb Thomas Zimmermann: The GEM and PRIME

[Nouveau] [PATCH v2 18/21] drm/vkms: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in vkms. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/vkms/vkms_drv.c | 8 drivers/gpu/drm/vkms/vkms_gem.c | 13

Re: [Nouveau] [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-15 Thread Miquel Raynal
Hi Joe, For MTD: > drivers/mtd/nand/raw/nandsim.c| 2 +- Reviewed-by: Miquel Raynal Thanks, Miquèl ___ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau

[Nouveau] [PATCH 16/18] dma-mapping: add new {alloc, free}_noncoherent dma_map_ops methods

2020-09-15 Thread Christoph Hellwig
This will allow IOMMU drivers to allocate non-contigous memory and return a vmapped virtual address. Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 5 + kernel/dma/mapping.c| 33 +++-- 2 files changed, 32 insertions(+), 6 deletions(-)

[Nouveau] [PATCH 03/18] drm/exynos: stop setting DMA_ATTR_NON_CONSISTENT

2020-09-15 Thread Christoph Hellwig
DMA_ATTR_NON_CONSISTENT is a no-op except on PA-RISC and a few MIPS configs, so don't set it in this ARM specific driver. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c

[Nouveau] [PATCH 10/18] hal2: convert to dma_alloc_noncoherent

2020-09-15 Thread Christoph Hellwig
Use the new non-coherent DMA API including proper ownership transfers. This also means we can allocate the buffer memory with the proper direction instead of bidirectional. Signed-off-by: Christoph Hellwig --- sound/mips/hal2.c | 58 ++- 1 file

Re: [Nouveau] [PATCH v2 20/21] drm/xlnx: Initialize DRM driver instance with CMA helper macro

2020-09-15 Thread Hyun Kwon
Hi Tomas, Thanks for the patch. On Tue, Sep 15, 2020 at 08:53:46AM -0700, Laurent Pinchart wrote: > Hi Thomas, > > Thank you for the patch. > > On Tue, Sep 15, 2020 at 04:59:57PM +0200, Thomas Zimmermann wrote: > > The xlnx driver uses CMA helpers with default callback functions. > >

[Nouveau] [PATCH v2 21/21] drm: Remove obsolete GEM and PRIME callbacks from struct drm_driver

2020-09-15 Thread Thomas Zimmermann
Several GEM and PRIME callbacks have been deprecated in favor of per-instance GEM object functions. Remove the callbacks as they are now unused. The only exception is .gem_prime_mmap, which is still in use by several drivers. What is also gone is gem_vm_ops in struct drm_driver. All drivers now

[Nouveau] [PATCH v2 13/21] drm/rockchip: Convert to drm_gem_object_funcs

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in rockchip. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann ---

Re: [Nouveau] [PATCH 03/17] drm/exynos: stop setting DMA_ATTR_NON_CONSISTENT

2020-09-15 Thread Christoph Hellwig
On Mon, Sep 14, 2020 at 06:34:02PM +0300, Sergei Shtylyov wrote: > On 9/14/20 5:44 PM, Christoph Hellwig wrote: > > > DMA_ATTR_NON_CONSISTENT is a no-op except on PARISC and some mips > > configs, so don't set it in this ARM specific driver. > >Hm, PARICS and ARM capitalized but mips in

[Nouveau] [PATCH v2 02/21] drm/armada: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in armada. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/armada/armada_drv.c | 3 --- drivers/gpu/drm/armada/armada_gem.c |

[Nouveau] [PATCH 05/18] net/au1000-eth: stop using DMA_ATTR_NON_CONSISTENT

2020-09-15 Thread Christoph Hellwig
The au1000-eth driver contains none of the manual cache synchronization required for using DMA_ATTR_NON_CONSISTENT. From what I can tell it can be used on both dma coherent and non-coherent DMA platforms, but I suspect it has been buggy on the non-coherent platforms all along. Signed-off-by:

Re: [Nouveau] [PATCH v2 06/21] drm/i915: Introduce GEM object functions

2020-09-15 Thread Tvrtko Ursulin
On 15/09/2020 15:59, Thomas Zimmermann wrote: GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in i915. v2: * move object-function instance to i915_gem_object.c (Jani)

[Nouveau] [PATCH v2 12/21] drm/radeon: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in radeon. v2: * move object-function instance to radeon_gem.c (Christian) * set callbacks in

[Nouveau] [PATCH 01/18] media/v4l2: remove V4L2-FLAG-MEMORY-NON-CONSISTENT flag

2020-09-15 Thread Christoph Hellwig
From: Sergey Senozhatsky The patch partially reverts some of the UAPI bits of the buffer cache management hints. Namely, the queue consistency (memory coherency) user-space hint because, as it turned out, the kernel implementation of this feature was misusing DMA_ATTR_NON_CONSISTENT. The patch

[Nouveau] [PATCH 04/18] drm/nouveau/gk20a: stop setting DMA_ATTR_NON_CONSISTENT

2020-09-15 Thread Christoph Hellwig
DMA_ATTR_NON_CONSISTENT is a no-op except on PA-RISC and a few MIPS configs, so don't set it in this ARM specific driver part. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[Nouveau] [PATCH 14/18] dma-mapping: remove dma_cache_sync

2020-09-15 Thread Christoph Hellwig
All users are gone now, remove the API. Signed-off-by: Christoph Hellwig --- arch/mips/Kconfig | 1 - arch/mips/jazz/jazzdma.c| 1 - arch/mips/mm/dma-noncoherent.c | 6 -- arch/parisc/Kconfig | 1 - arch/parisc/kernel/pci-dma.c| 6 --

[Nouveau] [PATCH 07/18] 53c700: improve non-coherent DMA handling

2020-09-15 Thread Christoph Hellwig
Switch the 53c700 driver to only use non-coherent descriptor memory if it really has to because dma_alloc_coherent fails. This doesn't matter for any of the platforms it runs on currently, but that will change soon. To help with this two new helpers to transfer ownership to and from the device

Re: [Nouveau] [PATCH v2 20/21] drm/xlnx: Initialize DRM driver instance with CMA helper macro

2020-09-15 Thread Laurent Pinchart
Hi Thomas, Thank you for the patch. On Tue, Sep 15, 2020 at 04:59:57PM +0200, Thomas Zimmermann wrote: > The xlnx driver uses CMA helpers with default callback functions. > Initialize the driver structure with the rsp CMA helper macro. The > driver is being converted to use GEM object functions

[Nouveau] [PATCH v2 17/21] drm/virtgpu: Set PRIME export function in struct drm_gem_object_funcs

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces virtgpu's per-driver PRIME export function with a per-object function. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/virtio/virtgpu_drv.c| 1 -

[Nouveau] [PATCH 18/18] firewire-ohci: use dma_alloc_pages

2020-09-15 Thread Christoph Hellwig
Use dma_alloc_pages to allocate DMAable pages instead of hoping that the architecture either has GFP_DMA32 or not more than 4G of memory. Signed-off-by: Christoph Hellwig --- drivers/firewire/ohci.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git

[Nouveau] [PATCH v2 20/21] drm/xlnx: Initialize DRM driver instance with CMA helper macro

2020-09-15 Thread Thomas Zimmermann
The xlnx driver uses CMA helpers with default callback functions. Initialize the driver structure with the rsp CMA helper macro. The driver is being converted to use GEM object functions as part of this change. Two callbacks, .dumb_destroy and .gem_prime_import, were initialized to their default

Re: [Nouveau] [PATCH v2 02/21] drm/armada: Introduce GEM object functions

2020-09-15 Thread Russell King - ARM Linux admin
On Tue, Sep 15, 2020 at 04:59:39PM +0200, Thomas Zimmermann wrote: > GEM object functions deprecate several similar callback interfaces in > struct drm_driver. This patch replaces the per-driver callbacks with > per-instance callbacks in armada. > > Signed-off-by: Thomas Zimmermann Acked-by:

[Nouveau] [PATCH 02/18] mm: turn alloc_pages into an inline function

2020-09-15 Thread Christoph Hellwig
To prevent a compiler error when a method call alloc_pages is added (which I plan to for the dma_map_ops). Signed-off-by: Christoph Hellwig --- include/linux/gfp.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-15 Thread Christoph Hellwig
On Mon, Sep 14, 2020 at 04:53:25PM -0700, Ralph Campbell wrote: > Since set_page_refcounted() is defined in mm_interal.h I would have to > move the definition to someplace like page_ref.h or have the drivers > cal init_page_count() or set_page_count() since get_page() calls > VM_BUG_ON_PAGE() if

[Nouveau] [PATCH v2 05/21] drm/gma500: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in gma500. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/gma500/framebuffer.c | 2 ++ drivers/gpu/drm/gma500/gem.c |

[Nouveau] [PATCH v2 16/21] drm/vgem: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in vgem. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann ---

[Nouveau] [PATCH v2 11/21] drm/pl111: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in pl111. The only exception is gem_prime_mmap, which is non-trivial to convert. v2: * use

Re: [Nouveau] a saner API for allocating DMA addressable pages v2

2020-09-15 Thread Christoph Hellwig
On Mon, Sep 14, 2020 at 04:26:17PM +0100, Matthew Wilcox wrote: > On Mon, Sep 14, 2020 at 04:44:16PM +0200, Christoph Hellwig wrote: > > I'm still a little unsure about the API naming, as alloc_pages sort of > > implies a struct page return value, but we return a kernel virtual > > address. > >

[Nouveau] [PATCH 15/18] dma-mapping: add a new dma_alloc_pages API

2020-09-15 Thread Christoph Hellwig
This API is the equivalent of alloc_pages, except that the returned memory is guaranteed to be DMA addressable by the passed in device. The implementation will also be used to provide a more sensible replacement for DMA_ATTR_NON_CONSISTENT flag. Additionally dma_alloc_noncoherent is switched

[Nouveau] [PATCH 06/18] lib82596: move DMA allocation into the callers of i82596_probe

2020-09-15 Thread Christoph Hellwig
This allows us to get rid of the LIB82596_DMA_ATTR defined and prepare for untangling the coherent vs non-coherent DMA allocation API. Signed-off-by: Christoph Hellwig --- drivers/net/ethernet/i825xx/lasi_82596.c | 24 ++-- drivers/net/ethernet/i825xx/lib82596.c | 36

Re: [Nouveau] [PATCH 18/20] drm/xen: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
Hi Am 13.08.20 um 13:19 schrieb Oleksandr Andrushchenko: > Hi, > > On 8/13/20 11:36 AM, Thomas Zimmermann wrote: >> GEM object functions deprecate several similar callback interfaces in >> struct drm_driver. This patch replaces the per-driver callbacks with >> per-instance callbacks in xen. The

[Nouveau] [PATCH v2 09/21] drm/nouveau: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in nouveau. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/nouveau/nouveau_drm.c | 9 -

Re: [Nouveau] [PATCH v2 01/21] drm/amdgpu: Introduce GEM object functions

2020-09-15 Thread Christian König
Am 15.09.20 um 16:59 schrieb Thomas Zimmermann: GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in amdgpu. The only exception is gem_prime_mmap, which is non-trivial to convert. v2:

[Nouveau] [PATCH v2 19/21] drm/xen: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in xen. The only exception is gem_prime_mmap, which is non-trivial to convert. v2: * convert xen_drm_drv_free_object_unlocked()

[Nouveau] [PATCH 11/18] lib82596: convert to dma_alloc_noncoherent

2020-09-15 Thread Christoph Hellwig
Use the new non-coherent DMA API including proper ownership transfers. This includes moving the DMA helpers to lib82596 based of an ifdef to avoid include order problems. Signed-off-by: Christoph Hellwig --- drivers/net/ethernet/i825xx/lasi_82596.c | 25 ++---

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-15 Thread Ralph Campbell
On 9/15/20 9:29 AM, Christoph Hellwig wrote: On Mon, Sep 14, 2020 at 04:53:25PM -0700, Ralph Campbell wrote: Since set_page_refcounted() is defined in mm_interal.h I would have to move the definition to someplace like page_ref.h or have the drivers cal init_page_count() or set_page_count()

[Nouveau] [PATCH v2 01/21] drm/amdgpu: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in amdgpu. The only exception is gem_prime_mmap, which is non-trivial to convert. v2: * move object-function instance to

[Nouveau] [PATCH 13/18] 53c700: convert to dma_alloc_noncoherent

2020-09-15 Thread Christoph Hellwig
Use the new non-coherent DMA API including proper ownership transfers. Signed-off-by: Christoph Hellwig --- drivers/scsi/53c700.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index

[Nouveau] [PATCH v2 08/21] drm/msm: Introduce GEM object funcs

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in msm. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann ---

[Nouveau] [PATCH 08/18] dma-mapping: add a new dma_alloc_noncoherent API

2020-09-15 Thread Christoph Hellwig
Add a new API to allocate and free memory that is guaranteed to be addressable by a device, but which potentially is not cache coherent for DMA. To transfer ownership to and from the device, the existing streaming DMA API calls dma_sync_single_for_device and dma_sync_single_for_cpu must be used.

Re: [Nouveau] [PATCH v2 12/21] drm/radeon: Introduce GEM object functions

2020-09-15 Thread Christian König
Am 15.09.20 um 16:59 schrieb Thomas Zimmermann: GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in radeon. v2: * move object-function instance to radeon_gem.c (Christian)

[Nouveau] [PATCH v2 00/21] Convert all remaining drivers to GEM object functions

2020-09-15 Thread Thomas Zimmermann
The GEM and PRIME related callbacks in struct drm_driver are deprecated in favor of GEM object functions in struct drm_gem_object_funcs. This patchset converts the remaining drivers to object functions and removes most of the obsolete interfaces. Patches #1 to #16 and #18 to #19 convert DRM

[Nouveau] [PATCH v2 04/21] drm/exynos: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in exynos. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann ---

[Nouveau] [PATCH v2 03/21] drm/etnaviv: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in etnaviv. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann ---

[Nouveau] [PATCH v2 15/21] drm/vc4: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in vc4. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann Reviewed-by: Eric

Re: [Nouveau] [PATCH 11/17] sgiseeq: convert to dma_alloc_noncoherent

2020-09-15 Thread Christoph Hellwig
On Mon, Sep 14, 2020 at 04:13:58PM +0100, Matthew Wilcox wrote: > On Mon, Sep 14, 2020 at 04:44:27PM +0200, Christoph Hellwig wrote: > > drivers/net/ethernet/i825xx/lasi_82596.c | 25 ++--- > > drivers/net/ethernet/i825xx/lib82596.c | 114 ++- > >

[Nouveau] [PATCH v2 07/21] drm/mediatek: Introduce GEM object functions

2020-09-15 Thread Thomas Zimmermann
GEM object functions deprecate several similar callback interfaces in struct drm_driver. This patch replaces the per-driver callbacks with per-instance callbacks in mediatek. The only exception is gem_prime_mmap, which is non-trivial to convert. Signed-off-by: Thomas Zimmermann ---

[Nouveau] [PATCH 09/18] sgiwd93: convert to dma_alloc_noncoherent

2020-09-15 Thread Christoph Hellwig
Use the new non-coherent DMA API including proper ownership transfers. This also means we can allocate the memory as DMA_TO_DEVICE instead of bidirectional. Signed-off-by: Christoph Hellwig --- drivers/scsi/sgiwd93.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff

Re: [Nouveau] [PATCH] mm: remove extra ZONE_DEVICE struct page refcount

2020-09-15 Thread Christoph Hellwig
On Tue, Sep 15, 2020 at 09:39:47AM -0700, Ralph Campbell wrote: >> I don't think any of the three ->page_free instances even cares about >> the page refcount. >> > Not true. The page_free() callback records the page is free by setting > a bit or putting the page on a free list but when it