From patchwork Thu Jul 30 18:49:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 11692789 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 3F80A913 for ; Thu, 30 Jul 2020 10:54:33 +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 27CE0207F5 for ; Thu, 30 Jul 2020 10:54:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27CE0207F5 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 7959E6E8D0; Thu, 30 Jul 2020 10:54:32 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A6D36E8D0 for ; Thu, 30 Jul 2020 10:54:29 +0000 (UTC) IronPort-SDR: ZbPmej1NvSnKw0UmztM4pfoATtjsRSP6WgrAFr4fg1Ib0uqTHDtTNXIpolyw/UWKJY8s/1+BWV HykBL484cxeA== X-IronPort-AV: E=McAfee;i="6000,8403,9697"; a="151551468" X-IronPort-AV: E=Sophos;i="5.75,414,1589266800"; d="scan'208";a="151551468" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2020 03:54:29 -0700 IronPort-SDR: SbDq+BdW0lizCb5/9jYuUr+5LpPPN7bIHjvP7MaE/ReiKQeTazt0M4VMcophtUV+cArNXhUIqC JHED2FAlpNbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,414,1589266800"; d="scan'208";a="435003209" Received: from bhanu-nuc8i7beh.iind.intel.com ([10.145.162.210]) by orsmga004.jf.intel.com with ESMTP; 30 Jul 2020 03:54:27 -0700 From: Bhanuprakash Modem To: bhanuprakash.modem@intel.com, intel-gfx@lists.freedesktop.org Date: Fri, 31 Jul 2020 00:19:30 +0530 Message-Id: <20200730184931.14049-2-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200730184931.14049-1-bhanuprakash.modem@intel.com> References: <20200730184931.14049-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/2] i915/debug: Expose crtc dither state via debugfs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" [Why] It's useful to know the dithering state for IGT testing. [How] Expose the dithering state for the crtc via a debugfs file "dither". Example usage: cat /sys/kernel/debug/dri/0/crtc-0/dither Cc: Uma Shankar Cc: Rodrigo Vivi Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/i915_debugfs.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 784219962193..7174fce05e6e 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1650,13 +1650,30 @@ static const struct i915_debugfs_files { #endif }; +static int dither_state_show(struct seq_file *m, void *data) +{ + struct intel_crtc *crtc = to_intel_crtc(m->private); + struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->base.state); + + seq_printf(m, "Dither: %u\n", crtc_state->dither); + + return 0; +} +DEFINE_SHOW_ATTRIBUTE(dither_state); + void i915_debugfs_register(struct drm_i915_private *dev_priv) { struct drm_minor *minor = dev_priv->drm.primary; + struct drm_device *dev = &dev_priv->drm; + struct drm_crtc *crtc; int i; i915_debugfs_params(dev_priv); + drm_for_each_crtc(crtc, dev) + debugfs_create_file("dither", S_IRUGO, crtc->debugfs_entry, crtc, + &dither_state_fops); + debugfs_create_file("i915_forcewake_user", S_IRUSR, minor->debugfs_root, to_i915(minor->dev), &i915_forcewake_fops); for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) { From patchwork Thu Jul 30 18:49:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 11692791 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 94D0D913 for ; Thu, 30 Jul 2020 10:54:37 +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 7D3192082E for ; Thu, 30 Jul 2020 10:54:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D3192082E 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 EECFD6E8D2; Thu, 30 Jul 2020 10:54:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id B1DAF6E8D0 for ; Thu, 30 Jul 2020 10:54:31 +0000 (UTC) IronPort-SDR: yEiFq/8e2jO/MHPfmhI8x5F0su8c857sAAS3Cc8yILea+yJxLEd/GQhB/O7BMxjwq9+YgH9gi4 wwZUp4X4utwA== X-IronPort-AV: E=McAfee;i="6000,8403,9697"; a="151551472" X-IronPort-AV: E=Sophos;i="5.75,414,1589266800"; d="scan'208";a="151551472" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2020 03:54:31 -0700 IronPort-SDR: 2UTX1PYG+V/2w/4aDnhOIS0QfLDZweR3+WIE7d/kX/+NZHvHF2S/04NRtY9Hbfjs1SXIssVgJS lnHWibzypnug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,414,1589266800"; d="scan'208";a="435003220" Received: from bhanu-nuc8i7beh.iind.intel.com ([10.145.162.210]) by orsmga004.jf.intel.com with ESMTP; 30 Jul 2020 03:54:29 -0700 From: Bhanuprakash Modem To: bhanuprakash.modem@intel.com, intel-gfx@lists.freedesktop.org Date: Fri, 31 Jul 2020 00:19:31 +0530 Message-Id: <20200730184931.14049-3-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200730184931.14049-1-bhanuprakash.modem@intel.com> References: <20200730184931.14049-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/2] i915/debug: Expose Max BPC info via debugfs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" [Why] It's useful to know the max supported panel BPC for IGT testing. [How] Expose the max supported BPC for the panel via a debugfs file on the connector, "output_bpc". Example usage: cat /sys/kernel/debug/dri/0/DP-1/output_bpc Cc: Uma Shankar Cc: Rodrigo Vivi Signed-off-by: Bhanuprakash Modem --- .../drm/i915/display/intel_display_debugfs.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index 3644752cc5ec..0877d029af77 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -2185,6 +2185,20 @@ static const struct file_operations i915_dsc_fec_support_fops = { .write = i915_dsc_fec_support_write }; +/* + * Returns the maximum output bpc for the connector. + * Example usage: cat /sys/kernel/debug/dri/0/DP-1/output_bpc + */ +static int output_bpc_show(struct seq_file *m, void *data) +{ + struct drm_connector *connector = m->private; + + seq_printf(m, "Maximum: %u\n", connector->display_info.bpc); + + return 0; +} +DEFINE_SHOW_ATTRIBUTE(output_bpc); + /** * intel_connector_debugfs_add - add i915 specific connector debugfs files * @connector: pointer to a registered drm_connector @@ -2235,5 +2249,8 @@ int intel_connector_debugfs_add(struct drm_connector *connector) debugfs_create_file("i915_lpsp_capability", 0444, root, connector, &i915_lpsp_capability_fops); + debugfs_create_file("output_bpc", S_IRUGO, root, + connector, &output_bpc_fops); + return 0; }