Guchun Chen
d39971d902
drm/ttm: check null pointer before accessing when swapping
...
commit 2dedcf414bb01b8d966eb445db1d181d92304fb2 upstream.
Add a check to avoid null pointer dereference as below:
[ 90.002283] general protection fault, probably for non-canonical
address 0xdffffc0000000000: 0000 [#1 ] PREEMPT SMP KASAN NOPTI
[ 90.002292] KASAN: null-ptr-deref in range
[0x0000000000000000-0x0000000000000007]
[ 90.002346] ? exc_general_protection+0x159/0x240
[ 90.002352] ? asm_exc_general_protection+0x26/0x30
[ 90.002357] ? ttm_bo_evict_swapout_allowable+0x322/0x5e0 [ttm]
[ 90.002365] ? ttm_bo_evict_swapout_allowable+0x42e/0x5e0 [ttm]
[ 90.002373] ttm_bo_swapout+0x134/0x7f0 [ttm]
[ 90.002383] ? __pfx_ttm_bo_swapout+0x10/0x10 [ttm]
[ 90.002391] ? lock_acquire+0x44d/0x4f0
[ 90.002398] ? ttm_device_swapout+0xa5/0x260 [ttm]
[ 90.002412] ? lock_acquired+0x355/0xa00
[ 90.002416] ? do_raw_spin_trylock+0xb6/0x190
[ 90.002421] ? __pfx_lock_acquired+0x10/0x10
[ 90.002426] ? ttm_global_swapout+0x25/0x210 [ttm]
[ 90.002442] ttm_device_swapout+0x198/0x260 [ttm]
[ 90.002456] ? __pfx_ttm_device_swapout+0x10/0x10 [ttm]
[ 90.002472] ttm_global_swapout+0x75/0x210 [ttm]
[ 90.002486] ttm_tt_populate+0x187/0x3f0 [ttm]
[ 90.002501] ttm_bo_handle_move_mem+0x437/0x590 [ttm]
[ 90.002517] ttm_bo_validate+0x275/0x430 [ttm]
[ 90.002530] ? __pfx_ttm_bo_validate+0x10/0x10 [ttm]
[ 90.002544] ? kasan_save_stack+0x33/0x60
[ 90.002550] ? kasan_set_track+0x25/0x30
[ 90.002554] ? __kasan_kmalloc+0x8f/0xa0
[ 90.002558] ? amdgpu_gtt_mgr_new+0x81/0x420 [amdgpu]
[ 90.003023] ? ttm_resource_alloc+0xf6/0x220 [ttm]
[ 90.003038] amdgpu_bo_pin_restricted+0x2dd/0x8b0 [amdgpu]
[ 90.003210] ? __x64_sys_ioctl+0x131/0x1a0
[ 90.003210] ? do_syscall_64+0x60/0x90
Fixes: a2848d08742c ("drm/ttm: never consider pinned BOs for eviction&swap")
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com >
Signed-off-by: Guchun Chen <guchun.chen@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20230724024229.1118444-1-guchun.chen@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-08-11 11:57:53 +02:00
Christian König
8996b13051
drm/ttm: never consider pinned BOs for eviction&swap
...
[ Upstream commit a2848d08742c8e8494675892c02c0d22acbe3cf8 ]
There is a small window where we have already incremented the pin count
but not yet moved the bo from the lru to the pinned list.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reported-by: Pelloux-Prayer, Pierre-Eric <Pierre-eric.Pelloux-prayer@amd.com >
Tested-by: Pelloux-Prayer, Pierre-Eric <Pierre-eric.Pelloux-prayer@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20230707120826.3701-1-christian.koenig@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-08-11 11:57:33 +02:00
Christian König
5f6d5b58c5
drm/ttm: add ttm_bo_pin()/ttm_bo_unpin() v2
...
[ Upstream commit deb0814b43f370a448a498409d949e38c9d8f02e ]
As an alternative to the placement flag add a
pin count to the ttm buffer object.
v2: add dma_resv_assert_help() calls
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Reviewed-by: Huang Rui <ray.huang@amd.com >
Link: https://patchwork.freedesktop.org/patch/391596/?series=81973&rev=1
Stable-dep-of: a2848d08742c ("drm/ttm: never consider pinned BOs for eviction&swap")
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-08-11 11:57:33 +02:00
xinhui pan
ed0b1fd3ec
drm/ttm: Put BO in its memory manager's lru list
...
commit 781050b0a3164934857c300bb0bc291e38c26b6f upstream.
After we move BO to a new memory region, we should put it to
the new memory manager's lru list regardless we unlock the resv or not.
Cc: stable@vger.kernel.org
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: xinhui pan <xinhui.pan@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211110043149.57554-1-xinhui.pan@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-01-27 10:53:44 +01:00
Dave Airlie
fea456d82c
drm/ttm: fix eviction valuable range check.
...
This was adding size to start, but pfn and start are in pages,
so it should be using num_pages.
Not sure this fixes anything in the real world, just noticed it
during refactoring.
Signed-off-by: Dave Airlie <airlied@redhat.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20201019222257.1684769-2-airlied@gmail.com
2020-10-21 06:59:07 +10:00
Dave Airlie
4856e5aa0e
drm/ttm: drop evicted from ttm_bo.
...
This was unused.
Signed-off-by: Dave Airlie <airlied@redhat.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200917064132.148521-3-airlied@gmail.com
2020-09-18 06:23:38 +10:00
Dave Airlie
cae515f4a5
drm/ttm/drivers: call the bind function directly.
...
Now the bind functions have all the protection explicitly the
drivers can just call them directly, and the api can be unexported
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200917043040.146575-5-airlied@gmail.com
2020-09-18 06:16:03 +10:00
Dave Airlie
37bff6542c
drm/ttm: move unbind into the tt destroy.
...
This moves unbind into the driver side on destroy paths.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200917043040.146575-4-airlied@gmail.com
2020-09-18 06:15:24 +10:00
Dave Airlie
0b988ca1c7
drm/ttm: protect against reentrant bind in the drivers
...
This moves the generic tracking into the drivers and protects
against reentrancy in the drivers. It fixes up radeon and agp
to be able to query the bound status as that is required.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200917043040.146575-2-airlied@gmail.com
2020-09-18 06:14:00 +10:00
Christian König
36183150e0
drm/ttm: some cleanups
...
Unexport ttm_check_under_lowerlimit.
Make ttm_bo_acc_size static and unexport it.
Remove ttm_get_kernel_zone_memory_size.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/390515/
2020-09-17 11:44:04 +02:00
Dave Airlie
9e9a153bdf
drm/ttm: move ttm binding/unbinding out of ttm_tt paths.
...
Move these up to the bo level, moving ttm_tt to just being
backing store. Next step is to move the bound flag out.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200915024007.67163-6-airlied@gmail.com
2020-09-16 09:35:30 +10:00
Dave Airlie
2040ec970e
drm/ttm: split populate out from binding.
...
Drivers have to call populate themselves now before binding.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200915024007.67163-5-airlied@gmail.com
2020-09-16 09:34:54 +10:00
Dave Airlie
395a73f8ba
drm/ttm: tt destroy move null check to outer function.
...
This just makes things easier later.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200915024007.67163-4-airlied@gmail.com
2020-09-16 09:34:33 +10:00
Dave Airlie
2ff6e69c04
drm/ttm: wrap tt destroy. (v2)
...
All places this was called was using bo->ttm either direct
or indirectly.
v2: move to ttm_bo
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200915024007.67163-3-airlied@gmail.com
2020-09-16 09:33:53 +10:00
Christian König
9c3006a4cc
drm/ttm: remove available_caching
...
Instead of letting TTM make an educated guess based on
some mask all drivers should just specify what caching
they want for their CPU mappings.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/390207/
2020-09-15 16:05:19 +02:00
Christian König
0fe438cec9
drm/ttm: remove default caching
...
As far as I can tell this was never used either and we just
always fallback to the order cached > wc > uncached anyway.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/390142/
2020-09-15 16:03:44 +02:00
Christian König
48e07c23cb
drm/ttm: nuke memory type flags
...
It's not supported to specify more than one of those flags.
So it never made sense to make this a flag in the first place.
Nuke the flags and specify directly which memory type to use.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/389826/?series=81551&rev=1
2020-09-11 13:31:23 +02:00
Christian König
54d04ea8cd
drm/ttm: merge offset and base in ttm_bus_placement
...
This is used by TTM to communicate the physical address
which should be used with ioremap(), ioremap_wc(). We don't
need to separate the base and offset in any way here.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/389457/
2020-09-08 10:43:30 +02:00
Dave Airlie
0a667b5007
drm/ttm: remove bdev from ttm_tt
...
I want to split this structure up and use it differently,
step one remove bdev pointer from it and pass it explicitly.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200826014428.828392-4-airlied@gmail.com
2020-09-08 06:39:21 +10:00
Christian König
fe662d846c
drm/ttm: remove io_reserve_lru handling v3
...
That is not used any more.
v2: keep the NULL checks in TTM.
v3: remove unused variable
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Link: https://patchwork.freedesktop.org/patch/388646/
2020-09-03 11:41:11 +02:00
Christian König
d575ee1131
drm/ttm: make sure that we always zero init mem.bus v2
...
We are trying to remove the io_lru handling and depend
on zero init base, offset and addr here.
v2: init addr as well
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Link: https://patchwork.freedesktop.org/patch/388642/
2020-09-03 11:40:32 +02:00
Christian König
0b06286579
drm/ttm: fix broken merge between drm-next and drm-misc-next
...
drm-next reverted the changes to ttm_tt_create() to do the
NULL check inside the function, but drm-misc-next adds new
users of this approach.
Re-apply the NULL check change inside the function to fix this.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/386628/
2020-08-20 14:03:10 +02:00
Thomas Zimmermann
534b1f9071
Merge drm/drm-next into drm-misc-next
...
Backmerging drm-next into drm-misc-next for nouveau and panel updates.
Resolves a conflict between ttm and nouveau, where struct ttm_mem_res got
renamed to struct ttm_resource.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
2020-08-12 20:42:08 +02:00
Christian König
b2458726b3
drm/ttm: give resource functions their own [ch] files
...
This is a separate object we work within TTM.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/384338/?series=80346&rev=1
2020-08-12 15:51:03 +02:00
Christian König
e92ae67d6e
drm/ttm: rename ttm_resource_manager_func callbacks
...
The names get/put are associated with reference counting
in the Linux kernel, use alloc/free instead.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/384340/?series=80346&rev=1
2020-08-12 15:50:51 +02:00
Christian König
62975d27d6
drm/ttm: revert "drm/ttm: make TT creation purely optional v3"
...
This reverts commit 2ddef17678
.
As it turned out VMWGFX needs a much wider audit to fix this.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200811092400.188124-1-christian.koenig@amd.com
2020-08-12 13:26:28 +10:00
Dave Airlie
2966141ad2
drm/ttm: rename ttm_mem_reg to ttm_resource.
...
This name better reflects what the object does. I didn't rename
all the pointers it seemed too messy.
Signed-off-by: Dave Airlie <airlied@redhat.com >
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-60-airlied@gmail.com
2020-08-06 13:19:21 +10:00
Dave Airlie
9de59bc201
drm/ttm: rename ttm_mem_type_manager -> ttm_resource_manager.
...
This name makes a lot more sense, since these are about managing
driver resources rather than just memory ranges.
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-59-airlied@gmail.com
2020-08-06 13:12:40 +10:00
Dave Airlie
3f48f938ad
drm/ttm: add a wrapper for checking if manager is in use
...
This converts vmwgfx over to using an interface to set the
in use and check the in use flag.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-57-airlied@gmail.com
2020-08-06 13:12:40 +10:00
Dave Airlie
90a0489a71
drm/ttm: drop type manager has_type
...
under driver control, this flag isn't needed anymore,
remove the API that used to access it, and consoldiate
with the used api.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-56-airlied@gmail.com
2020-08-06 13:12:40 +10:00
Dave Airlie
a751612d4c
drm/ttm: drop list of memory managers from device. (v2)
...
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.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-55-airlied@gmail.com
2020-08-06 13:12:40 +10:00
Dave Airlie
7541ce1a6f
drm/ttm: drop man->bdev link.
...
This link isn't needed anymore, drop it from the init interface.
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-54-airlied@gmail.com
2020-08-06 13:12:40 +10:00
Dave Airlie
01057278bc
drm/ttm: rename manager variable to make sure wrapper is used.
...
Other users of this should notice this change and switch to wrapper.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-44-airlied@gmail.com
2020-08-06 13:12:21 +10:00
Dave Airlie
9eca33f4a1
drm/ttm: add wrapper to get manager from bdev.
...
This will allow different abstractions later.
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-37-airlied@gmail.com
2020-08-06 12:32:03 +10:00
Dave Airlie
0cf0a79842
drm/ttm: make TTM responsible for cleaning system only.
...
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 <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-36-airlied@gmail.com
2020-08-06 12:32:03 +10:00
Dave Airlie
56ee8b1c71
drm/ttm: start allowing drivers to use new takedown path (v2)
...
Allow the takedown path callback to be optional as well.
v2: use fini for range manager
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-27-airlied@gmail.com
2020-08-06 12:32:03 +10:00
Dave Airlie
4265accbfc
drm/ttm: make some inline helper functions for cleanup paths. (v2)
...
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
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-26-airlied@gmail.com
2020-08-06 12:32:03 +10:00
Dave Airlie
a006a3ce8e
drm/ttm: pass man around instead of mem_type in some places
...
This makes it easier to cleanup things
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-25-airlied@gmail.com
2020-08-06 12:32:03 +10:00
Dave Airlie
98399abd52
drm/ttm: purge old manager init path.
...
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-24-airlied@gmail.com
2020-08-06 12:32:02 +10:00
Dave Airlie
5969793f86
drm/ttm: convert system manager init to new code.
...
Remove the exit path, since this can't fail now.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-23-airlied@gmail.com
2020-08-06 12:31:37 +10:00
Dave Airlie
747074bb04
drm/ttm: split the mm manager init code (v2)
...
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)
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-14-airlied@gmail.com
2020-08-06 12:31:29 +10:00
Dave Airlie
a2ff1e81d0
drm/ttm: export memory type debug entrypoint.
...
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 objects later.)
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-9-airlied@gmail.com
2020-08-06 12:16:39 +10:00
Dave Airlie
20784cdf4b
drm/ttm: use a helper for unlocked moves to the lru tail
...
The pattern was repeated a few times, just make an inline for it.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Ben Skeggs <bskeggs@redhat.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-7-airlied@gmail.com
2020-08-06 12:16:33 +10:00
Christian König
1a3fb59085
drm/ttm: remove the init_mem_type callback
...
It is a very strange concept to call a function which just
calls back the caller for the functions parameters.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/382085/
2020-07-31 17:14:37 +02:00
Christian König
be1213a341
drm/ttm: remove TTM_MEMTYPE_FLAG_FIXED v2
...
Instead use a boolean field in the memory manager structure.
Also invert the meaning of the field since the use of a TT
structure is the special case here.
v2: cleanup zero init.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/382079/
2020-07-31 17:13:09 +02:00
Christian König
418d2ad1ac
drm/ttm: initialize the system domain with defaults v2
...
Instead of repeating that in each driver.
v2: keep the caching limitation for VMWGFX for now.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/382078/
2020-07-31 17:12:51 +02:00
Dave Airlie
ec731e516a
drm/ttm: ttm_bo_swapout_all doesn't use it's argument.
...
Just drop the argument from this.
This does ask the question if this is the function vmwgfx
should be using or should it be doing an evict all like
the other drivers.
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Zack Rusin <zackr@vmware.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200728034254.20114-1-airlied@gmail.com
2020-07-29 10:01:23 +10:00
Christian König
d59bc63242
drm/ttm: fix pipelined gutting for evictions v2
...
We can't pipeline that during eviction because the memory needs
to be available immediately.
v2: fix how we cleanup the BOs resources
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Tested-by: Alex Sierra <alex.sierra@amd.com >
Link: https://patchwork.freedesktop.org/patch/379039/
2020-07-28 13:54:15 +02:00
Dave Airlie
41206a073c
Merge v5.8-rc6 into drm-next
...
I've got a silent conflict + two trees based on fixes to merge.
Fixes a silent merge with amdgpu
Signed-off-by: Dave Airlie <airlied@redhat.com >
2020-07-24 08:48:05 +10:00
Christian König
f5a9a9383f
drm/ttm: remove TTM_MEMTYPE_FLAG_CMA
...
The original intention was to avoid CPU page table unmaps
when BOs move between the GTT and SYSTEM domain.
The problem is that this never correctly handled changes
in the caching attributes or backing pages.
Just drop this for now and simply unmap the CPU page
tables in all cases.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/378240/
2020-07-21 16:21:43 +02:00