From patchwork Mon Aug 27 07:58:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10576589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF558139B for ; Mon, 27 Aug 2018 07:58:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8125297D9 for ; Mon, 27 Aug 2018 07:58:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC32E29809; Mon, 27 Aug 2018 07:58:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 77BED297D9 for ; Mon, 27 Aug 2018 07:58:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B05E6E1CB; Mon, 27 Aug 2018 07:58:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb2-smtp-cloud8.xs4all.net (lb2-smtp-cloud8.xs4all.net [194.109.24.25]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A78C6E1B2; Mon, 27 Aug 2018 07:58:24 +0000 (UTC) Received: from marune.fritz.box ([IPv6:2001:983:e9a7:1:8960:b49d:3b62:6d25]) by smtp-cloud8.xs4all.net with ESMTPA id uCPkfxuCooj71uCPmfrQ27; Mon, 27 Aug 2018 09:58:22 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCHv2 1/5] drm_dp_cec: check that aux has a transfer function Date: Mon, 27 Aug 2018 09:58:16 +0200 Message-Id: <20180827075820.41109-2-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180827075820.41109-1-hverkuil@xs4all.nl> References: <20180827075820.41109-1-hverkuil@xs4all.nl> X-CMAE-Envelope: MS4wfMH0NueUAPs/O2+m9fxxnj5O4PXDjtsPPxn+u+jlDFI0H9raQtNBckqZtLKT2Vvnli7R05QdbcBaTGYO9j4cig9NekQLDB/9VrCQw3EWZsLUIoAs0Voc eH1XTqX3eeb5SLentCMs3coElUc6NcLg8gpqWS8KHJ4y9wb5BABLUwdjV8RJN/z0ZGZrJXGICfeoBfhq8NBgmX5HKnU1ZWqT7OyC3mWnM5uWOiSyAmHiGBjj MXJSuJ0dXvyqqGQ+DH5jSAvsq41RFEXbS+AJA/DAvWpliDKECxUHglQATjhKmrgUb/BI8WlULg/3C4Z9o5ECRKRR9DRq5yLLA4yaQdlF2fnO+YqV169hv6dK MJYcNro5RfdeGqfFeCPkcJRrzysW4w== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Hans Verkuil , Maling list - DRI developers , amd-gfx@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil If aux->transfer == NULL, then just return without doing anything. In that case the function is likely called for a non-(e)DP connector. This never happened for the i915 driver, but the nouveau and amdgpu drivers need this check. The alternative would be to add this check in those drivers before every drm_dp_cec call, but it makes sense to check it in the drm_dp_cec functions to prevent a kernel oops. Signed-off-by: Hans Verkuil Reviewed-by: Lyude Paul Acked-by: Alex Deucher --- drivers/gpu/drm/drm_dp_cec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_cec.c b/drivers/gpu/drm/drm_dp_cec.c index 988513346e9c..1407b13a8d5d 100644 --- a/drivers/gpu/drm/drm_dp_cec.c +++ b/drivers/gpu/drm/drm_dp_cec.c @@ -238,6 +238,10 @@ void drm_dp_cec_irq(struct drm_dp_aux *aux) u8 cec_irq; int ret; + /* No transfer function was set, so not a DP connector */ + if (!aux->transfer) + return; + mutex_lock(&aux->cec.lock); if (!aux->cec.adap) goto unlock; @@ -293,6 +297,10 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid) unsigned int num_las = 1; u8 cap; + /* No transfer function was set, so not a DP connector */ + if (!aux->transfer) + return; + #ifndef CONFIG_MEDIA_CEC_RC /* * CEC_CAP_RC is part of CEC_CAP_DEFAULTS, but it is stripped by @@ -361,6 +369,10 @@ EXPORT_SYMBOL(drm_dp_cec_set_edid); */ void drm_dp_cec_unset_edid(struct drm_dp_aux *aux) { + /* No transfer function was set, so not a DP connector */ + if (!aux->transfer) + return; + cancel_delayed_work_sync(&aux->cec.unregister_work); mutex_lock(&aux->cec.lock); @@ -404,6 +416,8 @@ void drm_dp_cec_register_connector(struct drm_dp_aux *aux, const char *name, struct device *parent) { WARN_ON(aux->cec.adap); + if (WARN_ON(!aux->transfer)) + return; aux->cec.name = name; aux->cec.parent = parent; INIT_DELAYED_WORK(&aux->cec.unregister_work, From patchwork Mon Aug 27 07:58:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10576585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4CE9139B for ; Mon, 27 Aug 2018 07:58:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D027F297D9 for ; Mon, 27 Aug 2018 07:58:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C37222982D; Mon, 27 Aug 2018 07:58:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E89A5297D9 for ; Mon, 27 Aug 2018 07:58:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE4BF6E1B5; Mon, 27 Aug 2018 07:58:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb3-smtp-cloud8.xs4all.net (lb3-smtp-cloud8.xs4all.net [194.109.24.29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 67B816E1B9; Mon, 27 Aug 2018 07:58:24 +0000 (UTC) Received: from marune.fritz.box ([IPv6:2001:983:e9a7:1:8960:b49d:3b62:6d25]) by smtp-cloud8.xs4all.net with ESMTPA id uCPkfxuCooj71uCPmfrQ2D; Mon, 27 Aug 2018 09:58:22 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCHv2 2/5] drm_dp_cec: add note about good MegaChips 2900 CEC support Date: Mon, 27 Aug 2018 09:58:17 +0200 Message-Id: <20180827075820.41109-3-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180827075820.41109-1-hverkuil@xs4all.nl> References: <20180827075820.41109-1-hverkuil@xs4all.nl> X-CMAE-Envelope: MS4wfMH0NueUAPs/O2+m9fxxnj5O4PXDjtsPPxn+u+jlDFI0H9raQtNBckqZtLKT2Vvnli7R05QdbcBaTGYO9j4cig9NekQLDB/9VrCQw3EWZsLUIoAs0Voc eH1XTqX3eeb5SLentCMs3coElUc6NcLg8gpqWS8KHJ4y9wb5BABLUwdjV8RJN/z0ZGZrJXGICfeoBfhq8NBgmX5HKnU1ZWqT7OyC3mWnM5uWOiSyAmHiGBjj MXJSuJ0dXvyqqGQ+DH5jSAvsq41RFEXbS+AJA/DAvWpliDKECxUHglQATjhKmrgUb/BI8WlULg/3C4Z9o5ECRKRR9DRq5yLLA4yaQdlF2fnO+YqV169hv6dK MJYcNro5RfdeGqfFeCPkcJRrzysW4w== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Hans Verkuil , Maling list - DRI developers , amd-gfx@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil A big problem with DP CEC-Tunneling-over-AUX is that it is tricky to find adapters with a chipset that supports this AND where the manufacturer actually connected the HDMI CEC line to the chipset. Add a mention of the MegaChips 2900 chipset which seems to support this feature well. Signed-off-by: Hans Verkuil Reviewed-by: Lyude Paul Acked-by: Alex Deucher --- drivers/gpu/drm/drm_dp_cec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_cec.c b/drivers/gpu/drm/drm_dp_cec.c index 1407b13a8d5d..8a718f85079a 100644 --- a/drivers/gpu/drm/drm_dp_cec.c +++ b/drivers/gpu/drm/drm_dp_cec.c @@ -16,7 +16,9 @@ * here. Quite a few active (mini-)DP-to-HDMI or USB-C-to-HDMI adapters * have a converter chip that supports CEC-Tunneling-over-AUX (usually the * Parade PS176), but they do not wire up the CEC pin, thus making CEC - * useless. + * useless. Note that MegaChips 2900-based adapters appear to have good + * support for CEC tunneling. Those adapters that I have tested using + * this chipset all have the CEC line connected. * * Sadly there is no way for this driver to know this. What happens is * that a /dev/cecX device is created that is isolated and unable to see From patchwork Mon Aug 27 07:58:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10576583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E8D3139B for ; Mon, 27 Aug 2018 07:58:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72D28297D9 for ; Mon, 27 Aug 2018 07:58:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6695529809; Mon, 27 Aug 2018 07:58:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 28386297D9 for ; Mon, 27 Aug 2018 07:58:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F17956E1BF; Mon, 27 Aug 2018 07:58:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb2-smtp-cloud8.xs4all.net (lb2-smtp-cloud8.xs4all.net [194.109.24.25]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F68B6E1B8; Mon, 27 Aug 2018 07:58:24 +0000 (UTC) Received: from marune.fritz.box ([IPv6:2001:983:e9a7:1:8960:b49d:3b62:6d25]) by smtp-cloud8.xs4all.net with ESMTPA id uCPkfxuCooj71uCPmfrQ2G; Mon, 27 Aug 2018 09:58:22 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCHv2 3/5] drm_dp_mst_topology: fix broken drm_dp_sideband_parse_remote_dpcd_read() Date: Mon, 27 Aug 2018 09:58:18 +0200 Message-Id: <20180827075820.41109-4-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180827075820.41109-1-hverkuil@xs4all.nl> References: <20180827075820.41109-1-hverkuil@xs4all.nl> X-CMAE-Envelope: MS4wfMH0NueUAPs/O2+m9fxxnj5O4PXDjtsPPxn+u+jlDFI0H9raQtNBckqZtLKT2Vvnli7R05QdbcBaTGYO9j4cig9NekQLDB/9VrCQw3EWZsLUIoAs0Voc eH1XTqX3eeb5SLentCMs3coElUc6NcLg8gpqWS8KHJ4y9wb5BABLUwdjV8RJN/z0ZGZrJXGICfeoBfhq8NBgmX5HKnU1ZWqT7OyC3mWnM5uWOiSyAmHiGBjj MXJSuJ0dXvyqqGQ+DH5jSAvsq41RFEXbS+AJA/DAvWpliDKECxUHglQATjhKmrgUb/BI8WlULg/3C4Z9o5ECRKRR9DRq5yLLA4yaQdlF2fnO+YqV169hv6dK MJYcNro5RfdeGqfFeCPkcJRrzysW4w== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Hans Verkuil , Maling list - DRI developers , amd-gfx@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil When parsing the reply of a DP_REMOTE_DPCD_READ DPCD command the result is wrong due to a missing idx increment. This was never noticed since DP_REMOTE_DPCD_READ is currently not used, but if you enable it, then it is all wrong. Signed-off-by: Hans Verkuil Reviewed-by: Lyude Paul Acked-by: Alex Deucher --- drivers/gpu/drm/drm_dp_mst_topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 7780567aa669..5ff1d79b86c4 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -439,6 +439,7 @@ static bool drm_dp_sideband_parse_remote_dpcd_read(struct drm_dp_sideband_msg_rx if (idx > raw->curlen) goto fail_len; repmsg->u.remote_dpcd_read_ack.num_bytes = raw->msg[idx]; + idx++; if (idx > raw->curlen) goto fail_len; From patchwork Mon Aug 27 08:06:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10576597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D541920 for ; Mon, 27 Aug 2018 08:07:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66A57298C4 for ; Mon, 27 Aug 2018 08:07:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A2D4298D8; Mon, 27 Aug 2018 08:07:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0AE94298C4 for ; Mon, 27 Aug 2018 08:06:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38F536E149; Mon, 27 Aug 2018 08:06:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb1-smtp-cloud8.xs4all.net (lb1-smtp-cloud8.xs4all.net [194.109.24.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id E371A6E077; Mon, 27 Aug 2018 08:06:53 +0000 (UTC) Received: from [IPv6:2001:983:e9a7:1:8960:b49d:3b62:6d25] ([IPv6:2001:983:e9a7:1:8960:b49d:3b62:6d25]) by smtp-cloud8.xs4all.net with ESMTPA id uCXzfy0Nroj71uCY0frU4m; Mon, 27 Aug 2018 10:06:52 +0200 Subject: [PATCH 4/5] drm/nouveau: add DisplayPort CEC-Tunneling-over-AUX support From: Hans Verkuil To: linux-media@vger.kernel.org References: <20180827075820.41109-1-hverkuil@xs4all.nl> <20180827075820.41109-3-hverkuil@xs4all.nl> Message-ID: <5c0b907d-0bf2-7b80-b4b6-cbde78b03f0d@xs4all.nl> Date: Mon, 27 Aug 2018 10:06:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180827075820.41109-3-hverkuil@xs4all.nl> Content-Language: en-US X-CMAE-Envelope: MS4wfKzx8fF+63klb2Y2jDZ2z/1Ao0zxpGn42ViBwRaifLUD4cmYNkf/lM0Y9MUOVFVia3FgI3gN4z7K9loYwf+kps5izO5+Q+eGMCivB+DH3Jy4LaUJ06F8 TDdGUYhIHp3GlFS6W8Fe8WGzPCUsO0XtLYEWbhClaeub/GxCi3VPPrL41BJothd+2kn7vnnK+SUb8ljriOXpfpnSxyS4PO3Wsuddgtpwng20z1rrRiUrxD2X wj/3KUle3TpvO6yh72oPGBlTzVV0Xwk8awYwGQscVyzWPmP4pj4X6jmzJmynyW0X8Q5gbSkj9Nwr5u+db/tydYkvyqm1vzlej2SHl7zjxsZOumQ4HvSio8Zy i8PmzrrcR4DjAoPbwYcnWNMP8wc70v3hYTcbE1B5etp0z8oA5CWf0skZNuYt9Zg2JBRE2GBz/FcW0I4yFmoPs83jp8TjDw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Hans Verkuil , Maling list - DRI developers , amd-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add DisplayPort CEC-Tunneling-over-AUX support to nouveau. Signed-off-by: Hans Verkuil Reviewed-by: Lyude Paul Acked-by: Alex Deucher --- 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(&nv_connector->aux); drm_dp_aux_unregister(&nv_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(&nv_connector->aux, nv_connector->edid); goto out; } @@ -1108,11 +1111,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(&nv_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(&nv_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 = &nouveau_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(&nv_connector->aux, + connector->name, dev->dev); + break; + } + ret = nvif_notify_init(&disp->disp.object, nouveau_connector_hotplug, true, NV04_DISP_NTFY_CONN, &(struct nvif_notify_conn_req_v0) {