Skip to contentSkip to conversation

cleanup radeon_asic.h

PATCH In review Daniel Vetter 6 participants 25 messages Mar 11, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover cleanup radeon_asic.h

Hi all,

This patch pile moves the "static struct radeon_asic <asic>" definitions form radeon_asic.h into the asic-specific files, where I think they belong. This way radeon_asic.h becomes a real header file that can be #included. And indeed, with all the copy&pasting of function declarations, one has gotten out of sync.

The next step would be to collect asic specific declarations in radeon_asic.h - atm they are somewhat scattered. But this can easily be done on the go and has way too much potential for conflicts with other patches. So I didn't do this.

Tested on my rv570.

Comments higly welcome.

Yours, Daniel

Daniel Vetter (14):
drm/radoen: move r100 asic struct to r100.c
drm/radoen: move r200 asic struct to r200.c
drm/radeon: move r300 asic structs to r300.c
drm/radeon: move r420 asic struct to r420.c
drm/radoen: move rs400 asic struct to rs400.c
drm/radoen: move rs600 asic struct to rs600.c
drm/radoen: move rs690 asic struct to rs690.c
drm/radoen: move rv515 asic struct to rv515.c
drm/radoen: move r520 asic struct to r520.c
drm/radoen: move r600 asic struct to r600.c
drm/radoen: move rv770 asic struct to rv770.c
drm/radoen: move evergreen asic struct to evergreen.c drm/radoen: unconfuse return value of radeon_asic->clear_surface_reg drm/radeon: include radeon_asic.h in <asic>.c

 drivers/gpu/drm/radeon/evergreen.c   |   39 +++-
 drivers/gpu/drm/radeon/r100.c        |   39 +++
 drivers/gpu/drm/radeon/r200.c        |   38 +++
 drivers/gpu/drm/radeon/r300.c        |   76 ++++++
 drivers/gpu/drm/radeon/r420.c        |   39 +++
 drivers/gpu/drm/radeon/r520.c        |   39 +++
 drivers/gpu/drm/radeon/r600.c        |   43 +++-
 drivers/gpu/drm/radeon/radeon.h      |    3 +-
 drivers/gpu/drm/radeon/radeon_asic.h |  494 ++--------------------------------
 drivers/gpu/drm/radeon/rs400.c       |   39 +++
 drivers/gpu/drm/radeon/rs600.c       |   43 +++-
 drivers/gpu/drm/radeon/rs690.c       |   39 +++
 drivers/gpu/drm/radeon/rv515.c       |   41 +++-
 drivers/gpu/drm/radeon/rv770.c       |   42 +++-
 14 files changed, 518 insertions(+), 496 deletions(-)

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--

#1 lore raw

PATCH 1/14 drm/radoen: move r100 asic struct to r100.c

This is the first step to clean up radeon_asic.h and make it into a real header file (i.e. kill the static struct definitions). Then it can be included by the <asic>.c files to compile-check the declarations of shared functions (some differ atm).

This first patch just moves the r100_asic struct to r100.c

To accomplish this, the declarations for a few shared functions had to be moved from radeon_asic.h to radeon.h. They'll move back when this cleanup is complete.

---
 drivers/gpu/drm/radeon/r100.c        |   38 ++++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon.h      |   13 ++++++++
 drivers/gpu/drm/radeon/radeon_asic.h |   52 +---------------------------------
 3 files changed, 52 insertions(+), 51 deletions(-)
drivers/gpu/drm/radeon/r100.c +38 -0
index 91eb762..facf3d8 100644
@@ -3538,3 +3538,41 @@ int r100_init(struct radeon_device *rdev)
 	}
 	return 0;
 }
+
+struct radeon_asic r100_asic = {
+	.init = &r100_init,
+	.fini = &r100_fini,
+	.suspend = &r100_suspend,
+	.resume = &r100_resume,
+	.vga_set_state = &r100_vga_set_state,
+	.gpu_reset = &r100_gpu_reset,
+	.gart_tlb_flush = &r100_pci_gart_tlb_flush,
+	.gart_set_page = &r100_pci_gart_set_page,
+	.cp_commit = &r100_cp_commit,
+	.ring_start = &r100_ring_start,
+	.ring_test = &r100_ring_test,
+	.ring_ib_execute = &r100_ring_ib_execute,
+	.irq_set = &r100_irq_set,
+	.irq_process = &r100_irq_process,
+	.get_vblank_counter = &r100_get_vblank_counter,
+	.fence_ring_emit = &r100_fence_ring_emit,
+	.cs_parse = &r100_cs_parse,
+	.copy_blit = &r100_copy_blit,
+	.copy_dma = NULL,
+	.copy = &r100_copy_blit,
+	.get_engine_clock = &radeon_legacy_get_engine_clock,
+	.set_engine_clock = &radeon_legacy_set_engine_clock,
+	.get_memory_clock = &radeon_legacy_get_memory_clock,
+	.set_memory_clock = NULL,
+	.get_pcie_lanes = NULL,
+	.set_pcie_lanes = NULL,
+	.set_clock_gating = &radeon_legacy_set_clock_gating,
+	.set_surface_reg = r100_set_surface_reg,
+	.clear_surface_reg = r100_clear_surface_reg,
+	.bandwidth_update = &r100_bandwidth_update,
+	.hpd_init = &r100_hpd_init,
+	.hpd_fini = &r100_hpd_fini,
+	.hpd_sense = &r100_hpd_sense,
+	.hpd_set_polarity = &r100_hpd_set_polarity,
+	.ioctl_wait_idle = NULL,
+};
drivers/gpu/drm/radeon/radeon.h +13 -0
index 829e26e..bf5a2e6 100644
@@ -862,6 +862,19 @@ union radeon_asic_config {
 	struct rv770_asic	rv770;
 };
 
