<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Hans Verkuil <hverkuil-cisco@xs4all.nl><br>
<b>Sent:</b> Thursday, August 22, 2019 4:08 AM<br>
<b>To:</b> Dariusz Marcinkiewicz <darekm@google.com>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>; linux-media@vger.kernel.org <linux-media@vger.kernel.org><br>
<b>Cc:</b> David Airlie <airlied@linux.ie>; nouveau@lists.freedesktop.org <nouveau@lists.freedesktop.org>; Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>; Koo, Anthony <Anthony.Koo@amd.com>; Francis, David <David.Francis@amd.com>; amd-gfx@lists.freedesktop.org
<amd-gfx@lists.freedesktop.org>; Zuo, Jerry <Jerry.Zuo@amd.com>; Ben Skeggs <bskeggs@redhat.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; intel-gfx@lists.freedesktop.org <intel-gfx@lists.freedesktop.org>; Maxime Ripard <mripard@kernel.org>; Rodrigo Vivi <rodrigo.vivi@intel.com>;
Sean Paul <sean@poorly.run>; Thomas Lim <Thomas.Lim@amd.com>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; Manasi Navare <manasi.d.navare@intel.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>;
Ville Syrjälä <ville.syrjala@linux.intel.com><br>
<b>Subject:</b> Re: [PATCH v7 1/9] drm_dp_cec: add connector info support.</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Alex, Ville/Rodrigo, Ben,<br>
<br>
Can you (hopefully) Ack this patch so that I can merge it?<br>
<br>
Thank you!<br>
<br>
Hans<br>
<br>
On 8/14/19 12:44 PM, Dariusz Marcinkiewicz wrote:<br>
> Pass the connector info to the CEC adapter. This makes it possible<br>
> to associate the CEC adapter with the corresponding drm connector.<br>
> <br>
> Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com><br>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl><br>
> Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl><br>
> ---<br>
> .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-<br>
> drivers/gpu/drm/drm_dp_cec.c | 25 ++++++++++++-------<br>
> drivers/gpu/drm/i915/display/intel_dp.c | 4 +--<br>
> drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +--<br>
> include/drm/drm_dp_helper.h | 17 ++++++-------<br>
> 5 files changed, 27 insertions(+), 24 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c<br>
> index 16218a202b591..5ec14efd4d8cb 100644<br>
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c<br>
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c<br>
> @@ -416,7 +416,7 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm,<br>
> <br>
> drm_dp_aux_register(&aconnector->dm_dp_aux.aux);<br>
> drm_dp_cec_register_connector(&aconnector->dm_dp_aux.aux,<br>
> - aconnector->base.name, dm->adev->dev);<br>
> + &aconnector->base);<br>
> aconnector->mst_mgr.cbs = &dm_mst_cbs;<br>
> drm_dp_mst_topology_mgr_init(<br>
> &aconnector->mst_mgr,<br>
> diff --git a/drivers/gpu/drm/drm_dp_cec.c b/drivers/gpu/drm/drm_dp_cec.c<br>
> index b15cee85b702b..b457c16c3a8bb 100644<br>
> --- a/drivers/gpu/drm/drm_dp_cec.c<br>
> +++ b/drivers/gpu/drm/drm_dp_cec.c<br>
> @@ -8,7 +8,9 @@<br>
> #include <linux/kernel.h><br>
> #include <linux/module.h><br>
> #include <linux/slab.h><br>
> +#include <drm/drm_connector.h><br>
> #include <drm/drm_dp_helper.h><br>
> +#include <drm/drmP.h><br>
> #include <media/cec.h><br>
> <br>
> /*<br>
> @@ -295,7 +297,10 @@ static void drm_dp_cec_unregister_work(struct work_struct *work)<br>
> */<br>
> void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)<br>
> {<br>
> - u32 cec_caps = CEC_CAP_DEFAULTS | CEC_CAP_NEEDS_HPD;<br>
> + struct drm_connector *connector = aux->cec.connector;<br>
> + u32 cec_caps = CEC_CAP_DEFAULTS | CEC_CAP_NEEDS_HPD |<br>
> + CEC_CAP_CONNECTOR_INFO;<br>
> + struct cec_connector_info conn_info;<br>
> unsigned int num_las = 1;<br>
> u8 cap;<br>
> <br>
> @@ -344,13 +349,17 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid)<br>
> <br>
> /* Create a new adapter */<br>
> aux->cec.adap = cec_allocate_adapter(&drm_dp_cec_adap_ops,<br>
> - aux, aux->cec.name, cec_caps,<br>
> + aux, connector->name, cec_caps,<br>
> num_las);<br>
> if (IS_ERR(aux->cec.adap)) {<br>
> aux->cec.adap = NULL;<br>
> goto unlock;<br>
> }<br>
> - if (cec_register_adapter(aux->cec.adap, aux->cec.parent)) {<br>
> +<br>
> + cec_fill_conn_info_from_drm(&conn_info, connector);<br>
> + cec_s_conn_info(aux->cec.adap, &conn_info);<br>
> +<br>
> + if (cec_register_adapter(aux->cec.adap, connector->dev->dev)) {<br>
> cec_delete_adapter(aux->cec.adap);<br>
> aux->cec.adap = NULL;<br>
> } else {<br>
> @@ -406,22 +415,20 @@ EXPORT_SYMBOL(drm_dp_cec_unset_edid);<br>
> /**<br>
> * drm_dp_cec_register_connector() - register a new connector<br>
> * @aux: DisplayPort AUX channel<br>
> - * @name: name of the CEC device<br>
> - * @parent: parent device<br>
> + * @connector: drm connector<br>
> *<br>
> * A new connector was registered with associated CEC adapter name and<br>
> * CEC adapter parent device. After registering the name and parent<br>
> * drm_dp_cec_set_edid() is called to check if the connector supports<br>
> * CEC and to register a CEC adapter if that is the case.<br>
> */<br>
> -void drm_dp_cec_register_connector(struct drm_dp_aux *aux, const char *name,<br>
> - struct device *parent)<br>
> +void drm_dp_cec_register_connector(struct drm_dp_aux *aux,<br>
> + struct drm_connector *connector)<br>
> {<br>
> WARN_ON(aux->cec.adap);<br>
> if (WARN_ON(!aux->transfer))<br>
> return;<br>
> - aux->cec.name = name;<br>
> - aux->cec.parent = parent;<br>
> + aux->cec.connector = connector;<br>
> INIT_DELAYED_WORK(&aux->cec.unregister_work,<br>
> drm_dp_cec_unregister_work);<br>
> }<br>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c<br>
> index 1092499115760..de2486fe7bf2d 100644<br>
> --- a/drivers/gpu/drm/i915/display/intel_dp.c<br>
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c<br>
> @@ -5497,7 +5497,6 @@ static int<br>
> intel_dp_connector_register(struct drm_connector *connector)<br>
> {<br>
> struct intel_dp *intel_dp = intel_attached_dp(connector);<br>
> - struct drm_device *dev = connector->dev;<br>
> int ret;<br>
> <br>
> ret = intel_connector_register(connector);<br>
> @@ -5512,8 +5511,7 @@ intel_dp_connector_register(struct drm_connector *connector)<br>
> intel_dp->aux.dev = connector->kdev;<br>
> ret = drm_dp_aux_register(&intel_dp->aux);<br>
> if (!ret)<br>
> - drm_dp_cec_register_connector(&intel_dp->aux,<br>
> - connector->name, dev->dev);<br>
> + drm_dp_cec_register_connector(&intel_dp->aux, connector);<br>
> return ret;<br>
> }<br>
> <br>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c<br>
> index 330d7d29a6e34..8aa703347eb54 100644<br>
> --- a/drivers/gpu/drm/nouveau/nouveau_connector.c<br>
> +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c<br>
> @@ -1416,8 +1416,7 @@ nouveau_connector_create(struct drm_device *dev,<br>
> switch (type) {<br>
> case DRM_MODE_CONNECTOR_DisplayPort:<br>
> case DRM_MODE_CONNECTOR_eDP:<br>
> - drm_dp_cec_register_connector(&nv_connector->aux,<br>
> - connector->name, dev->dev);<br>
> + drm_dp_cec_register_connector(&nv_connector->aux, connector);<br>
> break;<br>
> }<br>
> <br>
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h<br>
> index 8364502f92cfe..7972b925a952b 100644<br>
> --- a/include/drm/drm_dp_helper.h<br>
> +++ b/include/drm/drm_dp_helper.h<br>
> @@ -1230,20 +1230,19 @@ struct drm_dp_aux_msg {<br>
> <br>
> struct cec_adapter;<br>
> struct edid;<br>
> +struct drm_connector;<br>
> <br>
> /**<br>
> * struct drm_dp_aux_cec - DisplayPort CEC-Tunneling-over-AUX<br>
> * @lock: mutex protecting this struct<br>
> * @adap: the CEC adapter for CEC-Tunneling-over-AUX support.<br>
> - * @name: name of the CEC adapter<br>
> - * @parent: parent device of the CEC adapter<br>
> + * @connector: the connector this CEC adapter is associated with<br>
> * @unregister_work: unregister the CEC adapter<br>
> */<br>
> struct drm_dp_aux_cec {<br>
> struct mutex lock;<br>
> struct cec_adapter *adap;<br>
> - const char *name;<br>
> - struct device *parent;<br>
> + struct drm_connector *connector;<br>
> struct delayed_work unregister_work;<br>
> };<br>
> <br>
> @@ -1451,8 +1450,8 @@ drm_dp_has_quirk(const struct drm_dp_desc *desc, enum drm_dp_quirk quirk)<br>
> <br>
> #ifdef CONFIG_DRM_DP_CEC<br>
> void drm_dp_cec_irq(struct drm_dp_aux *aux);<br>
> -void drm_dp_cec_register_connector(struct drm_dp_aux *aux, const char *name,<br>
> - struct device *parent);<br>
> +void drm_dp_cec_register_connector(struct drm_dp_aux *aux,<br>
> + struct drm_connector *connector);<br>
> void drm_dp_cec_unregister_connector(struct drm_dp_aux *aux);<br>
> void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid);<br>
> void drm_dp_cec_unset_edid(struct drm_dp_aux *aux);<br>
> @@ -1461,9 +1460,9 @@ static inline void drm_dp_cec_irq(struct drm_dp_aux *aux)<br>
> {<br>
> }<br>
> <br>
> -static inline void drm_dp_cec_register_connector(struct drm_dp_aux *aux,<br>
> - const char *name,<br>
> - struct device *parent)<br>
> +static inline void<br>
> +drm_dp_cec_register_connector(struct drm_dp_aux *aux,<br>
> + struct drm_connector *connector)<br>
> {<br>
> }<br>
> <br>
> <br>
<br>
</div>
</span></font></div>
</body>
</html>