aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/radeon/r300.c1
-rw-r--r--drivers/gpu/drm/radeon/r520.c1
-rw-r--r--drivers/gpu/drm/radeon/r600.c1
-rw-r--r--drivers/gpu/drm/radeon/r600_cs.c1
-rw-r--r--drivers/gpu/drm/radeon/radeon.h93
-rw-r--r--drivers/gpu/drm/radeon/radeon_share.h116
-rw-r--r--drivers/gpu/drm/radeon/rs400.c1
-rw-r--r--drivers/gpu/drm/radeon/rv515.c1
-rw-r--r--drivers/gpu/drm/radeon/rv770.c1
9 files changed, 84 insertions, 132 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 92f9cb74a7d2..ced3322bd5fb 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -31,7 +31,6 @@
31#include "radeon_reg.h" 31#include "radeon_reg.h"
32#include "radeon.h" 32#include "radeon.h"
33#include "radeon_drm.h" 33#include "radeon_drm.h"
34#include "radeon_share.h"
35#include "r100_track.h" 34#include "r100_track.h"
36#include "r300d.h" 35#include "r300d.h"
37 36
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index ebd6b0f7bdff..0e1686d1c873 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -28,7 +28,6 @@
28#include "drmP.h" 28#include "drmP.h"
29#include "radeon_reg.h" 29#include "radeon_reg.h"
30#include "radeon.h" 30#include "radeon.h"
31#include "radeon_share.h"
32 31
33/* r520,rv530,rv560,rv570,r580 depends on : */ 32/* r520,rv530,rv560,rv570,r580 depends on : */
34void r100_hdp_reset(struct radeon_device *rdev); 33void r100_hdp_reset(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index d8fcef44a69f..1bc25678986b 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -32,7 +32,6 @@
32#include "radeon_drm.h" 32#include "radeon_drm.h"
33#include "radeon.h" 33#include "radeon.h"
34#include "radeon_mode.h" 34#include "radeon_mode.h"
35#include "radeon_share.h"
36#include "r600d.h" 35#include "r600d.h"
37#include "avivod.h" 36#include "avivod.h"
38#include "atom.h" 37#include "atom.h"
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index 39bf6349351b..33b89cd8743e 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -27,7 +27,6 @@
27 */ 27 */
28#include "drmP.h" 28#include "drmP.h"
29#include "radeon.h" 29#include "radeon.h"
30#include "radeon_share.h"
31#include "r600d.h" 30#include "r600d.h"
32#include "avivod.h" 31#include "avivod.h"
33 32
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index e314756dacc3..8cec5bf2922b 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -50,7 +50,6 @@
50#include <linux/kref.h> 50#include <linux/kref.h>
51 51
52#include "radeon_mode.h" 52#include "radeon_mode.h"
53#include "radeon_share.h"
54#include "radeon_reg.h" 53#include "radeon_reg.h"
55 54
56/* 55/*
@@ -640,11 +639,55 @@ struct radeon_asic {
640 void (*bandwidth_update)(struct radeon_device *rdev); 639 void (*bandwidth_update)(struct radeon_device *rdev);
641}; 640};
642 641
642/*
643 * Asic structures
644 */
643struct r100_asic { 645struct r100_asic {
644 const unsigned *reg_safe_bm; 646 const unsigned *reg_safe_bm;
645 unsigned reg_safe_bm_size; 647 unsigned reg_safe_bm_size;
646}; 648};
647 649
650struct r300_asic {
651 const unsigned *reg_safe_bm;
652 unsigned reg_safe_bm_size;
653};
654
655struct r600_asic {
656 unsigned max_pipes;
657 unsigned max_tile_pipes;
658 unsigned max_simds;
659 unsigned max_backends;
660 unsigned max_gprs;
661 unsigned max_threads;
662 unsigned max_stack_entries;
663 unsigned max_hw_contexts;
664 unsigned max_gs_threads;
665 unsigned sx_max_export_size;
666 unsigned sx_max_export_pos_size;
667 unsigned sx_max_export_smx_size;
668 unsigned sq_num_cf_insts;
669};
670
671struct rv770_asic {
672 unsigned max_pipes;
673 unsigned max_tile_pipes;
674 unsigned max_simds;
675 unsigned max_backends;
676 unsigned max_gprs;
677 unsigned max_threads;
678 unsigned max_stack_entries;
679 unsigned max_hw_contexts;
680 unsigned max_gs_threads;
681 unsigned sx_max_export_size;
682 unsigned sx_max_export_pos_size;
683 unsigned sx_max_export_smx_size;
684 unsigned sq_num_cf_insts;
685 unsigned sx_num_of_sets;
686 unsigned sc_prim_fifo_size;
687 unsigned sc_hiz_tile_fifo_size;
688 unsigned sc_earlyz_tile_fifo_fize;
689};
690
648union radeon_asic_config { 691union radeon_asic_config {
649 struct r300_asic r300; 692 struct r300_asic r300;
650 struct r100_asic r100; 693 struct r100_asic r100;
@@ -935,9 +978,14 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
935#define radeon_bandwidth_update(rdev) (rdev)->asic->bandwidth_update((rdev)) 978#define radeon_bandwidth_update(rdev) (rdev)->asic->bandwidth_update((rdev))
936 979
937/* Common functions */ 980/* Common functions */
938int radeon_modeset_init(struct radeon_device *rdev); 981extern int radeon_modeset_init(struct radeon_device *rdev);
939void radeon_modeset_fini(struct radeon_device *rdev); 982extern void radeon_modeset_fini(struct radeon_device *rdev);
940extern bool radeon_card_posted(struct radeon_device *rdev); 983extern bool radeon_card_posted(struct radeon_device *rdev);
984extern int radeon_clocks_init(struct radeon_device *rdev);
985extern void radeon_clocks_fini(struct radeon_device *rdev);
986extern void radeon_scratch_init(struct radeon_device *rdev);
987extern void radeon_surface_init(struct radeon_device *rdev);
988extern int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data);
941 989
942/* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ 990/* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */
943struct r100_mc_save { 991struct r100_mc_save {
@@ -951,10 +999,10 @@ struct r100_mc_save {
951extern void r100_cp_disable(struct radeon_device *rdev); 999extern void r100_cp_disable(struct radeon_device *rdev);
952extern int r100_cp_init(struct radeon_device *rdev, unsigned ring_size); 1000extern int r100_cp_init(struct radeon_device *rdev, unsigned ring_size);
953extern void r100_cp_fini(struct radeon_device *rdev); 1001extern void r100_cp_fini(struct radeon_device *rdev);
954void r100_pci_gart_tlb_flush(struct radeon_device *rdev); 1002extern void r100_pci_gart_tlb_flush(struct radeon_device *rdev);
955int r100_pci_gart_enable(struct radeon_device *rdev); 1003extern int r100_pci_gart_enable(struct radeon_device *rdev);
956void r100_pci_gart_disable(struct radeon_device *rdev); 1004extern void r100_pci_gart_disable(struct radeon_device *rdev);
957int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); 1005extern int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
958extern int r100_debugfs_mc_info_init(struct radeon_device *rdev); 1006extern int r100_debugfs_mc_info_init(struct radeon_device *rdev);
959extern int r100_gui_wait_for_idle(struct radeon_device *rdev); 1007extern int r100_gui_wait_for_idle(struct radeon_device *rdev);
960extern void r100_ib_fini(struct radeon_device *rdev); 1008extern void r100_ib_fini(struct radeon_device *rdev);
@@ -963,6 +1011,7 @@ extern void r100_irq_disable(struct radeon_device *rdev);
963extern int r100_irq_set(struct radeon_device *rdev); 1011extern int r100_irq_set(struct radeon_device *rdev);
964extern void r100_mc_stop(struct radeon_device *rdev, struct r100_mc_save *save); 1012extern void r100_mc_stop(struct radeon_device *rdev, struct r100_mc_save *save);
965extern void r100_mc_resume(struct radeon_device *rdev, struct r100_mc_save *save); 1013extern void r100_mc_resume(struct radeon_device *rdev, struct r100_mc_save *save);
1014extern void r100_vram_init_sizes(struct radeon_device *rdev);
966extern void r100_wb_disable(struct radeon_device *rdev); 1015extern void r100_wb_disable(struct radeon_device *rdev);
967extern void r100_wb_fini(struct radeon_device *rdev); 1016extern void r100_wb_fini(struct radeon_device *rdev);
968extern int r100_wb_init(struct radeon_device *rdev); 1017extern int r100_wb_init(struct radeon_device *rdev);
@@ -974,8 +1023,34 @@ extern void r300_vram_info(struct radeon_device *rdev);
974extern void rv370_pcie_gart_disable(struct radeon_device *rdev); 1023extern void rv370_pcie_gart_disable(struct radeon_device *rdev);
975 1024
976/* r420,r423,rv410 */ 1025/* r420,r423,rv410 */
977u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg); 1026extern u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg);
978void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v); 1027extern void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v);
979extern int r420_debugfs_pipes_info_init(struct radeon_device *rdev); 1028extern int r420_debugfs_pipes_info_init(struct radeon_device *rdev);
980 1029
1030/* rv515 */
1031extern void rv515_bandwidth_avivo_update(struct radeon_device *rdev);
1032
1033/* rs690, rs740 */
1034extern void rs690_line_buffer_adjust(struct radeon_device *rdev,
1035 struct drm_display_mode *mode1,
1036 struct drm_display_mode *mode2);
1037
1038/* r600, rv610, rv630, rv620, rv635, rv670, rs780, rs880 */
1039extern bool r600_card_posted(struct radeon_device *rdev);
1040extern void r600_cp_stop(struct radeon_device *rdev);
1041extern void r600_ring_init(struct radeon_device *rdev, unsigned ring_size);
1042extern int r600_cp_resume(struct radeon_device *rdev);
1043extern int r600_count_pipe_bits(uint32_t val);
1044extern int r600_gart_clear_page(struct radeon_device *rdev, int i);
1045extern int r600_mc_wait_for_idle(struct radeon_device *rdev);
1046extern void r600_pcie_gart_tlb_flush(struct radeon_device *rdev);
1047extern int r600_ib_test(struct radeon_device *rdev);
1048extern int r600_ring_test(struct radeon_device *rdev);
1049extern int r600_wb_init(struct radeon_device *rdev);
1050extern void r600_wb_fini(struct radeon_device *rdev);
1051extern void r600_scratch_init(struct radeon_device *rdev);
1052extern int r600_blit_init(struct radeon_device *rdev);
1053extern void r600_blit_fini(struct radeon_device *rdev);
1054extern int r600_cp_init_microcode(struct radeon_device *rdev);
1055
981#endif 1056#endif
diff --git a/drivers/gpu/drm/radeon/radeon_share.h b/drivers/gpu/drm/radeon/radeon_share.h
deleted file mode 100644
index 5f9e358ab506..000000000000
--- a/drivers/gpu/drm/radeon/radeon_share.h
+++ /dev/null
@@ -1,116 +0,0 @@
1/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
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:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
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.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28#ifndef __RADEON_SHARE_H__
29#define __RADEON_SHARE_H__
30
31/* Common */
32struct radeon_device;
33struct radeon_cs_parser;
34int radeon_clocks_init(struct radeon_device *rdev);
35void radeon_clocks_fini(struct radeon_device *rdev);
36void radeon_scratch_init(struct radeon_device *rdev);
37void radeon_surface_init(struct radeon_device *rdev);
38int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data);
39
40
41/* R100, RV100, RS100, RV200, RS200, R200, RV250, RS300, RV280 */
42void r100_vram_init_sizes(struct radeon_device *rdev);
43
44
45/* R300, R350, RV350, RV380 */
46struct r300_asic {
47 const unsigned *reg_safe_bm;
48 unsigned reg_safe_bm_size;
49};
50
51
52/* RS690, RS740 */
53void rs690_line_buffer_adjust(struct radeon_device *rdev,
54 struct drm_display_mode *mode1,
55 struct drm_display_mode *mode2);
56
57
58/* RV515 */
59void rv515_bandwidth_avivo_update(struct radeon_device *rdev);
60
61
62/* R600, RV610, RV630, RV620, RV635, RV670, RS780, RS880 */
63bool r600_card_posted(struct radeon_device *rdev);
64void r600_cp_stop(struct radeon_device *rdev);
65void r600_ring_init(struct radeon_device *rdev, unsigned ring_size);
66int r600_cp_resume(struct radeon_device *rdev);
67int r600_count_pipe_bits(uint32_t val);
68int r600_gart_clear_page(struct radeon_device *rdev, int i);
69int r600_mc_wait_for_idle(struct radeon_device *rdev);
70void r600_pcie_gart_tlb_flush(struct radeon_device *rdev);
71int r600_ib_test(struct radeon_device *rdev);
72int r600_ring_test(struct radeon_device *rdev);
73int r600_wb_init(struct radeon_device *rdev);
74void r600_wb_fini(struct radeon_device *rdev);
75void r600_scratch_init(struct radeon_device *rdev);
76int r600_blit_init(struct radeon_device *rdev);
77void r600_blit_fini(struct radeon_device *rdev);
78int r600_cp_init_microcode(struct radeon_device *rdev);
79struct r600_asic {
80 unsigned max_pipes;
81 unsigned max_tile_pipes;
82 unsigned max_simds;
83 unsigned max_backends;
84 unsigned max_gprs;
85 unsigned max_threads;
86 unsigned max_stack_entries;
87 unsigned max_hw_contexts;
88 unsigned max_gs_threads;
89 unsigned sx_max_export_size;
90 unsigned sx_max_export_pos_size;
91 unsigned sx_max_export_smx_size;
92 unsigned sq_num_cf_insts;
93};
94
95/* RV770, RV7300, RV710 */
96struct rv770_asic {
97 unsigned max_pipes;
98 unsigned max_tile_pipes;
99 unsigned max_simds;
100 unsigned max_backends;
101 unsigned max_gprs;
102 unsigned max_threads;
103 unsigned max_stack_entries;
104 unsigned max_hw_contexts;
105 unsigned max_gs_threads;
106 unsigned sx_max_export_size;
107 unsigned sx_max_export_pos_size;
108 unsigned sx_max_export_smx_size;
109 unsigned sq_num_cf_insts;
110 unsigned sx_num_of_sets;
111 unsigned sc_prim_fifo_size;
112 unsigned sc_hiz_tile_fifo_size;
113 unsigned sc_earlyz_tile_fifo_fize;
114};
115
116#endif
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index 8c3ea7e36060..e1e4ce427828 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -29,7 +29,6 @@
29#include <drm/drmP.h> 29#include <drm/drmP.h>
30#include "radeon_reg.h" 30#include "radeon_reg.h"
31#include "radeon.h" 31#include "radeon.h"
32#include "radeon_share.h"
33 32
34/* rs400,rs480 depends on : */ 33/* rs400,rs480 depends on : */
35void r100_hdp_reset(struct radeon_device *rdev); 34void r100_hdp_reset(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 99e397f16384..03d490269ed0 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -29,7 +29,6 @@
29#include "drmP.h" 29#include "drmP.h"
30#include "rv515d.h" 30#include "rv515d.h"
31#include "radeon.h" 31#include "radeon.h"
32#include "radeon_share.h"
33 32
34#include "rv515_reg_safe.h" 33#include "rv515_reg_safe.h"
35/* rv515 depends on : */ 34/* rv515 depends on : */
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 57765f6d5b20..5ba5204091ec 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -29,7 +29,6 @@
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include "drmP.h" 30#include "drmP.h"
31#include "radeon.h" 31#include "radeon.h"
32#include "radeon_share.h"
33#include "rv770d.h" 32#include "rv770d.h"
34#include "avivod.h" 33#include "avivod.h"
35#include "atom.h" 34#include "atom.h"