From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Rob Clark <robdclark@gmail.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Sean Paul <sean@poorly.run>,
Marijn Suijten <marijn.suijten@somainline.org>,
David Airlie <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
Stephen Boyd <swboyd@chromium.org>,
Kuogee Hsieh <quic_khsieh@quicinc.com>
Cc: <linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
"Jessica Zhang" <quic_jesszhan@quicinc.com>,
Abhinav Kumar <quic_abhinavk@quicinc.com>
Subject: [PATCH 3/3] drm/msm/dp: add a debugfs node for using tpg
Date: Mon, 2 Dec 2024 12:42:00 -0800 [thread overview]
Message-ID: <20241202-tpg-v1-3-0fd6b518b914@quicinc.com> (raw)
In-Reply-To: <20241202-tpg-v1-0-0fd6b518b914@quicinc.com>
DP test pattern generator is a very useful tool to debug issues
where monitor is showing incorrect output as it helps to isolate
whether the issue is due to rest of DPU pipeline or in the DP
controller itself. Expose a debugfs to use the TPG configuration
to help debug DP issues.
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
drivers/gpu/drm/msm/dp/dp_debug.c | 61 +++++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/msm/dp/dp_panel.h | 2 ++
2 files changed, 63 insertions(+)
diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c
index 22fd946ee201..843fe77268f8 100644
--- a/drivers/gpu/drm/msm/dp/dp_debug.c
+++ b/drivers/gpu/drm/msm/dp/dp_debug.c
@@ -197,6 +197,65 @@ static const struct file_operations test_active_fops = {
.write = msm_dp_test_active_write
};
+static ssize_t msm_dp_tpg_write(struct file *file, const char __user *ubuf,
+ size_t len, loff_t *offp)
+{
+ const struct msm_dp_debug_private *debug;
+ char *input_buffer;
+ int val;
+ int status = 0;
+ struct msm_dp_panel *dp_panel;
+
+ debug = ((struct seq_file *)file->private_data)->private;
+ dp_panel = debug->panel;
+
+ input_buffer = memdup_user_nul(ubuf, len);
+ if (IS_ERR(input_buffer))
+ return PTR_ERR(input_buffer);
+
+ status = kstrtoint(input_buffer, 10, &val);
+ if (status < 0) {
+ kfree(input_buffer);
+ return status;
+ }
+
+ msm_dp_panel_tpg_config(dp_panel, val);
+
+ dp_panel->tpg_enabled = val;
+
+ kfree(input_buffer);
+
+ *offp += len;
+ return len;
+}
+
+static int msm_dp_tpg_show(struct seq_file *f, void *data)
+{
+ struct msm_dp_debug_private *debug = f->private;
+ struct msm_dp_panel *dp_panel = debug->panel;
+
+ if (dp_panel->tpg_enabled)
+ seq_puts(f, "1");
+ else
+ seq_puts(f, "0");
+
+ return 0;
+}
+
+static int msm_dp_tpg_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, msm_dp_tpg_show, inode->i_private);
+}
+
+static const struct file_operations msm_dp_tpg_fops = {
+ .owner = THIS_MODULE,
+ .open = msm_dp_tpg_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+ .write = msm_dp_tpg_write
+};
+
int msm_dp_debug_init(struct device *dev, struct msm_dp_panel *panel,
struct msm_dp_link *link,
struct drm_connector *connector,
@@ -231,6 +290,8 @@ int msm_dp_debug_init(struct device *dev, struct msm_dp_panel *panel,
debugfs_create_file("dp_test_type", 0444,
root,
debug, &msm_dp_test_type_fops);
+
+ debugfs_create_file("dp_tpg", 0444, root, debug, &msm_dp_tpg_fops);
}
return 0;
diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h
index 0e944db3adf2..7910b11fd685 100644
--- a/drivers/gpu/drm/msm/dp/dp_panel.h
+++ b/drivers/gpu/drm/msm/dp/dp_panel.h
@@ -50,6 +50,8 @@ struct msm_dp_panel {
u32 max_dp_link_rate;
u32 max_bw_code;
+
+ bool tpg_enabled;
};
int msm_dp_panel_init_panel_info(struct msm_dp_panel *msm_dp_panel);
--
2.34.1
next prev parent reply other threads:[~2024-12-02 20:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 20:41 [PATCH 0/3] drm/msm/dp: Fix and utilize TPG with a debugfs Abhinav Kumar
2024-12-02 20:41 ` [PATCH 1/3] drm/msm/dp: account for widebus in msm_dp_catalog_panel_tpg_enable() Abhinav Kumar
2024-12-03 14:34 ` Dmitry Baryshkov
2024-12-03 19:48 ` Abhinav Kumar
2024-12-02 20:41 ` [PATCH 2/3] drm/msm/dp: do not touch the MMSS_DP_INTF_CONFIG for tpg Abhinav Kumar
2024-12-03 15:09 ` Dmitry Baryshkov
2024-12-02 20:42 ` Abhinav Kumar [this message]
2024-12-03 23:38 ` [PATCH 3/3] drm/msm/dp: add a debugfs node for using tpg Dmitry Baryshkov
2024-12-04 3:57 ` Abhinav Kumar
2024-12-04 10:33 ` Dmitry Baryshkov
2024-12-03 14:31 ` [PATCH 0/3] drm/msm/dp: Fix and utilize TPG with a debugfs Dmitry Baryshkov
2024-12-03 19:42 ` Abhinav Kumar
2024-12-03 20:46 ` Dmitry Baryshkov
2024-12-10 22:33 ` Marijn Suijten
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241202-tpg-v1-3-0fd6b518b914@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=airlied@gmail.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=quic_jesszhan@quicinc.com \
--cc=quic_khsieh@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
--cc=swboyd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®