+/* WIP: Declarations from radeon_asic.h
+ * These will move back to radeon_asic.h as soon as it has morphed into
+ * a real header. */
+uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev);
+void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
+uint32_t radeon_legacy_get_memory_clock(struct radeon_device *rdev);
+void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable);
+
+uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev);
+void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
+uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev);
+void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock);
+void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
 
 /*
  * IOCTL.
drivers/gpu/drm/radeon/radeon_asic.h +1 -51

64 lines not on this page · raw message

Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#2 lore raw

PATCH 2/14 drm/radoen: move r200 asic struct to r200.c

In reply to Daniel Vetter

Like for the r100.

Because radeon_asic.h is not yet usable as a header file, I had to copy a few shared function declarations into r200.c. Yes, this is ugly but not actually worse than current state. And it'll all be gone when this header untangling is done.

---
 drivers/gpu/drm/radeon/r200.c        |   71 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon_asic.h |   37 +-----------------
 2 files changed, 72 insertions(+), 36 deletions(-)
drivers/gpu/drm/radeon/r200.c +71 -0
index 1146c99..7dfeab3 100644
@@ -507,3 +507,74 @@ void r200_set_safe_registers(struct radeon_device *rdev)
 	rdev->config.r100.reg_safe_bm = r200_reg_safe_bm;
 	rdev->config.r100.reg_safe_bm_size = ARRAY_SIZE(r200_reg_safe_bm);
 }
+
+extern int r100_init(struct radeon_device *rdev);
+extern void r100_fini(struct radeon_device *rdev);
+extern int r100_suspend(struct radeon_device *rdev);
+extern int r100_resume(struct radeon_device *rdev);
+void r100_vga_set_state(struct radeon_device *rdev, bool state);
+int r100_gpu_reset(struct radeon_device *rdev);
+void r100_pci_gart_tlb_flush(struct radeon_device *rdev);
+int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
+void r100_cp_commit(struct radeon_device *rdev);
+void r100_ring_start(struct radeon_device *rdev);
+int r100_ring_test(struct radeon_device *rdev);
+void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
+int r100_irq_set(struct radeon_device *rdev);
+int r100_irq_process(struct radeon_device *rdev);
+u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
+void r100_fence_ring_emit(struct radeon_device *rdev,
+			  struct radeon_fence *fence);
+int r100_cs_parse(struct radeon_cs_parser *p);
+int r100_copy_blit(struct radeon_device *rdev,
+		   uint64_t src_offset,
+		   uint64_t dst_offset,
+		   unsigned num_pages,
+		   struct radeon_fence *fence);
+int r100_set_surface_reg(struct radeon_device *rdev, int reg,
+			 uint32_t tiling_flags, uint32_t pitch,
+			 uint32_t offset, uint32_t obj_size);
+int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
+void r100_bandwidth_update(struct radeon_device *rdev);
+void r100_hpd_init(struct radeon_device *rdev);
+void r100_hpd_fini(struct radeon_device *rdev);
+bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
+void r100_hpd_set_polarity(struct radeon_device *rdev,
+			   enum radeon_hpd_id hpd);
+
+struct radeon_asic r200_asic = {
+	.init = &r100_init,
+	.fini = &r100_fini,
+	.suspend = &r100_suspend,
+	.resume = &r100_resume,
+	.vga_set_state = &r100_vga_set_state,
+	.gpu_reset = &r100_gpu_reset,
+	.gart_tlb_flush = &r100_pci_gart_tlb_flush,
+	.gart_set_page = &r100_pci_gart_set_page,
+	.cp_commit = &r100_cp_commit,
+	.ring_start = &r100_ring_start,
+	.ring_test = &r100_ring_test,
+	.ring_ib_execute = &r100_ring_ib_execute,
+	.irq_set = &r100_irq_set,
+	.irq_process = &r100_irq_process,
+	.get_vblank_counter = &r100_get_vblank_counter,
+	.fence_ring_emit = &r100_fence_ring_emit,
+	.cs_parse = &r100_cs_parse,
+	.copy_blit = &r100_copy_blit,
+	.copy_dma = &r200_copy_dma,
+	.copy = &r100_copy_blit,
+	.get_engine_clock = &radeon_legacy_get_engine_clock,
+	.set_engine_clock = &radeon_legacy_set_engine_clock,
+	.get_memory_clock = &radeon_legacy_get_memory_clock,
+	.set_memory_clock = NULL,
+	.set_pcie_lanes = NULL,
+	.set_clock_gating = &radeon_legacy_set_clock_gating,
+	.set_surface_reg = r100_set_surface_reg,
+	.clear_surface_reg = r100_clear_surface_reg,
+	.bandwidth_update = &r100_bandwidth_update,
+	.hpd_init = &r100_hpd_init,
+	.hpd_fini = &r100_hpd_fini,
+	.hpd_sense = &r100_hpd_sense,
+	.hpd_set_polarity = &r100_hpd_set_polarity,
+	.ioctl_wait_idle = NULL,
+};
drivers/gpu/drm/radeon/radeon_asic.h +1 -36
index a2b4bd4..e2378ce 100644
@@ -79,43 +79,8 @@ extern int r200_copy_dma(struct radeon_device *rdev,
 			uint64_t dst_offset,
 			unsigned num_pages,
 			struct radeon_fence *fence);
-static struct radeon_asic r200_asic = {
-	.init = &r100_init,
-	.fini = &r100_fini,
-	.suspend = &r100_suspend,
-	.resume = &r100_resume,
-	.vga_set_state = &r100_vga_set_state,
-	.gpu_reset = &r100_gpu_reset,
-	.gart_tlb_flush = &r100_pci_gart_tlb_flush,
-	.gart_set_page = &r100_pci_gart_set_page,
-	.cp_commit = &r100_cp_commit,
-	.ring_start = &r100_ring_start,
-	.ring_test = &r100_ring_test,
-	.ring_ib_execute = &r100_ring_ib_execute,
-	.irq_set = &r100_irq_set,
-	.irq_process = &r100_irq_process,
-	.get_vblank_counter = &r100_get_vblank_counter,
-	.fence_ring_emit = &r100_fence_ring_emit,
-	.cs_parse = &r100_cs_parse,
-	.copy_blit = &r100_copy_blit,
-	.copy_dma = &r200_copy_dma,
-	.copy = &r100_copy_blit,
-	.get_engine_clock = &radeon_legacy_get_engine_clock,
-	.set_engine_clock = &radeon_legacy_set_engine_clock,
-	.get_memory_clock = &radeon_legacy_get_memory_clock,
-	.set_memory_clock = NULL,
-	.set_pcie_lanes = NULL,
-	.set_clock_gating = &radeon_legacy_set_clock_gating,
-	.set_surface_reg = r100_set_surface_reg,
-	.clear_surface_reg = r100_clear_surface_reg,
-	.bandwidth_update = &r100_bandwidth_update,
-	.hpd_init = &r100_hpd_init,
-	.hpd_fini = &r100_hpd_fini,
-	.hpd_sense = &r100_hpd_sense,
-	.hpd_set_polarity = &r100_hpd_set_polarity,
-	.ioctl_wait_idle = NULL,
-};
 
+extern struct radeon_asic r200_asic;
 
 /*
  * r300,r350,rv350,rv380
Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#3 lore raw

PATCH 3/14 drm/radeon: move r300 asic structs to r300.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/r300.c        |  105 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon_asic.h |   76 +------------------------
 2 files changed, 107 insertions(+), 74 deletions(-)
drivers/gpu/drm/radeon/r300.c +105 -0
index 4cef90c..2592ba6 100644
@@ -1440,3 +1440,108 @@ int r300_init(struct radeon_device *rdev)
 	}
 	return 0;
 }
+
+void r100_vga_set_state(struct radeon_device *rdev, bool state);
+void r100_pci_gart_tlb_flush(struct radeon_device *rdev);
+int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
+void r100_cp_commit(struct radeon_device *rdev);
+int r100_ring_test(struct radeon_device *rdev);
+void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
+int r100_irq_set(struct radeon_device *rdev);
+int r100_irq_process(struct radeon_device *rdev);
+u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
+int r100_copy_blit(struct radeon_device *rdev,
+		   uint64_t src_offset,
+		   uint64_t dst_offset,
+		   unsigned num_pages,
+		   struct radeon_fence *fence);
+int r100_set_surface_reg(struct radeon_device *rdev, int reg,
+			 uint32_t tiling_flags, uint32_t pitch,
+			 uint32_t offset, uint32_t obj_size);
+int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
+void r100_bandwidth_update(struct radeon_device *rdev);
+void r100_hpd_init(struct radeon_device *rdev);
+void r100_hpd_fini(struct radeon_device *rdev);
+bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
+void r100_hpd_set_polarity(struct radeon_device *rdev,
+			   enum radeon_hpd_id hpd);
+extern int r200_copy_dma(struct radeon_device *rdev,
+			uint64_t src_offset,
+			uint64_t dst_offset,
+			unsigned num_pages,
+			struct radeon_fence *fence);
+
+struct radeon_asic r300_asic = {
+	.init = &r300_init,
+	.fini = &r300_fini,
+	.suspend = &r300_suspend,
+	.resume = &r300_resume,
+	.vga_set_state = &r100_vga_set_state,
+	.gpu_reset = &r300_gpu_reset,
+	.gart_tlb_flush = &r100_pci_gart_tlb_flush,
+	.gart_set_page = &r100_pci_gart_set_page,
+	.cp_commit = &r100_cp_commit,
+	.ring_start = &r300_ring_start,
+	.ring_test = &r100_ring_test,
+	.ring_ib_execute = &r100_ring_ib_execute,
+	.irq_set = &r100_irq_set,
+	.irq_process = &r100_irq_process,
+	.get_vblank_counter = &r100_get_vblank_counter,
+	.fence_ring_emit = &r300_fence_ring_emit,
+	.cs_parse = &r300_cs_parse,
+	.copy_blit = &r100_copy_blit,
+	.copy_dma = &r200_copy_dma,
+	.copy = &r100_copy_blit,
+	.get_engine_clock = &radeon_legacy_get_engine_clock,
+	.set_engine_clock = &radeon_legacy_set_engine_clock,
+	.get_memory_clock = &radeon_legacy_get_memory_clock,
+	.set_memory_clock = NULL,
+	.get_pcie_lanes = &rv370_get_pcie_lanes,
+	.set_pcie_lanes = &rv370_set_pcie_lanes,
+	.set_clock_gating = &radeon_legacy_set_clock_gating,
+	.set_surface_reg = r100_set_surface_reg,
+	.clear_surface_reg = r100_clear_surface_reg,
+	.bandwidth_update = &r100_bandwidth_update,
+	.hpd_init = &r100_hpd_init,
+	.hpd_fini = &r100_hpd_fini,
+	.hpd_sense = &r100_hpd_sense,
+	.hpd_set_polarity = &r100_hpd_set_polarity,
+	.ioctl_wait_idle = NULL,
+};
+
+struct radeon_asic r300_asic_pcie = {
+	.init = &r300_init,
+	.fini = &r300_fini,
+	.suspend = &r300_suspend,
+	.resume = &r300_resume,
+	.vga_set_state = &r100_vga_set_state,
+	.gpu_reset = &r300_gpu_reset,
+	.gart_tlb_flush = &rv370_pcie_gart_tlb_flush,
+	.gart_set_page = &rv370_pcie_gart_set_page,
+	.cp_commit = &r100_cp_commit,
+	.ring_start = &r300_ring_start,
+	.ring_test = &r100_ring_test,
+	.ring_ib_execute = &r100_ring_ib_execute,
+	.irq_set = &r100_irq_set,
+	.irq_process = &r100_irq_process,
+	.get_vblank_counter = &r100_get_vblank_counter,
+	.fence_ring_emit = &r300_fence_ring_emit,
+	.cs_parse = &r300_cs_parse,
+	.copy_blit = &r100_copy_blit,
+	.copy_dma = &r200_copy_dma,
+	.copy = &r100_copy_blit,
+	.get_engine_clock = &radeon_legacy_get_engine_clock,
+	.set_engine_clock = &radeon_legacy_set_engine_clock,
+	.get_memory_clock = &radeon_legacy_get_memory_clock,
+	.set_memory_clock = NULL,
+	.set_pcie_lanes = &rv370_set_pcie_lanes,
+	.set_clock_gating = &radeon_legacy_set_clock_gating,
+	.set_surface_reg = r100_set_surface_reg,
+	.clear_surface_reg = r100_clear_surface_reg,
+	.bandwidth_update = &r100_bandwidth_update,
+	.hpd_init = &r100_hpd_init,
+	.hpd_fini = &r100_hpd_fini,
+	.hpd_sense = &r100_hpd_sense,
+	.hpd_set_polarity = &r100_hpd_set_polarity,
+	.ioctl_wait_idle = NULL,
+};
drivers/gpu/drm/radeon/radeon_asic.h +2 -74

83 lines not on this page · raw message

Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#4 lore raw

PATCH 4/14 drm/radeon: move r420 asic struct to r420.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/r420.c        |   75 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon_asic.h |   39 +-----------------
 2 files changed, 77 insertions(+), 37 deletions(-)
drivers/gpu/drm/radeon/r420.c +75 -0
index c7593b8..2488edb 100644
@@ -417,3 +417,78 @@ int r420_debugfs_pipes_info_init(struct radeon_device *rdev)
 	return 0;
 #endif
 }
+
+void r100_vga_set_state(struct radeon_device *rdev, bool state);
+void r100_cp_commit(struct radeon_device *rdev);
+int r100_ring_test(struct radeon_device *rdev);
+void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
+int r100_irq_set(struct radeon_device *rdev);
+int r100_irq_process(struct radeon_device *rdev);
+u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
+int r100_copy_blit(struct radeon_device *rdev,
+		   uint64_t src_offset,
+		   uint64_t dst_offset,
+		   unsigned num_pages,
+		   struct radeon_fence *fence);
+int r100_set_surface_reg(struct radeon_device *rdev, int reg,
+			 uint32_t tiling_flags, uint32_t pitch,
+			 uint32_t offset, uint32_t obj_size);
+int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
+void r100_bandwidth_update(struct radeon_device *rdev);
+void r100_hpd_init(struct radeon_device *rdev);
+void r100_hpd_fini(struct radeon_device *rdev);
+bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
+void r100_hpd_set_polarity(struct radeon_device *rdev,
+			   enum radeon_hpd_id hpd);
+extern int r200_copy_dma(struct radeon_device *rdev,
+			uint64_t src_offset,
+			uint64_t dst_offset,
+			unsigned num_pages,
+			struct radeon_fence *fence);
+extern void r300_ring_start(struct radeon_device *rdev);
+extern void r300_fence_ring_emit(struct radeon_device *rdev,
+				struct radeon_fence *fence);
+extern int r300_cs_parse(struct radeon_cs_parser *p);
+extern void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev);
+extern int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
+extern void rv370_set_pcie_lanes(struct radeon_device *rdev, int lanes);
+extern int rv370_get_pcie_lanes(struct radeon_device *rdev);
+extern int r300_gpu_reset(struct radeon_device *rdev);
+
+struct radeon_asic r420_asic = {
+	.init = &r420_init,
+	.fini = &r420_fini,
+	.suspend = &r420_suspend,
+	.resume = &r420_resume,
+	.vga_set_state = &r100_vga_set_state,
+	.gpu_reset = &r300_gpu_reset,
+	.gart_tlb_flush = &rv370_pcie_gart_tlb_flush,
+	.gart_set_page = &rv370_pcie_gart_set_page,
+	.cp_commit = &r100_cp_commit,
+	.ring_start = &r300_ring_start,
+	.ring_test = &r100_ring_test,
+	.ring_ib_execute = &r100_ring_ib_execute,
+	.irq_set = &r100_irq_set,
+	.irq_process = &r100_irq_process,
+	.get_vblank_counter = &r100_get_vblank_counter,
+	.fence_ring_emit = &r300_fence_ring_emit,
+	.cs_parse = &r300_cs_parse,
+	.copy_blit = &r100_copy_blit,
+	.copy_dma = &r200_copy_dma,
+	.copy = &r100_copy_blit,
+	.get_engine_clock = &radeon_atom_get_engine_clock,
+	.set_engine_clock = &radeon_atom_set_engine_clock,
+	.get_memory_clock = &radeon_atom_get_memory_clock,
+	.set_memory_clock = &radeon_atom_set_memory_clock,
+	.get_pcie_lanes = &rv370_get_pcie_lanes,
+	.set_pcie_lanes = &rv370_set_pcie_lanes,
+	.set_clock_gating = &radeon_atom_set_clock_gating,
+	.set_surface_reg = r100_set_surface_reg,
+	.clear_surface_reg = r100_clear_surface_reg,
+	.bandwidth_update = &r100_bandwidth_update,
+	.hpd_init = &r100_hpd_init,
+	.hpd_fini = &r100_hpd_fini,
+	.hpd_sense = &r100_hpd_sense,
+	.hpd_set_polarity = &r100_hpd_set_polarity,
+	.ioctl_wait_idle = NULL,
+};
drivers/gpu/drm/radeon/radeon_asic.h +2 -37
index f93f8f7..ff408ff 100644
@@ -112,43 +112,8 @@ extern int r420_init(struct radeon_device *rdev);
 extern void r420_fini(struct radeon_device *rdev);
 extern int r420_suspend(struct radeon_device *rdev);
 extern int r420_resume(struct radeon_device *rdev);
-static struct radeon_asic r420_asic = {
-	.init = &r420_init,
-	.fini = &r420_fini,
-	.suspend = &r420_suspend,
-	.resume = &r420_resume,
-	.vga_set_state = &r100_vga_set_state,
-	.gpu_reset = &r300_gpu_reset,
-	.gart_tlb_flush = &rv370_pcie_gart_tlb_flush,
-	.gart_set_page = &rv370_pcie_gart_set_page,
-	.cp_commit = &r100_cp_commit,
-	.ring_start = &r300_ring_start,
-	.ring_test = &r100_ring_test,
-	.ring_ib_execute = &r100_ring_ib_execute,
-	.irq_set = &r100_irq_set,
-	.irq_process = &r100_irq_process,
-	.get_vblank_counter = &r100_get_vblank_counter,
-	.fence_ring_emit = &r300_fence_ring_emit,
-	.cs_parse = &r300_cs_parse,
-	.copy_blit = &r100_copy_blit,
-	.copy_dma = &r200_copy_dma,
-	.copy = &r100_copy_blit,
-	.get_engine_clock = &radeon_atom_get_engine_clock,
-	.set_engine_clock = &radeon_atom_set_engine_clock,
-	.get_memory_clock = &radeon_atom_get_memory_clock,
-	.set_memory_clock = &radeon_atom_set_memory_clock,
-	.get_pcie_lanes = &rv370_get_pcie_lanes,
-	.set_pcie_lanes = &rv370_set_pcie_lanes,
-	.set_clock_gating = &radeon_atom_set_clock_gating,
-	.set_surface_reg = r100_set_surface_reg,
-	.clear_surface_reg = r100_clear_surface_reg,
-	.bandwidth_update = &r100_bandwidth_update,
-	.hpd_init = &r100_hpd_init,
-	.hpd_fini = &r100_hpd_fini,
-	.hpd_sense = &r100_hpd_sense,
-	.hpd_set_polarity = &r100_hpd_set_polarity,
-	.ioctl_wait_idle = NULL,
-};
+
+extern struct radeon_asic r420_asic;
 
 
 /*
Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#5 lore raw

PATCH 5/14 drm/radoen: move rs400 asic struct to rs400.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/radeon_asic.h |   38 +-----------------
 drivers/gpu/drm/radeon/rs400.c       |   72 ++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 37 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.h +1 -37
index ff408ff..5671417 100644
@@ -127,44 +127,8 @@ void rs400_gart_tlb_flush(struct radeon_device *rdev);
 int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
 uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg);
 void rs400_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
-static struct radeon_asic rs400_asic = {
-	.init = &rs400_init,
-	.fini = &rs400_fini,
-	.suspend = &rs400_suspend,
-	.resume = &rs400_resume,
-	.vga_set_state = &r100_vga_set_state,
-	.gpu_reset = &r300_gpu_reset,
-	.gart_tlb_flush = &rs400_gart_tlb_flush,
-	.gart_set_page = &rs400_gart_set_page,
-	.cp_commit = &r100_cp_commit,
-	.ring_start = &r300_ring_start,
-	.ring_test = &r100_ring_test,
-	.ring_ib_execute = &r100_ring_ib_execute,
-	.irq_set = &r100_irq_set,
-	.irq_process = &r100_irq_process,
-	.get_vblank_counter = &r100_get_vblank_counter,
-	.fence_ring_emit = &r300_fence_ring_emit,
-	.cs_parse = &r300_cs_parse,
-	.copy_blit = &r100_copy_blit,
-	.copy_dma = &r200_copy_dma,
-	.copy = &r100_copy_blit,
-	.get_engine_clock = &radeon_legacy_get_engine_clock,
-	.set_engine_clock = &radeon_legacy_set_engine_clock,
-	.get_memory_clock = &radeon_legacy_get_memory_clock,
-	.set_memory_clock = NULL,
-	.get_pcie_lanes = NULL,
-	.set_pcie_lanes = NULL,
-	.set_clock_gating = &radeon_legacy_set_clock_gating,
-	.set_surface_reg = r100_set_surface_reg,
-	.clear_surface_reg = r100_clear_surface_reg,
-	.bandwidth_update = &r100_bandwidth_update,
-	.hpd_init = &r100_hpd_init,
-	.hpd_fini = &r100_hpd_fini,
-	.hpd_sense = &r100_hpd_sense,
-	.hpd_set_polarity = &r100_hpd_set_polarity,
-	.ioctl_wait_idle = NULL,
-};
 
+extern struct radeon_asic rs400_asic;
 
 /*
  * rs600.
drivers/gpu/drm/radeon/rs400.c +72 -0

75 lines not on this page · raw message

Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#6 lore raw

PATCH 6/14 drm/radoen: move rs600 asic struct to rs600.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/radeon_asic.h |   39 +--------------------
 drivers/gpu/drm/radeon/rs600.c       |   63 ++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+), 38 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.h +1 -38
index 5671417..2de7e08 100644
@@ -151,44 +151,7 @@ bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
 void rs600_hpd_set_polarity(struct radeon_device *rdev,
 			    enum radeon_hpd_id hpd);
 
-static struct radeon_asic rs600_asic = {
-	.init = &rs600_init,
-	.fini = &rs600_fini,
-	.suspend = &rs600_suspend,
-	.resume = &rs600_resume,
-	.vga_set_state = &r100_vga_set_state,
-	.gpu_reset = &r300_gpu_reset,
-	.gart_tlb_flush = &rs600_gart_tlb_flush,
-	.gart_set_page = &rs600_gart_set_page,
-	.cp_commit = &r100_cp_commit,
-	.ring_start = &r300_ring_start,
-	.ring_test = &r100_ring_test,
-	.ring_ib_execute = &r100_ring_ib_execute,
-	.irq_set = &rs600_irq_set,
-	.irq_process = &rs600_irq_process,
-	.get_vblank_counter = &rs600_get_vblank_counter,
-	.fence_ring_emit = &r300_fence_ring_emit,
-	.cs_parse = &r300_cs_parse,
-	.copy_blit = &r100_copy_blit,
-	.copy_dma = &r200_copy_dma,
-	.copy = &r100_copy_blit,
-	.get_engine_clock = &radeon_atom_get_engine_clock,
-	.set_engine_clock = &radeon_atom_set_engine_clock,
-	.get_memory_clock = &radeon_atom_get_memory_clock,
-	.set_memory_clock = &radeon_atom_set_memory_clock,
-	.get_pcie_lanes = NULL,
-	.set_pcie_lanes = NULL,
-	.set_clock_gating = &radeon_atom_set_clock_gating,
-	.set_surface_reg = r100_set_surface_reg,
-	.clear_surface_reg = r100_clear_surface_reg,
-	.bandwidth_update = &rs600_bandwidth_update,
-	.hpd_init = &rs600_hpd_init,
-	.hpd_fini = &rs600_hpd_fini,
-	.hpd_sense = &rs600_hpd_sense,
-	.hpd_set_polarity = &rs600_hpd_set_polarity,
-	.ioctl_wait_idle = NULL,
-};
-
+extern struct radeon_asic rs600_asic;
 
 /*
  * rs690,rs740
drivers/gpu/drm/radeon/rs600.c +63 -0

66 lines not on this page · raw message

Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#7 lore raw

PATCH 7/14 drm/radoen: move rs690 asic struct to rs690.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/radeon_asic.h |   38 +-----------------
 drivers/gpu/drm/radeon/rs690.c       |   72 ++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 37 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.h +1 -37
index 2de7e08..9ff56ff 100644
@@ -163,44 +163,8 @@ int rs690_suspend(struct radeon_device *rdev);
 uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg);
 void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
 void rs690_bandwidth_update(struct radeon_device *rdev);
-static struct radeon_asic rs690_asic = {
-	.init = &rs690_init,
-	.fini = &rs690_fini,
-	.suspend = &rs690_suspend,
-	.resume = &rs690_resume,
-	.vga_set_state = &r100_vga_set_state,
-	.gpu_reset = &r300_gpu_reset,
-	.gart_tlb_flush = &rs400_gart_tlb_flush,
-	.gart_set_page = &rs400_gart_set_page,
-	.cp_commit = &r100_cp_commit,
-	.ring_start = &r300_ring_start,
-	.ring_test = &r100_ring_test,
-	.ring_ib_execute = &r100_ring_ib_execute,
-	.irq_set = &rs600_irq_set,
-	.irq_process = &rs600_irq_process,
-	.get_vblank_counter = &rs600_get_vblank_counter,
-	.fence_ring_emit = &r300_fence_ring_emit,
-	.cs_parse = &r300_cs_parse,
-	.copy_blit = &r100_copy_blit,
-	.copy_dma = &r200_copy_dma,
-	.copy = &r200_copy_dma,
-	.get_engine_clock = &radeon_atom_get_engine_clock,
-	.set_engine_clock = &radeon_atom_set_engine_clock,
-	.get_memory_clock = &radeon_atom_get_memory_clock,
-	.set_memory_clock = &radeon_atom_set_memory_clock,
-	.get_pcie_lanes = NULL,
-	.set_pcie_lanes = NULL,
-	.set_clock_gating = &radeon_atom_set_clock_gating,
-	.set_surface_reg = r100_set_surface_reg,
-	.clear_surface_reg = r100_clear_surface_reg,
-	.bandwidth_update = &rs690_bandwidth_update,
-	.hpd_init = &rs600_hpd_init,
-	.hpd_fini = &rs600_hpd_fini,
-	.hpd_sense = &rs600_hpd_sense,
-	.hpd_set_polarity = &rs600_hpd_set_polarity,
-	.ioctl_wait_idle = NULL,
-};
 
+extern struct radeon_asic rs690_asic;
 
 /*
  * rv515
drivers/gpu/drm/radeon/rs690.c +72 -0

75 lines not on this page · raw message

Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#8 lore raw

PATCH 8/14 drm/radoen: move rv515 asic struct to rv515.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/radeon_asic.h |   38 +-----------------
 drivers/gpu/drm/radeon/rv515.c       |   72 ++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 37 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.h +1 -37
index 9ff56ff..941ef08 100644
@@ -180,44 +180,8 @@ void rv515_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
 void rv515_bandwidth_update(struct radeon_device *rdev);
 int rv515_resume(struct radeon_device *rdev);
 int rv515_suspend(struct radeon_device *rdev);
-static struct radeon_asic rv515_asic = {
-	.init = &rv515_init,
-	.fini = &rv515_fini,
-	.suspend = &rv515_suspend,
-	.resume = &rv515_resume,
-	.vga_set_state = &r100_vga_set_state,
-	.gpu_reset = &rv515_gpu_reset,
-	.gart_tlb_flush = &rv370_pcie_gart_tlb_flush,
-	.gart_set_page = &rv370_pcie_gart_set_page,
-	.cp_commit = &r100_cp_commit,
-	.ring_start = &rv515_ring_start,
-	.ring_test = &r100_ring_test,
-	.ring_ib_execute = &r100_ring_ib_execute,
-	.irq_set = &rs600_irq_set,
-	.irq_process = &rs600_irq_process,
-	.get_vblank_counter = &rs600_get_vblank_counter,
-	.fence_ring_emit = &r300_fence_ring_emit,
-	.cs_parse = &r300_cs_parse,
-	.copy_blit = &r100_copy_blit,
-	.copy_dma = &r200_copy_dma,
-	.copy = &r100_copy_blit,
-	.get_engine_clock = &radeon_atom_get_engine_clock,
-	.set_engine_clock = &radeon_atom_set_engine_clock,
-	.get_memory_clock = &radeon_atom_get_memory_clock,
-	.set_memory_clock = &radeon_atom_set_memory_clock,
-	.get_pcie_lanes = &rv370_get_pcie_lanes,
-	.set_pcie_lanes = &rv370_set_pcie_lanes,
-	.set_clock_gating = &radeon_atom_set_clock_gating,
-	.set_surface_reg = r100_set_surface_reg,
-	.clear_surface_reg = r100_clear_surface_reg,
-	.bandwidth_update = &rv515_bandwidth_update,
-	.hpd_init = &rs600_hpd_init,
-	.hpd_fini = &rs600_hpd_fini,
-	.hpd_sense = &rs600_hpd_sense,
-	.hpd_set_polarity = &rs600_hpd_set_polarity,
-	.ioctl_wait_idle = NULL,
-};
 
+extern struct radeon_asic rv515_asic;
 
 /*
  * r520,rv530,rv560,rv570,r580
drivers/gpu/drm/radeon/rv515.c +72 -0

75 lines not on this page · raw message

Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#9 lore raw

PATCH 9/14 drm/radoen: move r520 asic struct to r520.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/r520.c        |   77 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon_asic.h |   40 +-----------------
 2 files changed, 79 insertions(+), 38 deletions(-)
drivers/gpu/drm/radeon/r520.c +77 -0
index 2b8a5dd..554f667 100644
@@ -309,3 +309,80 @@ int r520_init(struct radeon_device *rdev)
 	}
 	return 0;
 }
+
+void r100_vga_set_state(struct radeon_device *rdev, bool state);
+extern void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev);
+extern int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
+void r100_cp_commit(struct radeon_device *rdev);
+void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
+int r100_ring_test(struct radeon_device *rdev);
+int rs600_irq_set(struct radeon_device *rdev);
+int rs600_irq_process(struct radeon_device *rdev);
+u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc);
+extern void r300_fence_ring_emit(struct radeon_device *rdev,
+				struct radeon_fence *fence);
+extern int r300_cs_parse(struct radeon_cs_parser *p);
+int r100_copy_blit(struct radeon_device *rdev,
+		   uint64_t src_offset,
+		   uint64_t dst_offset,
+		   unsigned num_pages,
+		   struct radeon_fence *fence);
+extern int r200_copy_dma(struct radeon_device *rdev,
+			uint64_t src_offset,
+			uint64_t dst_offset,
+			unsigned num_pages,
+			struct radeon_fence *fence);
+int r100_set_surface_reg(struct radeon_device *rdev, int reg,
+			 uint32_t tiling_flags, uint32_t pitch,
+			 uint32_t offset, uint32_t obj_size);
+int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
+extern void rv370_set_pcie_lanes(struct radeon_device *rdev, int lanes);
+extern int rv370_get_pcie_lanes(struct radeon_device *rdev);
+void rs600_hpd_init(struct radeon_device *rdev);
+void rs600_hpd_fini(struct radeon_device *rdev);
+bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
+void rs600_hpd_set_polarity(struct radeon_device *rdev,
+			    enum radeon_hpd_id hpd);
+void rv515_fini(struct radeon_device *rdev);
+int rv515_suspend(struct radeon_device *rdev);
+int rv515_gpu_reset(struct radeon_device *rdev);
+void rv515_ring_start(struct radeon_device *rdev);
+void rv515_bandwidth_update(struct radeon_device *rdev);
+
+struct radeon_asic r520_asic = {
+	.init = &r520_init,
+	.fini = &rv515_fini,
+	.suspend = &rv515_suspend,
+	.resume = &r520_resume,
+	.vga_set_state = &r100_vga_set_state,
+	.gpu_reset = &rv515_gpu_reset,
+	.gart_tlb_flush = &rv370_pcie_gart_tlb_flush,
+	.gart_set_page = &rv370_pcie_gart_set_page,
+	.cp_commit = &r100_cp_commit,
+	.ring_start = &rv515_ring_start,
+	.ring_test = &r100_ring_test,
+	.ring_ib_execute = &r100_ring_ib_execute,
+	.irq_set = &rs600_irq_set,
+	.irq_process = &rs600_irq_process,
+	.get_vblank_counter = &rs600_get_vblank_counter,
+	.fence_ring_emit = &r300_fence_ring_emit,
+	.cs_parse = &r300_cs_parse,
+	.copy_blit = &r100_copy_blit,
+	.copy_dma = &r200_copy_dma,
+	.copy = &r100_copy_blit,
+	.get_engine_clock = &radeon_atom_get_engine_clock,
+	.set_engine_clock = &radeon_atom_set_engine_clock,
+	.get_memory_clock = &radeon_atom_get_memory_clock,
+	.set_memory_clock = &radeon_atom_set_memory_clock,
+	.get_pcie_lanes = &rv370_get_pcie_lanes,
+	.set_pcie_lanes = &rv370_set_pcie_lanes,
+	.set_clock_gating = &radeon_atom_set_clock_gating,
+	.set_surface_reg = r100_set_surface_reg,
+	.clear_surface_reg = r100_clear_surface_reg,
+	.bandwidth_update = &rv515_bandwidth_update,
+	.hpd_init = &rs600_hpd_init,
+	.hpd_fini = &rs600_hpd_fini,
+	.hpd_sense = &rs600_hpd_sense,
+	.hpd_set_polarity = &rs600_hpd_set_polarity,
+	.ioctl_wait_idle = NULL,
+};
drivers/gpu/drm/radeon/radeon_asic.h +2 -38
index 941ef08..3137f2c 100644
@@ -115,7 +115,6 @@ extern int r420_resume(struct radeon_device *rdev);
 
 extern struct radeon_asic r420_asic;
 
-
 /*
  * rs400,rs480
  */
