drm/radeon/kms: add a radeon asic callback for mc idle
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 23 Feb 2012 22:53:38 +0000 (17:53 -0500)
committerDave Airlie <airlied@redhat.com>
Mon, 27 Feb 2012 14:48:58 +0000 (14:48 +0000)
Required for future functionality.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/r520.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_asic.c
drivers/gpu/drm/radeon/radeon_asic.h
drivers/gpu/drm/radeon/rs690.c

index 4ae1615e752ff8f6c5ecbfdc5eb83e3dbd120934..2e1087a2b97338fbcb85e0cdd3f5f9c359761629 100644 (file)
@@ -33,7 +33,7 @@
 
 /* This files gather functions specifics to: r520,rv530,rv560,rv570,r580 */
 
-static int r520_mc_wait_for_idle(struct radeon_device *rdev)
+int r520_mc_wait_for_idle(struct radeon_device *rdev)
 {
        unsigned i;
        uint32_t tmp;
index e19a430d3443f6a7acac74b9e6e0b9d2b6cd750e..37e104b063250da7c7aeb5c1ee119fb097fa02fb 100644 (file)
@@ -1206,6 +1206,8 @@ struct radeon_asic {
        void (*post_page_flip)(struct radeon_device *rdev, int crtc);
        /* wait for vblank */
        void (*wait_for_vblank)(struct radeon_device *rdev, int crtc);
+       /* wait for mc_idle */
+       int (*mc_wait_for_idle)(struct radeon_device *rdev);
 };
 
 /*
@@ -1695,6 +1697,7 @@ void radeon_ring_write(struct radeon_ring *ring, uint32_t v);
 #define radeon_page_flip(rdev, crtc, base) rdev->asic->page_flip((rdev), (crtc), (base))
 #define radeon_post_page_flip(rdev, crtc) rdev->asic->post_page_flip((rdev), (crtc))
 #define radeon_wait_for_vblank(rdev, crtc) rdev->asic->wait_for_vblank((rdev), (crtc))
+#define radeon_mc_wait_for_idle(rdev) rdev->asic->mc_wait_for_idle((rdev))
 
 /* Common functions */
 /* AGP */
index c6636085996196a2a407c8d1e0b1b06e93623a9b..cc71875383632b93e58ba59e1c5e727fc346eb59 100644 (file)
@@ -179,6 +179,7 @@ static struct radeon_asic r100_asic = {
        .page_flip = &r100_page_flip,
        .post_page_flip = &r100_post_page_flip,
        .wait_for_vblank = &r100_wait_for_vblank,
+       .mc_wait_for_idle = &r100_mc_wait_for_idle,
 };
 
 static struct radeon_asic r200_asic = {
@@ -231,6 +232,7 @@ static struct radeon_asic r200_asic = {
        .page_flip = &r100_page_flip,
        .post_page_flip = &r100_post_page_flip,
        .wait_for_vblank = &r100_wait_for_vblank,
+       .mc_wait_for_idle = &r100_mc_wait_for_idle,
 };
 
 static struct radeon_asic r300_asic = {
@@ -284,6 +286,7 @@ static struct radeon_asic r300_asic = {
        .page_flip = &r100_page_flip,
        .post_page_flip = &r100_post_page_flip,
        .wait_for_vblank = &r100_wait_for_vblank,
+       .mc_wait_for_idle = &r300_mc_wait_for_idle,
 };
 
 static struct radeon_asic r300_asic_pcie = {
@@ -336,6 +339,7 @@ static struct radeon_asic r300_asic_pcie = {
        .page_flip = &r100_page_flip,
        .post_page_flip = &r100_post_page_flip,
        .wait_for_vblank = &r100_wait_for_vblank,
+       .mc_wait_for_idle = &r300_mc_wait_for_idle,
 };
 
 static struct radeon_asic r420_asic = {
@@ -389,6 +393,7 @@ static struct radeon_asic r420_asic = {
        .page_flip = &r100_page_flip,
        .post_page_flip = &r100_post_page_flip,
        .wait_for_vblank = &r100_wait_for_vblank,
+       .mc_wait_for_idle = &r300_mc_wait_for_idle,
 };
 
 static struct radeon_asic rs400_asic = {
@@ -442,6 +447,7 @@ static struct radeon_asic rs400_asic = {
        .page_flip = &r100_page_flip,
        .post_page_flip = &r100_post_page_flip,
        .wait_for_vblank = &r100_wait_for_vblank,
+       .mc_wait_for_idle = &rs400_mc_wait_for_idle,
 };
 
 static struct radeon_asic rs600_asic = {
@@ -495,6 +501,7 @@ static struct radeon_asic rs600_asic = {
        .page_flip = &rs600_page_flip,
        .post_page_flip = &rs600_post_page_flip,
        .wait_for_vblank = &avivo_wait_for_vblank,
+       .mc_wait_for_idle = &rs600_mc_wait_for_idle,
 };
 
 static struct radeon_asic rs690_asic = {
@@ -548,6 +555,7 @@ static struct radeon_asic rs690_asic = {
        .page_flip = &rs600_page_flip,
        .post_page_flip = &rs600_post_page_flip,
        .wait_for_vblank = &avivo_wait_for_vblank,
+       .mc_wait_for_idle = &rs690_mc_wait_for_idle,
 };
 
 static struct radeon_asic rv515_asic = {
@@ -601,6 +609,7 @@ static struct radeon_asic rv515_asic = {
        .page_flip = &rs600_page_flip,
        .post_page_flip = &rs600_post_page_flip,
        .wait_for_vblank = &avivo_wait_for_vblank,
+       .mc_wait_for_idle = &rv515_mc_wait_for_idle,
 };
 
 static struct radeon_asic r520_asic = {
@@ -654,6 +663,7 @@ static struct radeon_asic r520_asic = {
        .page_flip = &rs600_page_flip,
        .post_page_flip = &rs600_post_page_flip,
        .wait_for_vblank = &avivo_wait_for_vblank,
+       .mc_wait_for_idle = &r520_mc_wait_for_idle,
 };
 
 static struct radeon_asic r600_asic = {
@@ -706,6 +716,7 @@ static struct radeon_asic r600_asic = {
        .page_flip = &rs600_page_flip,
        .post_page_flip = &rs600_post_page_flip,
        .wait_for_vblank = &avivo_wait_for_vblank,
+       .mc_wait_for_idle = &r600_mc_wait_for_idle,
 };
 
 static struct radeon_asic rs780_asic = {
@@ -758,6 +769,7 @@ static struct radeon_asic rs780_asic = {
        .page_flip = &rs600_page_flip,
        .post_page_flip = &rs600_post_page_flip,
        .wait_for_vblank = &avivo_wait_for_vblank,
+       .mc_wait_for_idle = &r600_mc_wait_for_idle,
 };
 
 static struct radeon_asic rv770_asic = {
@@ -810,6 +822,7 @@ static struct radeon_asic rv770_asic = {
        .page_flip = &rv770_page_flip,
        .post_page_flip = &rs600_post_page_flip,
        .wait_for_vblank = &avivo_wait_for_vblank,
+       .mc_wait_for_idle = &r600_mc_wait_for_idle,
 };
 
 static struct radeon_asic evergreen_asic = {
@@ -862,6 +875,7 @@ static struct radeon_asic evergreen_asic = {
        .page_flip = &evergreen_page_flip,
        .post_page_flip = &evergreen_post_page_flip,
        .wait_for_vblank = &dce4_wait_for_vblank,
+       .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
 };
 
 static struct radeon_asic sumo_asic = {
@@ -914,6 +928,7 @@ static struct radeon_asic sumo_asic = {
        .page_flip = &evergreen_page_flip,
        .post_page_flip = &evergreen_post_page_flip,
        .wait_for_vblank = &dce4_wait_for_vblank,
+       .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
 };
 
 static struct radeon_asic btc_asic = {
@@ -966,6 +981,7 @@ static struct radeon_asic btc_asic = {
        .page_flip = &evergreen_page_flip,
        .post_page_flip = &evergreen_post_page_flip,
        .wait_for_vblank = &dce4_wait_for_vblank,
+       .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
 };
 
 static const struct radeon_vm_funcs cayman_vm_funcs = {
@@ -1041,6 +1057,7 @@ static struct radeon_asic cayman_asic = {
        .page_flip = &evergreen_page_flip,
        .post_page_flip = &evergreen_post_page_flip,
        .wait_for_vblank = &dce4_wait_for_vblank,
+       .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
 };
 
 int radeon_asic_init(struct radeon_device *rdev)
index d9df84f9ebb68afbc9f5c72535bac546ad5c15a5..fd8d5dabdb6c8cf13435fe9ca4d101eee68622ad 100644 (file)
@@ -140,6 +140,7 @@ extern void r100_pre_page_flip(struct radeon_device *rdev, int crtc);
 extern u32 r100_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base);
 extern void r100_post_page_flip(struct radeon_device *rdev, int crtc);
 extern void r100_wait_for_vblank(struct radeon_device *rdev, int crtc);
+extern int r100_mc_wait_for_idle(struct radeon_device *rdev);
 
 /*
  * r200,rv250,rs300,rv280
@@ -177,6 +178,7 @@ extern int rv370_pcie_gart_init(struct radeon_device *rdev);
 extern void rv370_pcie_gart_fini(struct radeon_device *rdev);
 extern int rv370_pcie_gart_enable(struct radeon_device *rdev);
 extern void rv370_pcie_gart_disable(struct radeon_device *rdev);
+extern int r300_mc_wait_for_idle(struct radeon_device *rdev);
 
 /*
  * r420,r423,rv410
@@ -207,6 +209,7 @@ int rs400_gart_enable(struct radeon_device *rdev);
 void rs400_gart_adjust_size(struct radeon_device *rdev);
 void rs400_gart_disable(struct radeon_device *rdev);
 void rs400_gart_fini(struct radeon_device *rdev);
+extern int rs400_mc_wait_for_idle(struct radeon_device *rdev);
 
 /*
  * rs600.
@@ -238,6 +241,7 @@ extern u32 rs600_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base);
 extern void rs600_post_page_flip(struct radeon_device *rdev, int crtc);
 void rs600_set_safe_registers(struct radeon_device *rdev);
 extern void avivo_wait_for_vblank(struct radeon_device *rdev, int crtc);
+extern int rs600_mc_wait_for_idle(struct radeon_device *rdev);
 
 /*
  * rs690,rs740
@@ -252,6 +256,7 @@ void rs690_bandwidth_update(struct radeon_device *rdev);
 void rs690_line_buffer_adjust(struct radeon_device *rdev,
                                        struct drm_display_mode *mode1,
                                        struct drm_display_mode *mode2);
+extern int rs690_mc_wait_for_idle(struct radeon_device *rdev);
 
 /*
  * rv515
@@ -279,13 +284,14 @@ void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save);
 void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save);
 void rv515_clock_startup(struct radeon_device *rdev);
 void rv515_debugfs(struct radeon_device *rdev);
-
+int rv515_mc_wait_for_idle(struct radeon_device *rdev);
 
 /*
  * r520,rv530,rv560,rv570,r580
  */
 int r520_init(struct radeon_device *rdev);
 int r520_resume(struct radeon_device *rdev);
+int r520_mc_wait_for_idle(struct radeon_device *rdev);
 
 /*
  * r600,rv610,rv630,rv620,rv635,rv670,rs780,rs880
@@ -376,6 +382,7 @@ void r600_blit_done_copy(struct radeon_device *rdev, struct radeon_fence *fence)
 void r600_kms_blit_copy(struct radeon_device *rdev,
                        u64 src_gpu_addr, u64 dst_gpu_addr,
                        unsigned num_gpu_pages);
+int r600_mc_wait_for_idle(struct radeon_device *rdev);
 
 /*
  * rv770,rv730,rv710,rv740
@@ -427,6 +434,7 @@ extern void evergreen_post_page_flip(struct radeon_device *rdev, int crtc);
 extern void dce4_wait_for_vblank(struct radeon_device *rdev, int crtc);
 void evergreen_disable_interrupt_state(struct radeon_device *rdev);
 int evergreen_blit_init(struct radeon_device *rdev);
+int evergreen_mc_wait_for_idle(struct radeon_device *rdev);
 
 /*
  * cayman
index 4f24a0fa8c82f1c4b9ac790073be0a3e69fb00eb..29fc8b1506a48172043f0dc6879da57e5b8db6e1 100644 (file)
@@ -31,7 +31,7 @@
 #include "atom.h"
 #include "rs690d.h"
 
-static int rs690_mc_wait_for_idle(struct radeon_device *rdev)
+int rs690_mc_wait_for_idle(struct radeon_device *rdev)
 {
        unsigned i;
        uint32_t tmp;