Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp551860imm; Tue, 15 May 2018 05:49:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZowvnxcxphqG4MyB5IYYEtBwYYrECBCoX2TUXNxMk/5XrC1cNyi7cpEaEIK55jP350qynfQ X-Received: by 2002:a63:384d:: with SMTP id h13-v6mr12053117pgn.209.1526388566887; Tue, 15 May 2018 05:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526388566; cv=none; d=google.com; s=arc-20160816; b=0YEU18lVjx+bDkGY35lt0do6rTPVExdt6R3GGWHoga5zas7ChFkmBRYLKKaoW+VdWY Wqx5/MYCkn5igTHX3fPjI2x+haGISFUpQEhCT3gJdzxky6iWIre3vCvmSQsgw3bsHtcs 7Ij1MgRZW7/emkoOfBhqYWZ7Y902YpXd1+DBKdN/rJGFkwkg2x5hrBH1Th5sFZt7Xhg3 uvP0mh/Z7r5QiJhmvQM/HI5UFviMVD5TFKiQ9ZH4Na7UkLqczozMwLKk8YsAobw9SM3S /geL+Qt0INWd7qltG6Bekmn/ROO+8YpeO2nC7EyTRMXqYOa34ZktQxlpIXNzMxpnMx5h ntAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=u4ZpG0QWBDcAjTQgEC7oMkAJJM12Ztt3LPljPGcBdAY=; b=LYRv2wAbgGrROM1L+QEU6qEh+3mRzjEX3ZfT7UMNwcQ/KHCfNLokAJ4HLJonSMckMq AKMgEiSJNPMRxXIfm/kwAcLg7VyNhvjpYRhxn/68TGhFw1dSWRDBvJKD9RiaBFq8Bvol KugPUA3SLqVnixS/+6TSVSP1xOxbLKhvkBtX03/g0vCrnTInQX9AvKKCSjvEfRi3miiH 1t6CKqC8DfcWvXcm/G/rI8M5w9rdPZeXkAJwVI14JdDMmjnuzJIxQXm/yCkoc1GS/CUf D5tt61AhHYHOnZro4upNKgfB0k4pKYXRdAracwGgGt2qcMyV3vNgPZH3/cgzw2tEDQxW cOYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=VW/7wMdM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1-v6si11629843pfe.158.2018.05.15.05.49.12; Tue, 15 May 2018 05:49:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=VW/7wMdM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753098AbeEOMsT (ORCPT + 99 others); Tue, 15 May 2018 08:48:19 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:40437 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753435AbeEOMrW (ORCPT ); Tue, 15 May 2018 08:47:22 -0400 Received: by mail-qk0-f194.google.com with SMTP id s83-v6so7655240qke.7 for ; Tue, 15 May 2018 05:47:22 -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=u4ZpG0QWBDcAjTQgEC7oMkAJJM12Ztt3LPljPGcBdAY=; b=VW/7wMdM2OO0XMXDsstSKzaA7Z9xdwt5/O65NHV/JMkxA5EmETShk7GvHw03fOCslq G4Q/ksYMiprvJ4nHQQfAwrfplJfso6RGm92ziFI8gEpUdaVkgQmviEwwZaXyhDeaoOda wdGoBvRnUXjQAI2kPdQH7OFBHeitTbTjoyKPkkSC4MFXEihgqADSFqXvenBr3tUC3fQb tUSIKc4of3G//AgtRe1VUj5K2luZ/INWX5aPJMGI+C+h4odLihtR/XbYUAt35+ku7j// +Ph4hWV95c3G730B2wepG3MOy8DH5HWIVahSIFjPkIBUTPA6+QJCpj7E0GNFddTi/n9S IRIA== 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=u4ZpG0QWBDcAjTQgEC7oMkAJJM12Ztt3LPljPGcBdAY=; b=pK7qYLOS7UaXBk/aZEzttCAnJ5eaa+Ynq2NgZDls+nEuB+nCNFAshm/b0P0bp+5oc7 JESC+Dn4aqMkSjVX3lymcXpzk2bzQeEdZgF/BRM/FQA+ZugGgLX81P5sKYWwRUdBdgl2 UKYTmjVIEcgo2ThDUZ8/tjHRuifPr6eeFY/msFztywbr+EIAj7kBmEmFDP+Jr8lJS1EN BSfTI6HY+tzlLtFpvKCCITc4702dr0dPz4vKZzEN1vUJkGMmvwIFPrJhwcapJdhPAYQn LSNq/vIoTHl1ixJYCbKjBbCbmWz3FVgyFOoEAUhTe38qDYPH2YDPZB+B26fEl3OZtHw0 2seQ== X-Gm-Message-State: ALKqPwdBsLAOl+eDPbS7fpSEhDyKQkXHiESs3i970225ngDzlqdWDfk9 1uVrqkid3vD4vdR9d2UAalCbeg== X-Received: by 2002:a37:9bd3:: with SMTP id d202-v6mr12715825qke.20.1526388441713; Tue, 15 May 2018 05:47:21 -0700 (PDT) Received: from localhost.localdomain ([2620:0:1043:fd00:748b:2433:2688:e1f]) by smtp.gmail.com with ESMTPSA id d88-v6sm9725530qkj.25.2018.05.15.05.47.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 May 2018 05:47:20 -0700 (PDT) From: Neil Armstrong To: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Cc: Neil Armstrong , sadolfsson@google.com, felixe@google.com, bleung@google.com, darekm@google.com, marcheu@chromium.org, fparent@baylibre.com, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] drm/i915: hdmi: add CEC notifier to intel_hdmi Date: Tue, 15 May 2018 14:46:58 +0200 Message-Id: <1526388421-18808-3-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526388421-18808-1-git-send-email-narmstrong@baylibre.com> References: <1526388421-18808-1-git-send-email-narmstrong@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/Kconfig | 1 + drivers/gpu/drm/i915/intel_drv.h | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index dfd9588..2d65d56 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -23,6 +23,7 @@ config DRM_I915 select SYNC_FILE select IOSF_MBI select CRC32 + select CEC_CORE if CEC_NOTIFIER help Choose this option if you have a system that has "Intel Graphics Media Accelerator" or "HD Graphics" integrated graphics, 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, -- 2.7.4