@@ -188,43 +187,8 @@ extern struct radeon_asic rv515_asic;
  */
 int r520_init(struct radeon_device *rdev);
 int r520_resume(struct radeon_device *rdev);
-static struct radeon_asic r520_asic = {
-	.init = &r520_init,
-	.fini = &rv515_fini,
-	.suspend = &rv515_suspend,
-	.resume = &r520_resume,
-	.vga_set_state = &r100_vga_set_state,
-	.gpu_reset = &rv515_gpu_reset,
-	.gart_tlb_flush = &rv370_pcie_gart_tlb_flush,
-	.gart_set_page = &rv370_pcie_gart_set_page,
-	.cp_commit = &r100_cp_commit,
-	.ring_start = &rv515_ring_start,
-	.ring_test = &r100_ring_test,
-	.ring_ib_execute = &r100_ring_ib_execute,
-	.irq_set = &rs600_irq_set,
-	.irq_process = &rs600_irq_process,
-	.get_vblank_counter = &rs600_get_vblank_counter,
-	.fence_ring_emit = &r300_fence_ring_emit,
-	.cs_parse = &r300_cs_parse,
-	.copy_blit = &r100_copy_blit,
-	.copy_dma = &r200_copy_dma,
-	.copy = &r100_copy_blit,
-	.get_engine_clock = &radeon_atom_get_engine_clock,
-	.set_engine_clock = &radeon_atom_set_engine_clock,
-	.get_memory_clock = &radeon_atom_get_memory_clock,
-	.set_memory_clock = &radeon_atom_set_memory_clock,
-	.get_pcie_lanes = &rv370_get_pcie_lanes,
-	.set_pcie_lanes = &rv370_set_pcie_lanes,
-	.set_clock_gating = &radeon_atom_set_clock_gating,
-	.set_surface_reg = r100_set_surface_reg,
-	.clear_surface_reg = r100_clear_surface_reg,
-	.bandwidth_update = &rv515_bandwidth_update,
-	.hpd_init = &rs600_hpd_init,
-	.hpd_fini = &rs600_hpd_fini,
-	.hpd_sense = &rs600_hpd_sense,
-	.hpd_set_polarity = &rs600_hpd_set_polarity,
-	.ioctl_wait_idle = NULL,
-};
+
+extern struct radeon_asic r520_asic;
 
 /*
  * r600,rv610,rv630,rv620,rv635,rv670,rs780,rs880
Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#10 lore raw

PATCH 10/14 drm/radoen: move r600 asic struct to r600.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/r600.c        |   43 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon_asic.h |   37 +----------------------------
 2 files changed, 44 insertions(+), 36 deletions(-)
drivers/gpu/drm/radeon/r600.c +43 -0
index c522901..c45bbcc 100644
@@ -2950,3 +2950,46 @@ void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo)
 {
 	WREG32(R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL, 0x1);
 }
+
+extern int rv370_get_pcie_lanes(struct radeon_device *rdev);
+void rv515_bandwidth_update(struct radeon_device *rdev);
+int r600_cs_parse(struct radeon_cs_parser *p);
+u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc);
+int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
+
+struct radeon_asic r600_asic = {
+	.init = &r600_init,
+	.fini = &r600_fini,
+	.suspend = &r600_suspend,
+	.resume = &r600_resume,
+	.cp_commit = &r600_cp_commit,
+	.vga_set_state = &r600_vga_set_state,
+	.gpu_reset = &r600_gpu_reset,
+	.gart_tlb_flush = &r600_pcie_gart_tlb_flush,
+	.gart_set_page = &rs600_gart_set_page,
+	.ring_test = &r600_ring_test,
+	.ring_ib_execute = &r600_ring_ib_execute,
+	.irq_set = &r600_irq_set,
+	.irq_process = &r600_irq_process,
+	.get_vblank_counter = &rs600_get_vblank_counter,
+	.fence_ring_emit = &r600_fence_ring_emit,
+	.cs_parse = &r600_cs_parse,
+	.copy_blit = &r600_copy_blit,
+	.copy_dma = &r600_copy_blit,
+	.copy = &r600_copy_blit,
+	.get_engine_clock = &radeon_atom_get_engine_clock,
+	.set_engine_clock = &radeon_atom_set_engine_clock,
+	.get_memory_clock = &radeon_atom_get_memory_clock,
+	.set_memory_clock = &radeon_atom_set_memory_clock,
+	.get_pcie_lanes = &rv370_get_pcie_lanes,
+	.set_pcie_lanes = NULL,
+	.set_clock_gating = NULL,
+	.set_surface_reg = r600_set_surface_reg,
+	.clear_surface_reg = r600_clear_surface_reg,
+	.bandwidth_update = &rv515_bandwidth_update,
+	.hpd_init = &r600_hpd_init,
+	.hpd_fini = &r600_hpd_fini,
+	.hpd_sense = &r600_hpd_sense,
+	.hpd_set_polarity = &r600_hpd_set_polarity,
+	.ioctl_wait_idle = r600_ioctl_wait_idle,
+};
drivers/gpu/drm/radeon/radeon_asic.h +1 -36
index 3137f2c..ba40f8a 100644
@@ -231,42 +231,7 @@ void r600_hpd_set_polarity(struct radeon_device *rdev,
 			   enum radeon_hpd_id hpd);
 extern void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo);
 
-static struct radeon_asic r600_asic = {
-	.init = &r600_init,
-	.fini = &r600_fini,
-	.suspend = &r600_suspend,
-	.resume = &r600_resume,
-	.cp_commit = &r600_cp_commit,
-	.vga_set_state = &r600_vga_set_state,
-	.gpu_reset = &r600_gpu_reset,
-	.gart_tlb_flush = &r600_pcie_gart_tlb_flush,
-	.gart_set_page = &rs600_gart_set_page,
-	.ring_test = &r600_ring_test,
-	.ring_ib_execute = &r600_ring_ib_execute,
-	.irq_set = &r600_irq_set,
-	.irq_process = &r600_irq_process,
-	.get_vblank_counter = &rs600_get_vblank_counter,
-	.fence_ring_emit = &r600_fence_ring_emit,
-	.cs_parse = &r600_cs_parse,
-	.copy_blit = &r600_copy_blit,
-	.copy_dma = &r600_copy_blit,
-	.copy = &r600_copy_blit,
-	.get_engine_clock = &radeon_atom_get_engine_clock,
-	.set_engine_clock = &radeon_atom_set_engine_clock,
-	.get_memory_clock = &radeon_atom_get_memory_clock,
-	.set_memory_clock = &radeon_atom_set_memory_clock,
-	.get_pcie_lanes = &rv370_get_pcie_lanes,
-	.set_pcie_lanes = NULL,
-	.set_clock_gating = NULL,
-	.set_surface_reg = r600_set_surface_reg,
-	.clear_surface_reg = r600_clear_surface_reg,
-	.bandwidth_update = &rv515_bandwidth_update,
-	.hpd_init = &r600_hpd_init,
-	.hpd_fini = &r600_hpd_fini,
-	.hpd_sense = &r600_hpd_sense,
-	.hpd_set_polarity = &r600_hpd_set_polarity,
-	.ioctl_wait_idle = r600_ioctl_wait_idle,
-};
+extern struct radeon_asic r600_asic;
 
 /*
  * rv770,rv730,rv710,rv740
Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#11 lore raw

PATCH 11/14 drm/radoen: move rv770 asic struct to rv770.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/radeon_asic.h |   37 +-------------------
 drivers/gpu/drm/radeon/rv770.c       |   65 ++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 36 deletions(-)
drivers/gpu/drm/radeon/radeon_asic.h +1 -36
index ba40f8a..57dceeb 100644
@@ -242,42 +242,7 @@ int rv770_suspend(struct radeon_device *rdev);
 int rv770_resume(struct radeon_device *rdev);
 int rv770_gpu_reset(struct radeon_device *rdev);
 
-static struct radeon_asic rv770_asic = {
-	.init = &rv770_init,
-	.fini = &rv770_fini,
-	.suspend = &rv770_suspend,
-	.resume = &rv770_resume,
-	.cp_commit = &r600_cp_commit,
-	.gpu_reset = &rv770_gpu_reset,
-	.vga_set_state = &r600_vga_set_state,
-	.gart_tlb_flush = &r600_pcie_gart_tlb_flush,
-	.gart_set_page = &rs600_gart_set_page,
-	.ring_test = &r600_ring_test,
-	.ring_ib_execute = &r600_ring_ib_execute,
-	.irq_set = &r600_irq_set,
-	.irq_process = &r600_irq_process,
-	.get_vblank_counter = &rs600_get_vblank_counter,
-	.fence_ring_emit = &r600_fence_ring_emit,
-	.cs_parse = &r600_cs_parse,
-	.copy_blit = &r600_copy_blit,
-	.copy_dma = &r600_copy_blit,
-	.copy = &r600_copy_blit,
-	.get_engine_clock = &radeon_atom_get_engine_clock,
-	.set_engine_clock = &radeon_atom_set_engine_clock,
-	.get_memory_clock = &radeon_atom_get_memory_clock,
-	.set_memory_clock = &radeon_atom_set_memory_clock,
-	.get_pcie_lanes = &rv370_get_pcie_lanes,
-	.set_pcie_lanes = NULL,
-	.set_clock_gating = &radeon_atom_set_clock_gating,
-	.set_surface_reg = r600_set_surface_reg,
-	.clear_surface_reg = r600_clear_surface_reg,
-	.bandwidth_update = &rv515_bandwidth_update,
-	.hpd_init = &r600_hpd_init,
-	.hpd_fini = &r600_hpd_fini,
-	.hpd_sense = &r600_hpd_sense,
-	.hpd_set_polarity = &r600_hpd_set_polarity,
-	.ioctl_wait_idle = r600_ioctl_wait_idle,
-};
+extern struct radeon_asic rv770_asic;
 
 /*
  * evergreen
drivers/gpu/drm/radeon/rv770.c +65 -0

68 lines not on this page · raw message

Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#12 lore raw

PATCH 12/14 drm/radoen: move evergreen asic struct to evergreen.c

In reply to Daniel Vetter

Like for r200.

---
 drivers/gpu/drm/radeon/evergreen.c   |   43 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon_asic.h |   35 +--------------------------
 2 files changed, 44 insertions(+), 34 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +43 -0
index bd2e7aa..618006a 100644
@@ -765,3 +765,46 @@ void evergreen_fini(struct radeon_device *rdev)
 	rdev->bios = NULL;
 	radeon_dummy_page_fini(rdev);
 }
+
+void r600_vga_set_state(struct radeon_device *rdev, bool state);
+void r600_pcie_gart_tlb_flush(struct radeon_device *rdev);
+int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
+int r600_set_surface_reg(struct radeon_device *rdev, int reg,
+			 uint32_t tiling_flags, uint32_t pitch,
+			 uint32_t offset, uint32_t obj_size);
+int r600_clear_surface_reg(struct radeon_device *rdev, int reg);
+
+struct radeon_asic evergreen_asic = {
+	.init = &evergreen_init,
+	.fini = &evergreen_fini,
+	.suspend = &evergreen_suspend,
+	.resume = &evergreen_resume,
+	.cp_commit = NULL,
+	.gpu_reset = &evergreen_gpu_reset,
+	.vga_set_state = &r600_vga_set_state,
+	.gart_tlb_flush = &r600_pcie_gart_tlb_flush,
+	.gart_set_page = &rs600_gart_set_page,
+	.ring_test = NULL,
+	.ring_ib_execute = NULL,
+	.irq_set = NULL,
+	.irq_process = NULL,
+	.get_vblank_counter = NULL,
+	.fence_ring_emit = NULL,
+	.cs_parse = NULL,
+	.copy_blit = NULL,
+	.copy_dma = NULL,
+	.copy = NULL,
+	.get_engine_clock = &radeon_atom_get_engine_clock,
+	.set_engine_clock = &radeon_atom_set_engine_clock,
+	.get_memory_clock = &radeon_atom_get_memory_clock,
+	.set_memory_clock = &radeon_atom_set_memory_clock,
+	.set_pcie_lanes = NULL,
+	.set_clock_gating = NULL,
+	.set_surface_reg = r600_set_surface_reg,
+	.clear_surface_reg = r600_clear_surface_reg,
+	.bandwidth_update = &evergreen_bandwidth_update,
+	.hpd_init = &evergreen_hpd_init,
+	.hpd_fini = &evergreen_hpd_fini,
+	.hpd_sense = &evergreen_hpd_sense,
+	.hpd_set_polarity = &evergreen_hpd_set_polarity,
+};
drivers/gpu/drm/radeon/radeon_asic.h +1 -34
index 57dceeb..4db2e37 100644
@@ -259,39 +259,6 @@ bool evergreen_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
 void evergreen_hpd_set_polarity(struct radeon_device *rdev,
 				enum radeon_hpd_id hpd);
 
-static struct radeon_asic evergreen_asic = {
-	.init = &evergreen_init,
-	.fini = &evergreen_fini,
-	.suspend = &evergreen_suspend,
-	.resume = &evergreen_resume,
-	.cp_commit = NULL,
-	.gpu_reset = &evergreen_gpu_reset,
-	.vga_set_state = &r600_vga_set_state,
-	.gart_tlb_flush = &r600_pcie_gart_tlb_flush,
-	.gart_set_page = &rs600_gart_set_page,
-	.ring_test = NULL,
-	.ring_ib_execute = NULL,
-	.irq_set = NULL,
-	.irq_process = NULL,
-	.get_vblank_counter = NULL,
-	.fence_ring_emit = NULL,
-	.cs_parse = NULL,
-	.copy_blit = NULL,
-	.copy_dma = NULL,
-	.copy = NULL,
-	.get_engine_clock = &radeon_atom_get_engine_clock,
-	.set_engine_clock = &radeon_atom_set_engine_clock,
-	.get_memory_clock = &radeon_atom_get_memory_clock,
-	.set_memory_clock = &radeon_atom_set_memory_clock,
-	.set_pcie_lanes = NULL,
-	.set_clock_gating = NULL,
-	.set_surface_reg = r600_set_surface_reg,
-	.clear_surface_reg = r600_clear_surface_reg,
-	.bandwidth_update = &evergreen_bandwidth_update,
-	.hpd_init = &evergreen_hpd_init,
-	.hpd_fini = &evergreen_hpd_fini,
-	.hpd_sense = &evergreen_hpd_sense,
-	.hpd_set_polarity = &evergreen_hpd_set_polarity,
-};
+extern struct radeon_asic evergreen_asic;
 
 #endif
Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#13 lore raw

PATCH 13/14 drm/radoen: unconfuse return value of radeon_asic->clear_surface_reg

In reply to Daniel Vetter

No one cares about it, so set it to void.

---
 drivers/gpu/drm/radeon/radeon.h      |    2 +-
 drivers/gpu/drm/radeon/radeon_asic.h |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/radeon.h +1 -1
index bf5a2e6..9187fd7 100644
@@ -782,7 +782,7 @@ struct radeon_asic {
 	int (*set_surface_reg)(struct radeon_device *rdev, int reg,
 			       uint32_t tiling_flags, uint32_t pitch,
 			       uint32_t offset, uint32_t obj_size);
-	int (*clear_surface_reg)(struct radeon_device *rdev, int reg);
+	void (*clear_surface_reg)(struct radeon_device *rdev, int reg);
 	void (*bandwidth_update)(struct radeon_device *rdev);
 	void (*hpd_init)(struct radeon_device *rdev);
 	void (*hpd_fini)(struct radeon_device *rdev);
drivers/gpu/drm/radeon/radeon_asic.h +2 -2
index 4db2e37..9a3bf44 100644
@@ -59,7 +59,7 @@ int r100_copy_blit(struct radeon_device *rdev,
 int r100_set_surface_reg(struct radeon_device *rdev, int reg,
 			 uint32_t tiling_flags, uint32_t pitch,
 			 uint32_t offset, uint32_t obj_size);
-int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
+void r100_clear_surface_reg(struct radeon_device *rdev, int reg);
 void r100_bandwidth_update(struct radeon_device *rdev);
 void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
 int r100_ring_test(struct radeon_device *rdev);
@@ -218,7 +218,7 @@ int r600_gpu_reset(struct radeon_device *rdev);
 int r600_set_surface_reg(struct radeon_device *rdev, int reg,
 			 uint32_t tiling_flags, uint32_t pitch,
 			 uint32_t offset, uint32_t obj_size);
-int r600_clear_surface_reg(struct radeon_device *rdev, int reg);
+void r600_clear_surface_reg(struct radeon_device *rdev, int reg);
 void r600_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
 int r600_ring_test(struct radeon_device *rdev);
 int r600_copy_blit(struct radeon_device *rdev,
Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#14 lore raw

PATCH 14/14 drm/radeon: include radeon_asic.h in <asic>.c

In reply to Daniel Vetter

And kill the temporary function declarations. Also drop a few unnecessary forward declarations.

---
 drivers/gpu/drm/radeon/evergreen.c   |   12 +---------
 drivers/gpu/drm/radeon/r100.c        |    1 +
 drivers/gpu/drm/radeon/r200.c        |   35 +----------------------------
 drivers/gpu/drm/radeon/r300.c        |   31 +-------------------------
 drivers/gpu/drm/radeon/r420.c        |   38 +-------------------------------
 drivers/gpu/drm/radeon/r520.c        |   40 +---------------------------------
 drivers/gpu/drm/radeon/r600.c        |   12 +--------
 drivers/gpu/drm/radeon/radeon.h      |   14 ------------
 drivers/gpu/drm/radeon/radeon_asic.h |   14 ++++++++++++
 drivers/gpu/drm/radeon/rs400.c       |   35 +----------------------------
 drivers/gpu/drm/radeon/rs600.c       |   30 +-----------------------
 drivers/gpu/drm/radeon/rs690.c       |   35 +----------------------------
 drivers/gpu/drm/radeon/rv515.c       |   37 +------------------------------
 drivers/gpu/drm/radeon/rv770.c       |   33 +---------------------------
 14 files changed, 28 insertions(+), 339 deletions(-)
drivers/gpu/drm/radeon/evergreen.c +1 -11
index 618006a..a016694 100644
@@ -25,15 +25,13 @@
 #include <linux/platform_device.h>
 #include "drmP.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "radeon_drm.h"
 #include "rv770d.h"
 #include "atom.h"
 #include "avivod.h"
 #include "evergreen_reg.h"
 
-static void evergreen_gpu_init(struct radeon_device *rdev);
-void evergreen_fini(struct radeon_device *rdev);
-
 bool evergreen_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd)
 {
 	bool connected = false;
@@ -766,14 +764,6 @@ void evergreen_fini(struct radeon_device *rdev)
 	radeon_dummy_page_fini(rdev);
 }
 
-void r600_vga_set_state(struct radeon_device *rdev, bool state);
-void r600_pcie_gart_tlb_flush(struct radeon_device *rdev);
-int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
-int r600_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r600_clear_surface_reg(struct radeon_device *rdev, int reg);
-
 struct radeon_asic evergreen_asic = {
 	.init = &evergreen_init,
 	.fini = &evergreen_fini,
drivers/gpu/drm/radeon/r100.c +1 -0
index facf3d8..270fbdf 100644
@@ -31,6 +31,7 @@
 #include "radeon_drm.h"
 #include "radeon_reg.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "r100d.h"
 #include "rs100d.h"
 #include "rv200d.h"
drivers/gpu/drm/radeon/r200.c +1 -34
index 7dfeab3..990142f 100644
@@ -30,6 +30,7 @@
 #include "radeon_drm.h"
 #include "radeon_reg.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 
 #include "r100d.h"
 #include "r200_reg_safe.h"
@@ -508,40 +509,6 @@ void r200_set_safe_registers(struct radeon_device *rdev)
 	rdev->config.r100.reg_safe_bm_size = ARRAY_SIZE(r200_reg_safe_bm);
 }
 
-extern int r100_init(struct radeon_device *rdev);
-extern void r100_fini(struct radeon_device *rdev);
-extern int r100_suspend(struct radeon_device *rdev);
-extern int r100_resume(struct radeon_device *rdev);
-void r100_vga_set_state(struct radeon_device *rdev, bool state);
-int r100_gpu_reset(struct radeon_device *rdev);
-void r100_pci_gart_tlb_flush(struct radeon_device *rdev);
-int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
-void r100_cp_commit(struct radeon_device *rdev);
-void r100_ring_start(struct radeon_device *rdev);
-int r100_ring_test(struct radeon_device *rdev);
-void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
-int r100_irq_set(struct radeon_device *rdev);
-int r100_irq_process(struct radeon_device *rdev);
-u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
-void r100_fence_ring_emit(struct radeon_device *rdev,
-			  struct radeon_fence *fence);
-int r100_cs_parse(struct radeon_cs_parser *p);
-int r100_copy_blit(struct radeon_device *rdev,
-		   uint64_t src_offset,
-		   uint64_t dst_offset,
-		   unsigned num_pages,
-		   struct radeon_fence *fence);
-int r100_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
-void r100_bandwidth_update(struct radeon_device *rdev);
-void r100_hpd_init(struct radeon_device *rdev);
-void r100_hpd_fini(struct radeon_device *rdev);
-bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
-void r100_hpd_set_polarity(struct radeon_device *rdev,
-			   enum radeon_hpd_id hpd);
-
 struct radeon_asic r200_asic = {
 	.init = &r100_init,
 	.fini = &r100_fini,
drivers/gpu/drm/radeon/r300.c +1 -30
index 2592ba6..1f26c60 100644
@@ -30,6 +30,7 @@
 #include "drm.h"
 #include "radeon_reg.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "radeon_drm.h"
 #include "r100_track.h"
 #include "r300d.h"
@@ -1441,36 +1442,6 @@ int r300_init(struct radeon_device *rdev)
 	return 0;
 }
 
-void r100_vga_set_state(struct radeon_device *rdev, bool state);
-void r100_pci_gart_tlb_flush(struct radeon_device *rdev);
-int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
-void r100_cp_commit(struct radeon_device *rdev);
-int r100_ring_test(struct radeon_device *rdev);
-void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
-int r100_irq_set(struct radeon_device *rdev);
-int r100_irq_process(struct radeon_device *rdev);
-u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
-int r100_copy_blit(struct radeon_device *rdev,
-		   uint64_t src_offset,
-		   uint64_t dst_offset,
-		   unsigned num_pages,
-		   struct radeon_fence *fence);
-int r100_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
-void r100_bandwidth_update(struct radeon_device *rdev);
-void r100_hpd_init(struct radeon_device *rdev);
-void r100_hpd_fini(struct radeon_device *rdev);
-bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
-void r100_hpd_set_polarity(struct radeon_device *rdev,
-			   enum radeon_hpd_id hpd);
-extern int r200_copy_dma(struct radeon_device *rdev,
-			uint64_t src_offset,
-			uint64_t dst_offset,
-			unsigned num_pages,
-			struct radeon_fence *fence);
-
 struct radeon_asic r300_asic = {
 	.init = &r300_init,
 	.fini = &r300_fini,
drivers/gpu/drm/radeon/r420.c +1 -37
index 2488edb..ea1db1f 100644
@@ -29,6 +29,7 @@
 #include "drmP.h"
 #include "radeon_reg.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include "r100d.h"
 #include "r420d.h"
@@ -418,43 +419,6 @@ int r420_debugfs_pipes_info_init(struct radeon_device *rdev)
 #endif
 }
 
-void r100_vga_set_state(struct radeon_device *rdev, bool state);
-void r100_cp_commit(struct radeon_device *rdev);
-int r100_ring_test(struct radeon_device *rdev);
-void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
-int r100_irq_set(struct radeon_device *rdev);
-int r100_irq_process(struct radeon_device *rdev);
-u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
-int r100_copy_blit(struct radeon_device *rdev,
-		   uint64_t src_offset,
-		   uint64_t dst_offset,
-		   unsigned num_pages,
-		   struct radeon_fence *fence);
-int r100_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
-void r100_bandwidth_update(struct radeon_device *rdev);
-void r100_hpd_init(struct radeon_device *rdev);
-void r100_hpd_fini(struct radeon_device *rdev);
-bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
-void r100_hpd_set_polarity(struct radeon_device *rdev,
-			   enum radeon_hpd_id hpd);
-extern int r200_copy_dma(struct radeon_device *rdev,
-			uint64_t src_offset,
-			uint64_t dst_offset,
-			unsigned num_pages,
-			struct radeon_fence *fence);
-extern void r300_ring_start(struct radeon_device *rdev);
-extern void r300_fence_ring_emit(struct radeon_device *rdev,
-				struct radeon_fence *fence);
-extern int r300_cs_parse(struct radeon_cs_parser *p);
-extern void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev);
-extern int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
-extern void rv370_set_pcie_lanes(struct radeon_device *rdev, int lanes);
-extern int rv370_get_pcie_lanes(struct radeon_device *rdev);
-extern int r300_gpu_reset(struct radeon_device *rdev);
-
 struct radeon_asic r420_asic = {
 	.init = &r420_init,
 	.fini = &r420_fini,
drivers/gpu/drm/radeon/r520.c +1 -39
index 554f667..fd445fe 100644
@@ -27,6 +27,7 @@
  */
 #include "drmP.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include "r520d.h"
 
