From patchwork Tue Jan 26 19:36:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Konno X-Patchwork-Id: 8126951 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 93E0FBEEE5 for ; Tue, 26 Jan 2016 19:37:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD006202F8 for ; Tue, 26 Jan 2016 19:37:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A4D9F202E6 for ; Tue, 26 Jan 2016 19:37:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF7076E29A; Tue, 26 Jan 2016 11:36:59 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 9503F6E296 for ; Tue, 26 Jan 2016 11:36:58 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 26 Jan 2016 11:36:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,351,1449561600"; d="scan'208";a="898791252" Received: from jbkonno-beef.jf.intel.com ([10.7.197.231]) by orsmga002.jf.intel.com with ESMTP; 26 Jan 2016 11:36:57 -0800 From: Joe Konno To: intel-gfx@lists.freedesktop.org Date: Tue, 26 Jan 2016 11:36:55 -0800 Message-Id: <1453837017-23209-2-git-send-email-joe.konno@linux.intel.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1453837017-23209-1-git-send-email-joe.konno@linux.intel.com> References: <1453837017-23209-1-git-send-email-joe.konno@linux.intel.com> Subject: [Intel-gfx] [RFC 1/3] drm/i915: get cpu, pch underrun reporting state X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joe Konno There are mechanisms for "set and return previous" underrun reporting state, but no convenience functions for simply getting the underrun reporting state for a particular pipe or pch transcoder. Signed-off-by: Joe Konno --- drivers/gpu/drm/i915/intel_fifo_underrun.c | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_fifo_underrun.c b/drivers/gpu/drm/i915/intel_fifo_underrun.c index bda526660e20..9516bd416226 100644 --- a/drivers/gpu/drm/i915/intel_fifo_underrun.c +++ b/drivers/gpu/drm/i915/intel_fifo_underrun.c @@ -297,6 +297,27 @@ bool intel_set_cpu_fifo_underrun_reporting(struct drm_i915_private *dev_priv, } /** + * intel_get_cpu_fifo_underrun_reporting - get cpu fifo underrrun reporting state + * @dev_priv: i915 device instance + * @pipe: (CPU) pipe to get state for + * + * This function gets the fifo underrun reporting state for @pipe. + * + * Returns true if underrun reporting is enabled for @pipe. + */ +bool intel_get_cpu_fifo_underrun_reporting(struct drm_i915_private *dev_priv, + enum pipe pipe) +{ + struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; + struct intel_crtc *intel_crtc = to_intel_crtc(crtc); + bool ret; + + ret = !intel_crtc->cpu_fifo_underrun_disabled; + + return ret; +} + +/** * intel_set_pch_fifo_underrun_reporting - set PCH fifo underrun reporting state * @dev_priv: i915 device instance * @pch_transcoder: the PCH transcoder (same as pipe on IVB and older) @@ -345,6 +366,28 @@ bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv, } /** + * intel_get_pch_fifo_underrun_reporting - get PCH fifo underrun reporting state + * @dev_priv: i915 device instance + * @pch_transcoder: the PCH transcoder (same as pipe on IVB and older) + * + * This function shows whether PCH fifo underrun reporting is enabled for + * @pch_transcoder. + * + * Returns true if PCH underrun reporting is enabled for @pch_transcoder. + */ +bool intel_get_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv, + enum transcoder pch_transcoder) +{ + struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pch_transcoder]; + struct intel_crtc *intel_crtc = to_intel_crtc(crtc); + bool ret; + + ret = !intel_crtc->pch_fifo_underrun_disabled; + + return ret; +} + +/** * intel_cpu_fifo_underrun_irq_handler - handle CPU fifo underrun interrupt * @dev_priv: i915 device instance * @pipe: (CPU) pipe to set state for