Re: [PATCH] drm/mgag200: Set PCI option register in G200SE models

2020-08-03 Thread Dave Airlie
On Tue, 4 Aug 2020 at 16:52, Thomas Zimmermann wrote: > > The initial value of the PCI option register got lost while refactoring > the driver init code. Restore the setting. > Ooops, Reviewed-by: Dave Airlie > Signed-off-by: Thomas Zimmermann > Reported-by: kernel t

Re: [00/59] ttm misc cleanups, mem refactoring, rename objects. (v2)

2020-08-03 Thread Dave Airlie
On Tue, 4 Aug 2020 at 12:56, Dave Airlie wrote: > > I've decided to repost the whole queue this time, it has a few driver > patches up front that are just cleanups. Sample branch is https://cgit.freedesktop.org/~airlied/linux/log/?h=ttm-refactor-mem-manage

[PATCH 59/59] drm/ttm: rename ttm_mem_reg to ttm_resource.

2020-08-03 Thread Dave Airlie
From: Dave Airlie This name better reflects what the object does. I didn't rename all the pointers it seemed too messy. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 6 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 4 +- drivers/gpu/drm/amd/a

[PATCH 41/59] drm/radeon/ttm: use wrapper to access memory manager

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/radeon_gem.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index

[PATCH 57/59] drm/ttm: rename bo manager to range manager.

2020-08-03 Thread Dave Airlie
From: Dave Airlie The generic manager is called the range manager now, rename the file and some internals. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/Makefile | 2 +- .../{ttm_bo_manager.c => ttm_range_manager.c} | 26 +-- 2 files changed,

[PATCH 55/59] drm/ttm: drop type manager has_type

2020-08-03 Thread Dave Airlie
From: Dave Airlie under driver control, this flag isn't needed anymore, remove the API that used to access it, and consoldiate with the used api. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c

[PATCH 58/59] drm/ttm: rename ttm_mem_type_manager -> ttm_resource_manager.

2020-08-03 Thread Dave Airlie
From: Dave Airlie This name makes a lot more sense, since these are about managing driver resources rather than just memory ranges. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c| 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c| 2 +- drivers/gpu/drm/amd

[PATCH 56/59] drm/ttm: add a wrapper for checking if manager is in use

2020-08-03 Thread Dave Airlie
From: Dave Airlie This converts vmwgfx over to using an interface to set the in use and check the in use flag. Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 1 - drivers/gpu/drm/ttm/ttm_bo.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 14

[PATCH 53/59] drm/ttm: drop man->bdev link.

2020-08-03 Thread Dave Airlie
From: Dave Airlie This link isn't needed anymore, drop it from the init interface. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +- drivers/gpu/drm/nouveau/nouveau_ttm.c | 6 ++ driver

[PATCH 48/59] drm/vmwgfx/ttm: move thp to driver managed

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_thp.c | 32 +++-- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c b/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c index 720a24214c74..1cefd9c1e8ea

[PATCH 44/59] drm/ttm: allow drivers to provide their own manager subclasses

2020-08-03 Thread Dave Airlie
From: Dave Airlie This will get removed eventually and all drivers will use this. Signed-off-by: Dave Airlie --- include/drm/ttm/ttm_bo_driver.h | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h

[PATCH 50/59] drm/nouveau/ttm: move to driver allocated manager

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 45 +++ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 1c636723823c

[PATCH 54/59] drm/ttm: drop list of memory managers from device. (v2)

2020-08-03 Thread Dave Airlie
From: Dave Airlie The driver now controls these, the core just controls the system memory one. v2: init sysman explicitly and assign it as a driver manager to simplify the lookup sequence. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 6 +++--- include/drm/ttm

[PATCH 45/59] drm/amdgpu/ttm: use bo manager subclassing for vram/gtt mgrs

2020-08-03 Thread Dave Airlie
From: Dave Airlie Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 35 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 36 +--- 2 files changed, 44 insertions(+), 27 deletions(-) diff --git a/drivers

[PATCH 51/59] drm/ttm: drop priv pointer in memory manager

2020-08-03 Thread Dave Airlie
From: Dave Airlie This isn't needed anymore by any drivers. Reviewed-by: Christian König Signed-off-by: Dave Airlie --- include/drm/ttm/ttm_bo_driver.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 789c1eb

[PATCH 52/59] drm/amdgpu/ttm: remove man->bdev references.

