From patchwork Thu Jun 28 07:42:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10493233 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 3FCFD60325 for ; Thu, 28 Jun 2018 07:43:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D7C129EA7 for ; Thu, 28 Jun 2018 07:43:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2159829EE5; Thu, 28 Jun 2018 07:43:13 +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 D16C929EA7 for ; Thu, 28 Jun 2018 07:43:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4C696EC38; Thu, 28 Jun 2018 07:43:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb2-smtp-cloud9.xs4all.net (lb2-smtp-cloud9.xs4all.net [194.109.24.26]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D0586EC35 for ; Thu, 28 Jun 2018 07:42:59 +0000 (UTC) Received: from tschai.fritz.box ([212.251.195.8]) by smtp-cloud9.xs4all.net with ESMTPA id YRZtfNuykEJtcYRZxffZKO; Thu, 28 Jun 2018 09:42:58 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCHv7 3/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Date: Thu, 28 Jun 2018 09:42:53 +0200 Message-Id: <20180628074253.21088-4-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180628074253.21088-1-hverkuil@xs4all.nl> References: <20180628074253.21088-1-hverkuil@xs4all.nl> X-CMAE-Envelope: MS4wfLPX0/lS9PM6Yfapx/CG9h8u6LHiKQrvnEj9CkSyGdydAOOCAogbAidXh3B67LNASzCK7nwpIfI+WOghajjdCxUaN3V7+FdG87D7/pXAA85qYIUcV38s Oi9FJysOib40AOCaGnUtS1+A3WeN4m1zPApuzm/0embmEhbJf9KVVMcZ10EPjyyF48q/vBPFjIjVUH5s4ZtdXpOxqBmzUk/YSU3UjvPQt+m0DKCgN9kPSkeg 4upioVkT/TZ1Lti6XMeuu0s9XvrGNvyfuZ6SFZ8MhJeVJS4PP0RerGEV8tqvZDK1AgtoMKPJRTYgE9Q5JlQJHGSiaeY/ikigNnwC/xX29kpkolEglAsTfLQM dZ9iyvS2dvCw7otFgiomVkZbotQfEA== 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 , Daniel Vetter , dri-devel@lists.freedesktop.org, Hans Verkuil MIME-Version: 1.0 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 --- 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); }