Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp560060imm; Tue, 15 May 2018 05:57:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrQreDdWLqsOLkZhHwRjEWulmr+gDxvBozlA5AFxk+uZAukoI8WckBGQxbgcm5WpTchgi/y X-Received: by 2002:a62:dc4e:: with SMTP id t75-v6mr14925893pfg.139.1526389067997; Tue, 15 May 2018 05:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526389067; cv=none; d=google.com; s=arc-20160816; b=n+WCRAjsMvIldq99bkPhJAVZW6er4ZxDPxPjP3np8FRYsJEN0H08xEo/Kp2iW1uF0S DCMz57Q3GWmRAIA/eANMcQMfIyxEFKjngnlYr1hx1X7zzpR1xYYsx0/OCin3SKDKFX+Z IDExGdFpIlgvaaqoca9OmdrCKNayL3m4wW5UCrz7VzZIL2JhsmqiqeNHMTfMaua2OD7T ivNrhd2yWnxndsVKfX9fACxT0mjBkGqPsH9qtS2gYXCOgZ0W+B//oiw0ZG2tnLaaW2Eo lBrUD7nFthUTxFt07twmKSDe0wCemB7fBxxZhM2wHmAB7gKndhqkrbn80oTaoHhGDr8z YWCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=/r41Tu8jeHWM7KyttU+ONqjTDGsOlv1n2riu9+3fFms=; b=l+XdeQtgem9QwH5+BBapXkIWfnRELmTzdb1JI0pv+J9iXmiQwV3XxiCS9hmcxHVoJz mMB3KMkKohU3H0c2lYSn0oJRcD14SmP8HpFCF+LE/7UQe8eiDdrytd/aMF1cUaUEyXZP qUPd1EcfzL/XQyCefLZ7SBxMPEpPDOBqKopYwOro8iKF7i+6M9Np/pQCx5tecc+yArP+ hcuQ5O6VVI9MJqL7BVN6IDTgpSJuLPIAOK9cPxOyE51xiTXKN/N0BsdG2qq4FOX91q+C xzrKGieuX43/ssOpmR6lX9oCw2Doc+R41+QNMH+6X66qTb7CrghfhSvfvLSEjXMzdDkS qirA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=K2dktiQg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cisco.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z64-v6si9325331pgb.471.2018.05.15.05.57.33; Tue, 15 May 2018 05:57:47 -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=@cisco.com header.s=iport header.b=K2dktiQg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cisco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbeEOM4K (ORCPT + 99 others); Tue, 15 May 2018 08:56:10 -0400 Received: from aer-iport-3.cisco.com ([173.38.203.53]:26446 "EHLO aer-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753117AbeEOM4J (ORCPT ); Tue, 15 May 2018 08:56:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3359; q=dns/txt; s=iport; t=1526388969; x=1527598569; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=bvnC8eANzyQmHKt08WV3HoVEqKK67GSNF5/ossnnKl0=; b=K2dktiQgQah94pdCcW6D0MdG2SgrOY9CwWfNzZ9DHC+FYpr1GIUpcCWK /j4OHsHbWlEkl3H2XMVKxBfCY3n8ElGl0xTU6zP8TWA27iqhZ+Du1j/hA gUcTgJvWQvfsbnGRCik4Eb1Acmgq8l3w3nA5WD/nwx+KNiSEkz56u1/es M=; X-IronPort-AV: E=Sophos;i="5.49,403,1520899200"; d="scan'208";a="3794164" Received: from aer-iport-nat.cisco.com (HELO aer-core-4.cisco.com) ([173.38.203.22]) by aer-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2018 12:56:07 +0000 Received: from [10.47.79.81] ([10.47.79.81]) (authenticated bits=0) by aer-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id w4FCu6en014144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 15 May 2018 12:56:07 GMT Subject: Re: [PATCH 2/5] drm/i915: hdmi: add CEC notifier to intel_hdmi To: Neil Armstrong , airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com Cc: 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 References: <1526388421-18808-1-git-send-email-narmstrong@baylibre.com> <1526388421-18808-3-git-send-email-narmstrong@baylibre.com> From: Hans Verkuil Message-ID: Date: Tue, 15 May 2018 14:56:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1526388421-18808-3-git-send-email-narmstrong@baylibre.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-User: hansverk Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/15/18 14:46, Neil Armstrong wrote: > 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. You haven't figured yet out where to place the cec_notifier_put() call? Or did you forget? Regards, Hans > > 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, >