2020-08-03 Thread Dave Airlie
From: Dave Airlie Just store the device in the private so the link can be removed from the manager Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu

[PATCH 46/59] drm/ttm: make ttm_range_man_init/takedown take type + args

2020-08-03 Thread Dave Airlie
From: Dave Airlie This makes it easier to move these to a driver allocated system Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 15 +--- drivers/gpu/drm/drm_gem_vram_helper.c | 10 drivers/gpu/drm/nouveau/nouveau_ttm.c | 22

[PATCH 49/59] drm/vmwgfx/gmrid: convert to driver controlled allocation.

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 32 +++ 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c index

[PATCH 47/59] drm/ttm: move range manager to subclassed driver allocation

2020-08-03 Thread Dave Airlie
From: Dave Airlie Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo_manager.c | 31 +--- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c

[PATCH 29/59] drm/vram_helper: call explicit mm takedown

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_gem_vram_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index d7c0fdf82eb6..2099851c017e 100644 --- a/drivers/gpu/drm

[PATCH 28/59] drm/vmwgfx: takedown vram manager

2020-08-03 Thread Dave Airlie
From: Dave Airlie Don't bother returning EBUSY, nobody cares enough, if the driver has a problem, it should deal with it. Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 14 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_

[PATCH 26/59] drm/ttm: start allowing drivers to use new takedown path (v2)

2020-08-03 Thread Dave Airlie
From: Dave Airlie Allow the takedown path callback to be optional as well. v2: use fini for range manager Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c | 12 +++- drivers/gpu/drm/ttm/ttm_bo_manager.c | 21 +++-- include/drm/ttm/ttm_bo_driver.h

[PATCH 25/59] drm/ttm: make some inline helper functions for cleanup paths. (v2)

2020-08-03 Thread Dave Airlie
From: Dave Airlie The disable path is just temporary for now, it will be dropped once has_type is gone in a later patch. v2: add docs. rename to ttm_mem_type_manager namespace Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 6 ++ include/drm/ttm/ttm_bo_driver.h | 26

[PATCH 33/59] drm/vmwgfx: fix gmrid takedown paths to new interface

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 9 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 11 --- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a

[PATCH 32/59] drm/qxl/ttm: use new takedown path

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_ttm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index bfbd2c5c38a2..0f7071829056 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b

[PATCH 42/59] drm/vmwgfx/ttm: use wrapper to access memory manager

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 23 +++ drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_thp.c | 4 ++-- 3 files changed, 18 insertions(+), 13 deletions(-) diff

[PATCH 35/59] drm/ttm: make TTM responsible for cleaning system only.

2020-08-03 Thread Dave Airlie
From: Dave Airlie Drivers should all be cleaning up their memory managers themselves now, so let the core just clean the system one up. Remove the legacy cleaning interface. Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 54

[PATCH 37/59] drm/amdgfx/ttm: use wrapper to get ttm memory managers

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 12 +-- drivers/gpu

[PATCH 36/59] drm/ttm: add wrapper to get manager from bdev.

2020-08-03 Thread Dave Airlie
From: Dave Airlie This will allow different abstractions later. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c | 34 +++ drivers/gpu/drm/ttm/ttm_bo_util.c | 20 +- drivers/gpu/drm/ttm/ttm_bo_vm.c | 2 +- include/drm/ttm

[PATCH 43/59] drm/ttm: rename manager variable to make sure wrapper is used.

2020-08-03 Thread Dave Airlie
From: Dave Airlie Other users of this should notice this change and switch to wrapper. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 2 +- include/drm/ttm/ttm_bo_driver.h | 7 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ttm

[PATCH 38/59] drm/vram-helper: use wrapper to access memory managers

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_gem_vram_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index 2099851c017e..a01768adb96d 100644 --- a/drivers

[PATCH 23/59] drm/ttm: purge old manager init path.

2020-08-03 Thread Dave Airlie
From: Dave Airlie Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c | 19 -- drivers/gpu/drm/ttm/ttm_bo_manager.c | 29 ++-- include/drm/ttm/ttm_bo_api.h | 18 - include/drm/ttm

[PATCH 34/59] drm/ttm: remove range manager legacy takedown path

2020-08-03 Thread Dave Airlie
From: Dave Airlie Now all drivers have been converted, drop the non-driver path. Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo_manager.c | 28 +--- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 31/59] drm/radeon/ttm: use new takedown paths

