aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h100
1 files changed, 18 insertions, 82 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 51d1364cf185..a5427cf4b19d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -373,78 +373,10 @@ struct amdgpu_clock {
373}; 373};
374 374
375/* 375/*
376 * BO. 376 * GEM.
377 */ 377 */
378struct amdgpu_bo_list_entry {
379 struct amdgpu_bo *robj;
380 struct ttm_validate_buffer tv;
381 struct amdgpu_bo_va *bo_va;
382 uint32_t priority;
383 struct page **user_pages;
384 int user_invalidated;
385};
386
387struct amdgpu_bo_va_mapping {
388 struct list_head list;
389 struct rb_node rb;
390 uint64_t start;
391 uint64_t last;
392 uint64_t __subtree_last;
393 uint64_t offset;
394 uint64_t flags;
395};
396
397/* bo virtual addresses in a specific vm */
398struct amdgpu_bo_va {
399 /* protected by bo being reserved */
400 struct list_head bo_list;
401 struct dma_fence *last_pt_update;
402 unsigned ref_count;
403
404 /* protected by vm mutex and spinlock */
405 struct list_head vm_status;
406
407 /* mappings for this bo_va */
408 struct list_head invalids;
409 struct list_head valids;
410
411 /* constant after initialization */
412 struct amdgpu_vm *vm;
413 struct amdgpu_bo *bo;
414};
415 378
416#define AMDGPU_GEM_DOMAIN_MAX 0x3 379#define AMDGPU_GEM_DOMAIN_MAX 0x3
417
418struct amdgpu_bo {
419 /* Protected by tbo.reserved */
420 u32 prefered_domains;
421 u32 allowed_domains;
422 struct ttm_place placements[AMDGPU_GEM_DOMAIN_MAX + 1];
423 struct ttm_placement placement;
424 struct ttm_buffer_object tbo;
425 struct ttm_bo_kmap_obj kmap;
426 u64 flags;
427 unsigned pin_count;
428 void *kptr;
429 u64 tiling_flags;
430 u64 metadata_flags;
431 void *metadata;
432 u32 metadata_size;
433 unsigned prime_shared_count;
434 /* list of all virtual address to which this bo
435 * is associated to
436 */
437 struct list_head va;
438 /* Constant after initialization */
439 struct drm_gem_object gem_base;
440 struct amdgpu_bo *parent;
441 struct amdgpu_bo *shadow;
442
443 struct ttm_bo_kmap_obj dma_buf_vmap;
444 struct amdgpu_mn *mn;
445 struct list_head mn_list;
446 struct list_head shadow_list;
447};
448#define gem_to_amdgpu_bo(gobj) container_of((gobj), struct amdgpu_bo, gem_base) 380#define gem_to_amdgpu_bo(gobj) container_of((gobj), struct amdgpu_bo, gem_base)
449 381
450void amdgpu_gem_object_free(struct drm_gem_object *obj); 382void amdgpu_gem_object_free(struct drm_gem_object *obj);
@@ -678,15 +610,15 @@ typedef enum _AMDGPU_DOORBELL64_ASSIGNMENT
678 /* overlap the doorbell assignment with VCN as they are mutually exclusive 610 /* overlap the doorbell assignment with VCN as they are mutually exclusive
679 * VCE engine's doorbell is 32 bit and two VCE ring share one QWORD 611 * VCE engine's doorbell is 32 bit and two VCE ring share one QWORD
680 */ 612 */
681 AMDGPU_DOORBELL64_RING0_1 = 0xF8, 613 AMDGPU_DOORBELL64_UVD_RING0_1 = 0xF8,
682 AMDGPU_DOORBELL64_RING2_3 = 0xF9, 614 AMDGPU_DOORBELL64_UVD_RING2_3 = 0xF9,
683 AMDGPU_DOORBELL64_RING4_5 = 0xFA, 615 AMDGPU_DOORBELL64_UVD_RING4_5 = 0xFA,
684 AMDGPU_DOORBELL64_RING6_7 = 0xFB, 616 AMDGPU_DOORBELL64_UVD_RING6_7 = 0xFB,
685 617
686 AMDGPU_DOORBELL64_UVD_RING0_1 = 0xFC, 618 AMDGPU_DOORBELL64_VCE_RING0_1 = 0xFC,
687 AMDGPU_DOORBELL64_UVD_RING2_3 = 0xFD, 619 AMDGPU_DOORBELL64_VCE_RING2_3 = 0xFD,
688 AMDGPU_DOORBELL64_UVD_RING4_5 = 0xFE, 620 AMDGPU_DOORBELL64_VCE_RING4_5 = 0xFE,
689 AMDGPU_DOORBELL64_UVD_RING6_7 = 0xFF, 621 AMDGPU_DOORBELL64_VCE_RING6_7 = 0xFF,
690 622
691 AMDGPU_DOORBELL64_MAX_ASSIGNMENT = 0xFF, 623 AMDGPU_DOORBELL64_MAX_ASSIGNMENT = 0xFF,
692 AMDGPU_DOORBELL64_INVALID = 0xFFFF 624 AMDGPU_DOORBELL64_INVALID = 0xFFFF
@@ -825,6 +757,14 @@ struct amdgpu_fpriv {
825/* 757/*
826 * residency list 758 * residency list
827 */ 759 */
760struct amdgpu_bo_list_entry {
761 struct amdgpu_bo *robj;
762 struct ttm_validate_buffer tv;
763 struct amdgpu_bo_va *bo_va;
764 uint32_t priority;
765 struct page **user_pages;
766 int user_invalidated;
767};
828 768
829struct amdgpu_bo_list { 769struct amdgpu_bo_list {
830 struct mutex lock; 770 struct mutex lock;
@@ -1191,10 +1131,6 @@ struct amdgpu_wb {
1191 1131
1192int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb); 1132int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb);
1193void amdgpu_wb_free(struct amdgpu_device *adev, u32 wb); 1133void amdgpu_wb_free(struct amdgpu_device *adev, u32 wb);
1194int amdgpu_wb_get_64bit(struct amdgpu_device *adev, u32 *wb);
1195int amdgpu_wb_get_256Bit(struct amdgpu_device *adev, u32 *wb);
1196void amdgpu_wb_free_64bit(struct amdgpu_device *adev, u32 wb);
1197void amdgpu_wb_free_256bit(struct amdgpu_device *adev, u32 wb);
1198 1134
1199void amdgpu_get_pcie_info(struct amdgpu_device *adev); 1135void amdgpu_get_pcie_info(struct amdgpu_device *adev);
1200 1136
@@ -1488,7 +1424,7 @@ struct amdgpu_device {
1488 bool is_atom_fw; 1424 bool is_atom_fw;
1489 uint8_t *bios; 1425 uint8_t *bios;
1490 uint32_t bios_size; 1426 uint32_t bios_size;
1491 struct amdgpu_bo *stollen_vga_memory; 1427 struct amdgpu_bo *stolen_vga_memory;
1492 uint32_t bios_scratch_reg_offset; 1428 uint32_t bios_scratch_reg_offset;
1493 uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH]; 1429 uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH];
1494 1430