Re: [PATCH (repost) 4/5] drm/nouveau: add DisplayPort CEC-Tunneling-over-AUX support

2018-08-20 Thread Lyude Paul
On Fri, 2018-08-17 at 16:11 +0200, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> Add DisplayPort CEC-Tunneling-over-AUX support to nouveau.
> 
> Signed-off-by: Hans Verkuil 
> ---
>  drivers/gpu/drm/nouveau/nouveau_connector.c | 17 +++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c
> b/drivers/gpu/drm/nouveau/nouveau_connector.c
> index 51932c72334e..eb4f766b5958 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_connector.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
> @@ -400,8 +400,10 @@ nouveau_connector_destroy(struct drm_connector
> *connector)
>   kfree(nv_connector->edid);
>   drm_connector_unregister(connector);
>   drm_connector_cleanup(connector);
> - if (nv_connector->aux.transfer)
> + if (nv_connector->aux.transfer) {
With the comments I made about this on patch 1 addressed/resolved:

Reviewed-by: Lyude Paul 

> + drm_dp_cec_unregister_connector(_connector->aux);
>   drm_dp_aux_unregister(_connector->aux);
> + }
>   kfree(connector);
>  }
>  
> @@ -608,6 +610,7 @@ nouveau_connector_detect(struct drm_connector *connector,
> bool force)
>  
>   nouveau_connector_set_encoder(connector, nv_encoder);
>   conn_status = connector_status_connected;
> + drm_dp_cec_set_edid(_connector->aux, nv_connector->edid);
>   goto out;
>   }
>  
> @@ -1108,11 +,14 @@ nouveau_connector_hotplug(struct nvif_notify *notify)
>  
>   if (rep->mask & NVIF_NOTIFY_CONN_V0_IRQ) {
>   NV_DEBUG(drm, "service %s\n", name);
> + drm_dp_cec_irq(_connector->aux);
>   if ((nv_encoder = find_encoder(connector, DCB_OUTPUT_DP)))
>   nv50_mstm_service(nv_encoder->dp.mstm);
>   } else {
>   bool plugged = (rep->mask != NVIF_NOTIFY_CONN_V0_UNPLUG);
>  
> + if (!plugged)
> + drm_dp_cec_unset_edid(_connector->aux);
>   NV_DEBUG(drm, "%splugged %s\n", plugged ? "" : "un", name);
>   if ((nv_encoder = find_encoder(connector, DCB_OUTPUT_DP))) {
>   if (!plugged)
> @@ -1302,7 +1308,6 @@ nouveau_connector_create(struct drm_device *dev, int
> index)
>   kfree(nv_connector);
>   return ERR_PTR(ret);
>   }
> -
>   funcs = _connector_funcs;
>   break;
>   default:
> @@ -1356,6 +1361,14 @@ nouveau_connector_create(struct drm_device *dev, int
> index)
>   break;
>   }
>  
> + switch (type) {
> + case DRM_MODE_CONNECTOR_DisplayPort:
> + case DRM_MODE_CONNECTOR_eDP:
> + drm_dp_cec_register_connector(_connector->aux,
> +   connector->name, dev->dev);
> + break;
> + }
> +
>   ret = nvif_notify_init(>disp.object, nouveau_connector_hotplug,
>  true, NV04_DISP_NTFY_CONN,
>  &(struct nvif_notify_conn_req_v0) {

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH (repost) 4/5] drm/nouveau: add DisplayPort CEC-Tunneling-over-AUX support

2018-08-17 Thread Hans Verkuil
From: Hans Verkuil 

Add DisplayPort CEC-Tunneling-over-AUX support to nouveau.

Signed-off-by: Hans Verkuil 
---
 drivers/gpu/drm/nouveau/nouveau_connector.c | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c 
b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 51932c72334e..eb4f766b5958 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -400,8 +400,10 @@ nouveau_connector_destroy(struct drm_connector *connector)
kfree(nv_connector->edid);
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
-   if (nv_connector->aux.transfer)
+   if (nv_connector->aux.transfer) {
+   drm_dp_cec_unregister_connector(_connector->aux);
drm_dp_aux_unregister(_connector->aux);
+   }
kfree(connector);
 }
 
@@ -608,6 +610,7 @@ nouveau_connector_detect(struct drm_connector *connector, 
bool force)
 
nouveau_connector_set_encoder(connector, nv_encoder);
conn_status = connector_status_connected;
+   drm_dp_cec_set_edid(_connector->aux, nv_connector->edid);
goto out;
}
 
@@ -1108,11 +,14 @@ nouveau_connector_hotplug(struct nvif_notify *notify)
 
if (rep->mask & NVIF_NOTIFY_CONN_V0_IRQ) {
NV_DEBUG(drm, "service %s\n", name);
+   drm_dp_cec_irq(_connector->aux);
if ((nv_encoder = find_encoder(connector, DCB_OUTPUT_DP)))
nv50_mstm_service(nv_encoder->dp.mstm);
} else {
bool plugged = (rep->mask != NVIF_NOTIFY_CONN_V0_UNPLUG);
 
+   if (!plugged)
+   drm_dp_cec_unset_edid(_connector->aux);
NV_DEBUG(drm, "%splugged %s\n", plugged ? "" : "un", name);
if ((nv_encoder = find_encoder(connector, DCB_OUTPUT_DP))) {
if (!plugged)
@@ -1302,7 +1308,6 @@ nouveau_connector_create(struct drm_device *dev, int 
index)
kfree(nv_connector);
return ERR_PTR(ret);
}
-
funcs = _connector_funcs;
break;
default:
@@ -1356,6 +1361,14 @@ nouveau_connector_create(struct drm_device *dev, int 
index)
break;
}
 
+   switch (type) {
+   case DRM_MODE_CONNECTOR_DisplayPort:
+   case DRM_MODE_CONNECTOR_eDP:
+   drm_dp_cec_register_connector(_connector->aux,
+ connector->name, dev->dev);
+   break;
+   }
+
ret = nvif_notify_init(>disp.object, nouveau_connector_hotplug,
   true, NV04_DISP_NTFY_CONN,
   &(struct nvif_notify_conn_req_v0) {
-- 
2.18.0

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx