| .. | .. |
|---|
| 24 | 24 | * Authors: |
|---|
| 25 | 25 | * Jerome Glisse <glisse@freedesktop.org> |
|---|
| 26 | 26 | */ |
|---|
| 27 | + |
|---|
| 27 | 28 | #include <linux/list_sort.h> |
|---|
| 28 | | -#include <drm/drmP.h> |
|---|
| 29 | +#include <linux/pci.h> |
|---|
| 30 | +#include <linux/uaccess.h> |
|---|
| 31 | + |
|---|
| 32 | +#include <drm/drm_device.h> |
|---|
| 33 | +#include <drm/drm_file.h> |
|---|
| 29 | 34 | #include <drm/radeon_drm.h> |
|---|
| 30 | | -#include "radeon_reg.h" |
|---|
| 35 | + |
|---|
| 31 | 36 | #include "radeon.h" |
|---|
| 37 | +#include "radeon_reg.h" |
|---|
| 32 | 38 | #include "radeon_trace.h" |
|---|
| 33 | 39 | |
|---|
| 34 | 40 | #define RADEON_CS_MAX_PRIORITY 32u |
|---|
| .. | .. |
|---|
| 154 | 160 | p->relocs[i].allowed_domains = domain; |
|---|
| 155 | 161 | } |
|---|
| 156 | 162 | |
|---|
| 157 | | - if (radeon_ttm_tt_has_userptr(p->relocs[i].robj->tbo.ttm)) { |
|---|
| 163 | + if (radeon_ttm_tt_has_userptr(p->rdev, p->relocs[i].robj->tbo.ttm)) { |
|---|
| 158 | 164 | uint32_t domain = p->relocs[i].preferred_domains; |
|---|
| 159 | 165 | if (!(domain & RADEON_GEM_DOMAIN_GTT)) { |
|---|
| 160 | 166 | DRM_ERROR("Only RADEON_GEM_DOMAIN_GTT is " |
|---|
| .. | .. |
|---|
| 178 | 184 | } |
|---|
| 179 | 185 | |
|---|
| 180 | 186 | p->relocs[i].tv.bo = &p->relocs[i].robj->tbo; |
|---|
| 181 | | - p->relocs[i].tv.shared = !r->write_domain; |
|---|
| 187 | + p->relocs[i].tv.num_shared = !r->write_domain; |
|---|
| 182 | 188 | |
|---|
| 183 | 189 | radeon_cs_buckets_add(&buckets, &p->relocs[i].tv.head, |
|---|
| 184 | 190 | priority); |
|---|
| .. | .. |
|---|
| 190 | 196 | p->vm_bos = radeon_vm_get_bos(p->rdev, p->ib.vm, |
|---|
| 191 | 197 | &p->validated); |
|---|
| 192 | 198 | if (need_mmap_lock) |
|---|
| 193 | | - down_read(¤t->mm->mmap_sem); |
|---|
| 199 | + mmap_read_lock(current->mm); |
|---|
| 194 | 200 | |
|---|
| 195 | 201 | r = radeon_bo_list_validate(p->rdev, &p->ticket, &p->validated, p->ring); |
|---|
| 196 | 202 | |
|---|
| 197 | 203 | if (need_mmap_lock) |
|---|
| 198 | | - up_read(¤t->mm->mmap_sem); |
|---|
| 204 | + mmap_read_unlock(current->mm); |
|---|
| 199 | 205 | |
|---|
| 200 | 206 | return r; |
|---|
| 201 | 207 | } |
|---|
| .. | .. |
|---|
| 249 | 255 | int r; |
|---|
| 250 | 256 | |
|---|
| 251 | 257 | list_for_each_entry(reloc, &p->validated, tv.head) { |
|---|
| 252 | | - struct reservation_object *resv; |
|---|
| 258 | + struct dma_resv *resv; |
|---|
| 253 | 259 | |
|---|
| 254 | | - resv = reloc->robj->tbo.resv; |
|---|
| 260 | + resv = reloc->robj->tbo.base.resv; |
|---|
| 255 | 261 | r = radeon_sync_resv(p->rdev, &p->ib.sync, resv, |
|---|
| 256 | | - reloc->tv.shared); |
|---|
| 262 | + reloc->tv.num_shared); |
|---|
| 257 | 263 | if (r) |
|---|
| 258 | 264 | return r; |
|---|
| 259 | 265 | } |
|---|
| .. | .. |
|---|
| 437 | 443 | if (bo == NULL) |
|---|
| 438 | 444 | continue; |
|---|
| 439 | 445 | |
|---|
| 440 | | - drm_gem_object_put_unlocked(&bo->gem_base); |
|---|
| 446 | + drm_gem_object_put(&bo->tbo.base); |
|---|
| 441 | 447 | } |
|---|
| 442 | 448 | } |
|---|
| 443 | 449 | kfree(parser->track); |
|---|