drm/radeon: Backport two bugfixes from drm v3.19
authorzrj <rimvydas.jasinskas@gmail.com>
Tue, 17 May 2016 09:06:30 +0000 (12:06 +0300)
committerzrj <zrj@dragonflybsd.org>
Tue, 17 May 2016 09:55:41 +0000 (12:55 +0300)
In attempt to keep radeon at v3.18 level for drm/ttm update.

sys/dev/drm/radeon/ci_dpm.c
sys/dev/drm/radeon/radeon_asic.c

index 36a7cc9..c799335 100644 (file)
@@ -4664,6 +4664,12 @@ int ci_dpm_enable(struct radeon_device *rdev)
                return ret;
        }
 
+       ret = ci_power_control_set_level(rdev);
+       if (ret) {
+               DRM_ERROR("ci_power_control_set_level failed\n");
+               return ret;
+       }
+
        ci_enable_auto_throttle_source(rdev, RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL, true);
 
        ci_update_current_ps(rdev, boot_ps);
@@ -4793,11 +4799,6 @@ int ci_dpm_set_power_state(struct radeon_device *rdev)
        return 0;
 }
 
-static int __unused ci_dpm_power_control_set_level(struct radeon_device *rdev)
-{
-       return ci_power_control_set_level(rdev);
-}
-
 #if 0
 void ci_dpm_reset_asic(struct radeon_device *rdev)
 {
index d90a51b..201dd29 100644 (file)
@@ -332,6 +332,20 @@ static struct radeon_asic_ring r300_gfx_ring = {
        .set_wptr = &r100_gfx_set_wptr,
 };
 
+static struct radeon_asic_ring rv515_gfx_ring = {
+       .ib_execute = &r100_ring_ib_execute,
+       .emit_fence = &r300_fence_ring_emit,
+       .emit_semaphore = &r100_semaphore_ring_emit,
+       .cs_parse = &r300_cs_parse,
+       .ring_start = &rv515_ring_start,
+       .ring_test = &r100_ring_test,
+       .ib_test = &r100_ib_test,
+       .is_lockup = &r100_gpu_is_lockup,
+       .get_rptr = &r100_gfx_get_rptr,
+       .get_wptr = &r100_gfx_get_wptr,
+       .set_wptr = &r100_gfx_set_wptr,
+};
+
 static struct radeon_asic r300_asic = {
        .init = &r300_init,
        .fini = &r300_fini,
@@ -747,7 +761,7 @@ static struct radeon_asic rv515_asic = {
                .set_page = &rv370_pcie_gart_set_page,
        },
        .ring = {
-               [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
+               [RADEON_RING_TYPE_GFX_INDEX] = &rv515_gfx_ring
        },
        .irq = {
                .set = &rs600_irq_set,
@@ -813,7 +827,7 @@ static struct radeon_asic r520_asic = {
                .set_page = &rv370_pcie_gart_set_page,
        },
        .ring = {
-               [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
+               [RADEON_RING_TYPE_GFX_INDEX] = &rv515_gfx_ring
        },
        .irq = {
                .set = &rs600_irq_set,