Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp767974imm; Tue, 15 May 2018 08:54:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoOuiht5Oq9CmR3bTu/yppZLI3dFy2OFE2feqNY7cX+oscKFqey+mNxr1aXfInjIj4Qr23G X-Received: by 2002:a63:7c0b:: with SMTP id x11-v6mr12474875pgc.384.1526399687041; Tue, 15 May 2018 08:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526399687; cv=none; d=google.com; s=arc-20160816; b=GxY5F+lV2Vdj80z3H716+vCg91ehrjhdG7cOVwoN4cNO+/zME9709IvQLPV9sQHWMo obYfFDGOkfzRnWq5fETHdGNS+X0pr6AU/GWVOlX2FvgSE5zip0SOKd8hc1iFZDAsOJuK PkVDt0vUhkCe0OiU6XHZqbIllYOfcxt/3WVIKNQkmr21ocA7lIejbEBe8UQfFBcrBuwP HVKpRvU/KE5eFcWsNhpHQuITEsZI4igTSh6E9FMT/Djc8tJeUJa9/qN1FbNIS7je+cZ7 hJaJwZ18IWg6Q7gu7ZJFdsjTJN2GNbhmPYayoztMdkH0acRSfq3lRyEfsEoI9wGLgqtE WwCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=6Ck8wyZtT0gwL1gh18rHOdwfEuZ5TsS0cPLfeqnoFtk=; b=xQL4tIw6xLyHhmdQPz2IcCj0/NVxmW6nFgAtKZx++hbIFrF/7pW+bh8i5BY5gv3GfX qKfn1UITed0wjTBd1JGYx1M7dwzHzZN0wO09MyuPmFhLsJWuIIR09jkP0qicvflGILjv oELr94omaUM1GjAaKSMdx28kOrBwUSo7Sb9Baux2hCEJMDyBTxnto8ty15b6e0ziJ/B4 /fsVBJRuHUAs9AyEItG+Z8ClENr9Isll/0lDBWBFQ4JKcYkIRaLAyHNRn7ScUx/I5TWc OoXn+0nZflbbFJmeq3ue1L0oQb91hmTFjKr2BtVg/kuNOGvl5fhvqR8V3nZsl547vdwD y2qQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22-v6si270205pll.599.2018.05.15.08.54.32; Tue, 15 May 2018 08:54:46 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754188AbeEOPf3 (ORCPT + 99 others); Tue, 15 May 2018 11:35:29 -0400 Received: from mga11.intel.com ([192.55.52.93]:57647 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753987AbeEOPf1 (ORCPT ); Tue, 15 May 2018 11:35:27 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2018 08:35:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,403,1520924400"; d="scan'208";a="56111918" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga001.jf.intel.com with SMTP; 15 May 2018 08:35:22 -0700 Received: by stinkbox (sSMTP sendmail emulation); Tue, 15 May 2018 18:35:21 +0300 Date: Tue, 15 May 2018 18:35:21 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Neil Armstrong Cc: airlied@linux.ie, hans.verkuil@cisco.com, lee.jones@linaro.org, olof@lixom.net, seanpaul@google.com, 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 Subject: Re: [Intel-gfx] [PATCH v2 2/5] drm/i915: hdmi: add CEC notifier to intel_hdmi Message-ID: <20180515153521.GB23723@intel.com> References: <1526395342-15481-1-git-send-email-narmstrong@baylibre.com> <1526395342-15481-3-git-send-email-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1526395342-15481-3-git-send-email-narmstrong@baylibre.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 15, 2018 at 04:42:19PM +0200, 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. > > 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 | 12 ++++++++++++ > 3 files changed, 15 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..e98103d 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; > } > > @@ -2031,6 +2037,8 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder, > > static void intel_hdmi_destroy(struct drm_connector *connector) > { > + if (intel_attached_hdmi(connector)->notifier) > + cec_notifier_put(intel_attached_hdmi(connector)->notifier); > kfree(to_intel_connector(connector)->detect_edid); > drm_connector_cleanup(connector); > kfree(connector); > @@ -2358,6 +2366,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); What are we doing with the connector name here? Those are not actually guaranteed to be stable, and any change in the connector probe order may cause the name to change. > + 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 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Ville Syrj?l? Intel