2020-08-03 Thread Dave Airlie
From: Dave Airlie Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/radeon_ttm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 84c02b4529c0..76b409af9476

[PATCH 39/59] drm/nouveau/ttm: use wrapper to access memory managers

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index bb310719e3f5..cc6cf04553dd 100644 --- a

[PATCH 11/59] drm/qxl/ttm: call ttm manager debug (v2)

2020-08-03 Thread Dave Airlie
From: Dave Airlie v2: use the new exported interface. This code was poking inside a struct and assuming it was a drm_mm at the start. Call the proper API. Signed-off-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_ttm.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git

[PATCH 30/59] drm/nouveau: use new cleanup paths

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 41 --- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index cfcbecd332ef

[PATCH 40/59] drm/qxl/ttm: use wrapper to access memory manager

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_ttm.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 0f7071829056..57c96f7271db 100644 --- a/drivers/gpu/drm/qxl

[PATCH 24/59] drm/ttm: pass man around instead of mem_type in some places

2020-08-03 Thread Dave Airlie
From: Dave Airlie This makes it easier to cleanup things Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c

[PATCH 18/59] drm/vram_helper: use new ttm manager init function

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_gem_vram_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index c20aee2fddf3..d7c0fdf82eb6 100644 --- a/drivers/gpu

[PATCH 27/59] drm/amdgpu/ttm: use new takedown path

2020-08-03 Thread Dave Airlie
From: Dave Airlie Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 15 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 2 ++ drivers/gpu/drm/amd/amdgpu

[PATCH 22/59] drm/ttm: convert system manager init to new code.

2020-08-03 Thread Dave Airlie
From: Dave Airlie Remove the exit path, since this can't fail now. Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_b

[PATCH 15/59] drm/amdgpu/ttm: init managers from the driver side.

2020-08-03 Thread Dave Airlie
From: Dave Airlie Use new init calls to unwrap manager init Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 19 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 37 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 4 +-- drivers/gpu

[PATCH 21/59] drm/vmwgfx/ttm: switch gmrid allocator to new init paths.

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 17 --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 21 --- 3 files changed, 19 insertions(+), 21 deletions

[PATCH 03/59] nouveau: use ttm populate mapping functions. (v2)

2020-08-03 Thread Dave Airlie
From: Dave Airlie Instead of rolling driver copies of them. v2: cleanup return handling (Ben) Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_bo.c | 38 ++-- 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/nouveau

[PATCH 14/59] drm/ttm: provide a driver-led init path for range mm manager. (v2)

2020-08-03 Thread Dave Airlie
From: Dave Airlie This lets the generic range mm manager be initialised by the driver. v2: add docs. rename api to range_man_init for now. v1-Reviewed-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo_manager.c | 23 --- include/drm/ttm

[PATCH 02/59] drm/vmwgfx: drop bo map/unmap dma functions.

2020-08-03 Thread Dave Airlie
From: Dave Airlie The map one was used once, just inline it, and drop them both. Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h| 2 - drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 46 +++--- 2 files changed, 6 insertions(+), 42 deletions(-) diff

[PATCH 06/59] drm/ttm: use a helper for unlocked moves to the lru tail

2020-08-03 Thread Dave Airlie
From: Dave Airlie The pattern was repeated a few times, just make an inline for it. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 8 ++-- drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +--- include/drm/ttm/ttm_bo_driver.h | 11 --- 3 files changed, 11 insertions(+), 12

[PATCH 01/59] drm/vmwgfx: consolidate ttm object creation and populate

2020-08-03 Thread Dave Airlie
From: Dave Airlie These two functions has the same code in them, create a common helper function instead. Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h| 4 ++ drivers/gpu/drm/vmwgfx/vmwgfx_mob.c| 60 ++ drivers/gpu/drm/vmwgfx

[PATCH 19/59] drm/nouveau: use new memory manager init paths

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 43 --- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 6de762a0c229

[PATCH 17/59] drm/qxl/ttm: use new init path for manager

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_ttm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 3e664bb58764..bfbd2c5c38a2 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b

[PATCH 07/59] drm/vram-helper: remove populate/unpopulate

2020-08-03 Thread Dave Airlie
From: Dave Airlie The default path for populate/unpopulate is already this. Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_gem_vram_helper.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index

[PATCH 20/59] drm/vmwgfx/ttm: convert vram mm init to new code paths

