mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-08 07:16:26 +00:00
drm/nouveau/kms/nv50-: fixup sink D3 before tearing down link
- fixes bug preventing this on SST - implement for MST Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Acked-by: Danilo Krummrich <me@dakr.org> Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-32-lyude@redhat.com
This commit is contained in:
parent
625ead3d39
commit
757033808c
@ -1300,6 +1300,7 @@ nv50_mstm_cleanup(struct drm_atomic_state *state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mstm->disabled) {
|
if (mstm->disabled) {
|
||||||
|
nouveau_dp_power_down(mstm->outp);
|
||||||
nvif_outp_release(&mstm->outp->outp);
|
nvif_outp_release(&mstm->outp->outp);
|
||||||
mstm->disabled = false;
|
mstm->disabled = false;
|
||||||
}
|
}
|
||||||
@ -1551,7 +1552,6 @@ nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *st
|
|||||||
#endif
|
#endif
|
||||||
struct drm_dp_aux *aux = &nv_connector->aux;
|
struct drm_dp_aux *aux = &nv_connector->aux;
|
||||||
int ret;
|
int ret;
|
||||||
u8 pwr;
|
|
||||||
|
|
||||||
#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
|
#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
|
||||||
if (backlight && backlight->uses_dpcd) {
|
if (backlight && backlight->uses_dpcd) {
|
||||||
@ -1568,15 +1568,8 @@ nv50_sor_atomic_disable(struct drm_encoder *encoder, struct drm_atomic_state *st
|
|||||||
nv_encoder->hdmi.enabled = false;
|
nv_encoder->hdmi.enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nv_encoder->dcb->type == DCB_OUTPUT_DP) {
|
if (nv_encoder->dcb->type == DCB_OUTPUT_DP)
|
||||||
ret = drm_dp_dpcd_readb(aux, DP_SET_POWER, &pwr);
|
nouveau_dp_power_down(nv_encoder);
|
||||||
|
|
||||||
if (ret == 0) {
|
|
||||||
pwr &= ~DP_SET_POWER_MASK;
|
|
||||||
pwr |= DP_SET_POWER_D3;
|
|
||||||
drm_dp_dpcd_writeb(aux, DP_SET_POWER, pwr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nv_encoder->update(nv_encoder, nv_crtc->index, NULL, 0, 0);
|
nv_encoder->update(nv_encoder, nv_crtc->index, NULL, 0, 0);
|
||||||
nv50_audio_disable(encoder, nv_crtc);
|
nv50_audio_disable(encoder, nv_crtc);
|
||||||
|
@ -284,6 +284,21 @@ nouveau_dp_detect(struct nouveau_connector *nv_connector,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nouveau_dp_power_down(struct nouveau_encoder *outp)
|
||||||
|
{
|
||||||
|
struct drm_dp_aux *aux = &outp->conn->aux;
|
||||||
|
int ret;
|
||||||
|
u8 pwr;
|
||||||
|
|
||||||
|
ret = drm_dp_dpcd_readb(aux, DP_SET_POWER, &pwr);
|
||||||
|
if (ret == 1) {
|
||||||
|
pwr &= ~DP_SET_POWER_MASK;
|
||||||
|
pwr |= DP_SET_POWER_D3;
|
||||||
|
drm_dp_dpcd_writeb(aux, DP_SET_POWER, pwr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
nouveau_dp_link_check(struct nouveau_connector *nv_connector)
|
nouveau_dp_link_check(struct nouveau_connector *nv_connector)
|
||||||
{
|
{
|
||||||
|
@ -155,6 +155,7 @@ enum nouveau_dp_status {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int nouveau_dp_detect(struct nouveau_connector *, struct nouveau_encoder *);
|
int nouveau_dp_detect(struct nouveau_connector *, struct nouveau_encoder *);
|
||||||
|
void nouveau_dp_power_down(struct nouveau_encoder *);
|
||||||
bool nouveau_dp_link_check(struct nouveau_connector *);
|
bool nouveau_dp_link_check(struct nouveau_connector *);
|
||||||
void nouveau_dp_irq(struct work_struct *);
|
void nouveau_dp_irq(struct work_struct *);
|
||||||
enum drm_mode_status nv50_dp_mode_valid(struct nouveau_encoder *,
|
enum drm_mode_status nv50_dp_mode_valid(struct nouveau_encoder *,
|
||||||
|
Loading…
Reference in New Issue
Block a user