aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-30 11:03:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-30 11:03:00 -0400
commite15daf6cdf59fd76c0c5d396ccd1426567305750 (patch)
treebd8702d19899673f9363fb83a644f0bd9062057b /drivers/gpu/drm/radeon/radeon.h
parent07892acf37d98bcf1e5f2df9e23d414ded830b61 (diff)
parentf0ed1f655aa0375e2abba84cc4e8e6c853d48555 (diff)
Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (25 commits) drm/radeon/kms: Convert R520 to new init path and associated cleanup drm/radeon/kms: Convert RV515 to new init path and associated cleanup drm: fix radeon DRM warnings when !CONFIG_DEBUG_FS drm: fix drm_fb_helper warning when !CONFIG_MAGIC_SYSRQ drm/r600: fix memory leak introduced with 64k malloc avoidance fix. drm/kms: make fb helper work for all drivers. drm/radeon/r600: fix offset handling in CS parser drm/radeon/kms/r600: fix forcing pci mode on agp cards drm/radeon/kms: fix for the extra pages copying. drm/radeon/kms/r600: add support for vline relocs drm/radeon/kms: fix some bugs in vline reloc drm/radeon/kms/r600: clamp vram to aperture size drm/kms: protect against fb helper not being created. drm/r600: get values from the passed in IB not the copy. drm: create gitignore file for radeon drm/radeon/kms: remove unneeded master create/destroy functions. drm/kms: start adding command line interface using fb. fb: change rules for global rules match. drm/radeon/kms: don't require up to 64k allocations. (v2) drm/radeon/kms: enable dac load detection by default. ... Trivial conflicts in drivers/gpu/drm/radeon/radeon_asic.h due to adding '->vga_set_state' function pointers.
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h76
1 files changed, 75 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 6311b1362594..950b346e343f 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -44,6 +44,24 @@
44 * - TESTING, TESTING, TESTING 44 * - TESTING, TESTING, TESTING
45 */ 45 */
46 46
47/* Initialization path:
48 * We expect that acceleration initialization might fail for various
49 * reasons even thought we work hard to make it works on most
50 * configurations. In order to still have a working userspace in such
51 * situation the init path must succeed up to the memory controller
52 * initialization point. Failure before this point are considered as
53 * fatal error. Here is the init callchain :
54 * radeon_device_init perform common structure, mutex initialization
55 * asic_init setup the GPU memory layout and perform all
56 * one time initialization (failure in this
57 * function are considered fatal)
58 * asic_startup setup the GPU acceleration, in order to
59 * follow guideline the first thing this
60 * function should do is setting the GPU
61 * memory controller (only MC setup failure
62 * are considered as fatal)
63 */
64
47#include <asm/atomic.h> 65#include <asm/atomic.h>
48#include <linux/wait.h> 66#include <linux/wait.h>
49#include <linux/list.h> 67#include <linux/list.h>
@@ -342,7 +360,7 @@ struct radeon_ib {
342 unsigned long idx; 360 unsigned long idx;
343 uint64_t gpu_addr; 361 uint64_t gpu_addr;
344 struct radeon_fence *fence; 362 struct radeon_fence *fence;
345 volatile uint32_t *ptr; 363 uint32_t *ptr;
346 uint32_t length_dw; 364 uint32_t length_dw;
347}; 365};
348 366
@@ -415,7 +433,12 @@ struct radeon_cs_reloc {
415struct radeon_cs_chunk { 433struct radeon_cs_chunk {
416 uint32_t chunk_id; 434 uint32_t chunk_id;
417 uint32_t length_dw; 435 uint32_t length_dw;
436 int kpage_idx[2];
437 uint32_t *kpage[2];
418 uint32_t *kdata; 438 uint32_t *kdata;
439 void __user *user_ptr;
440 int last_copied_page;
441 int last_page_index;
419}; 442};
420 443
421struct radeon_cs_parser { 444struct radeon_cs_parser {
@@ -438,8 +461,38 @@ struct radeon_cs_parser {
438 struct radeon_ib *ib; 461 struct radeon_ib *ib;
439 void *track; 462 void *track;
440 unsigned family; 463 unsigned family;
464 int parser_error;
441}; 465};
442 466
467extern int radeon_cs_update_pages(struct radeon_cs_parser *p, int pg_idx);
468extern int radeon_cs_finish_pages(struct radeon_cs_parser *p);
469
470
471static inline u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
472{
473 struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
474 u32 pg_idx, pg_offset;
475 u32 idx_value = 0;
476 int new_page;
477
478 pg_idx = (idx * 4) / PAGE_SIZE;
479 pg_offset = (idx * 4) % PAGE_SIZE;
480
481 if (ibc->kpage_idx[0] == pg_idx)
482 return ibc->kpage[0][pg_offset/4];
483 if (ibc->kpage_idx[1] == pg_idx)
484 return ibc->kpage[1][pg_offset/4];
485
486 new_page = radeon_cs_update_pages(p, pg_idx);
487 if (new_page < 0) {
488 p->parser_error = new_page;
489 return 0;
490 }
491
492 idx_value = ibc->kpage[new_page][pg_offset/4];
493 return idx_value;
494}
495
443struct radeon_cs_packet { 496struct radeon_cs_packet {
444 unsigned idx; 497 unsigned idx;
445 unsigned type; 498 unsigned type;
@@ -943,6 +996,7 @@ extern void radeon_clocks_fini(struct radeon_device *rdev);
943extern void radeon_scratch_init(struct radeon_device *rdev); 996extern void radeon_scratch_init(struct radeon_device *rdev);
944extern void radeon_surface_init(struct radeon_device *rdev); 997extern void radeon_surface_init(struct radeon_device *rdev);
945extern int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data); 998extern int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data);
999extern void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
946 1000
947/* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ 1001/* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */
948struct r100_mc_save { 1002struct r100_mc_save {
@@ -974,6 +1028,9 @@ extern void r100_vram_init_sizes(struct radeon_device *rdev);
974extern void r100_wb_disable(struct radeon_device *rdev); 1028extern void r100_wb_disable(struct radeon_device *rdev);
975extern void r100_wb_fini(struct radeon_device *rdev); 1029extern void r100_wb_fini(struct radeon_device *rdev);
976extern int r100_wb_init(struct radeon_device *rdev); 1030extern int r100_wb_init(struct radeon_device *rdev);
1031extern void r100_hdp_reset(struct radeon_device *rdev);
1032extern int r100_rb2d_reset(struct radeon_device *rdev);
1033extern int r100_cp_reset(struct radeon_device *rdev);
977 1034
978/* r300,r350,rv350,rv370,rv380 */ 1035/* r300,r350,rv350,rv370,rv380 */
979extern void r300_set_reg_safe(struct radeon_device *rdev); 1036extern void r300_set_reg_safe(struct radeon_device *rdev);
@@ -985,12 +1042,29 @@ extern int rv370_pcie_gart_enable(struct radeon_device *rdev);
985extern void rv370_pcie_gart_disable(struct radeon_device *rdev); 1042extern void rv370_pcie_gart_disable(struct radeon_device *rdev);
986 1043
987/* r420,r423,rv410 */ 1044/* r420,r423,rv410 */
1045extern int r420_mc_init(struct radeon_device *rdev);
988extern u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg); 1046extern u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg);
989extern void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v); 1047extern void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v);
990extern int r420_debugfs_pipes_info_init(struct radeon_device *rdev); 1048extern int r420_debugfs_pipes_info_init(struct radeon_device *rdev);
1049extern void r420_pipes_init(struct radeon_device *rdev);
991 1050
992/* rv515 */ 1051/* rv515 */
1052struct rv515_mc_save {
1053 u32 d1vga_control;
1054 u32 d2vga_control;
1055 u32 vga_render_control;
1056 u32 vga_hdp_control;
1057 u32 d1crtc_control;
1058 u32 d2crtc_control;
1059};
993extern void rv515_bandwidth_avivo_update(struct radeon_device *rdev); 1060extern void rv515_bandwidth_avivo_update(struct radeon_device *rdev);
1061extern void rv515_vga_render_disable(struct radeon_device *rdev);
1062extern void rv515_set_safe_registers(struct radeon_device *rdev);
1063extern void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save);
1064extern void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save);
1065extern void rv515_clock_startup(struct radeon_device *rdev);
1066extern void rv515_debugfs(struct radeon_device *rdev);
1067extern int rv515_suspend(struct radeon_device *rdev);
994 1068
995/* rs690, rs740 */ 1069/* rs690, rs740 */
996extern void rs690_line_buffer_adjust(struct radeon_device *rdev, 1070extern void rs690_line_buffer_adjust(struct radeon_device *rdev,