From patchwork Wed Jul 11 13:29:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10519771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8CF426028E for ; Wed, 11 Jul 2018 13:29:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81B7F29021 for ; Wed, 11 Jul 2018 13:29:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 758052902D; Wed, 11 Jul 2018 13:29:19 +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 2C9EC29021 for ; Wed, 11 Jul 2018 13:29:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D71C06ECBA; Wed, 11 Jul 2018 13:29:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb3-smtp-cloud9.xs4all.net (lb3-smtp-cloud9.xs4all.net [194.109.24.30]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1ABC06E241; Wed, 11 Jul 2018 13:29:11 +0000 (UTC) Received: from marune.fritz.box ([IPv6:2001:983:e9a7:1:6552:dbd8:563d:1905]) by smtp-cloud9.xs4all.net with ESMTPA id dFB7flt35EJtcdFB8fYg7W; Wed, 11 Jul 2018 15:29:10 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCHv10 3/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Date: Wed, 11 Jul 2018 15:29:09 +0200 Message-Id: <20180711132909.25409-4-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180711132909.25409-1-hverkuil@xs4all.nl> References: <20180711132909.25409-1-hverkuil@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfIeTmnCtKwoUEKTWU5dnCAfSBe9oeVyK10g5tYx5kaQ6Pd8E8/MkZU2BgOBPknakxKbt97EvkVvtyq8EaGwrLXNWqV6FosfgAg2rIU6gqOFLmns4ByC+ 1b6yAuunMYlaLMGBuLwbN84t7IVPmgWEjKDOrJ5R6qKVOJkuJeiYfsE8OAMVVnouLNrA7IS1uMSoxOYQoNEC0zG3nCgFUVbJF36yElkRmTKYgHNBCPaBy6pk ejbP644F78KOg5rGgL3CHI9xTSXLqlOys2N3pZRDYYdE4qYjgy3U3M3fSY8iglfXzjaNcoDGJ0slm0SVAhO3icfyLubo/PzkCO1nImOd9BD3hxpgjm9aQZl5 aHrHVZ5QDndcuf7Az0698Bwbn7QijkvOgI8DasWzmIoTcNbbrSdOruHRAHGObNJiN/PFhbab 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: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org, Hans Verkuil , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil Implement support for this DisplayPort feature. Signed-off-by: Hans Verkuil Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_dp.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 5be07e1d816d..6fefc5c244ee 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4487,6 +4487,9 @@ intel_dp_short_pulse(struct intel_dp *intel_dp) DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n"); } + /* Handle CEC interrupts, if any */ + drm_dp_cec_irq(&intel_dp->aux); + /* defer to the hotplug work for link retraining if needed */ if (intel_dp_needs_link_retrain(intel_dp)) return false; @@ -4803,6 +4806,7 @@ intel_dp_set_edid(struct intel_dp *intel_dp) intel_connector->detect_edid = edid; intel_dp->has_audio = drm_detect_monitor_audio(edid); + drm_dp_cec_set_edid(&intel_dp->aux, edid); } static void @@ -4810,6 +4814,7 @@ intel_dp_unset_edid(struct intel_dp *intel_dp) { struct intel_connector *intel_connector = intel_dp->attached_connector; + drm_dp_cec_unset_edid(&intel_dp->aux); kfree(intel_connector->detect_edid); intel_connector->detect_edid = NULL; @@ -4998,6 +5003,7 @@ static int intel_dp_connector_register(struct drm_connector *connector) { struct intel_dp *intel_dp = intel_attached_dp(connector); + struct drm_device *dev = connector->dev; int ret; ret = intel_connector_register(connector); @@ -5010,13 +5016,20 @@ intel_dp_connector_register(struct drm_connector *connector) intel_dp->aux.name, connector->kdev->kobj.name); intel_dp->aux.dev = connector->kdev; - return drm_dp_aux_register(&intel_dp->aux); + ret = drm_dp_aux_register(&intel_dp->aux); + if (!ret) + drm_dp_cec_register_connector(&intel_dp->aux, + connector->name, dev->dev); + return ret; } static void intel_dp_connector_unregister(struct drm_connector *connector) { - drm_dp_aux_unregister(&intel_attached_dp(connector)->aux); + struct intel_dp *intel_dp = intel_attached_dp(connector); + + drm_dp_cec_unregister_connector(&intel_dp->aux); + drm_dp_aux_unregister(&intel_dp->aux); intel_connector_unregister(connector); }