@@ -310,45 +311,6 @@ int r520_init(struct radeon_device *rdev)
 	return 0;
 }
 
-void r100_vga_set_state(struct radeon_device *rdev, bool state);
-extern void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev);
-extern int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
-void r100_cp_commit(struct radeon_device *rdev);
-void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
-int r100_ring_test(struct radeon_device *rdev);
-int rs600_irq_set(struct radeon_device *rdev);
-int rs600_irq_process(struct radeon_device *rdev);
-u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc);
-extern void r300_fence_ring_emit(struct radeon_device *rdev,
-				struct radeon_fence *fence);
-extern int r300_cs_parse(struct radeon_cs_parser *p);
-int r100_copy_blit(struct radeon_device *rdev,
-		   uint64_t src_offset,
-		   uint64_t dst_offset,
-		   unsigned num_pages,
-		   struct radeon_fence *fence);
-extern int r200_copy_dma(struct radeon_device *rdev,
-			uint64_t src_offset,
-			uint64_t dst_offset,
-			unsigned num_pages,
-			struct radeon_fence *fence);
-int r100_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
-extern void rv370_set_pcie_lanes(struct radeon_device *rdev, int lanes);
-extern int rv370_get_pcie_lanes(struct radeon_device *rdev);
-void rs600_hpd_init(struct radeon_device *rdev);
-void rs600_hpd_fini(struct radeon_device *rdev);
-bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
-void rs600_hpd_set_polarity(struct radeon_device *rdev,
-			    enum radeon_hpd_id hpd);
-void rv515_fini(struct radeon_device *rdev);
-int rv515_suspend(struct radeon_device *rdev);
-int rv515_gpu_reset(struct radeon_device *rdev);
-void rv515_ring_start(struct radeon_device *rdev);
-void rv515_bandwidth_update(struct radeon_device *rdev);
-
 struct radeon_asic r520_asic = {
 	.init = &r520_init,
 	.fini = &rv515_fini,
drivers/gpu/drm/radeon/r600.c +2 -10
index c45bbcc..1db27e8 100644
@@ -31,6 +31,7 @@
 #include "drmP.h"
 #include "radeon_drm.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "radeon_mode.h"
 #include "r600d.h"
 #include "atom.h"
@@ -69,10 +70,7 @@ MODULE_FIRMWARE("radeon/R700_rlc.bin");
 
 int r600_debugfs_mc_info_init(struct radeon_device *rdev);
 
-/* r600,rv610,rv630,rv620,rv635,rv670 */
-int r600_mc_wait_for_idle(struct radeon_device *rdev);
-void r600_gpu_init(struct radeon_device *rdev);
-void r600_fini(struct radeon_device *rdev);
+/* This file gathers functions for r600,rv610,rv630,rv620,rv635,rv670 */
 
 /* hpd for digital panel detect/disconnect */
 bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd)
