Rev 5078 | Rev 6104 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5078 | Rev 5271 | ||
---|---|---|---|
Line 1364... | Line 1364... | ||
1364 | } |
1364 | } |
Line 1365... | Line 1365... | ||
1365 | 1365 | ||
1366 | void cayman_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) |
1366 | void cayman_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) |
1367 | { |
1367 | { |
- | 1368 | struct radeon_ring *ring = &rdev->ring[ib->ring]; |
|
1368 | struct radeon_ring *ring = &rdev->ring[ib->ring]; |
1369 | unsigned vm_id = ib->vm ? ib->vm->ids[ib->ring].id : 0; |
1369 | u32 cp_coher_cntl = PACKET3_FULL_CACHE_ENA | PACKET3_TC_ACTION_ENA | |
1370 | u32 cp_coher_cntl = PACKET3_FULL_CACHE_ENA | PACKET3_TC_ACTION_ENA | |
Line 1370... | Line 1371... | ||
1370 | PACKET3_SH_ACTION_ENA; |
1371 | PACKET3_SH_ACTION_ENA; |
1371 | 1372 | ||
Line 1386... | Line 1387... | ||
1386 | #ifdef __BIG_ENDIAN |
1387 | #ifdef __BIG_ENDIAN |
1387 | (2 << 0) | |
1388 | (2 << 0) | |
1388 | #endif |
1389 | #endif |
1389 | (ib->gpu_addr & 0xFFFFFFFC)); |
1390 | (ib->gpu_addr & 0xFFFFFFFC)); |
1390 | radeon_ring_write(ring, upper_32_bits(ib->gpu_addr) & 0xFF); |
1391 | radeon_ring_write(ring, upper_32_bits(ib->gpu_addr) & 0xFF); |
1391 | radeon_ring_write(ring, ib->length_dw | |
1392 | radeon_ring_write(ring, ib->length_dw | (vm_id << 24)); |
1392 | (ib->vm ? (ib->vm->id << 24) : 0)); |
- | |
Line 1393... | Line 1393... | ||
1393 | 1393 | ||
1394 | /* flush read cache over gart for this vmid */ |
1394 | /* flush read cache over gart for this vmid */ |
1395 | radeon_ring_write(ring, PACKET3(PACKET3_SURFACE_SYNC, 3)); |
1395 | radeon_ring_write(ring, PACKET3(PACKET3_SURFACE_SYNC, 3)); |
1396 | radeon_ring_write(ring, PACKET3_ENGINE_ME | cp_coher_cntl); |
1396 | radeon_ring_write(ring, PACKET3_ENGINE_ME | cp_coher_cntl); |
1397 | radeon_ring_write(ring, 0xFFFFFFFF); |
1397 | radeon_ring_write(ring, 0xFFFFFFFF); |
1398 | radeon_ring_write(ring, 0); |
1398 | radeon_ring_write(ring, 0); |
1399 | radeon_ring_write(ring, ((ib->vm ? ib->vm->id : 0) << 24) | 10); /* poll interval */ |
1399 | radeon_ring_write(ring, (vm_id << 24) | 10); /* poll interval */ |
Line 1400... | Line 1400... | ||
1400 | } |
1400 | } |
1401 | 1401 | ||
1402 | static void cayman_cp_enable(struct radeon_device *rdev, bool enable) |
1402 | static void cayman_cp_enable(struct radeon_device *rdev, bool enable) |
Line 1670... | Line 1670... | ||
1670 | rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX].ready = false; |
1670 | rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX].ready = false; |
1671 | return r; |
1671 | return r; |
1672 | } |
1672 | } |
Line 1673... | Line 1673... | ||
1673 | 1673 | ||
1674 | if (rdev->asic->copy.copy_ring_index == RADEON_RING_TYPE_GFX_INDEX) |
1674 | if (rdev->asic->copy.copy_ring_index == RADEON_RING_TYPE_GFX_INDEX) |
Line 1675... | Line 1675... | ||
1675 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size); |
1675 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size); |
1676 | 1676 | ||
Line 1677... | Line 1677... | ||
1677 | return 0; |
1677 | return 0; |
Line 1901... | Line 1901... | ||
1901 | reset_mask = cayman_gpu_check_soft_reset(rdev); |
1901 | reset_mask = cayman_gpu_check_soft_reset(rdev); |
Line 1902... | Line 1902... | ||
1902 | 1902 | ||
1903 | if (reset_mask) |
1903 | if (reset_mask) |
Line 1904... | Line 1904... | ||
1904 | evergreen_gpu_pci_config_reset(rdev); |
1904 | evergreen_gpu_pci_config_reset(rdev); |
Line 1905... | Line 1905... | ||
1905 | 1905 | ||
1906 | r600_set_bios_scratch_engine_hung(rdev, false); |
1906 | r600_set_bios_scratch_engine_hung(rdev, false); |
Line 1907... | Line 1907... | ||
1907 | 1907 | ||
Line 1941... | Line 1941... | ||
1941 | evergreen_program_aspm(rdev); |
1941 | evergreen_program_aspm(rdev); |
Line 1942... | Line 1942... | ||
1942 | 1942 | ||
1943 | /* scratch needs to be initialized before MC */ |
1943 | /* scratch needs to be initialized before MC */ |
1944 | r = r600_vram_scratch_init(rdev); |
1944 | r = r600_vram_scratch_init(rdev); |
1945 | if (r) |
1945 | if (r) |
Line 1946... | Line 1946... | ||
1946 | return r; |
1946 | return r; |
Line 1947... | Line 1947... | ||
1947 | 1947 | ||
1948 | evergreen_mc_program(rdev); |
1948 | evergreen_mc_program(rdev); |
1949 | 1949 | ||
1950 | if (!(rdev->flags & RADEON_IS_IGP) && !rdev->pm.dpm_enabled) { |
1950 | if (!(rdev->flags & RADEON_IS_IGP) && !rdev->pm.dpm_enabled) { |
1951 | r = ni_mc_load_microcode(rdev); |
1951 | r = ni_mc_load_microcode(rdev); |
1952 | if (r) { |
1952 | if (r) { |
1953 | DRM_ERROR("Failed to load MC firmware!\n"); |
1953 | DRM_ERROR("Failed to load MC firmware!\n"); |
Line 1954... | Line 1954... | ||
1954 | return r; |
1954 | return r; |
1955 | } |
1955 | } |
1956 | } |
1956 | } |
Line 2377... | Line 2377... | ||
2377 | block = "HDP"; |
2377 | block = "HDP"; |
2378 | break; |
2378 | break; |
2379 | default: |
2379 | default: |
2380 | block = "unknown"; |
2380 | block = "unknown"; |
2381 | break; |
2381 | break; |
2382 | } |
2382 | } |
Line 2383... | Line 2383... | ||
2383 | 2383 | ||
2384 | printk("VM fault (0x%02x, vmid %d) at page %u, %s from %s (%d)\n", |
2384 | printk("VM fault (0x%02x, vmid %d) at page %u, %s from %s (%d)\n", |
2385 | protections, vmid, addr, |
2385 | protections, vmid, addr, |
2386 | (status & MEMORY_CLIENT_RW_MASK) ? "write" : "read", |
2386 | (status & MEMORY_CLIENT_RW_MASK) ? "write" : "read", |
Line 2393... | Line 2393... | ||
2393 | * @rdev: radeon_device pointer |
2393 | * @rdev: radeon_device pointer |
2394 | * |
2394 | * |
2395 | * Update the page table base and flush the VM TLB |
2395 | * Update the page table base and flush the VM TLB |
2396 | * using the CP (cayman-si). |
2396 | * using the CP (cayman-si). |
2397 | */ |
2397 | */ |
2398 | void cayman_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm) |
2398 | void cayman_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, |
- | 2399 | unsigned vm_id, uint64_t pd_addr) |
|
2399 | { |
2400 | { |
2400 | struct radeon_ring *ring = &rdev->ring[ridx]; |
- | |
2401 | - | ||
2402 | if (vm == NULL) |
- | |
2403 | return; |
- | |
2404 | - | ||
2405 | radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (vm->id << 2), 0)); |
2401 | radeon_ring_write(ring, PACKET0(VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (vm_id << 2), 0)); |
2406 | radeon_ring_write(ring, vm->pd_gpu_addr >> 12); |
2402 | radeon_ring_write(ring, pd_addr >> 12); |
Line 2407... | Line 2403... | ||
2407 | 2403 | ||
2408 | /* flush hdp cache */ |
2404 | /* flush hdp cache */ |
2409 | radeon_ring_write(ring, PACKET0(HDP_MEM_COHERENCY_FLUSH_CNTL, 0)); |
2405 | radeon_ring_write(ring, PACKET0(HDP_MEM_COHERENCY_FLUSH_CNTL, 0)); |
Line 2410... | Line 2406... | ||
2410 | radeon_ring_write(ring, 0x1); |
2406 | radeon_ring_write(ring, 0x1); |
2411 | 2407 | ||
2412 | /* bits 0-7 are the VM contexts0-7 */ |
2408 | /* bits 0-7 are the VM contexts0-7 */ |
Line 2413... | Line 2409... | ||
2413 | radeon_ring_write(ring, PACKET0(VM_INVALIDATE_REQUEST, 0)); |
2409 | radeon_ring_write(ring, PACKET0(VM_INVALIDATE_REQUEST, 0)); |
2414 | radeon_ring_write(ring, 1 << vm->id); |
2410 | radeon_ring_write(ring, 1 << vm_id); |
2415 | 2411 | ||
2416 | /* sync PFP to ME, otherwise we might get invalid PFP reads */ |
2412 | /* sync PFP to ME, otherwise we might get invalid PFP reads */ |