2020-08-03 Thread Dave Airlie
From: Dave Airlie Split out the vram thp init path vs the range manager init. Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 25 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 +--- drivers/gpu/drm/vmwgfx/vmwgfx_thp.c | 12 3 files

[PATCH 08/59] drm/ttm: export memory type debug entrypoint.

2020-08-03 Thread Dave Airlie
From: Dave Airlie As suggested on review, just export the memory type debug for drivers to use, while also making the debug callback optional (don't need to test for system as it won't init it). rename it to be more consistent with object name for now. (we may rename all the obj

[PATCH 04/59] qxl/ttm: drop the unusued no wait flag to reserve function

2020-08-03 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_cmd.c| 2 +- drivers/gpu/drm/qxl/qxl_ioctl.c | 2 +- drivers/gpu/drm/qxl/qxl_object.c | 4 ++-- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu

[PATCH 13/59] drm/ttm: split the mm manager init code (v2)

2020-08-03 Thread Dave Airlie
From: Dave Airlie This will allow the driver to control the ordering here better. Eventually the old path will be removed. v2: add docs for new APIs. rename new path to ttm_mem_type_manager_init/set_used(for now) Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 34

[PATCH 16/59] drm/radeon: use new ttm man init path

2020-08-03 Thread Dave Airlie
From: Dave Airlie Use the new common manager init path. Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/radeon_ttm.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index

[PATCH 09/59] drm/nouveau/ttm: don't fill in blank ttm debug callback

2020-08-03 Thread Dave Airlie
From: Dave Airlie Acked-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index b0012021ae12..6de762a0c229 100644

[PATCH 10/59] drm/vmwgfx/gmrid: don't provide pointless ttm debug callback

2020-08-03 Thread Dave Airlie
From: Dave Airlie Acked-by: Christian König Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c index 4a76fc7114ad

[PATCH 12/59] drm/vram-helper: call the ttm manager debug function

2020-08-03 Thread Dave Airlie
From: Dave Airlie This code was assuming there was a drm_mm here, don't do that call the correct API. v2: use the new exported interface. Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_gem_vram_helper.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/driver

[00/59] ttm misc cleanups, mem refactoring, rename objects. (v2)

2020-08-03 Thread Dave Airlie
I've decided to repost the whole queue this time, it has a few driver patches up front that are just cleanups. I've reorodered things a little since the first posting, but not much. misc core/driver cleanups mem type manager debug callback cleanup (reordered) new mem type manager init path new me

[PATCH 05/59] drm/ttm/amdgpu: consolidate ttm reserve paths

2020-08-03 Thread Dave Airlie
From: Dave Airlie Drop the WARN_ON and consolidate the two paths into one. Use the consolidate slowpath in the execbuf utils code. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 +- drivers/gpu/drm/ttm/ttm_execbuf_util.c | 12 +-- include/drm/ttm

Re: [PATCH 15/49] drm/ttm: make some inline helper functions for cleanup paths.

2020-08-03 Thread Dave Airlie
On Fri, 31 Jul 2020 at 23:07, Christian König wrote: > > Am 31.07.20 um 06:04 schrieb Dave Airlie: > > From: Dave Airlie > > > > Signed-off-by: Dave Airlie > > --- > > drivers/gpu/drm/ttm/ttm_bo.c| 6 ++ > > include/drm/ttm/ttm_bo_driver.h |

Re: [PATCH 39/49] drm/ttm: make ttm_bo_man_init/takedown take type + args

2020-08-03 Thread Dave Airlie
On Fri, 31 Jul 2020 at 23:32, Christian König wrote: > > Am 31.07.20 um 06:05 schrieb Dave Airlie: > > From: Dave Airlie > > > > This makes it easier to move these to a driver allocated system > > No, sorry that looks like going into the wrong direction to me. >

Re: [PATCH 00/49] ttm mem manager refactoring.

2020-08-03 Thread Dave Airlie
On Fri, 31 Jul 2020 at 19:17, Christian König wrote: > > Am 31.07.20 um 06:04 schrieb Dave Airlie: > > I started pulling on a thread, and it led me down a hole. > > We might want to make that hole even bigger :) > > How about we rename the ttm_mem_reg into ttm_resource an

Re: [PATCH 26/49] drm/ttm: add wrapper to get manager from bdev.

2020-07-31 Thread Dave Airlie
On Fri, 31 Jul 2020 at 23:23, Christian König wrote: > > Am 31.07.20 um 06:04 schrieb Dave Airlie: > > From: Dave Airlie > > > > This will allow different abstractions later. > > Mhm, I'm questioning if this is really worth it and not just overkill. > >