@@ -2951,12 +2949,6 @@ void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo)
 	WREG32(R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL, 0x1);
 }
 
-extern int rv370_get_pcie_lanes(struct radeon_device *rdev);
-void rv515_bandwidth_update(struct radeon_device *rdev);
-int r600_cs_parse(struct radeon_cs_parser *p);
-u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc);
-int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
-
 struct radeon_asic r600_asic = {
 	.init = &r600_init,
 	.fini = &r600_fini,
drivers/gpu/drm/radeon/radeon.h +0 -14
index 9187fd7..79a0f66 100644
@@ -862,20 +862,6 @@ union radeon_asic_config {
 	struct rv770_asic	rv770;
 };
 
-/* WIP: Declarations from radeon_asic.h
- * These will move back to radeon_asic.h as soon as it has morphed into
- * a real header. */
-uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev);
-void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
-uint32_t radeon_legacy_get_memory_clock(struct radeon_device *rdev);
-void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable);
-
-uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev);
-void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
-uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev);
-void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock);
-void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
-
 /*
  * IOCTL.
  */
drivers/gpu/drm/radeon/radeon_asic.h +14 -0
index 9a3bf44..0ddb2da 100644
@@ -29,6 +29,20 @@
 #define __RADEON_ASIC_H__
 
 /*
+ * common functions
+ */
+uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev);
+void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
+uint32_t radeon_legacy_get_memory_clock(struct radeon_device *rdev);
+void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable);
+
+uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev);
+void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
+uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev);
+void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock);
+void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
+
+/*
  * r100,rv100,rs100,rv200,rs200
  */
 extern int r100_init(struct radeon_device *rdev);
