diff options
author | Lyude Paul <lyude@redhat.com> | 2018-07-12 20:13:52 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2018-12-11 08:37:09 +0300 |
commit | 3c7fc252b3fab080db110057d2d6d8c9a56d349b (patch) | |
tree | 9c5054b6481a00d0062e1984b15175f04a1b3709 | |
parent | b89fdf7ae8500feae1100d8b283176a44d31d698 (diff) | |
download | linux-3c7fc252b3fab080db110057d2d6d8c9a56d349b.tar.xz |
drm/nouveau/drm/nouveau: Don't forget to label dp_aux devices
This makes debugging with DP tracing a lot harder to interpret, so name
each i2c based off the name of the encoder that it's for
Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv04/disp.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_connector.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_connector.h | 3 |
4 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c index 70dce544984e..1727d399833c 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c @@ -67,7 +67,7 @@ nv04_display_create(struct drm_device *dev) for (i = 0; i < dcb->entries; i++) { struct dcb_output *dcbent = &dcb->entry[i]; - connector = nouveau_connector_create(dev, dcbent->connector); + connector = nouveau_connector_create(dev, dcbent); if (IS_ERR(connector)) continue; diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 6aa3521b6326..00add3ba051f 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -2301,7 +2301,7 @@ nv50_display_create(struct drm_device *dev) /* create encoder/connector objects based on VBIOS DCB table */ for (i = 0, dcbe = &dcb->entry[0]; i < dcb->entries; i++, dcbe++) { - connector = nouveau_connector_create(dev, dcbe->connector); + connector = nouveau_connector_create(dev, dcbe); if (IS_ERR(connector)) continue; diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index fd80661dff92..96d7a92e3023 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -403,6 +403,7 @@ nouveau_connector_destroy(struct drm_connector *connector) if (nv_connector->aux.transfer) { drm_dp_cec_unregister_connector(&nv_connector->aux); drm_dp_aux_unregister(&nv_connector->aux); + kfree(nv_connector->aux.name); } kfree(connector); } @@ -1232,7 +1233,8 @@ drm_conntype_from_dcb(enum dcb_connector_type dcb) } struct drm_connector * -nouveau_connector_create(struct drm_device *dev, int index) +nouveau_connector_create(struct drm_device *dev, + const struct dcb_output *dcbe) { const struct drm_connector_funcs *funcs = &nouveau_connector_funcs; struct nouveau_drm *drm = nouveau_drm(dev); @@ -1240,6 +1242,8 @@ nouveau_connector_create(struct drm_device *dev, int index) struct nouveau_connector *nv_connector = NULL; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; + char aux_name[48] = {0}; + int index = dcbe->connector; int type, ret = 0; bool dummy; @@ -1342,6 +1346,9 @@ nouveau_connector_create(struct drm_device *dev, int index) case DRM_MODE_CONNECTOR_eDP: nv_connector->aux.dev = dev->dev; nv_connector->aux.transfer = nouveau_connector_aux_xfer; + snprintf(aux_name, sizeof(aux_name), "sor-%04x-%04x", + dcbe->hasht, dcbe->hashm); + nv_connector->aux.name = kstrdup(aux_name, GFP_KERNEL); ret = drm_dp_aux_register(&nv_connector->aux); if (ret) { NV_ERROR(drm, "failed to register aux channel\n"); diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h index f57ef35b1e5e..f43a8d63aef8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.h +++ b/drivers/gpu/drm/nouveau/nouveau_connector.h @@ -38,6 +38,7 @@ #include "nouveau_encoder.h" struct nvkm_i2c_port; +struct dcb_output; #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT struct nouveau_backlight; @@ -113,7 +114,7 @@ nouveau_crtc_connector_get(struct nouveau_crtc *nv_crtc) } struct drm_connector * -nouveau_connector_create(struct drm_device *, int index); +nouveau_connector_create(struct drm_device *, const struct dcb_output *); extern int nouveau_tv_disable; extern int nouveau_ignorelid; |