Re: [PATCH 26/49] drm/ttm: add wrapper to get manager from bdev.

2020-07-31 Thread Dave Airlie
On Fri, 31 Jul 2020 at 17:14, Thomas Zimmermann wrote: > > Hi > > Am 31.07.20 um 06:04 schrieb Dave Airlie: > > From: Dave Airlie > > > > This will allow different abstractions later. > > You should consider moving this patch to the beginning of the series, s

Re: [PATCH 04/49] drm/ttm: provide a driver-led init path for generic mm manager.

2020-07-31 Thread Dave Airlie
On Fri, 31 Jul 2020 at 16:57, Thomas Zimmermann wrote: > > Hi > > Am 31.07.20 um 06:04 schrieb Dave Airlie: > > From: Dave Airlie > > > > This lets the generic mm manager be initialised by the driver. > > > > Signed-off-by: Dave Airlie > > --

oops in drm-next on vmwgfx

2020-07-30 Thread Dave Airlie
I booted up drm-next to test my ttm rework, but hey drm-next oops on startup without it. Probably need to get that fixed, haven't bisected yet. Dave. [2.689057] [drm] DMA map mode: Caching DMA mappings. [2.689151] [drm] Capabilities: [2.689151] [drm] Rect copy. [2.689151] [drm]

Re: [PATCH 03/49] drm/ttm: split the mm manager init code

2020-07-30 Thread Dave Airlie
On Fri, 31 Jul 2020 at 15:51, Dave Airlie wrote: > > On Fri, 31 Jul 2020 at 15:44, Sam Ravnborg wrote: > > > > Hi Dave. > > > > On Fri, Jul 31, 2020 at 02:04:34PM +1000, Dave Airlie wrote: > > > From: Dave Airlie > > > > > > This

Re: [PATCH 03/49] drm/ttm: split the mm manager init code

2020-07-30 Thread Dave Airlie
On Fri, 31 Jul 2020 at 15:44, Sam Ravnborg wrote: > > Hi Dave. > > On Fri, Jul 31, 2020 at 02:04:34PM +1000, Dave Airlie wrote: > > From: Dave Airlie > > > > This will allow the driver to control the ordering here better. > > > > Eventually the old p

[PATCH 47/49] drm/ttm: drop list of memory managers from device.

2020-07-30 Thread Dave Airlie
From: Dave Airlie The driver now controls these, the core just controls the system memory one. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 2 -- include/drm/ttm/ttm_bo_driver.h | 6 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm

[PATCH 42/49] drm/vmwgfx/gmrid: convert to driver controlled allocation.

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 33 +++ 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c index

[PATCH 41/49] drm/vmwgfx/ttm: move thp to driver managed

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_thp.c | 33 +++-- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c b/drivers/gpu/drm/vmwgfx/vmwgfx_thp.c index 0dd619c9d207..d2dde8159c3d

[PATCH 46/49] drm/ttm: drop man->bdev link.

2020-07-30 Thread Dave Airlie
From: Dave Airlie This link isn't needed anymore, drop it from the init interface. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +- drivers/gpu/drm/nouveau/nouveau_ttm.c | 6 ++ driver

[PATCH 48/49] drm/ttm: drop type manager has_type

2020-07-30 Thread Dave Airlie
From: Dave Airlie under driver control, this flag isn't needed anymore Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 6 ++ include/drm/ttm/ttm_bo_driver.h | 5 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/dr

[PATCH 30/49] drm/qxl/ttm: use wrapper to access memory manager

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/qxl/qxl_ttm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index acc4497887a6..9aea35a66e25 100644 --- a/drivers/gpu/drm/qxl

[PATCH 23/49] drm/vmwgfx: fix gmrid takedown paths to new interface

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 11 --- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a

[PATCH 43/49] drm/nouveau/ttm: move to driver allocated manager

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 41 ++- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 225f9af2eaa1

[PATCH 45/49] drm/amdgpu/ttm: remove man->bdev references.

2020-07-30 Thread Dave Airlie
From: Dave Airlie Just store the device in the private so the link can be removed from the manager Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH 16/49] drm/ttm: start allowing drivers to use new takedown path