drivers/gpu/drm/radeon/rs400.c +1 -34
index 4d5427a..db0c4f0 100644
@@ -28,6 +28,7 @@
 #include <linux/seq_file.h>
 #include <drm/drmP.h>
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "rs400d.h"
 
 /* This files gather functions specifics to : rs400,rs480 */
@@ -537,40 +538,6 @@ int rs400_init(struct radeon_device *rdev)
 	return 0;
 }
 
-void r100_vga_set_state(struct radeon_device *rdev, bool state);
-extern int r300_gpu_reset(struct radeon_device *rdev);
-void r100_cp_commit(struct radeon_device *rdev);
-void r300_ring_start(struct radeon_device *rdev);
-int r100_irq_set(struct radeon_device *rdev);
-void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
-int r100_irq_set(struct radeon_device *rdev);
-int r100_irq_process(struct radeon_device *rdev);
-u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
-extern void r300_fence_ring_emit(struct radeon_device *rdev,
-				struct radeon_fence *fence);
-extern int r300_cs_parse(struct radeon_cs_parser *p);
-int r100_copy_blit(struct radeon_device *rdev,
-		   uint64_t src_offset,
-		   uint64_t dst_offset,
-		   unsigned num_pages,
-		   struct radeon_fence *fence);
-extern int r200_copy_dma(struct radeon_device *rdev,
-			uint64_t src_offset,
-			uint64_t dst_offset,
-			unsigned num_pages,
-			struct radeon_fence *fence);
-int r100_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
-void r100_bandwidth_update(struct radeon_device *rdev);
-void r100_hpd_init(struct radeon_device *rdev);
-void r100_hpd_fini(struct radeon_device *rdev);
-bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
-void r100_hpd_set_polarity(struct radeon_device *rdev,
-			   enum radeon_hpd_id hpd);
-int r100_ring_test(struct radeon_device *rdev);
-
 struct radeon_asic rs400_asic = {
 	.init = &rs400_init,
 	.fini = &rs400_fini,
drivers/gpu/drm/radeon/rs600.c +2 -28
index d3f75fd..d9ed2c5 100644
@@ -37,14 +37,13 @@
  */
 #include "drmP.h"
 #include "radeon.h"
+#include "radeon_asic.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include "rs600d.h"
 
 #include "rs600_reg_safe.h"
 
-void rs600_gpu_init(struct radeon_device *rdev);
-int rs600_mc_wait_for_idle(struct radeon_device *rdev);
-
 /* hpd for digital panel detect/disconnect */
 bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd)
 {
@@ -682,31 +681,6 @@ int rs600_init(struct radeon_device *rdev)
 	return 0;
 }
 
