diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index e3170c794c1d..b316b301152f 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -93,6 +93,7 @@ extern int radeon_audio; | |||
93 | extern int radeon_disp_priority; | 93 | extern int radeon_disp_priority; |
94 | extern int radeon_hw_i2c; | 94 | extern int radeon_hw_i2c; |
95 | extern int radeon_pcie_gen2; | 95 | extern int radeon_pcie_gen2; |
96 | extern int radeon_msi; | ||
96 | 97 | ||
97 | /* | 98 | /* |
98 | * Copy from radeon_drv.h so we don't have to include both and have conflicting | 99 | * Copy from radeon_drv.h so we don't have to include both and have conflicting |
@@ -306,30 +307,17 @@ int radeon_mode_dumb_destroy(struct drm_file *file_priv, | |||
306 | */ | 307 | */ |
307 | struct radeon_mc; | 308 | struct radeon_mc; |
308 | 309 | ||
309 | struct radeon_gart_table_ram { | ||
310 | volatile uint32_t *ptr; | ||
311 | }; | ||
312 | |||
313 | struct radeon_gart_table_vram { | ||
314 | struct radeon_bo *robj; | ||
315 | volatile uint32_t *ptr; | ||
316 | }; | ||
317 | |||
318 | union radeon_gart_table { | ||
319 | struct radeon_gart_table_ram ram; | ||
320 | struct radeon_gart_table_vram vram; | ||
321 | }; | ||
322 | |||
323 | #define RADEON_GPU_PAGE_SIZE 4096 | 310 | #define RADEON_GPU_PAGE_SIZE 4096 |
324 | #define RADEON_GPU_PAGE_MASK (RADEON_GPU_PAGE_SIZE - 1) | 311 | #define RADEON_GPU_PAGE_MASK (RADEON_GPU_PAGE_SIZE - 1) |
325 | #define RADEON_GPU_PAGE_SHIFT 12 | 312 | #define RADEON_GPU_PAGE_SHIFT 12 |
326 | 313 | ||
327 | struct radeon_gart { | 314 | struct radeon_gart { |
328 | dma_addr_t table_addr; | 315 | dma_addr_t table_addr; |
316 | struct radeon_bo *robj; | ||
317 | void *ptr; | ||
329 | unsigned num_gpu_pages; | 318 | unsigned num_gpu_pages; |
330 | unsigned num_cpu_pages; | 319 | unsigned num_cpu_pages; |
331 | unsigned table_size; | 320 | unsigned table_size; |
332 | union radeon_gart_table table; | ||
333 | struct page **pages; | 321 | struct page **pages; |
334 | dma_addr_t *pages_addr; | 322 | dma_addr_t *pages_addr; |
335 | bool *ttm_alloced; | 323 | bool *ttm_alloced; |
@@ -340,6 +328,8 @@ int radeon_gart_table_ram_alloc(struct radeon_device *rdev); | |||
340 | void radeon_gart_table_ram_free(struct radeon_device *rdev); | 328 | void radeon_gart_table_ram_free(struct radeon_device *rdev); |
341 | int radeon_gart_table_vram_alloc(struct radeon_device *rdev); | 329 | int radeon_gart_table_vram_alloc(struct radeon_device *rdev); |
342 | void radeon_gart_table_vram_free(struct radeon_device *rdev); | 330 | void radeon_gart_table_vram_free(struct radeon_device *rdev); |
331 | int radeon_gart_table_vram_pin(struct radeon_device *rdev); | ||
332 | void radeon_gart_table_vram_unpin(struct radeon_device *rdev); | ||
343 | int radeon_gart_init(struct radeon_device *rdev); | 333 | int radeon_gart_init(struct radeon_device *rdev); |
344 | void radeon_gart_fini(struct radeon_device *rdev); | 334 | void radeon_gart_fini(struct radeon_device *rdev); |
345 | void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, | 335 | void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, |
@@ -347,6 +337,7 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, | |||
347 | int radeon_gart_bind(struct radeon_device *rdev, unsigned offset, | 337 | int radeon_gart_bind(struct radeon_device *rdev, unsigned offset, |
348 | int pages, struct page **pagelist, | 338 | int pages, struct page **pagelist, |
349 | dma_addr_t *dma_addr); | 339 | dma_addr_t *dma_addr); |
340 | void radeon_gart_restore(struct radeon_device *rdev); | ||
350 | 341 | ||
351 | 342 | ||
352 | /* | 343 | /* |
@@ -437,25 +428,26 @@ union radeon_irq_stat_regs { | |||
437 | struct evergreen_irq_stat_regs evergreen; | 428 | struct evergreen_irq_stat_regs evergreen; |
438 | }; | 429 | }; |
439 | 430 | ||
431 | #define RADEON_MAX_HPD_PINS 6 | ||
432 | #define RADEON_MAX_CRTCS 6 | ||
433 | #define RADEON_MAX_HDMI_BLOCKS 2 | ||
434 | |||
440 | struct radeon_irq { | 435 | struct radeon_irq { |
441 | bool installed; | 436 | bool installed; |
442 | bool sw_int; | 437 | bool sw_int; |
443 | /* FIXME: use a define max crtc rather than hardcode it */ | 438 | bool crtc_vblank_int[RADEON_MAX_CRTCS]; |
444 | bool crtc_vblank_int[6]; | 439 | bool pflip[RADEON_MAX_CRTCS]; |
445 | bool pflip[6]; | ||
446 | wait_queue_head_t vblank_queue; | 440 | wait_queue_head_t vblank_queue; |
447 | /* FIXME: use defines for max hpd/dacs */ | 441 | bool hpd[RADEON_MAX_HPD_PINS]; |
448 | bool hpd[6]; | ||
449 | bool gui_idle; | 442 | bool gui_idle; |
450 | bool gui_idle_acked; | 443 | bool gui_idle_acked; |
451 | wait_queue_head_t idle_queue; | 444 | wait_queue_head_t idle_queue; |
452 | /* FIXME: use defines for max HDMI blocks */ | 445 | bool hdmi[RADEON_MAX_HDMI_BLOCKS]; |
453 | bool hdmi[2]; | ||
454 | spinlock_t sw_lock; | 446 | spinlock_t sw_lock; |
455 | int sw_refcount; | 447 | int sw_refcount; |
456 | union radeon_irq_stat_regs stat_regs; | 448 | union radeon_irq_stat_regs stat_regs; |
457 | spinlock_t pflip_lock[6]; | 449 | spinlock_t pflip_lock[RADEON_MAX_CRTCS]; |
458 | int pflip_refcount[6]; | 450 | int pflip_refcount[RADEON_MAX_CRTCS]; |
459 | }; | 451 | }; |
460 | 452 | ||
461 | int radeon_irq_kms_init(struct radeon_device *rdev); | 453 | int radeon_irq_kms_init(struct radeon_device *rdev); |
@@ -533,7 +525,7 @@ struct r600_blit_cp_primitives { | |||
533 | void (*set_vtx_resource)(struct radeon_device *rdev, u64 gpu_addr); | 525 | void (*set_vtx_resource)(struct radeon_device *rdev, u64 gpu_addr); |
534 | void (*set_tex_resource)(struct radeon_device *rdev, | 526 | void (*set_tex_resource)(struct radeon_device *rdev, |
535 | int format, int w, int h, int pitch, | 527 | int format, int w, int h, int pitch, |
536 | u64 gpu_addr); | 528 | u64 gpu_addr, u32 size); |
537 | void (*set_scissors)(struct radeon_device *rdev, int x1, int y1, | 529 | void (*set_scissors)(struct radeon_device *rdev, int x1, int y1, |
538 | int x2, int y2); | 530 | int x2, int y2); |
539 | void (*draw_auto)(struct radeon_device *rdev); | 531 | void (*draw_auto)(struct radeon_device *rdev); |
@@ -1143,10 +1135,11 @@ int radeon_gem_set_tiling_ioctl(struct drm_device *dev, void *data, | |||
1143 | int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data, | 1135 | int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data, |
1144 | struct drm_file *filp); | 1136 | struct drm_file *filp); |
1145 | 1137 | ||
1146 | /* VRAM scratch page for HDP bug */ | 1138 | /* VRAM scratch page for HDP bug, default vram page */ |
1147 | struct r700_vram_scratch { | 1139 | struct r600_vram_scratch { |
1148 | struct radeon_bo *robj; | 1140 | struct radeon_bo *robj; |
1149 | volatile uint32_t *ptr; | 1141 | volatile uint32_t *ptr; |
1142 | u64 gpu_addr; | ||
1150 | }; | 1143 | }; |
1151 | 1144 | ||
1152 | /* | 1145 | /* |
@@ -1218,7 +1211,7 @@ struct radeon_device { | |||
1218 | const struct firmware *rlc_fw; /* r6/700 RLC firmware */ | 1211 | const struct firmware *rlc_fw; /* r6/700 RLC firmware */ |
1219 | const struct firmware *mc_fw; /* NI MC firmware */ | 1212 | const struct firmware *mc_fw; /* NI MC firmware */ |
1220 | struct r600_blit r600_blit; | 1213 | struct r600_blit r600_blit; |
1221 | struct r700_vram_scratch vram_scratch; | 1214 | struct r600_vram_scratch vram_scratch; |
1222 | int msi_enabled; /* msi enabled */ | 1215 | int msi_enabled; /* msi enabled */ |
1223 | struct r600_ih ih; /* r6/700 interrupt ring */ | 1216 | struct r600_ih ih; /* r6/700 interrupt ring */ |
1224 | struct work_struct hotplug_work; | 1217 | struct work_struct hotplug_work; |
@@ -1442,8 +1435,6 @@ void radeon_ring_write(struct radeon_device *rdev, uint32_t v); | |||
1442 | /* AGP */ | 1435 | /* AGP */ |
1443 | extern int radeon_gpu_reset(struct radeon_device *rdev); | 1436 | extern int radeon_gpu_reset(struct radeon_device *rdev); |
1444 | extern void radeon_agp_disable(struct radeon_device *rdev); | 1437 | extern void radeon_agp_disable(struct radeon_device *rdev); |
1445 | extern int radeon_gart_table_vram_pin(struct radeon_device *rdev); | ||
1446 | extern void radeon_gart_restore(struct radeon_device *rdev); | ||
1447 | extern int radeon_modeset_init(struct radeon_device *rdev); | 1438 | extern int radeon_modeset_init(struct radeon_device *rdev); |
1448 | extern void radeon_modeset_fini(struct radeon_device *rdev); | 1439 | extern void radeon_modeset_fini(struct radeon_device *rdev); |
1449 | extern bool radeon_card_posted(struct radeon_device *rdev); | 1440 | extern bool radeon_card_posted(struct radeon_device *rdev); |
@@ -1467,6 +1458,12 @@ extern int radeon_suspend_kms(struct drm_device *dev, pm_message_t state); | |||
1467 | extern void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size); | 1458 | extern void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size); |
1468 | 1459 | ||
1469 | /* | 1460 | /* |
1461 | * R600 vram scratch functions | ||
1462 | */ | ||
1463 | int r600_vram_scratch_init(struct radeon_device *rdev); | ||
1464 | void r600_vram_scratch_fini(struct radeon_device *rdev); | ||
1465 | |||
1466 | /* | ||
1470 | * r600 functions used by radeon_encoder.c | 1467 | * r600 functions used by radeon_encoder.c |
1471 | */ | 1468 | */ |
1472 | extern void r600_hdmi_enable(struct drm_encoder *encoder); | 1469 | extern void r600_hdmi_enable(struct drm_encoder *encoder); |