mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-29 07:34:06 +08:00
drm/radeon/kms: keep HDMI state in separated variable
If we want hdmi_offset to be relative to the first block, zero value can be used also for enabled block. Signed-off-by: Rafał Miłecki <zajec5@gmail.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>
This commit is contained in:
parent
816ce43705
commit
af0b57436d
@ -275,7 +275,7 @@ int r600_hdmi_buffer_status_changed(struct drm_encoder *encoder)
|
|||||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||||
int status, result;
|
int status, result;
|
||||||
|
|
||||||
if (!radeon_encoder->hdmi_offset)
|
if (!radeon_encoder->hdmi_enabled)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
status = r600_hdmi_is_audio_buffer_filled(encoder);
|
status = r600_hdmi_is_audio_buffer_filled(encoder);
|
||||||
@ -295,7 +295,7 @@ void r600_hdmi_audio_workaround(struct drm_encoder *encoder)
|
|||||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||||
uint32_t offset = radeon_encoder->hdmi_offset;
|
uint32_t offset = radeon_encoder->hdmi_offset;
|
||||||
|
|
||||||
if (!offset)
|
if (!radeon_encoder->hdmi_enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!radeon_encoder->hdmi_audio_workaround ||
|
if (!radeon_encoder->hdmi_audio_workaround ||
|
||||||
@ -323,7 +323,7 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod
|
|||||||
if (ASIC_IS_DCE5(rdev))
|
if (ASIC_IS_DCE5(rdev))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!offset)
|
if (!to_radeon_encoder(encoder)->hdmi_enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
r600_audio_set_clock(encoder, mode->clock);
|
r600_audio_set_clock(encoder, mode->clock);
|
||||||
@ -370,7 +370,7 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder)
|
|||||||
|
|
||||||
uint32_t iec;
|
uint32_t iec;
|
||||||
|
|
||||||
if (!offset)
|
if (!to_radeon_encoder(encoder)->hdmi_enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DRM_DEBUG("%s with %d channels, %d Hz sampling rate, %d bits per sample,\n",
|
DRM_DEBUG("%s with %d channels, %d Hz sampling rate, %d bits per sample,\n",
|
||||||
@ -463,6 +463,7 @@ static void r600_hdmi_assign_block(struct drm_encoder *encoder)
|
|||||||
/* Only 1 routable block */
|
/* Only 1 routable block */
|
||||||
radeon_encoder->hdmi_offset = R600_HDMI_BLOCK1;
|
radeon_encoder->hdmi_offset = R600_HDMI_BLOCK1;
|
||||||
}
|
}
|
||||||
|
radeon_encoder->hdmi_enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -478,9 +479,9 @@ void r600_hdmi_enable(struct drm_encoder *encoder)
|
|||||||
if (ASIC_IS_DCE5(rdev))
|
if (ASIC_IS_DCE5(rdev))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!radeon_encoder->hdmi_offset) {
|
if (!radeon_encoder->hdmi_enabled) {
|
||||||
r600_hdmi_assign_block(encoder);
|
r600_hdmi_assign_block(encoder);
|
||||||
if (!radeon_encoder->hdmi_offset) {
|
if (!radeon_encoder->hdmi_enabled) {
|
||||||
dev_warn(rdev->dev, "Could not find HDMI block for "
|
dev_warn(rdev->dev, "Could not find HDMI block for "
|
||||||
"0x%x encoder\n", radeon_encoder->encoder_id);
|
"0x%x encoder\n", radeon_encoder->encoder_id);
|
||||||
return;
|
return;
|
||||||
@ -538,7 +539,7 @@ void r600_hdmi_disable(struct drm_encoder *encoder)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
offset = radeon_encoder->hdmi_offset;
|
offset = radeon_encoder->hdmi_offset;
|
||||||
if (!offset) {
|
if (!radeon_encoder->hdmi_enabled) {
|
||||||
dev_err(rdev->dev, "Disabling not enabled HDMI\n");
|
dev_err(rdev->dev, "Disabling not enabled HDMI\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -575,5 +576,6 @@ void r600_hdmi_disable(struct drm_encoder *encoder)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
radeon_encoder->hdmi_enabled = false;
|
||||||
radeon_encoder->hdmi_offset = 0;
|
radeon_encoder->hdmi_offset = 0;
|
||||||
}
|
}
|
||||||
|
@ -384,6 +384,7 @@ struct radeon_encoder {
|
|||||||
struct drm_display_mode native_mode;
|
struct drm_display_mode native_mode;
|
||||||
void *enc_priv;
|
void *enc_priv;
|
||||||
int audio_polling_active;
|
int audio_polling_active;
|
||||||
|
bool hdmi_enabled;
|
||||||
int hdmi_offset;
|
int hdmi_offset;
|
||||||
int hdmi_audio_workaround;
|
int hdmi_audio_workaround;
|
||||||
int hdmi_buffer_status;
|
int hdmi_buffer_status;
|
||||||
|
Loading…
Reference in New Issue
Block a user