-void r100_vga_set_state(struct radeon_device *rdev, bool state);
-extern int r300_gpu_reset(struct radeon_device *rdev);
-void r100_cp_commit(struct radeon_device *rdev);
-void r300_ring_start(struct radeon_device *rdev);
-void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
-u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc);
-extern void r300_fence_ring_emit(struct radeon_device *rdev,
-				struct radeon_fence *fence);
-extern int r300_cs_parse(struct radeon_cs_parser *p);
-int r100_copy_blit(struct radeon_device *rdev,
-		   uint64_t src_offset,
-		   uint64_t dst_offset,
-		   unsigned num_pages,
-		   struct radeon_fence *fence);
-extern int r200_copy_dma(struct radeon_device *rdev,
-			uint64_t src_offset,
-			uint64_t dst_offset,
-			unsigned num_pages,
-			struct radeon_fence *fence);
-int r100_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
-int r100_ring_test(struct radeon_device *rdev);
-
 struct radeon_asic rs600_asic = {
 	.init = &rs600_init,
 	.fini = &rs600_fini,
drivers/gpu/drm/radeon/rs690.c +1 -34
index 5c84c0b..33e0c40 100644
@@ -27,6 +27,7 @@
  */
 #include "drmP.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include "rs690d.h"
 
@@ -742,40 +743,6 @@ int rs690_init(struct radeon_device *rdev)
 	return 0;
 }
 
-void r100_vga_set_state(struct radeon_device *rdev, bool state);
-extern int r300_gpu_reset(struct radeon_device *rdev);
-void r100_cp_commit(struct radeon_device *rdev);
-void r300_ring_start(struct radeon_device *rdev);
-void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
-extern void r300_fence_ring_emit(struct radeon_device *rdev,
-				struct radeon_fence *fence);
-extern int r300_cs_parse(struct radeon_cs_parser *p);
-int r100_copy_blit(struct radeon_device *rdev,
-		   uint64_t src_offset,
-		   uint64_t dst_offset,
-		   unsigned num_pages,
-		   struct radeon_fence *fence);
-extern int r200_copy_dma(struct radeon_device *rdev,
-			uint64_t src_offset,
-			uint64_t dst_offset,
-			unsigned num_pages,
-			struct radeon_fence *fence);
-int r100_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
-int r100_ring_test(struct radeon_device *rdev);
-void rs400_gart_tlb_flush(struct radeon_device *rdev);
-int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
-u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc);
-void rs600_hpd_init(struct radeon_device *rdev);
-void rs600_hpd_fini(struct radeon_device *rdev);
-bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
-void rs600_hpd_set_polarity(struct radeon_device *rdev,
-			    enum radeon_hpd_id hpd);
-int rs600_irq_set(struct radeon_device *rdev);
-int rs600_irq_process(struct radeon_device *rdev);
-
 struct radeon_asic rs690_asic = {
 	.init = &rs690_init,
 	.fini = &rs690_fini,
drivers/gpu/drm/radeon/rv515.c +1 -36
index a27494f..b3572cb 100644
@@ -29,14 +29,13 @@
 #include "drmP.h"
 #include "rv515d.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "atom.h"
 #include "rv515_reg_safe.h"
 
 /* This files gather functions specifics to: rv515 */
 int rv515_debugfs_pipes_info_init(struct radeon_device *rdev);
 int rv515_debugfs_ga_info_init(struct radeon_device *rdev);
-void rv515_gpu_init(struct radeon_device *rdev);
-int rv515_mc_wait_for_idle(struct radeon_device *rdev);
 
 void rv515_debugfs(struct radeon_device *rdev)
 {
@@ -1183,40 +1182,6 @@ void rv515_bandwidth_update(struct radeon_device *rdev)
 	rv515_bandwidth_avivo_update(rdev);
 }
 
-void r100_vga_set_state(struct radeon_device *rdev, bool state);
-extern void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev);
-extern int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
-void r100_cp_commit(struct radeon_device *rdev);
-void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
-int r100_ring_test(struct radeon_device *rdev);
-int rs600_irq_set(struct radeon_device *rdev);
-int rs600_irq_process(struct radeon_device *rdev);
-u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc);
-extern void r300_fence_ring_emit(struct radeon_device *rdev,
-				struct radeon_fence *fence);
-extern int r300_cs_parse(struct radeon_cs_parser *p);
-int r100_copy_blit(struct radeon_device *rdev,
-		   uint64_t src_offset,
-		   uint64_t dst_offset,
-		   unsigned num_pages,
-		   struct radeon_fence *fence);
-extern int r200_copy_dma(struct radeon_device *rdev,
-			uint64_t src_offset,
-			uint64_t dst_offset,
-			unsigned num_pages,
-			struct radeon_fence *fence);
-int r100_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
-extern void rv370_set_pcie_lanes(struct radeon_device *rdev, int lanes);
-extern int rv370_get_pcie_lanes(struct radeon_device *rdev);
-void rs600_hpd_init(struct radeon_device *rdev);
-void rs600_hpd_fini(struct radeon_device *rdev);
-bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
-void rs600_hpd_set_polarity(struct radeon_device *rdev,
-			    enum radeon_hpd_id hpd);
-
 struct radeon_asic rv515_asic = {
 	.init = &rv515_init,
 	.fini = &rv515_fini,
drivers/gpu/drm/radeon/rv770.c +1 -32
index 309bc66..2afc76e 100644
@@ -29,6 +29,7 @@
 #include <linux/platform_device.h>
 #include "drmP.h"
 #include "radeon.h"
+#include "radeon_asic.h"
 #include "radeon_drm.h"
 #include "rv770d.h"
 #include "atom.h"
@@ -37,10 +38,6 @@
 #define R700_PFP_UCODE_SIZE 848
 #define R700_PM4_UCODE_SIZE 1360
 
-static void rv770_gpu_init(struct radeon_device *rdev);
-void rv770_fini(struct radeon_device *rdev);
-
-
 /*
  * GART
  */
@@ -1166,34 +1163,6 @@ void rv770_fini(struct radeon_device *rdev)
 	radeon_dummy_page_fini(rdev);
 }
 
