aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h57
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;
93extern int radeon_disp_priority; 93extern int radeon_disp_priority;
94extern int radeon_hw_i2c; 94extern int radeon_hw_i2c;
95extern int radeon_pcie_gen2; 95extern int radeon_pcie_gen2;
96extern 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 */
307struct radeon_mc; 308struct radeon_mc;
308 309
309struct radeon_gart_table_ram {
310 volatile uint32_t *ptr;
311};
312
313struct radeon_gart_table_vram {
314 struct radeon_bo *robj;
315 volatile uint32_t *ptr;
316};
317
318union 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
327struct radeon_gart { 314struct 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);
340void radeon_gart_table_ram_free(struct radeon_device *rdev); 328void radeon_gart_table_ram_free(struct radeon_device *rdev);
341int radeon_gart_table_vram_alloc(struct radeon_device *rdev); 329int radeon_gart_table_vram_alloc(struct radeon_device *rdev);
342void radeon_gart_table_vram_free(struct radeon_device *rdev); 330void radeon_gart_table_vram_free(struct radeon_device *rdev);
331int radeon_gart_table_vram_pin(struct radeon_device *rdev);
332void radeon_gart_table_vram_unpin(struct radeon_device *rdev);
343int radeon_gart_init(struct radeon_device *rdev); 333int radeon_gart_init(struct radeon_device *rdev);
344void radeon_gart_fini(struct radeon_device *rdev); 334void radeon_gart_fini(struct radeon_device *rdev);
345void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, 335void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset,
@@ -347,6 +337,7 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset,
347int radeon_gart_bind(struct radeon_device *rdev, unsigned offset, 337int 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);
340void 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
440struct radeon_irq { 435struct 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
461int radeon_irq_kms_init(struct radeon_device *rdev); 453int 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,
1143int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data, 1135int 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 */
1147struct r700_vram_scratch { 1139struct 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 */
1443extern int radeon_gpu_reset(struct radeon_device *rdev); 1436extern int radeon_gpu_reset(struct radeon_device *rdev);
1444extern void radeon_agp_disable(struct radeon_device *rdev); 1437extern void radeon_agp_disable(struct radeon_device *rdev);
1445extern int radeon_gart_table_vram_pin(struct radeon_device *rdev);
1446extern void radeon_gart_restore(struct radeon_device *rdev);
1447extern int radeon_modeset_init(struct radeon_device *rdev); 1438extern int radeon_modeset_init(struct radeon_device *rdev);
1448extern void radeon_modeset_fini(struct radeon_device *rdev); 1439extern void radeon_modeset_fini(struct radeon_device *rdev);
1449extern bool radeon_card_posted(struct radeon_device *rdev); 1440extern 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);
1467extern void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size); 1458extern void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size);
1468 1459
1469/* 1460/*
1461 * R600 vram scratch functions
1462 */
1463int r600_vram_scratch_init(struct radeon_device *rdev);
1464void 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 */
1472extern void r600_hdmi_enable(struct drm_encoder *encoder); 1469extern void r600_hdmi_enable(struct drm_encoder *encoder);