From patchwork Fri Oct 25 12:55:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gwan-gyeong Mun X-Patchwork-Id: 11212293 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D33F214E5 for ; Fri, 25 Oct 2019 12:55:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB6C921D7B for ; Fri, 25 Oct 2019 12:55:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB6C921D7B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FACF89FC9; Fri, 25 Oct 2019 12:55:47 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 031A589F41 for ; Fri, 25 Oct 2019 12:55:45 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2019 05:55:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,228,1569308400"; d="scan'208";a="201801028" Received: from helsinki.fi.intel.com ([10.237.66.157]) by orsmga003.jf.intel.com with ESMTP; 25 Oct 2019 05:55:43 -0700 From: Gwan-gyeong Mun To: intel-gfx@lists.freedesktop.org Date: Fri, 25 Oct 2019 15:55:27 +0300 Message-Id: <20191025125530.1015447-3-gwan-gyeong.mun@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191025125530.1015447-1-gwan-gyeong.mun@intel.com> References: <20191025125530.1015447-1-gwan-gyeong.mun@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 2/5] drm/i915: Add checking a specific Video DIP is enabled or not 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Because DP ports don't use intel_hdmi_infoframes_enabled() machanism, DP ports requires a way to check a specific infoframe (aka. Video DIP ) is enabled or not. Signed-off-by: Gwan-gyeong Mun --- drivers/gpu/drm/i915/display/intel_hdmi.c | 21 +++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_hdmi.h | 3 +++ 2 files changed, 24 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index b62afeccd44e..6a3dff9b5ef9 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -621,6 +621,27 @@ void intel_enable_infoframe(struct intel_encoder *encoder, } } +bool intel_infoframe_enabled(struct intel_encoder *encoder, + const struct intel_crtc_state *crtc_state, + unsigned int type) +{ + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base); + u32 val = 0; + + val = dig_port->infoframes_enabled(encoder, crtc_state); + + if (HAS_DDI(dev_priv)) { + if (val & hsw_infoframe_enable(type)) + return true; + } else { + if (val & g4x_infoframe_enable(type)) + return true; + } + + return false; +} + u32 intel_hdmi_infoframe_enable(unsigned int type) { int i; diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h b/drivers/gpu/drm/i915/display/intel_hdmi.h index 86f925526514..96d50f591b69 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.h +++ b/drivers/gpu/drm/i915/display/intel_hdmi.h @@ -51,5 +51,8 @@ void intel_read_infoframe(struct intel_encoder *encoder, void intel_enable_infoframe(struct intel_encoder *encoder, bool enable, const struct intel_crtc_state *crtc_state, unsigned int type); +bool intel_infoframe_enabled(struct intel_encoder *encoder, + const struct intel_crtc_state *crtc_state, + unsigned int type); #endif /* __INTEL_HDMI_H__ */