2020-07-30 Thread Dave Airlie
From: Dave Airlie Allow the takedown path callback to be optional as well. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c | 8 +--- drivers/gpu/drm/ttm/ttm_bo_manager.c | 21 +++-- include/drm/ttm/ttm_bo_driver.h | 5 - 3 files changed, 28

[PATCH 44/49] drm/ttm: drop priv pointer in memory manager

2020-07-30 Thread Dave Airlie
From: Dave Airlie This isn't needed anymore by any drivers. Signed-off-by: Dave Airlie --- include/drm/ttm/ttm_bo_driver.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 6319d85d7270..a38704fe0737 100644

[PATCH 39/49] drm/ttm: make ttm_bo_man_init/takedown take type + args

2020-07-30 Thread Dave Airlie
From: Dave Airlie This makes it easier to move these to a driver allocated system Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 15 +-- drivers/gpu/drm/drm_gem_vram_helper.c | 10 drivers/gpu/drm/nouveau/nouveau_ttm.c | 21

[PATCH 27/49] drm/amdgfx/ttm: use wrapper to get ttm memory managers

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 12 +-- drivers/gpu

[PATCH 37/49] drm/ttm: allow drivers to provide their own manager subclasses

2020-07-30 Thread Dave Airlie
From: Dave Airlie This will get removed eventually and all drivers will use this. Signed-off-by: Dave Airlie --- include/drm/ttm/ttm_bo_driver.h | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h

[PATCH 31/49] drm/radeon/ttm: use wrapper to access memory manager

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/radeon_gem.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 13 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index

[PATCH 28/49] drm/vram-helper: use wrapper to access memory managers

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_gem_vram_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index c6cc90d42f56..08fbfa32540a 100644 --- a/drivers

[PATCH 49/49] drm/ttm: consolidate manager used apis into a set and get.

2020-07-30 Thread Dave Airlie
From: Dave Airlie This is probably something we could consider removing, vmwgfx is the only user, and we might be able to faciliate it another way but for now just consolidate it all into accessors. Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 4

[PATCH 40/49] drm/ttm: move range manager to subclassed driver allocation

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo_manager.c | 32 +--- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c index 2f5fa44b6474..2782ccff9b66

[PATCH 36/49] drm/vmwgfx/gmrid: don't provide pointless ttm debug callback

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c index 3fa809b5e3bd..2db99f0449b0 100644 --- a

[PATCH 38/49] drm/amdgpu/ttm: use bo manager subclassing for vram/gtt mgrs

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 35 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 36 +--- 2 files changed, 44 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH 34/49] drm/ttm: make manager debug function optional

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 92de8a6d7647..1e8fda1c9b3a 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers

[PATCH 32/49] drm/vmwgfx/ttm: use wrapper to access memory manager

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 21 --- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_thp.c | 4 ++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff

[PATCH 09/49] drm/nouveau: use new memory manager init paths

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 43 --- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index b0012021ae12

[PATCH 26/49] drm/ttm: add wrapper to get manager from bdev.

2020-07-30 Thread Dave Airlie
From: Dave Airlie This will allow different abstractions later. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c | 34 +++ drivers/gpu/drm/ttm/ttm_bo_util.c | 20 +- drivers/gpu/drm/ttm/ttm_bo_vm.c | 2 +- include/drm/ttm

[PATCH 29/49] drm/nouveau/ttm: use wrapper to access memory managers

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index 2ccfdf203c52..ed651d7679fe 100644 --- a

[PATCH 33/49] drm/ttm: rename manager variable to make sure wrapper is used.

2020-07-30 Thread Dave Airlie
From: Dave Airlie Other users of this should notice this change and switch to wrapper. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 2 +- include/drm/ttm/ttm_bo_driver.h | 7 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ttm

[PATCH 35/49] drm/nouveau/ttm: don't fill in blank ttm debug callback

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/nouveau/nouveau_ttm.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index ed651d7679fe..1b9d9362132d 100644 --- a/drivers/gpu/drm

[PATCH 25/49] drm/ttm: make TTM responsible for cleaning system only.

2020-07-30 Thread Dave Airlie
From: Dave Airlie drivers should all be cleaning up their memory managers themselves now, so let the core just clean the system one up. Remove the legacy cleaning interface. Signed-off-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c| 55 +++-- include/drm/ttm

[PATCH 17/49] drm/amdgpu/ttm: use new takedown path

2020-07-30 Thread Dave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 15 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 15

<    4   5   6   7   8   9   10   11   12   13   >