diff options
| author | Dave Airlie <airlied@redhat.com> | 2017-04-06 15:41:42 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2017-04-06 15:49:12 -0400 |
| commit | 0168778115687486575a6831df865dbc4f5369fe (patch) | |
| tree | 29a3f1e3348f1ddbc9924611fa0cad738507ba64 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
| parent | aed93ee7d03eac9b7d21f08aebe8a7d9ea069e20 (diff) | |
| parent | f4e7c7c1b4ed4c28caf679bc94ca5aa096310c10 (diff) | |
Merge branch 'drm-next-4.12' of git://people.freedesktop.org/~agd5f/linux into drm-next
A few more things for 4.12:
- ttm and amdgpu support for non-contiguous vram CPU mappings
- lots of bug fixes and cleanups for vega10
- misc bug fixes and code cleanups
[airlied: fix do_div error on 32-bit arm, not sure it's 100% correct]
* 'drm-next-4.12' of git://people.freedesktop.org/~agd5f/linux: (58 commits)
drm/amdgpu: use uintptr_t instead of unsigned long to store pointer
drm/amdgpu: Avoid using signed integer to store pointer value
drm/amdgpu:invoke new implemented AI MB func
drm/amdgpu/vega10:timeout set to equal with VI
drm/amdgpu:implement the reset MB func for vega10
drm/amdgpu:fix typo for mxgpu_ai
drm/amdgpu:no need to involv HDP in KIQ
drm/amdgpu:add PSP block only load_type=PSP (v2)
drm/amdgpu/smu9: update to latest driver interface
drm/amd/amdgpu: cleanup gfx_v9_0_gpu_init()
drm/amd/amdgpu: cleanup gfx_v9_0_rlc_reset()
drm/amd/amdgpu: cleanup gfx_v9_0_rlc_start()
drm/amd/amdgpu: simplify gfx_v9_0_cp_gfx_enable()
drm/amd/amdgpu: cleanup gfx_v9_0_kiq_init_register()
drm/amd/amdgpu: Drop gfx_v9_0_print_status()
drm/amd/amdgpu: cleanup gfx_v9_0_set_gfx_eop_interrupt_state()
drm/amd/amdgpu: cleanup gfx_v9_0_set_priv_reg_fault_state()
drm/amd/amdgpu: cleanup gfx_v9_0_set_priv_inst_fault_state()
drm/amd/amdgpu: cleanup gfx_v9_0_init_queue()
drm/amdgpu: Move function amdgpu_has_atpx near other similar functions
...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 97f661372a1c..9cd4e1e05b97 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
| @@ -161,7 +161,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) | |||
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | /* get chunks */ | 163 | /* get chunks */ |
| 164 | chunk_array_user = (uint64_t __user *)(unsigned long)(cs->in.chunks); | 164 | chunk_array_user = (uint64_t __user *)(uintptr_t)(cs->in.chunks); |
| 165 | if (copy_from_user(chunk_array, chunk_array_user, | 165 | if (copy_from_user(chunk_array, chunk_array_user, |
| 166 | sizeof(uint64_t)*cs->in.num_chunks)) { | 166 | sizeof(uint64_t)*cs->in.num_chunks)) { |
| 167 | ret = -EFAULT; | 167 | ret = -EFAULT; |
| @@ -181,7 +181,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) | |||
| 181 | struct drm_amdgpu_cs_chunk user_chunk; | 181 | struct drm_amdgpu_cs_chunk user_chunk; |
| 182 | uint32_t __user *cdata; | 182 | uint32_t __user *cdata; |
| 183 | 183 | ||
| 184 | chunk_ptr = (void __user *)(unsigned long)chunk_array[i]; | 184 | chunk_ptr = (void __user *)(uintptr_t)chunk_array[i]; |
| 185 | if (copy_from_user(&user_chunk, chunk_ptr, | 185 | if (copy_from_user(&user_chunk, chunk_ptr, |
| 186 | sizeof(struct drm_amdgpu_cs_chunk))) { | 186 | sizeof(struct drm_amdgpu_cs_chunk))) { |
| 187 | ret = -EFAULT; | 187 | ret = -EFAULT; |
| @@ -192,7 +192,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) | |||
| 192 | p->chunks[i].length_dw = user_chunk.length_dw; | 192 | p->chunks[i].length_dw = user_chunk.length_dw; |
| 193 | 193 | ||
| 194 | size = p->chunks[i].length_dw; | 194 | size = p->chunks[i].length_dw; |
| 195 | cdata = (void __user *)(unsigned long)user_chunk.chunk_data; | 195 | cdata = (void __user *)(uintptr_t)user_chunk.chunk_data; |
| 196 | 196 | ||
| 197 | p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t)); | 197 | p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t)); |
| 198 | if (p->chunks[i].kdata == NULL) { | 198 | if (p->chunks[i].kdata == NULL) { |
| @@ -949,7 +949,7 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev, | |||
| 949 | } | 949 | } |
| 950 | 950 | ||
| 951 | if ((chunk_ib->va_start + chunk_ib->ib_bytes) > | 951 | if ((chunk_ib->va_start + chunk_ib->ib_bytes) > |
| 952 | (m->it.last + 1) * AMDGPU_GPU_PAGE_SIZE) { | 952 | (m->last + 1) * AMDGPU_GPU_PAGE_SIZE) { |
| 953 | DRM_ERROR("IB va_start+ib_bytes is invalid\n"); | 953 | DRM_ERROR("IB va_start+ib_bytes is invalid\n"); |
| 954 | return -EINVAL; | 954 | return -EINVAL; |
| 955 | } | 955 | } |
| @@ -960,7 +960,7 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev, | |||
| 960 | return r; | 960 | return r; |
| 961 | } | 961 | } |
| 962 | 962 | ||
| 963 | offset = ((uint64_t)m->it.start) * AMDGPU_GPU_PAGE_SIZE; | 963 | offset = m->start * AMDGPU_GPU_PAGE_SIZE; |
| 964 | kptr += chunk_ib->va_start - offset; | 964 | kptr += chunk_ib->va_start - offset; |
| 965 | 965 | ||
| 966 | r = amdgpu_ib_get(adev, vm, chunk_ib->ib_bytes, ib); | 966 | r = amdgpu_ib_get(adev, vm, chunk_ib->ib_bytes, ib); |
| @@ -1339,7 +1339,7 @@ int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, void *data, | |||
| 1339 | if (fences == NULL) | 1339 | if (fences == NULL) |
| 1340 | return -ENOMEM; | 1340 | return -ENOMEM; |
| 1341 | 1341 | ||
| 1342 | fences_user = (void __user *)(unsigned long)(wait->in.fences); | 1342 | fences_user = (void __user *)(uintptr_t)(wait->in.fences); |
| 1343 | if (copy_from_user(fences, fences_user, | 1343 | if (copy_from_user(fences, fences_user, |
| 1344 | sizeof(struct drm_amdgpu_fence) * fence_count)) { | 1344 | sizeof(struct drm_amdgpu_fence) * fence_count)) { |
| 1345 | r = -EFAULT; | 1345 | r = -EFAULT; |
| @@ -1388,8 +1388,8 @@ amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, | |||
| 1388 | continue; | 1388 | continue; |
| 1389 | 1389 | ||
| 1390 | list_for_each_entry(mapping, &lobj->bo_va->valids, list) { | 1390 | list_for_each_entry(mapping, &lobj->bo_va->valids, list) { |
| 1391 | if (mapping->it.start > addr || | 1391 | if (mapping->start > addr || |
| 1392 | addr > mapping->it.last) | 1392 | addr > mapping->last) |
| 1393 | continue; | 1393 | continue; |
| 1394 | 1394 | ||
| 1395 | *bo = lobj->bo_va->bo; | 1395 | *bo = lobj->bo_va->bo; |
| @@ -1397,8 +1397,8 @@ amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, | |||
| 1397 | } | 1397 | } |
| 1398 | 1398 | ||
| 1399 | list_for_each_entry(mapping, &lobj->bo_va->invalids, list) { | 1399 | list_for_each_entry(mapping, &lobj->bo_va->invalids, list) { |
| 1400 | if (mapping->it.start > addr || | 1400 | if (mapping->start > addr || |
| 1401 | addr > mapping->it.last) | 1401 | addr > mapping->last) |
| 1402 | continue; | 1402 | continue; |
| 1403 | 1403 | ||
| 1404 | *bo = lobj->bo_va->bo; | 1404 | *bo = lobj->bo_va->bo; |
