Commit Graph
17 Commits
Author SHA1 Message Date
Rasmus Villemoes 09ccbb74b6 drm/amdgpu: use post-decrement in error handling
We need to use post-decrement to get the pci_map_page undone also for
i==0, and to avoid some very unpleasant behaviour if pci_map_page
failed already at i==0.

Reviewed-by: Christian König <[email protected]>
Signed-off-by: Rasmus Villemoes <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
2016-02-16 10:05:38 -05:00
Christian König cc1de6e800 drm/amdgpu: fix issue with overlapping userptrs
Otherwise we could try to evict overlapping userptr BOs in get_user_pages(),
leading to a possible circular locking dependency.

Signed-off-by: Christian König <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Cc: [email protected]
2016-02-10 14:07:52 -05:00
Ken Wang 8f3c162961 drm/amdgpu: The VI specific EXE bit should only apply to GMC v8.0 above
Reviewed-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Ken Wang <[email protected]>
Cc: [email protected]
2016-02-02 22:54:11 -05:00
Christian König 6d99905a8c drm/amdgpu: set snooped flags only on system addresses v2
Not necessary for VRAM.

v2: no need to check if ttm is NULL.

Signed-off-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2015-12-04 12:31:46 -05:00
Chunming Zhou e2f784fa8a drm/amdgpu: add err check for pin userptr
Missing error check if the operation failed.

Signed-off-by: Chunming Zhou <[email protected]>
Reviewed-by: Christian König <[email protected]>
2015-12-02 15:03:54 -05:00
Arnd Bergmann e1b35f6103 drm/amdgpu: fix seq_printf format string
The amdgpu driver has a debugfs interface that shows the amount of
VRAM in use, but the newly added code causes a build error on
all 32-bit architectures:

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:1076:17: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'long long int' [-Wformat=]

This fixes the format string to use "%llu" for printing 64-bit
numbers, which works everywhere, as long as we also cast to 'u64'.
Unlike atomic64_t, u64 is defined as 'unsigned long long' on
all architectures.

Signed-off-by: Arnd Bergmann <[email protected]>
Fixes: a2ef8a9749 ("drm/amdgpu: add vram usage into debugfs")
Signed-off-by: Alex Deucher <[email protected]>
2015-11-16 11:05:55 -05:00
Christian König 7a91d6cb3c drm/amdgpu: remove AMDGPU_FENCE_OWNER_MOVE
Moves are exclusive operations anyway, just use the undefined owner for those.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Chunming Zhou <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
2015-11-04 12:29:23 -05:00
Chunming Zhou a2ef8a9749 drm/amdgpu: add vram usage into debugfs
Signed-off-by: Chunming Zhou <[email protected]>
Reviewed-by: Jammy Zhou <[email protected]>
Reviewed-by: Christian König <[email protected]>
2015-10-07 23:48:22 -04:00
Christian König 72d7668b5b drm/amdgpu: export reservation_object from dmabuf to ttm (v2)
Adds an extra argument to amdgpu_bo_create, which is only used in amdgpu_prime.c.

Port of radeon commit 831b6966a6.

v2: fix up kfd.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Jammy Zhou <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
2015-09-23 17:23:34 -04:00
Alex Deucher 857d913d05 drm/amdgpu: be explicit about cpu vram access for driver BOs (v2)
For kernel driver BOs, be explicit about whether we need
vram access up front.  This avoids unecessary migrations and
avoids using visible vram for buffers were it's not needed.

v2: line wrap fixes

Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2015-09-03 10:29:32 -04:00
Chunming Zhou c7ae72c01b drm/amdgpu: use IB for copy buffer of eviction
This aids handling buffers moves with the scheduler.

Signed-off-by: Chunming Zhou <[email protected]>
Reviewed-by: Christian K?nig <[email protected]>
2015-08-26 17:50:42 -04:00
Chunming Zhou 9066b0c318 drm/amdgpu: fix no sync_wait in copy_buffer
when eviction is happening, if don't handle
dependency, then the fence could be dead off.

Signed-off-by: Chunming Zhou <[email protected]>
Reviewed-by: Jammy Zhou <[email protected]>
Reviewed-by: Christian K?nig <[email protected]>
2015-08-25 10:53:48 -04:00
Chunming Zhou 4ce9891ee1 drm/amdgpu: improve sa_bo->fence by kernel fence
Signed-off-by: Chunming Zhou <[email protected]>
Reviewed-by: Christian K?nig <[email protected]>
2015-08-25 10:38:41 -04:00
Maninder Singh 5f0b34cc72 drm/amdgpu: use kzalloc for allocating one thing
Use kzalloc rather than kcalloc(1.. for allocating
one thing.

Signed-off-by: Maninder Singh <[email protected]>
Reviewed-by: Vaneet Narang <[email protected]>
Reviewed-by: Christian Konig <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2015-06-29 11:21:50 -04:00
Christian König e176fe176d drm/amdgpu: remove mclk_lock
Not needed any more.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
2015-06-03 21:03:58 -04:00
monk.liu dd08fae1e9 drm/amdgpu: fix userptr BO unpin bug (v2)
sg could point to array of contigiouse page*, only free page could lead
to memory leak.

v2: use iterator

Signed-off-by: monk.liu <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2015-06-03 21:03:25 -04:00
Alex Deucher d38ceaf99e drm/amdgpu: add core driver (v4)
This adds the non-asic specific core driver code.

v2: remove extra kconfig option
v3: implement minor fixes from Fengguang Wu
v4: fix cast in amdgpu_ucode.c

Acked-by: Christian König <[email protected]>
Acked-by: Jammy Zhou <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
2015-06-03 21:03:15 -04:00