2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
24 * Authors: Dave Airlie
31 #include "radeon_object.h"
33 /* TODO: Here are things that needs to be done :
34 * - surface allocator & initializer : (bit like scratch reg) should
35 * initialize HDP_ stuff on RS600, R600, R700 hw, well anythings
37 * - WB : write back stuff (do it bit like scratch reg things)
38 * - Vblank : look at Jesse's rework and what we should do
39 * - r600/r700: gart & cp
40 * - cs : clean cs ioctl use bitmap & things like that.
41 * - power management stuff
42 * - Barrier in gart code
43 * - Unmappabled vram ?
44 * - TESTING, TESTING, TESTING
47 #include <asm/atomic.h>
48 #include <linux/wait.h>
49 #include <linux/list.h>
50 #include <linux/kref.h>
52 #include "radeon_mode.h"
53 #include "radeon_reg.h"
59 extern int radeon_no_wb;
60 extern int radeon_modeset;
61 extern int radeon_dynclks;
62 extern int radeon_r4xx_atom;
63 extern int radeon_agpmode;
64 extern int radeon_vram_limit;
65 extern int radeon_gart_size;
66 extern int radeon_benchmarking;
67 extern int radeon_connector_table;
70 * Copy from radeon_drv.h so we don't have to include both and have conflicting
73 #define RADEON_MAX_USEC_TIMEOUT 100000 /* 100 ms */
74 #define RADEON_IB_POOL_SIZE 16
75 #define RADEON_DEBUGFS_MAX_NUM_FILES 32
76 #define RADEONFB_CONN_LIMIT 4
119 enum radeon_chip_flags {
120 RADEON_FAMILY_MASK = 0x0000ffffUL,
121 RADEON_FLAGS_MASK = 0xffff0000UL,
122 RADEON_IS_MOBILITY = 0x00010000UL,
123 RADEON_IS_IGP = 0x00020000UL,
124 RADEON_SINGLE_CRTC = 0x00040000UL,
125 RADEON_IS_AGP = 0x00080000UL,
126 RADEON_HAS_HIERZ = 0x00100000UL,
127 RADEON_IS_PCIE = 0x00200000UL,
128 RADEON_NEW_MEMMAP = 0x00400000UL,
129 RADEON_IS_PCI = 0x00800000UL,
130 RADEON_IS_IGPGART = 0x01000000UL,
135 * Errata workarounds.
137 enum radeon_pll_errata {
138 CHIP_ERRATA_R300_CG = 0x00000001,
139 CHIP_ERRATA_PLL_DUMMYREADS = 0x00000002,
140 CHIP_ERRATA_PLL_DELAY = 0x00000004
144 struct radeon_device;
150 bool radeon_get_bios(struct radeon_device *rdev);
156 struct radeon_clock {
157 struct radeon_pll p1pll;
158 struct radeon_pll p2pll;
159 struct radeon_pll spll;
160 struct radeon_pll mpll;
162 uint32_t default_mclk;
163 uint32_t default_sclk;
169 struct radeon_fence_driver {
170 uint32_t scratch_reg;
173 unsigned long count_timeout;
174 wait_queue_head_t queue;
176 struct list_head created;
177 struct list_head emited;
178 struct list_head signaled;
181 struct radeon_fence {
182 struct radeon_device *rdev;
184 struct list_head list;
185 /* protected by radeon_fence.lock */
187 unsigned long timeout;
192 int radeon_fence_driver_init(struct radeon_device *rdev);
193 void radeon_fence_driver_fini(struct radeon_device *rdev);
194 int radeon_fence_create(struct radeon_device *rdev, struct radeon_fence **fence);
195 int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence *fence);
196 void radeon_fence_process(struct radeon_device *rdev);
197 bool radeon_fence_signaled(struct radeon_fence *fence);
198 int radeon_fence_wait(struct radeon_fence *fence, bool interruptible);
199 int radeon_fence_wait_next(struct radeon_device *rdev);
200 int radeon_fence_wait_last(struct radeon_device *rdev);
201 struct radeon_fence *radeon_fence_ref(struct radeon_fence *fence);
202 void radeon_fence_unref(struct radeon_fence **fence);
208 struct radeon_object;
210 struct radeon_object_list {
211 struct list_head list;
212 struct radeon_object *robj;
218 int radeon_object_init(struct radeon_device *rdev);
219 void radeon_object_fini(struct radeon_device *rdev);
220 int radeon_object_create(struct radeon_device *rdev,
221 struct drm_gem_object *gobj,
226 struct radeon_object **robj_ptr);
227 int radeon_object_kmap(struct radeon_object *robj, void **ptr);
228 void radeon_object_kunmap(struct radeon_object *robj);
229 void radeon_object_unref(struct radeon_object **robj);
230 int radeon_object_pin(struct radeon_object *robj, uint32_t domain,
232 void radeon_object_unpin(struct radeon_object *robj);
233 int radeon_object_wait(struct radeon_object *robj);
234 int radeon_object_evict_vram(struct radeon_device *rdev);
235 int radeon_object_mmap(struct radeon_object *robj, uint64_t *offset);
236 void radeon_object_force_delete(struct radeon_device *rdev);
237 void radeon_object_list_add_object(struct radeon_object_list *lobj,
238 struct list_head *head);
239 int radeon_object_list_validate(struct list_head *head, void *fence);
240 void radeon_object_list_unvalidate(struct list_head *head);
241 void radeon_object_list_clean(struct list_head *head);
242 int radeon_object_fbdev_mmap(struct radeon_object *robj,
243 struct vm_area_struct *vma);
244 unsigned long radeon_object_size(struct radeon_object *robj);
251 struct list_head objects;
254 int radeon_gem_init(struct radeon_device *rdev);
255 void radeon_gem_fini(struct radeon_device *rdev);
256 int radeon_gem_object_create(struct radeon_device *rdev, int size,
257 int alignment, int initial_domain,
258 bool discardable, bool kernel,
260 struct drm_gem_object **obj);
261 int radeon_gem_object_pin(struct drm_gem_object *obj, uint32_t pin_domain,
263 void radeon_gem_object_unpin(struct drm_gem_object *obj);
267 * GART structures, functions & helpers
271 struct radeon_gart_table_ram {
272 volatile uint32_t *ptr;
275 struct radeon_gart_table_vram {
276 struct radeon_object *robj;
277 volatile uint32_t *ptr;
280 union radeon_gart_table {
281 struct radeon_gart_table_ram ram;
282 struct radeon_gart_table_vram vram;
286 dma_addr_t table_addr;
287 unsigned num_gpu_pages;
288 unsigned num_cpu_pages;
290 union radeon_gart_table table;
292 dma_addr_t *pages_addr;
296 int radeon_gart_table_ram_alloc(struct radeon_device *rdev);
297 void radeon_gart_table_ram_free(struct radeon_device *rdev);
298 int radeon_gart_table_vram_alloc(struct radeon_device *rdev);
299 void radeon_gart_table_vram_free(struct radeon_device *rdev);
300 int radeon_gart_init(struct radeon_device *rdev);
301 void radeon_gart_fini(struct radeon_device *rdev);
302 void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset,
304 int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
305 int pages, struct page **pagelist);
309 * GPU MC structures, functions & helpers
312 resource_size_t aper_size;
313 resource_size_t aper_base;
314 resource_size_t agp_base;
315 unsigned gtt_location;
317 unsigned vram_location;
324 int radeon_mc_setup(struct radeon_device *rdev);
328 * GPU scratch registers structures, functions & helpers
330 struct radeon_scratch {
336 int radeon_scratch_get(struct radeon_device *rdev, uint32_t *reg);
337 void radeon_scratch_free(struct radeon_device *rdev, uint32_t reg);
346 /* FIXME: use a define max crtc rather than hardcode it */
347 bool crtc_vblank_int[2];
350 int radeon_irq_kms_init(struct radeon_device *rdev);
351 void radeon_irq_kms_fini(struct radeon_device *rdev);
358 struct list_head list;
361 struct radeon_fence *fence;
362 volatile uint32_t *ptr;
366 struct radeon_ib_pool {
368 struct radeon_object *robj;
369 struct list_head scheduled_ibs;
370 struct radeon_ib ibs[RADEON_IB_POOL_SIZE];
372 DECLARE_BITMAP(alloc_bm, RADEON_IB_POOL_SIZE);
376 struct radeon_object *ring_obj;
377 volatile uint32_t *ring;
382 unsigned ring_free_dw;
391 int radeon_ib_get(struct radeon_device *rdev, struct radeon_ib **ib);
392 void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib **ib);
393 int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib);
394 int radeon_ib_pool_init(struct radeon_device *rdev);
395 void radeon_ib_pool_fini(struct radeon_device *rdev);
396 int radeon_ib_test(struct radeon_device *rdev);
397 /* Ring access between begin & end cannot sleep */
398 void radeon_ring_free_size(struct radeon_device *rdev);
399 int radeon_ring_lock(struct radeon_device *rdev, unsigned ndw);
400 void radeon_ring_unlock_commit(struct radeon_device *rdev);
401 void radeon_ring_unlock_undo(struct radeon_device *rdev);
402 int radeon_ring_test(struct radeon_device *rdev);
403 int radeon_ring_init(struct radeon_device *rdev, unsigned ring_size);
404 void radeon_ring_fini(struct radeon_device *rdev);
410 struct radeon_cs_reloc {
411 struct drm_gem_object *gobj;
412 struct radeon_object *robj;
413 struct radeon_object_list lobj;
418 struct radeon_cs_chunk {
424 struct radeon_cs_parser {
425 struct radeon_device *rdev;
426 struct drm_file *filp;
429 struct radeon_cs_chunk *chunks;
430 uint64_t *chunks_array;
435 struct radeon_cs_reloc *relocs;
436 struct radeon_cs_reloc **relocs_ptr;
437 struct list_head validated;
438 /* indices of various chunks */
440 int chunk_relocs_idx;
441 struct radeon_ib *ib;
445 struct radeon_cs_packet {
454 typedef int (*radeon_packet0_check_t)(struct radeon_cs_parser *p,
455 struct radeon_cs_packet *pkt,
456 unsigned idx, unsigned reg);
457 typedef int (*radeon_packet3_check_t)(struct radeon_cs_parser *p,
458 struct radeon_cs_packet *pkt);
464 int radeon_agp_init(struct radeon_device *rdev);
465 void radeon_agp_fini(struct radeon_device *rdev);
472 struct radeon_object *wb_obj;
473 volatile uint32_t *wb;
481 void radeon_benchmark(struct radeon_device *rdev);
487 int radeon_debugfs_add_files(struct radeon_device *rdev,
488 struct drm_info_list *files,
490 int radeon_debugfs_fence_init(struct radeon_device *rdev);
491 int r100_debugfs_rbbm_init(struct radeon_device *rdev);
492 int r100_debugfs_cp_init(struct radeon_device *rdev);
496 * ASIC specific functions.
499 void (*errata)(struct radeon_device *rdev);
500 void (*vram_info)(struct radeon_device *rdev);
501 int (*gpu_reset)(struct radeon_device *rdev);
502 int (*mc_init)(struct radeon_device *rdev);
503 void (*mc_fini)(struct radeon_device *rdev);
504 int (*wb_init)(struct radeon_device *rdev);
505 void (*wb_fini)(struct radeon_device *rdev);
506 int (*gart_enable)(struct radeon_device *rdev);
507 void (*gart_disable)(struct radeon_device *rdev);
508 void (*gart_tlb_flush)(struct radeon_device *rdev);
509 int (*gart_set_page)(struct radeon_device *rdev, int i, uint64_t addr);
510 int (*cp_init)(struct radeon_device *rdev, unsigned ring_size);
511 void (*cp_fini)(struct radeon_device *rdev);
512 void (*cp_disable)(struct radeon_device *rdev);
513 void (*ring_start)(struct radeon_device *rdev);
514 int (*irq_set)(struct radeon_device *rdev);
515 int (*irq_process)(struct radeon_device *rdev);
516 void (*fence_ring_emit)(struct radeon_device *rdev, struct radeon_fence *fence);
517 int (*cs_parse)(struct radeon_cs_parser *p);
518 int (*copy_blit)(struct radeon_device *rdev,
522 struct radeon_fence *fence);
523 int (*copy_dma)(struct radeon_device *rdev,
527 struct radeon_fence *fence);
528 int (*copy)(struct radeon_device *rdev,
532 struct radeon_fence *fence);
533 void (*set_engine_clock)(struct radeon_device *rdev, uint32_t eng_clock);
534 void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock);
535 void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes);
536 void (*set_clock_gating)(struct radeon_device *rdev, int enable);
543 int radeon_gem_info_ioctl(struct drm_device *dev, void *data,
544 struct drm_file *filp);
545 int radeon_gem_create_ioctl(struct drm_device *dev, void *data,
546 struct drm_file *filp);
547 int radeon_gem_pin_ioctl(struct drm_device *dev, void *data,
548 struct drm_file *file_priv);
549 int radeon_gem_unpin_ioctl(struct drm_device *dev, void *data,
550 struct drm_file *file_priv);
551 int radeon_gem_pwrite_ioctl(struct drm_device *dev, void *data,
552 struct drm_file *file_priv);
553 int radeon_gem_pread_ioctl(struct drm_device *dev, void *data,
554 struct drm_file *file_priv);
555 int radeon_gem_set_domain_ioctl(struct drm_device *dev, void *data,
556 struct drm_file *filp);
557 int radeon_gem_mmap_ioctl(struct drm_device *dev, void *data,
558 struct drm_file *filp);
559 int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
560 struct drm_file *filp);
561 int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
562 struct drm_file *filp);
563 int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp);
567 * Core structure, functions and helpers.
569 typedef uint32_t (*radeon_rreg_t)(struct radeon_device*, uint32_t);
570 typedef void (*radeon_wreg_t)(struct radeon_device*, uint32_t, uint32_t);
572 struct radeon_device {
573 struct drm_device *ddev;
574 struct pci_dev *pdev;
576 enum radeon_family family;
579 enum radeon_pll_errata pll_errata;
585 uint16_t bios_header_start;
586 struct radeon_object *stollen_vga_memory;
587 struct fb_info *fbdev_info;
588 struct radeon_object *fbdev_robj;
589 struct radeon_framebuffer *fbdev_rfb;
591 unsigned long rmmio_base;
592 unsigned long rmmio_size;
594 radeon_rreg_t mm_rreg;
595 radeon_wreg_t mm_wreg;
596 radeon_rreg_t mc_rreg;
597 radeon_wreg_t mc_wreg;
598 radeon_rreg_t pll_rreg;
599 radeon_wreg_t pll_wreg;
600 radeon_rreg_t pcie_rreg;
601 radeon_wreg_t pcie_wreg;
602 radeon_rreg_t pciep_rreg;
603 radeon_wreg_t pciep_wreg;
604 struct radeon_clock clock;
606 struct radeon_gart gart;
607 struct radeon_mode_info mode_info;
608 struct radeon_scratch scratch;
609 struct radeon_mman mman;
610 struct radeon_fence_driver fence_drv;
612 struct radeon_ib_pool ib_pool;
613 struct radeon_irq irq;
614 struct radeon_asic *asic;
615 struct radeon_gem gem;
616 struct mutex cs_mutex;
623 int radeon_device_init(struct radeon_device *rdev,
624 struct drm_device *ddev,
625 struct pci_dev *pdev,
627 void radeon_device_fini(struct radeon_device *rdev);
628 int radeon_gpu_wait_for_idle(struct radeon_device *rdev);
632 * Registers read & write functions.
634 #define RREG8(reg) readb(((void __iomem *)rdev->rmmio) + (reg))
635 #define WREG8(reg, v) writeb(v, ((void __iomem *)rdev->rmmio) + (reg))
636 #define RREG32(reg) rdev->mm_rreg(rdev, (reg))
637 #define WREG32(reg, v) rdev->mm_wreg(rdev, (reg), (v))
638 #define REG_SET(FIELD, v) (((v) << FIELD##_SHIFT) & FIELD##_MASK)
639 #define REG_GET(FIELD, v) (((v) << FIELD##_SHIFT) & FIELD##_MASK)
640 #define RREG32_PLL(reg) rdev->pll_rreg(rdev, (reg))
641 #define WREG32_PLL(reg, v) rdev->pll_wreg(rdev, (reg), (v))
642 #define RREG32_MC(reg) rdev->mc_rreg(rdev, (reg))
643 #define WREG32_MC(reg, v) rdev->mc_wreg(rdev, (reg), (v))
644 #define RREG32_PCIE(reg) rdev->pcie_rreg(rdev, (reg))
645 #define WREG32_PCIE(reg, v) rdev->pcie_wreg(rdev, (reg), (v))
646 #define WREG32_P(reg, val, mask) \
648 uint32_t tmp_ = RREG32(reg); \
650 tmp_ |= ((val) & ~(mask)); \
653 #define WREG32_PLL_P(reg, val, mask) \
655 uint32_t tmp_ = RREG32_PLL(reg); \
657 tmp_ |= ((val) & ~(mask)); \
658 WREG32_PLL(reg, tmp_); \
661 void r100_pll_errata_after_index(struct radeon_device *rdev);
667 #define ASIC_IS_RV100(rdev) ((rdev->family == CHIP_RV100) || \
668 (rdev->family == CHIP_RV200) || \
669 (rdev->family == CHIP_RS100) || \
670 (rdev->family == CHIP_RS200) || \
671 (rdev->family == CHIP_RV250) || \
672 (rdev->family == CHIP_RV280) || \
673 (rdev->family == CHIP_RS300))
674 #define ASIC_IS_R300(rdev) ((rdev->family == CHIP_R300) || \
675 (rdev->family == CHIP_RV350) || \
676 (rdev->family == CHIP_R350) || \
677 (rdev->family == CHIP_RV380) || \
678 (rdev->family == CHIP_R420) || \
679 (rdev->family == CHIP_R423) || \
680 (rdev->family == CHIP_RV410) || \
681 (rdev->family == CHIP_RS400) || \
682 (rdev->family == CHIP_RS480))
683 #define ASIC_IS_AVIVO(rdev) ((rdev->family >= CHIP_RS600))
684 #define ASIC_IS_DCE3(rdev) ((rdev->family >= CHIP_RV620))
685 #define ASIC_IS_DCE32(rdev) ((rdev->family >= CHIP_RV730))
691 #define RBIOS8(i) (rdev->bios[i])
692 #define RBIOS16(i) (RBIOS8(i) | (RBIOS8((i)+1) << 8))
693 #define RBIOS32(i) ((RBIOS16(i)) | (RBIOS16((i)+2) << 16))
695 int radeon_combios_init(struct radeon_device *rdev);
696 void radeon_combios_fini(struct radeon_device *rdev);
697 int radeon_atombios_init(struct radeon_device *rdev);
698 void radeon_atombios_fini(struct radeon_device *rdev);
704 #define CP_PACKET0 0x00000000
705 #define PACKET0_BASE_INDEX_SHIFT 0
706 #define PACKET0_BASE_INDEX_MASK (0x1ffff << 0)
707 #define PACKET0_COUNT_SHIFT 16
708 #define PACKET0_COUNT_MASK (0x3fff << 16)
709 #define CP_PACKET1 0x40000000
710 #define CP_PACKET2 0x80000000
711 #define PACKET2_PAD_SHIFT 0
712 #define PACKET2_PAD_MASK (0x3fffffff << 0)
713 #define CP_PACKET3 0xC0000000
714 #define PACKET3_IT_OPCODE_SHIFT 8
715 #define PACKET3_IT_OPCODE_MASK (0xff << 8)
716 #define PACKET3_COUNT_SHIFT 16
717 #define PACKET3_COUNT_MASK (0x3fff << 16)
718 /* PACKET3 op code */
719 #define PACKET3_NOP 0x10
720 #define PACKET3_3D_DRAW_VBUF 0x28
721 #define PACKET3_3D_DRAW_IMMD 0x29
722 #define PACKET3_3D_DRAW_INDX 0x2A
723 #define PACKET3_3D_LOAD_VBPNTR 0x2F
724 #define PACKET3_INDX_BUFFER 0x33
725 #define PACKET3_3D_DRAW_VBUF_2 0x34
726 #define PACKET3_3D_DRAW_IMMD_2 0x35
727 #define PACKET3_3D_DRAW_INDX_2 0x36
728 #define PACKET3_BITBLT_MULTI 0x9B
730 #define PACKET0(reg, n) (CP_PACKET0 | \
731 REG_SET(PACKET0_BASE_INDEX, (reg) >> 2) | \
732 REG_SET(PACKET0_COUNT, (n)))
733 #define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v)))
734 #define PACKET3(op, n) (CP_PACKET3 | \
735 REG_SET(PACKET3_IT_OPCODE, (op)) | \
736 REG_SET(PACKET3_COUNT, (n)))
738 #define PACKET_TYPE0 0
739 #define PACKET_TYPE1 1
740 #define PACKET_TYPE2 2
741 #define PACKET_TYPE3 3
743 #define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3)
744 #define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF)
745 #define CP_PACKET0_GET_REG(h) (((h) & 0x1FFF) << 2)
746 #define CP_PACKET0_GET_ONE_REG_WR(h) (((h) >> 15) & 1)
747 #define CP_PACKET3_GET_OPCODE(h) (((h) >> 8) & 0xFF)
749 static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
752 if (rdev->cp.count_dw <= 0) {
753 DRM_ERROR("radeon: writting more dword to ring than expected !\n");
756 rdev->cp.ring[rdev->cp.wptr++] = v;
757 rdev->cp.wptr &= rdev->cp.ptr_mask;
759 rdev->cp.ring_free_dw--;
766 #define radeon_cs_parse(p) rdev->asic->cs_parse((p))
767 #define radeon_errata(rdev) (rdev)->asic->errata((rdev))
768 #define radeon_vram_info(rdev) (rdev)->asic->vram_info((rdev))
769 #define radeon_gpu_reset(rdev) (rdev)->asic->gpu_reset((rdev))
770 #define radeon_mc_init(rdev) (rdev)->asic->mc_init((rdev))
771 #define radeon_mc_fini(rdev) (rdev)->asic->mc_fini((rdev))
772 #define radeon_wb_init(rdev) (rdev)->asic->wb_init((rdev))
773 #define radeon_wb_fini(rdev) (rdev)->asic->wb_fini((rdev))
774 #define radeon_gart_enable(rdev) (rdev)->asic->gart_enable((rdev))
775 #define radeon_gart_disable(rdev) (rdev)->asic->gart_disable((rdev))
776 #define radeon_gart_tlb_flush(rdev) (rdev)->asic->gart_tlb_flush((rdev))
777 #define radeon_gart_set_page(rdev, i, p) (rdev)->asic->gart_set_page((rdev), (i), (p))
778 #define radeon_cp_init(rdev,rsize) (rdev)->asic->cp_init((rdev), (rsize))
779 #define radeon_cp_fini(rdev) (rdev)->asic->cp_fini((rdev))
780 #define radeon_cp_disable(rdev) (rdev)->asic->cp_disable((rdev))
781 #define radeon_ring_start(rdev) (rdev)->asic->ring_start((rdev))
782 #define radeon_irq_set(rdev) (rdev)->asic->irq_set((rdev))
783 #define radeon_irq_process(rdev) (rdev)->asic->irq_process((rdev))
784 #define radeon_fence_ring_emit(rdev, fence) (rdev)->asic->fence_ring_emit((rdev), (fence))
785 #define radeon_copy_blit(rdev, s, d, np, f) (rdev)->asic->copy_blit((rdev), (s), (d), (np), (f))
786 #define radeon_copy_dma(rdev, s, d, np, f) (rdev)->asic->copy_dma((rdev), (s), (d), (np), (f))
787 #define radeon_copy(rdev, s, d, np, f) (rdev)->asic->copy((rdev), (s), (d), (np), (f))
788 #define radeon_set_engine_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e))
789 #define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e))
790 #define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l))
791 #define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e))