diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-08-20 20:29:05 -0400 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2014-02-18 10:11:32 -0500 |
commit | b62d628bd63f61e9aea3b8fab2ec638680bf4aa4 (patch) | |
tree | 24d38dfe3996169ca839971241ac427b23ba5a39 | |
parent | 82f79cc54b6a67c0b17aff4fb5ed43155ff3f0ea (diff) |
drm/radeon/dpm: fill in some initial vce infrastructure
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 8 |
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 2b26feb0a7c6..60c171c60a64 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -1259,6 +1259,15 @@ enum radeon_dpm_event_src { | |||
1259 | RADEON_DPM_EVENT_SRC_DIGIAL_OR_EXTERNAL = 4 | 1259 | RADEON_DPM_EVENT_SRC_DIGIAL_OR_EXTERNAL = 4 |
1260 | }; | 1260 | }; |
1261 | 1261 | ||
1262 | enum radeon_vce_level { | ||
1263 | RADEON_VCE_LEVEL_AC_ALL = 0, /* AC, All cases */ | ||
1264 | RADEON_VCE_LEVEL_DC_EE = 1, /* DC, entropy encoding */ | ||
1265 | RADEON_VCE_LEVEL_DC_LL_LOW = 2, /* DC, low latency queue, res <= 720 */ | ||
1266 | RADEON_VCE_LEVEL_DC_LL_HIGH = 3, /* DC, low latency queue, 1080 >= res > 720 */ | ||
1267 | RADEON_VCE_LEVEL_DC_GP_LOW = 4, /* DC, general purpose queue, res <= 720 */ | ||
1268 | RADEON_VCE_LEVEL_DC_GP_HIGH = 5, /* DC, general purpose queue, 1080 >= res > 720 */ | ||
1269 | }; | ||
1270 | |||
1262 | struct radeon_ps { | 1271 | struct radeon_ps { |
1263 | u32 caps; /* vbios flags */ | 1272 | u32 caps; /* vbios flags */ |
1264 | u32 class; /* vbios flags */ | 1273 | u32 class; /* vbios flags */ |
@@ -1269,6 +1278,8 @@ struct radeon_ps { | |||
1269 | /* VCE clocks */ | 1278 | /* VCE clocks */ |
1270 | u32 evclk; | 1279 | u32 evclk; |
1271 | u32 ecclk; | 1280 | u32 ecclk; |
1281 | bool vce_active; | ||
1282 | enum radeon_vce_level vce_level; | ||
1272 | /* asic priv */ | 1283 | /* asic priv */ |
1273 | void *ps_priv; | 1284 | void *ps_priv; |
1274 | }; | 1285 | }; |
@@ -1480,6 +1491,7 @@ struct radeon_dpm { | |||
1480 | /* special states active */ | 1491 | /* special states active */ |
1481 | bool thermal_active; | 1492 | bool thermal_active; |
1482 | bool uvd_active; | 1493 | bool uvd_active; |
1494 | bool vce_active; | ||
1483 | /* thermal handling */ | 1495 | /* thermal handling */ |
1484 | struct radeon_dpm_thermal thermal; | 1496 | struct radeon_dpm_thermal thermal; |
1485 | /* forced levels */ | 1497 | /* forced levels */ |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 8e8153e471c2..a4687e7b45f8 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -826,6 +826,9 @@ static void radeon_dpm_change_power_state_locked(struct radeon_device *rdev) | |||
826 | 826 | ||
827 | /* no need to reprogram if nothing changed unless we are on BTC+ */ | 827 | /* no need to reprogram if nothing changed unless we are on BTC+ */ |
828 | if (rdev->pm.dpm.current_ps == rdev->pm.dpm.requested_ps) { | 828 | if (rdev->pm.dpm.current_ps == rdev->pm.dpm.requested_ps) { |
829 | /* vce just modifies an existing state so force a change */ | ||
830 | if (ps->vce_active != rdev->pm.dpm.vce_active) | ||
831 | goto force; | ||
829 | if ((rdev->family < CHIP_BARTS) || (rdev->flags & RADEON_IS_IGP)) { | 832 | if ((rdev->family < CHIP_BARTS) || (rdev->flags & RADEON_IS_IGP)) { |
830 | /* for pre-BTC and APUs if the num crtcs changed but state is the same, | 833 | /* for pre-BTC and APUs if the num crtcs changed but state is the same, |
831 | * all we need to do is update the display configuration. | 834 | * all we need to do is update the display configuration. |
@@ -862,16 +865,21 @@ static void radeon_dpm_change_power_state_locked(struct radeon_device *rdev) | |||
862 | } | 865 | } |
863 | } | 866 | } |
864 | 867 | ||
868 | force: | ||
865 | if (radeon_dpm == 1) { | 869 | if (radeon_dpm == 1) { |
866 | printk("switching from power state:\n"); | 870 | printk("switching from power state:\n"); |
867 | radeon_dpm_print_power_state(rdev, rdev->pm.dpm.current_ps); | 871 | radeon_dpm_print_power_state(rdev, rdev->pm.dpm.current_ps); |
868 | printk("switching to power state:\n"); | 872 | printk("switching to power state:\n"); |
869 | radeon_dpm_print_power_state(rdev, rdev->pm.dpm.requested_ps); | 873 | radeon_dpm_print_power_state(rdev, rdev->pm.dpm.requested_ps); |
870 | } | 874 | } |
875 | |||
871 | mutex_lock(&rdev->ddev->struct_mutex); | 876 | mutex_lock(&rdev->ddev->struct_mutex); |
872 | down_write(&rdev->pm.mclk_lock); | 877 | down_write(&rdev->pm.mclk_lock); |
873 | mutex_lock(&rdev->ring_lock); | 878 | mutex_lock(&rdev->ring_lock); |
874 | 879 | ||
880 | /* update whether vce is active */ | ||
881 | ps->vce_active = rdev->pm.dpm.vce_active; | ||
882 | |||
875 | ret = radeon_dpm_pre_set_power_state(rdev); | 883 | ret = radeon_dpm_pre_set_power_state(rdev); |
876 | if (ret) | 884 | if (ret) |
877 | goto done; | 885 | goto done; |