From patchwork Mon May 14 22:40:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10399535 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 02D24601F7 for ; Mon, 14 May 2018 22:40:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D69A28585 for ; Mon, 14 May 2018 22:40:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 121F12858D; Mon, 14 May 2018 22:40:58 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 C796C28585 for ; Mon, 14 May 2018 22:40:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAD7D6E137; Mon, 14 May 2018 22:40:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F78D6E047 for ; Mon, 14 May 2018 22:40:48 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id m17-v6so15248327lfj.8 for ; Mon, 14 May 2018 15:40:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5YF0tQV2uGyKWvG7Keh4yPh7rhrw9i8a9K6f2M84kTM=; b=JtK9BHjoYnfW5gF3SqorRtV6zxILE96dZq01b8DKBN3b/3xxu5Hzw0QQQmTUdZFQRa UuOPEuxqYIibugIRahe90CH+U1k1c3vi8m8Q6eKwejSBx7F2NWIU5kMzA2Bk4ej4ARqX 6PXGBG0UTC0iGsNnI7IedYh9pIW2Emffe9EzgVHkv+QBpnPSqRsLrBrRGxO/oCRrEI+o LouGkdAMIBVTob3q2mp1cphdu0zMcC8p486I0wOK9UQXra6C5vv64A2dobLuTrlHeSuc 6Oq6mlc0UR+0iZPA8BeNiC2Fr9zzKTuvrAMSu0Q7WmjTRvkFFPGz/tt1hox3l73BDl82 4oYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5YF0tQV2uGyKWvG7Keh4yPh7rhrw9i8a9K6f2M84kTM=; b=D5e2Uk8S4nz5XuXmwxa1/KZjWjHlHVA2MnQ3dCRwj7AClkawwpNCTnv5PBDmoAnX5v xQhI/ilJsUUXTDY2wDlkyZKWgWSSrruzudHJopm2sqIFCDtdjmcx+u21Oe3DXYTT//MN z+c6/sXBNqXq9qmKDY3COgIJWZoS/xZq2PgBpjHNmYTwQkfZlzCMvg18C/++eRVL3QcD HvSkL6jPkAnVudT2w4zYKVtCSvOS3oH+OzLczhHvGN+RGib8/VZ4kyMcM5iF6bHoOA1s Lb0zQ29AmJV3Gau7u8pfyGAwzhZmrT5YuA1l+AGT33vJ0u6YPE3hCVg/uLf/jIENM8TT 2pJA== X-Gm-Message-State: ALKqPwcfuzY4sM5AP3f2qpvpJc60Iix1i2g3mOJYnDB6KvBqngGfhL0Y buh010jOckp+2XS2RFQ3IL4XLA== X-Google-Smtp-Source: AB8JxZo1q0CSxZl+U9wCSdStHdNUFxu5GFKFyrlaLAIl8TuLd+dsLmAZpr+HPhVnFgdCpM0B0TtjjQ== X-Received: by 2002:a19:4f4c:: with SMTP id a12-v6mr9723591lfk.97.1526337646815; Mon, 14 May 2018 15:40:46 -0700 (PDT) Received: from bender.ownit.se (89-253-66-137.customers.ownit.se. [89.253.66.137]) by smtp.gmail.com with ESMTPSA id f196-v6sm2071149lff.59.2018.05.14.15.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 May 2018 15:40:46 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Date: Tue, 15 May 2018 00:40:37 +0200 Message-Id: <1526337639-3568-4-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526337639-3568-1-git-send-email-narmstrong@baylibre.com> References: <1526337639-3568-1-git-send-email-narmstrong@baylibre.com> Subject: [Intel-gfx] [RFC PATCH 3/5] drm/i915: hdmi: add CEC notifier to intel_hdmi X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , sadolfsson@google.com, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, fparent@baylibre.com, felixe@google.com, bleung@google.com, darekm@google.com, linux-media@vger.kernel.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This patchs adds the cec_notifier feature to the intel_hdmi part of the i915 DRM driver. It uses the HDMI DRM connector name to differentiate between each HDMI ports. The changes will allow the i915 HDMI code to notify EDID and HPD changes to an eventual CEC adapter. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/i915/intel_drv.h | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index d436858..b50e51b 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -39,6 +39,7 @@ #include #include #include +#include /** * __wait_for - magic wait macro @@ -1001,6 +1002,7 @@ struct intel_hdmi { bool has_audio; bool rgb_quant_range_selectable; struct intel_connector *attached_connector; + struct cec_notifier *notifier; }; struct intel_dp_mst_encoder; diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 1baef4a..9b94d72 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -1868,6 +1868,8 @@ intel_hdmi_set_edid(struct drm_connector *connector) connected = true; } + cec_notifier_set_phys_addr_from_edid(intel_hdmi->notifier, edid); + return connected; } @@ -1876,6 +1878,7 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) { enum drm_connector_status status; struct drm_i915_private *dev_priv = to_i915(connector->dev); + struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); @@ -1891,6 +1894,9 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); + if (status != connector_status_connected) + cec_notifier_phys_addr_invalidate(intel_hdmi->notifier); + return status; } @@ -2358,6 +2364,10 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, u32 temp = I915_READ(PEG_BAND_GAP_DATA); I915_WRITE(PEG_BAND_GAP_DATA, (temp & ~0xf) | 0xd); } + + intel_hdmi->notifier = cec_notifier_get_conn(dev->dev, connector->name); + if (!intel_hdmi->notifier) + DRM_DEBUG_KMS("CEC notifier get failed\n"); } void intel_hdmi_init(struct drm_i915_private *dev_priv,