summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_audio.c
diff options
context:
space:
mode:
authorSlava Grigorev <slava.grigorev@amd.com>2014-12-09 00:25:37 +0300
committerAlex Deucher <alexander.deucher@amd.com>2015-01-22 18:42:12 +0300
commitbe273e58f00f75c750fd0ece8f0d7c3cfb36c88e (patch)
treee9cacd95a4ae8e85897cfa91c9019fba993f0f39 /drivers/gpu/drm/radeon/radeon_audio.c
parent930a9785120d7397ba8912e1a4f72b65e7e25f25 (diff)
downloadlinux-be273e58f00f75c750fd0ece8f0d7c3cfb36c88e.tar.xz
radeon: moved HDMI color depth programming to a separate function
Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Slava Grigorev <slava.grigorev@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_audio.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_audio.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_audio.c b/drivers/gpu/drm/radeon/radeon_audio.c
index 8fad9af92ec8..ac9ebbfc48af 100644
--- a/drivers/gpu/drm/radeon/radeon_audio.c
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
@@ -87,6 +87,8 @@ void evergreen_hdmi_update_acr(struct drm_encoder *encoder, long offset,
const struct radeon_hdmi_acr *acr);
void r600_set_vbi_packet(struct drm_encoder *encoder, u32 offset);
void dce4_set_vbi_packet(struct drm_encoder *encoder, u32 offset);
+void dce4_hdmi_set_color_depth(struct drm_encoder *encoder,
+ u32 offset, int bpc);
static const u32 pin_offsets[7] =
{
@@ -169,6 +171,7 @@ static struct radeon_audio_funcs dce4_hdmi_funcs = {
.set_dto = dce4_hdmi_audio_set_dto,
.update_acr = evergreen_hdmi_update_acr,
.set_vbi_packet = dce4_set_vbi_packet,
+ .set_color_depth = dce4_hdmi_set_color_depth,
};
static struct radeon_audio_funcs dce4_dp_funcs = {
@@ -188,6 +191,7 @@ static struct radeon_audio_funcs dce6_hdmi_funcs = {
.set_dto = dce6_hdmi_audio_set_dto,
.update_acr = evergreen_hdmi_update_acr,
.set_vbi_packet = dce4_set_vbi_packet,
+ .set_color_depth = dce4_hdmi_set_color_depth,
};
static struct radeon_audio_funcs dce6_dp_funcs = {
@@ -574,3 +578,21 @@ void radeon_audio_set_vbi_packet(struct drm_encoder *encoder)
if (radeon_encoder->audio && radeon_encoder->audio->set_vbi_packet)
radeon_encoder->audio->set_vbi_packet(encoder, dig->afmt->offset);
}
+
+void radeon_hdmi_set_color_depth(struct drm_encoder *encoder)
+{
+ int bpc = 8;
+ struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+ struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
+
+ if (!dig || !dig->afmt)
+ return;
+
+ if (encoder->crtc) {
+ struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
+ bpc = radeon_crtc->bpc;
+ }
+
+ if (radeon_encoder->audio && radeon_encoder->audio->set_color_depth)
+ radeon_encoder->audio->set_color_depth(encoder, dig->afmt->offset, bpc);
+}