-void r600_cp_commit(struct radeon_device *rdev);
-void r600_vga_set_state(struct radeon_device *rdev, bool state);
-void r600_pcie_gart_tlb_flush(struct radeon_device *rdev);
-int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
-void r600_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
-int r600_ring_test(struct radeon_device *rdev);
-int r600_copy_blit(struct radeon_device *rdev,
-		   uint64_t src_offset, uint64_t dst_offset,
-		   unsigned num_pages, struct radeon_fence *fence);
-int r600_irq_process(struct radeon_device *rdev);
-int r600_irq_set(struct radeon_device *rdev);
-u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc);
-void r600_fence_ring_emit(struct radeon_device *rdev,
-			  struct radeon_fence *fence);
-extern int rv370_get_pcie_lanes(struct radeon_device *rdev);
-int r600_set_surface_reg(struct radeon_device *rdev, int reg,
-			 uint32_t tiling_flags, uint32_t pitch,
-			 uint32_t offset, uint32_t obj_size);
-int r600_clear_surface_reg(struct radeon_device *rdev, int reg);
-void rv515_bandwidth_update(struct radeon_device *rdev);
-void r600_hpd_init(struct radeon_device *rdev);
-void r600_hpd_fini(struct radeon_device *rdev);
-bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd);
-void r600_hpd_set_polarity(struct radeon_device *rdev,
-			   enum radeon_hpd_id hpd);
-extern void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo);
-int r600_cs_parse(struct radeon_cs_parser *p);
-
 struct radeon_asic rv770_asic = {
 	.init = &rv770_init,
 	.fini = &rv770_fini,
Signature · 10 lines
1.7.0


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#15 lore raw
In reply to Daniel Vetter
Quoted 13 lines · Daniel Vetter

Hi all,

This patch pile moves the "static struct radeon_asic <asic>" definitions form radeon_asic.h into the asic-specific files, where I think they belong. This way radeon_asic.h becomes a real header file that can be #included. And indeed, with all the copy&pasting of function declarations, one has gotten out of sync.

The next step would be to collect asic specific declarations in radeon_asic.h - atm they are somewhat scattered. But this can easily be done on the go and has way too much potential for conflicts with other patches. So I didn't do this.

Quoted 5 lines

Tested on my rv570.

Comments higly welcome.

Yours, Daniel

It all looks good from a quick read through of the patches. For gathering asic function prototype i kind of started adding them to radeon.h at the bottom (there is already a bunch of them). Thus i think radeon_asic.h can be kill and extern declaration directly put into radeon_asic.c

Cheers,
Jerome

Quoted 34 lines

Daniel Vetter (14):
drm/radoen: move r100 asic struct to r100.c
drm/radoen: move r200 asic struct to r200.c
drm/radeon: move r300 asic structs to r300.c
drm/radeon: move r420 asic struct to r420.c
drm/radoen: move rs400 asic struct to rs400.c
drm/radoen: move rs600 asic struct to rs600.c
drm/radoen: move rs690 asic struct to rs690.c
drm/radoen: move rv515 asic struct to rv515.c
drm/radoen: move r520 asic struct to r520.c
drm/radoen: move r600 asic struct to r600.c
drm/radoen: move rv770 asic struct to rv770.c
drm/radoen: move evergreen asic struct to evergreen.c drm/radoen: unconfuse return value of radeon_asic->clear_surface_reg drm/radeon: include radeon_asic.h in <asic>.c

 drivers/gpu/drm/radeon/evergreen.c   |   39 +++-
 drivers/gpu/drm/radeon/r100.c        |   39 +++
 drivers/gpu/drm/radeon/r200.c        |   38 +++
 drivers/gpu/drm/radeon/r300.c        |   76 ++++++
 drivers/gpu/drm/radeon/r420.c        |   39 +++
 drivers/gpu/drm/radeon/r520.c        |   39 +++
 drivers/gpu/drm/radeon/r600.c        |   43 +++-
 drivers/gpu/drm/radeon/radeon.h      |    3 +-
 drivers/gpu/drm/radeon/radeon_asic.h |  494 ++--------------------------------
 drivers/gpu/drm/radeon/rs400.c       |   39 +++
 drivers/gpu/drm/radeon/rs600.c       |   43 +++-
 drivers/gpu/drm/radeon/rs690.c       |   39 +++
 drivers/gpu/drm/radeon/rv515.c       |   41 +++-
 drivers/gpu/drm/radeon/rv770.c       |   42 +++-
 14 files changed, 518 insertions(+), 496 deletions(-)
Quoted 12 lines

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--

#16 lore raw
Quoted 18 lines · Jerome Glisse
Quoted 17 lines · Daniel Vetter

Hi all,

This patch pile moves the "static struct radeon_asic <asic>" definitions form radeon_asic.h into the asic-specific files, where I think they belong. This way radeon_asic.h becomes a real header file that can be #included. And indeed, with all the copy&pasting of function declarations, one has gotten out of sync.

The next step would be to collect asic specific declarations in radeon_asic.h - atm they are somewhat scattered. But this can easily be done on the go and has way too much potential for conflicts with other patches. So I didn't do this.

Tested on my rv570.

Comments higly welcome.

Quoted 7 lines
Quoted 1 line

Yours, Daniel

It all looks good from a quick read through of the patches. For gathering asic function prototype i kind of started adding them to radeon.h at the bottom (there is already a bunch of them). Thus i think radeon_asic.h can be kill and extern declaration directly put into radeon_asic.c

Yes, I've noticed that radeon.h has started to accumulate some declarations (because radeon_asic.h could not be included, I think). IMHO radeon.h is already growing out of bounds, so my plan was to move these declarations to radeon_asic.h. Most of the functions are only used by the asic specific support code (eg. r600 the blit stuff) so would only pollute the general namespace in radeon.h

Does that sound reasonable?

btw, radeon_asic.c doesn't exist here in my tree.

Quoted 2 lines

Cheers,
Jerome

Cheers, Daniel

Signature · 11 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#17 lore raw
In reply to Daniel Vetter
Quoted 8 lines · Daniel Vetter

Hi all,

This patch pile moves the "static struct radeon_asic <asic>" definitions form radeon_asic.h into the asic-specific files, where I think they belong. This way radeon_asic.h becomes a real header file that can be #included. And indeed, with all the copy&pasting of function declarations, one has gotten out of sync.

Quoted 9 lines

The next step would be to collect asic specific declarations in radeon_asic.h - atm they are somewhat scattered. But this can easily be done on the go and has way too much potential for conflicts with other patches. So I didn't do this.

Tested on my rv570.

Comments higly welcome.

I like keeping all the asic definitions in one file as you tend to need to update them all at one time and having them spread across all the asic files increases the likelihood of one or more of them getting missed. But I can live with it if other folks think it's a good idea.

Alex

Quoted 16 lines

Yours, Daniel

Daniel Vetter (14):
 drm/radoen: move r100 asic struct to r100.c
 drm/radoen: move r200 asic struct to r200.c
 drm/radeon: move r300 asic structs to r300.c
 drm/radeon: move r420 asic struct to r420.c
 drm/radoen: move rs400 asic struct to rs400.c
 drm/radoen: move rs600 asic struct to rs600.c
 drm/radoen: move rs690 asic struct to rs690.c
 drm/radoen: move rv515 asic struct to rv515.c
 drm/radoen: move r520 asic struct to r520.c
 drm/radoen: move r600 asic struct to r600.c
 drm/radoen: move rv770 asic struct to rv770.c
 drm/radoen: move evergreen asic struct to evergreen.c drm/radoen: unconfuse return value of radeon_asic->clear_surface_reg

This one should be applied.

Quoted 19 lines

 drm/radeon: include radeon_asic.h in <asic>.c

 drivers/gpu/drm/radeon/evergreen.c   |   39 +++-

 drivers/gpu/drm/radeon/r100.c        |   39 +++
 drivers/gpu/drm/radeon/r200.c        |   38 +++
 drivers/gpu/drm/radeon/r300.c        |   76 ++++++
 drivers/gpu/drm/radeon/r420.c        |   39 +++
 drivers/gpu/drm/radeon/r520.c        |   39 +++
 drivers/gpu/drm/radeon/r600.c        |   43 +++-
 drivers/gpu/drm/radeon/radeon.h      |    3 +-
 drivers/gpu/drm/radeon/radeon_asic.h |  494 ++--------------------------------
 drivers/gpu/drm/radeon/rs400.c       |   39 +++
 drivers/gpu/drm/radeon/rs600.c       |   43 +++-
 drivers/gpu/drm/radeon/rs690.c       |   39 +++
 drivers/gpu/drm/radeon/rv515.c       |   41 +++-
 drivers/gpu/drm/radeon/rv770.c       |   42 +++-
 14 files changed, 518 insertions(+), 496 deletions(-)
Quoted 12 lines

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--

#18 lore raw
Quoted 6 lines · Alex Deucher

I like keeping all the asic definitions in one file as you tend to need to update them all at one time and having them spread across all the asic files increases the likelihood of one or more of them getting missed. But I can live with it if other folks think it's a good idea.

Alex

I've also thought about putting all asic structs into one file but decided against it for two reasons:
- putting the asics into the asic specific files allows us to mark asic-private functions as static. This makes code-reading easier. Of course, as someone who has just started to look at the radeon drm, I'm biased ;)
- there was no .c file around where they'd fit.

Creating a new radeon_asic.c file would be another option of course. If you think that's much better, I could respin the series.

Daniel

Signature · 11 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
#19 lore raw
In reply to Alex Deucher

2010/3/11 Alex Deucher <[email protected]>:

Quoted 4 lines

I like keeping all the asic definitions in one file as you tend to need to update them all at one time and having them spread across all the asic files increases the likelihood of one or more of them getting missed.  But I can live with it if other folks think it's a good idea.

Same here. One file means easier editing. Maybe we could use some other of proposed tricks?

Signature · 13 lines
Rafał

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
#20 lore raw
Quoted 11 lines · Rafał Miłecki

2010/3/11 Alex Deucher <[email protected]>:

Quoted 4 lines

I like keeping all the asic definitions in one file as you tend to need to update them all at one time and having them spread across all the asic files increases the likelihood of one or more of them getting missed.  But I can live with it if other folks think it's a good idea.

Same here. One file means easier editing. Maybe we could use some other of proposed tricks?

Signature · 1 line
Rafał

I don't have strong feeling but Alex has a point, right now we often update them, maybe we should add radeon_asic.c and move asic init (function now in radeon_device.c) along structure there.

Cheers,
Jerome

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

#21 lore raw

2010/3/11 Jerome Glisse <[email protected]>:

Quoted 10 lines · Rafał Miłecki
Quoted 9 lines

2010/3/11 Alex Deucher <[email protected]>:

Quoted 4 lines

I like keeping all the asic definitions in one file as you tend to need to update them all at one time and having them spread across all the asic files increases the likelihood of one or more of them getting missed.  But I can live with it if other folks think it's a good idea.

Same here. One file means easier editing. Maybe we could use some other of proposed tricks?

Quoted 6 lines
Quoted 2 lines

--
Rafał

I don't have strong feeling but Alex has a point, right now we often update them, maybe we should add radeon_asic.c and move asic init (function now in radeon_device.c) along structure there.

That seems like a good plan.

Alex

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

#22 lore raw
In reply to Jerome Glisse
Quoted 10 lines · Jerome Glisse
Quoted 9 lines · Rafał Miłecki

2010/3/11 Alex Deucher <[email protected]>:

Quoted 4 lines

I like keeping all the asic definitions in one file as you tend to need to update them all at one time and having them spread across all the asic files increases the likelihood of one or more of them getting missed.  But I can live with it if other folks think it's a good idea.

Same here. One file means easier editing. Maybe we could use some other of proposed tricks?

Quoted 6 lines
Quoted 2 lines
Signature · 1 line
Rafał

I don't have strong feeling but Alex has a point, right now we often update them, maybe we should add radeon_asic.c and move asic init (function now in radeon_device.c) along structure there.

Ok, convinced. I'll respin the patch series along your idea (creating radeon_asic.c) and resend.

Yours, Daniel

Signature · 15 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel
maintainer
#23 lore raw
In reply to Jerome Glisse

2010/3/12 Jerome Glisse <[email protected]>:

Quoted 10 lines · Rafał Miłecki
Quoted 9 lines

2010/3/11 Alex Deucher <[email protected]>:

Quoted 4 lines

I like keeping all the asic definitions in one file as you tend to need to update them all at one time and having them spread across all the asic files increases the likelihood of one or more of them getting missed.  But I can live with it if other folks think it's a good idea.

Same here. One file means easier editing. Maybe we could use some other of proposed tricks?

Quoted 7 lines
Quoted 2 lines

--
Rafał

I don't have strong feeling but Alex has a point, right now we often update them, maybe we should add radeon_asic.c and move asic init (function now in radeon_device.c) along structure there.

I've seen it sugggested earlier,

Just don't use declarations in the C file, that isn't acceptable coding.

If we add radeon_asic.h make sure to include that in places that define the functions as well.

Last thing we want is declarations to diverge by accident.

Dave.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

#24 lore raw
Quoted 5 lines · Dave Airlie
Quoted 4 lines

I don't have strong feeling but Alex has a point, right now we often update them, maybe we should add radeon_asic.c and move asic init (function now in radeon_device.c) along structure there.

Quoted 8 lines

I've seen it sugggested earlier,

Just don't use declarations in the C file, that isn't acceptable coding.

If we add radeon_asic.h make sure to include that in places that define the functions as well.

Last thing we want is declarations to diverge by accident.

Well, this is exactly what I'm trying to fix here. atm radeon_asic.h contains static struct definitions (i.e. should be a C file) and is therefore included only exactly _once_. And contains tons of declarations for the functions it uses. Which are actually in one case not coherent with the actual definitions!
-Daniel

Signature · 11 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--