|
@@ -53,6 +53,10 @@ void dce6_afmt_hdmi_write_speaker_allocation(struct drm_encoder *encoder,
|
|
u8 *sadb, int sad_count);
|
|
u8 *sadb, int sad_count);
|
|
void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
|
|
void dce6_afmt_dp_write_speaker_allocation(struct drm_encoder *encoder,
|
|
u8 *sadb, int sad_count);
|
|
u8 *sadb, int sad_count);
|
|
|
|
+void dce4_afmt_write_latency_fields(struct drm_encoder *encoder,
|
|
|
|
+ struct drm_connector *connector, struct drm_display_mode *mode);
|
|
|
|
+void dce6_afmt_write_latency_fields(struct drm_encoder *encoder,
|
|
|
|
+ struct drm_connector *connector, struct drm_display_mode *mode);
|
|
|
|
|
|
static const u32 pin_offsets[7] =
|
|
static const u32 pin_offsets[7] =
|
|
{
|
|
{
|
|
@@ -104,21 +108,25 @@ static struct radeon_audio_funcs dce32_dp_funcs = {
|
|
static struct radeon_audio_funcs dce4_hdmi_funcs = {
|
|
static struct radeon_audio_funcs dce4_hdmi_funcs = {
|
|
.write_sad_regs = evergreen_hdmi_write_sad_regs,
|
|
.write_sad_regs = evergreen_hdmi_write_sad_regs,
|
|
.write_speaker_allocation = dce4_afmt_hdmi_write_speaker_allocation,
|
|
.write_speaker_allocation = dce4_afmt_hdmi_write_speaker_allocation,
|
|
|
|
+ .write_latency_fields = dce4_afmt_write_latency_fields,
|
|
};
|
|
};
|
|
|
|
|
|
static struct radeon_audio_funcs dce4_dp_funcs = {
|
|
static struct radeon_audio_funcs dce4_dp_funcs = {
|
|
.write_sad_regs = evergreen_hdmi_write_sad_regs,
|
|
.write_sad_regs = evergreen_hdmi_write_sad_regs,
|
|
.write_speaker_allocation = dce4_afmt_dp_write_speaker_allocation,
|
|
.write_speaker_allocation = dce4_afmt_dp_write_speaker_allocation,
|
|
|
|
+ .write_latency_fields = dce4_afmt_write_latency_fields,
|
|
};
|
|
};
|
|
|
|
|
|
static struct radeon_audio_funcs dce6_hdmi_funcs = {
|
|
static struct radeon_audio_funcs dce6_hdmi_funcs = {
|
|
.write_sad_regs = dce6_afmt_write_sad_regs,
|
|
.write_sad_regs = dce6_afmt_write_sad_regs,
|
|
.write_speaker_allocation = dce6_afmt_hdmi_write_speaker_allocation,
|
|
.write_speaker_allocation = dce6_afmt_hdmi_write_speaker_allocation,
|
|
|
|
+ .write_latency_fields = dce6_afmt_write_latency_fields,
|
|
};
|
|
};
|
|
|
|
|
|
static struct radeon_audio_funcs dce6_dp_funcs = {
|
|
static struct radeon_audio_funcs dce6_dp_funcs = {
|
|
.write_sad_regs = dce6_afmt_write_sad_regs,
|
|
.write_sad_regs = dce6_afmt_write_sad_regs,
|
|
.write_speaker_allocation = dce6_afmt_dp_write_speaker_allocation,
|
|
.write_speaker_allocation = dce6_afmt_dp_write_speaker_allocation,
|
|
|
|
+ .write_latency_fields = dce6_afmt_write_latency_fields,
|
|
};
|
|
};
|
|
|
|
|
|
static void radeon_audio_interface_init(struct radeon_device *rdev)
|
|
static void radeon_audio_interface_init(struct radeon_device *rdev)
|
|
@@ -307,3 +315,29 @@ void radeon_audio_write_speaker_allocation(struct drm_encoder *encoder)
|
|
|
|
|
|
kfree(sadb);
|
|
kfree(sadb);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+void radeon_audio_write_latency_fields(struct drm_encoder *encoder,
|
|
|
|
+ struct drm_display_mode *mode)
|
|
|
|
+{
|
|
|
|
+ struct radeon_encoder *radeon_encoder;
|
|
|
|
+ struct drm_connector *connector;
|
|
|
|
+ struct radeon_connector *radeon_connector = 0;
|
|
|
|
+
|
|
|
|
+ list_for_each_entry(connector,
|
|
|
|
+ &encoder->dev->mode_config.connector_list, head) {
|
|
|
|
+ if (connector->encoder == encoder) {
|
|
|
|
+ radeon_connector = to_radeon_connector(connector);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!radeon_connector) {
|
|
|
|
+ DRM_ERROR("Couldn't find encoder's connector\n");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ radeon_encoder = to_radeon_encoder(encoder);
|
|
|
|
+
|
|
|
|
+ if (radeon_encoder->audio && radeon_encoder->audio->write_latency_fields)
|
|
|
|
+ radeon_encoder->audio->write_latency_fields(encoder, connector, mode);
|
|
|
|
+}
|