From patchwork Wed Jul 11 12:28:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10519633 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 7C8FD601D4 for ; Wed, 11 Jul 2018 12:28:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6185128DDE for ; Wed, 11 Jul 2018 12:28:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 555A528DF5; Wed, 11 Jul 2018 12:28:32 +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=unavailable 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 17EBD28DDE for ; Wed, 11 Jul 2018 12:28:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F01D56EAC0; Wed, 11 Jul 2018 12:28:25 +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 D4AA26E90D; Wed, 11 Jul 2018 12:28:23 +0000 (UTC) Received: from marune.fritz.box ([IPv6:2001:983:e9a7:1:6552:dbd8:563d:1905]) by smtp-cloud9.xs4all.net with ESMTPA id dEEFflKk1EJtcdEEIfYOpv; Wed, 11 Jul 2018 14:28:22 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCHv9 3/3] drm/i915: add DisplayPort CEC-Tunneling-over-AUX support Date: Wed, 11 Jul 2018 14:28:19 +0200 Message-Id: <20180711122819.80457-4-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180711122819.80457-1-hverkuil@xs4all.nl> References: <20180711122819.80457-1-hverkuil@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfGApucgiMh8B/DGZyd3RNw1CJTF+62T/8NHXGtu+sK+Ir1KabH16xwc7KOOCAvuZ5P+cacuWJsgqhMAKVHSwAZwnyMyZikS15jr7d0UBc7r53Bd4ggJv qZbAZ7bXdFwGSOgKlrnYRI/93mkWtz5AIqbzRgGMS6lOI1rEuB0X5Ti7J+PHBZjEQ/lzrsKSXbHpGotQ1wfCU0n0PWmN8M7op7zYzwG6ofxkWECvUq4mrisJ tm6f9W567usTTqVusmIctN9gcmFDZ4GaD/hYOD/60U2oGW37oNaW/mf/ZeIYdtGGJ5/ibMreHVWNRVEenyL2bl+ujLdiGhCXPESlOPFl93Nxervx5GgP75Jg AeKu0ZF6G/eIKmzUrftQx+rxmV9oKhRK45jc4nmQD0Ey1D6Gx4Odn70wfIVsNhn/uq5wBnCH 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 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); }