diff options
| author | Rafał Miłecki <zajec5@gmail.com> | 2012-04-28 17:35:20 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2012-05-01 05:57:36 -0400 |
| commit | a92553abe585429c65d2db0c4567f336f4fdf22b (patch) | |
| tree | 979ac5f6746dfe83691e1fcb01fad77266f4384a | |
| parent | 2baf8377997cce10bb730f306392f29794dea217 (diff) | |
drm/radeon/kms: move audio params to separated struct
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/radeon/r600_audio.c | 34 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 19 |
2 files changed, 27 insertions, 26 deletions
diff --git a/drivers/gpu/drm/radeon/r600_audio.c b/drivers/gpu/drm/radeon/r600_audio.c index a7c06c330fe1..b922a3cd90db 100644 --- a/drivers/gpu/drm/radeon/r600_audio.c +++ b/drivers/gpu/drm/radeon/r600_audio.c | |||
| @@ -120,18 +120,18 @@ void r600_audio_update_hdmi(struct work_struct *work) | |||
| 120 | struct drm_encoder *encoder; | 120 | struct drm_encoder *encoder; |
| 121 | int changes = 0; | 121 | int changes = 0; |
| 122 | 122 | ||
| 123 | changes |= channels != rdev->audio_channels; | 123 | changes |= channels != rdev->audio.channels; |
| 124 | changes |= rate != rdev->audio_rate; | 124 | changes |= rate != rdev->audio.rate; |
| 125 | changes |= bps != rdev->audio_bits_per_sample; | 125 | changes |= bps != rdev->audio.bits_per_sample; |
| 126 | changes |= status_bits != rdev->audio_status_bits; | 126 | changes |= status_bits != rdev->audio.status_bits; |
| 127 | changes |= category_code != rdev->audio_category_code; | 127 | changes |= category_code != rdev->audio.category_code; |
| 128 | 128 | ||
| 129 | if (changes) { | 129 | if (changes) { |
| 130 | rdev->audio_channels = channels; | 130 | rdev->audio.channels = channels; |
| 131 | rdev->audio_rate = rate; | 131 | rdev->audio.rate = rate; |
| 132 | rdev->audio_bits_per_sample = bps; | 132 | rdev->audio.bits_per_sample = bps; |
| 133 | rdev->audio_status_bits = status_bits; | 133 | rdev->audio.status_bits = status_bits; |
| 134 | rdev->audio_category_code = category_code; | 134 | rdev->audio.category_code = category_code; |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | 137 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
| @@ -157,7 +157,7 @@ static void r600_audio_engine_enable(struct radeon_device *rdev, bool enable) | |||
| 157 | WREG32_P(R600_AUDIO_ENABLE, | 157 | WREG32_P(R600_AUDIO_ENABLE, |
| 158 | enable ? 0x81000000 : 0x0, ~0x81000000); | 158 | enable ? 0x81000000 : 0x0, ~0x81000000); |
| 159 | } | 159 | } |
| 160 | rdev->audio_enabled = enable; | 160 | rdev->audio.enabled = enable; |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | /* | 163 | /* |
| @@ -170,11 +170,11 @@ int r600_audio_init(struct radeon_device *rdev) | |||
| 170 | 170 | ||
| 171 | r600_audio_engine_enable(rdev, true); | 171 | r600_audio_engine_enable(rdev, true); |
| 172 | 172 | ||
| 173 | rdev->audio_channels = -1; | 173 | rdev->audio.channels = -1; |
| 174 | rdev->audio_rate = -1; | 174 | rdev->audio.rate = -1; |
| 175 | rdev->audio_bits_per_sample = -1; | 175 | rdev->audio.bits_per_sample = -1; |
| 176 | rdev->audio_status_bits = 0; | 176 | rdev->audio.status_bits = 0; |
| 177 | rdev->audio_category_code = 0; | 177 | rdev->audio.category_code = 0; |
| 178 | 178 | ||
| 179 | return 0; | 179 | return 0; |
| 180 | } | 180 | } |
| @@ -243,7 +243,7 @@ void r600_audio_set_clock(struct drm_encoder *encoder, int clock) | |||
| 243 | */ | 243 | */ |
| 244 | void r600_audio_fini(struct radeon_device *rdev) | 244 | void r600_audio_fini(struct radeon_device *rdev) |
| 245 | { | 245 | { |
| 246 | if (!rdev->audio_enabled) | 246 | if (!rdev->audio.enabled) |
| 247 | return; | 247 | return; |
| 248 | 248 | ||
| 249 | r600_audio_engine_enable(rdev, false); | 249 | r600_audio_engine_enable(rdev, false); |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 566ca3b3c873..610acee74a3d 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
| @@ -1114,6 +1114,15 @@ int radeon_pm_get_type_index(struct radeon_device *rdev, | |||
| 1114 | enum radeon_pm_state_type ps_type, | 1114 | enum radeon_pm_state_type ps_type, |
| 1115 | int instance); | 1115 | int instance); |
| 1116 | 1116 | ||
| 1117 | struct r600_audio { | ||
| 1118 | bool enabled; | ||
| 1119 | int channels; | ||
| 1120 | int rate; | ||
| 1121 | int bits_per_sample; | ||
| 1122 | u8 status_bits; | ||
| 1123 | u8 category_code; | ||
| 1124 | }; | ||
| 1125 | |||
| 1117 | /* | 1126 | /* |
| 1118 | * Benchmarking | 1127 | * Benchmarking |
| 1119 | */ | 1128 | */ |
| @@ -1559,15 +1568,7 @@ struct radeon_device { | |||
| 1559 | int num_crtc; /* number of crtcs */ | 1568 | int num_crtc; /* number of crtcs */ |
| 1560 | struct mutex dc_hw_i2c_mutex; /* display controller hw i2c mutex */ | 1569 | struct mutex dc_hw_i2c_mutex; /* display controller hw i2c mutex */ |
| 1561 | struct mutex vram_mutex; | 1570 | struct mutex vram_mutex; |
| 1562 | 1571 | struct r600_audio audio; /* audio stuff */ | |
| 1563 | /* audio stuff */ | ||
| 1564 | bool audio_enabled; | ||
| 1565 | int audio_channels; | ||
| 1566 | int audio_rate; | ||
| 1567 | int audio_bits_per_sample; | ||
| 1568 | uint8_t audio_status_bits; | ||
| 1569 | uint8_t audio_category_code; | ||
| 1570 | |||
| 1571 | struct notifier_block acpi_nb; | 1572 | struct notifier_block acpi_nb; |
| 1572 | /* only one userspace can use Hyperz features or CMASK at a time */ | 1573 | /* only one userspace can use Hyperz features or CMASK at a time */ |
| 1573 | struct drm_file *hyperz_filp; | 1574 | struct drm_file *hyperz_filp; |
