From patchwork Mon Sep 3 05:31:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 10585443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8EFD14E0 for ; Mon, 3 Sep 2018 05:31:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2E95290B4 for ; Mon, 3 Sep 2018 05:31:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4C1D290D1; Mon, 3 Sep 2018 05:31:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42514290B4 for ; Mon, 3 Sep 2018 05:31:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8EE626E0AB; Mon, 3 Sep 2018 05:31:55 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 274266E0AB for ; Mon, 3 Sep 2018 05:31:55 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2018 22:31:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,323,1531810800"; d="scan'208";a="229726840" Received: from mlhuck-mobl.amr.corp.intel.com (HELO rdvivi-vienna.intel.com) ([10.254.70.143]) by orsmga004.jf.intel.com with ESMTP; 02 Sep 2018 22:31:54 -0700 From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Sun, 2 Sep 2018 22:31:53 -0700 Message-Id: <20180903053153.13619-1-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [Intel-gfx] [PATCH] drm/i915: Kill debugfs's i915_dpcd 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: , Cc: Jani Nikula , Dhinakaran Pandiyan , Rodrigo Vivi MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP We don't need a dpcd dump at kernel level on i915 if we have a generic tool that can dump dpcd reg from user space. So, let's deprecate this in favor of igt/tools/dpcd_reg dump Current debugfs: $ sudo cat /sys/kernel/debug/dri/0/DP-1/i915_dpcd 0000: 12 14 c4 01 01 00 01 00 02 02 06 00 00 00 02 0070: 00 00 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0100: 14 84 00 06 06 06 06 00 01 04 00 0200: 41 00 77 77 01 03 22 22 0600: 01 0700: 01 0701: 00 00 00 00 0720: 00 01 00 00 00 01 01 00 00 00 00 00 01 00 00 01 0732: 00 00 $ sudo cat /sys/kernel/debug/dri/0/eDP-1/i915_dpcd 0000: 12 14 84 40 00 00 01 01 02 00 00 00 00 0b 00 0070: 01 00 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0100: 14 04 00 00 00 00 00 00 00 00 00 0200: 41 00 00 00 80 00 66 66 0600: 01 0700: 02 0701: 9f 40 00 00 0720: 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 0732: 00 00 new tool: $ sudo tools/dpcd_reg Dumping DPDDC-B 0000: 12 14 c4 01 01 00 01 00 02 02 06 00 00 00 02 0070: 00 00 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0100: 14 84 00 06 06 06 06 00 01 04 00 0200: 41 00 77 77 01 03 22 22 0600: 01 0700: 01 0701: 00 00 00 00 0720: 00 01 00 00 00 01 01 00 00 00 00 00 01 00 00 01 0732: 00 00 Dumping DPDDC-A 0000: 12 14 84 40 00 00 01 01 02 00 00 00 00 0b 00 0070: 01 00 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0100: 14 04 00 00 00 00 00 00 00 00 00 0200: 41 00 00 00 80 00 66 66 0600: 01 0700: 02 0701: 9f 40 00 00 0720: 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 0732: 00 00 Cc: Tarun Vyas Cc: Dhinakaran Pandiyan Cc: Jani Nikula Reference: https://patchwork.freedesktop.org/series/49037/ Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_debugfs.c | 67 ----------------------------- 1 file changed, 67 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index a5265c236a33..0883ad0cd67f 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -4816,68 +4816,6 @@ int i915_debugfs_register(struct drm_i915_private *dev_priv) minor->debugfs_root, minor); } -struct dpcd_block { - /* DPCD dump start address. */ - unsigned int offset; - /* DPCD dump end address, inclusive. If unset, .size will be used. */ - unsigned int end; - /* DPCD dump size. Used if .end is unset. If unset, defaults to 1. */ - size_t size; - /* Only valid for eDP. */ - bool edp; -}; - -static const struct dpcd_block i915_dpcd_debug[] = { - { .offset = DP_DPCD_REV, .size = DP_RECEIVER_CAP_SIZE }, - { .offset = DP_PSR_SUPPORT, .end = DP_PSR_CAPS }, - { .offset = DP_DOWNSTREAM_PORT_0, .size = 16 }, - { .offset = DP_LINK_BW_SET, .end = DP_EDP_CONFIGURATION_SET }, - { .offset = DP_SINK_COUNT, .end = DP_ADJUST_REQUEST_LANE2_3 }, - { .offset = DP_SET_POWER }, - { .offset = DP_EDP_DPCD_REV }, - { .offset = DP_EDP_GENERAL_CAP_1, .end = DP_EDP_GENERAL_CAP_3 }, - { .offset = DP_EDP_DISPLAY_CONTROL_REGISTER, .end = DP_EDP_BACKLIGHT_FREQ_CAP_MAX_LSB }, - { .offset = DP_EDP_DBC_MINIMUM_BRIGHTNESS_SET, .end = DP_EDP_DBC_MAXIMUM_BRIGHTNESS_SET }, -}; - -static int i915_dpcd_show(struct seq_file *m, void *data) -{ - struct drm_connector *connector = m->private; - struct intel_dp *intel_dp = - enc_to_intel_dp(&intel_attached_encoder(connector)->base); - uint8_t buf[16]; - ssize_t err; - int i; - - if (connector->status != connector_status_connected) - return -ENODEV; - - for (i = 0; i < ARRAY_SIZE(i915_dpcd_debug); i++) { - const struct dpcd_block *b = &i915_dpcd_debug[i]; - size_t size = b->end ? b->end - b->offset + 1 : (b->size ?: 1); - - if (b->edp && - connector->connector_type != DRM_MODE_CONNECTOR_eDP) - continue; - - /* low tech for now */ - if (WARN_ON(size > sizeof(buf))) - continue; - - err = drm_dp_dpcd_read(&intel_dp->aux, b->offset, buf, size); - if (err <= 0) { - DRM_ERROR("dpcd read (%zu bytes at %u) failed (%zd)\n", - size, b->offset, err); - continue; - } - - seq_printf(m, "%04x: %*ph\n", b->offset, (int) size, buf); - } - - return 0; -} -DEFINE_SHOW_ATTRIBUTE(i915_dpcd); - static int i915_panel_show(struct seq_file *m, void *data) { struct drm_connector *connector = m->private; @@ -4917,11 +4855,6 @@ int i915_debugfs_connector_add(struct drm_connector *connector) if (!root) return -ENODEV; - if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || - connector->connector_type == DRM_MODE_CONNECTOR_eDP) - debugfs_create_file("i915_dpcd", S_IRUGO, root, - connector, &i915_dpcd_fops); - if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { debugfs_create_file("i915_panel_timings", S_IRUGO, root, connector, &i915_panel_fops);