From patchwork Mon Jul 2 15:47:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10501957 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 DF2F460547 for ; Mon, 2 Jul 2018 15:48:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD0DF28CE8 for ; Mon, 2 Jul 2018 15:48:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C13DD28CF1; Mon, 2 Jul 2018 15:48:05 +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 7385D28CE8 for ; Mon, 2 Jul 2018 15:48:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00CC66E221; Mon, 2 Jul 2018 15:48:01 +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 D455C6E0F5 for ; Mon, 2 Jul 2018 15:47:59 +0000 (UTC) Received: from marune.fritz.box ([IPv6:2001:983:e9a7:1:64b7:68bc:9d17:fa06]) by smtp-cloud8.xs4all.net with ESMTPA id a13Ufswn8oj71a13WfEBx7; Mon, 02 Jul 2018 17:47:58 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCHv8 3/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Date: Mon, 2 Jul 2018 17:47:56 +0200 Message-Id: <20180702154756.117244-4-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180702154756.117244-1-hverkuil@xs4all.nl> References: <20180702154756.117244-1-hverkuil@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfKRyOPhDO4tjdnqTeebpMB/Uyj8ejaDe0G06hLeYENyLEpT0VmIHlx3/tFKdqQiToW1UC/zoyjfC2KcaPPXdn2LPQqQe5W3rCX+ZUSVagE4NzDBR1EGi /503FuLBKFl3hz8XmjXCUw65nS8sNRkeBsUi/B5DyirEB6mIlYr5rNAebcFfuW3NOrLHRVnHTa3uf69fnWxfQWD9UiqntMBytNoafXq+yjR/2rT30FSkRkVp SH2MAnLBvLn4iX0rrKxM0/Z2VOYvACaNbts1n5jWxBoMfYct4rfR5jLvx9nEOgdmUzR833oypblUvzEClTBrsmCVz1mEmUwgHDjQbATeAriQzrTnfHQeFQBd jejv+XPGw5jyL9+bRwNLUpnqchUlonXihG9N+X1nSbr9K8lRXS7HfIZRtUnEq1PzwnSFjV5+aDI15wOLRel5YuKIFwB5Mg== 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: carlos.santa@intel.com, daniel.vetter@ffwll.ch, dri-devel@lists.freedesktop.org, Hans Verkuil 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 16faea30114a..c3045262eba1 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4466,6 +4466,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; @@ -4780,6 +4783,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 @@ -4787,6 +4791,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; @@ -4975,6 +4980,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); @@ -4987,13 +4993,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); }