From patchwork Tue Jun 12 11:18:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10460075 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 0EBE560532 for ; Tue, 12 Jun 2018 11:18:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D757A22A6B for ; Tue, 12 Jun 2018 11:18:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC3D626E4A; Tue, 12 Jun 2018 11:18:45 +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 D316022A6B for ; Tue, 12 Jun 2018 11:18:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07C4B6E4B6; Tue, 12 Jun 2018 11:18:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb1-smtp-cloud9.xs4all.net (lb1-smtp-cloud9.xs4all.net [194.109.24.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id 400776E4B8 for ; Tue, 12 Jun 2018 11:18:37 +0000 (UTC) Received: from marune.fritz.box ([IPv6:2001:983:e9a7:1:5839:ca32:cf14:dfd0]) by smtp-cloud9.xs4all.net with ESMTPA id ShJnfGj2UtPPeShJrfKTSY; Tue, 12 Jun 2018 13:18:35 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCHv6 3/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Date: Tue, 12 Jun 2018 13:18:31 +0200 Message-Id: <20180612111831.58210-4-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180612111831.58210-1-hverkuil@xs4all.nl> References: <20180612111831.58210-1-hverkuil@xs4all.nl> X-CMAE-Envelope: MS4wfIdoZXb0R9NoxYVuvl7fP61UGMrCQrHjGKvf0023TTAGIf2ymsPcLHkZrsu2POAYuC5KxRb2lHUP6UxqKKNoCUwTsTJRK+9/p0MjuaXo7u+MM1RAJS9N ZvaTSO01ZIlQo2fjwGhKugy/Uj51Yo2gyWbUiS56emffx55RY4/A3v4vd4vISi30OSZ+uuqCMOfr+g3dGvYNdDFUGne5r6xnYtajqCkLvdfTBk/dbtFVXW6J 73tJbhg2pt24+1M8bHJf3oJIPvRDyQAs7saCDbxKOIS9z0nPdg/hy9SFnMncAL6PnyU1Bi/rlzxi+za4iYcMkSH7IVNzPRvFv+4Iylk6Xng8gdbsmZGDhFut vyg9e6V6sFwmUZ+IXmtPG0B3xn22jDYz2x4bFR86rTUbj2pzj2p48xeEJFt8v48VPBD+TPWY7g1WOhFJTKWNgGDTEFKxSw== 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 9a4a51e79fa1..f176af2c0bd6 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4471,6 +4471,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; @@ -4785,6 +4788,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 @@ -4792,6 +4796,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; @@ -4980,6 +4985,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); @@ -4992,13 +4998,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); }