diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2023-09-20 00:56:22 +0300 |
---|---|---|
committer | Lyude Paul <lyude@redhat.com> | 2023-09-20 01:22:11 +0300 |
commit | bd7a61bcbb50bfca1b9a585f17d5590dbb521b78 (patch) | |
tree | ee22bd210445deeeb5a68bf8089d54ffc8ea4d0f /drivers/gpu/drm/nouveau/dispnv50 | |
parent | 0bd4e9f7dcd17003b7274b0608bf6575c6a07b88 (diff) | |
download | linux-bd7a61bcbb50bfca1b9a585f17d5590dbb521b78.tar.xz |
drm/nouveau/disp: add dp aux xfer method
- preparation for GSP-RM
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-28-lyude@redhat.com
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv50')
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/disp.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 11b11284a321..ee53bc5d1004 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1704,14 +1704,13 @@ nv50_sor_destroy(struct drm_encoder *encoder) { struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); - nvif_outp_dtor(&nv_encoder->outp); - nv50_mstm_del(&nv_encoder->dp.mstm); drm_encoder_cleanup(encoder); if (nv_encoder->dcb->type == DCB_OUTPUT_DP) mutex_destroy(&nv_encoder->dp.hpd_irq_lock); + nvif_outp_dtor(&nv_encoder->outp); kfree(encoder); } @@ -1764,22 +1763,22 @@ nv50_sor_create(struct nouveau_encoder *nv_encoder) nv50_outp_dump_caps(drm, nv_encoder); if (dcbe->type == DCB_OUTPUT_DP) { - struct nvkm_i2c_aux *aux = - nvkm_i2c_aux_find(i2c, dcbe->i2c_index); - mutex_init(&nv_encoder->dp.hpd_irq_lock); - if (aux) { - if (disp->disp->object.oclass < GF110_DISP) { - /* HW has no support for address-only - * transactions, so we're required to - * use custom I2C-over-AUX code. - */ - nv_encoder->i2c = &aux->i2c; - } else { - nv_encoder->i2c = &nv_connector->aux.ddc; - } - nv_encoder->aux = aux; + if (disp->disp->object.oclass < GF110_DISP) { + /* HW has no support for address-only + * transactions, so we're required to + * use custom I2C-over-AUX code. + */ + struct nvkm_i2c_aux *aux; + + aux = nvkm_i2c_aux_find(i2c, dcbe->i2c_index); + if (!aux) + return -EINVAL; + + nv_encoder->i2c = &aux->i2c; + } else { + nv_encoder->i2c = &nv_connector->aux.ddc; } if (nv_connector->type != DCB_CONNECTOR_eDP && @@ -1925,7 +1924,6 @@ nv50_pior_create(struct nouveau_encoder *nv_encoder) } nv_encoder->i2c = ddc; - nv_encoder->aux = aux; encoder = to_drm_encoder(nv_encoder); drm_encoder_init(connector->dev, encoder, &nv50_pior_func, type, |