Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp649937imm; Tue, 15 May 2018 07:11:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrXdERXYiReYXgERt9sc8BLV7g+Lmv+wnkBsnSUaxXhVo9YGjfykrUrfw3Jflr3a388j3Xa X-Received: by 2002:a65:4306:: with SMTP id j6-v6mr12442890pgq.341.1526393499137; Tue, 15 May 2018 07:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526393499; cv=none; d=google.com; s=arc-20160816; b=aC+MOBGMFNz5SOWMmjIz/3ZvhTwl1dx7IKuVb2aFbddFeLYFtuAsmB1LkctB/XTlUo R8uhlY2SzWM2HpCcJt5y6gS/d4Q6tml6+/Z2jxoF23r+IW0aO0l6te1nIxdjFXnDiQiY z9XOWwyTxeHPZM1NS7ef8asUGKDygy/Na7W8cnHjkkIY7CZuTCeDFdUX5LQNxL4IHXpG uVJzrmQ9eAXKxV1pFgZkhNaumQPlOJXJqjo7RDtclloPTKpKYWrviH9dpEzH6TsjzaB8 DI2mgk8DmIutvPjHuRGOZa0jNSVJXOi0xi7KkqThKer/vbfovWBkD7SdE+GKzlH/UDoy KgYA== 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:organization:autocrypt:openpgp:from:references:cc:to :subject:dkim-signature:arc-authentication-results; bh=gVFByU+swD4QEpim7es/x9Iqf8r7td80FylAyzLYKjo=; b=zX4JgJmEFbfcd/3BimqAt7wU/IiT3/hIpFuPK7hXMnWqyOv/XqwZARPUz3uo4NmNMf ntVAoJI/ZX/0KqE1ig76nRLuy1SPXO0OPIGhKwFKyCWaNSLClXH371LvYQZJO4ZalSY4 722cIl+TabBxlz+BLlHPwEE4lmNnl3u2TPGywqMGBsA4LnY3rtjLME2pu6CTv5zABSBC D2LXb29TTgTQQieWw44UKevA615C4nXlI32BN3PHjUT7KmV7inDlHg0A6BWUOih0j9zf Afy+UWXzmYF8Anu9IyhK4VBNg40Xc3vD16qygidwTnbUS/MkAEI1blwtcncZKQXChnDh tpvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=DnG0Q9F6; 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 x11-v6si143553plo.41.2018.05.15.07.11.16; Tue, 15 May 2018 07:11:39 -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=DnG0Q9F6; 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 S1753756AbeEOOH5 (ORCPT + 99 others); Tue, 15 May 2018 10:07:57 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:45710 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753733AbeEOOHy (ORCPT ); Tue, 15 May 2018 10:07:54 -0400 Received: by mail-lf0-f68.google.com with SMTP id w202-v6so385700lff.12 for ; Tue, 15 May 2018 07:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:openpgp:autocrypt:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=gVFByU+swD4QEpim7es/x9Iqf8r7td80FylAyzLYKjo=; b=DnG0Q9F6rboIi6OhM9t3k9Q8IbSOG9ei92ucMUKimh07dDLrxBb25I3fbOUTDIpOHZ DMpYGT1vKWbEMg02zTixNpSQYp4uHK0f7YsVHlBAshCihlZqBg+fe/XOS5/PSWczDpgT cjWO9WhNXT1ZzTrgR0/cUg6TD0/xtWrPOtBdzVrEhqv6S983VY28ZJHLtxaWKIVmTEvR OVkP/iX4r9t9CGxhJMdYo2dr8+q7ZKXIiA40UCuJT6QBh+yAH+dI1XTD6b0QOm4XiUnQ lSUouj7PskOr5Guj8xLoPbxmI0/9b51J4MfF8gc1DbLWMSIN8kExcja7SF0X7cQiinwp UlTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=gVFByU+swD4QEpim7es/x9Iqf8r7td80FylAyzLYKjo=; b=fdFbB2q34A1ANgXZadz2EYoLrXY/nGZAfZ2rwHf9B+qvVI74mBYtBQaI0aR3gYcUfS V6B5Wh3ppjMV8hP7vfhApmBlRjwoKWCHW1wxpWd+19v4zlsIP+6XQ7tY7+GHnN/dRRN+ kODRpIxGHz39kqcpOqIAykhn91+4Q4XAeLO3Bwrh/OCG+m+kVJHO5zvooKINW77RWGGE YuLDy3AuyYkeMzXUpcXDTrJPZ8E/+1CKd/UaSA78Fsy7kwGgUZRnJp2nqjO91JjaydKz Xt6w97NTT0Eru1T48+cHoxtX82lTxp+kBkA4Ql6WeGLlqRJqJmTHUgNzR0p/vajaEKrc 9f8Q== X-Gm-Message-State: ALKqPweO1gfp1JN9JnaV6NfgdIisMynh6x1EIoLHpbsnphFUV4yvcsqL QvjVRsuX8d52TqYpcHfWNO9mD/APVw4= X-Received: by 2002:a2e:9158:: with SMTP id q24-v6mr7168860ljg.73.1526393272965; Tue, 15 May 2018 07:07:52 -0700 (PDT) Received: from ?IPv6:2620:0:1043:fd00:748b:2433:2688:e1f? ([2620:0:1043:fd00:748b:2433:2688:e1f]) by smtp.gmail.com with ESMTPSA id e18-v6sm19056ljk.57.2018.05.15.07.07.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 07:07:52 -0700 (PDT) Subject: Re: [PATCH 2/5] drm/i915: hdmi: add CEC notifier to intel_hdmi To: Hans Verkuil , 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: Neil Armstrong Openpgp: preference=signencrypt Autocrypt: addr=narmstrong@baylibre.com; prefer-encrypt=mutual; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAHNKE5laWwgQXJtc3Ryb25nIDxuYXJtc3Ryb25nQGJheWxpYnJlLmNvbT7CwHsEEwEKACUC GyMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheABQJXDO2CAhkBAAoJEBaat7Gkz/iubGIH/iyk RqvgB62oKOFlgOTYCMkYpm2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h8g Organization: Baylibre Message-ID: Date: Tue, 15 May 2018 16:07:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 15/05/2018 14:56, Hans Verkuil wrote: > 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? I just figured it out, I was busy on the CEC driver and notifier, will re-spin a v2 with this and the other small fixes you requested. Thanks, Neil > > 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, >> >