Skip to contentSkip to conversation

drm/msm/rd: Add chip-id

PATCH In review Rob Clark 2 participants 2 messages Jan 14, 2022 – Feb 9, 2022

Subsystems (3)
lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 drm/msm/rd: Add chip-id

From: Rob Clark <[email protected]>

For newer devices which deprecate gpu-id and do matching based on chip-id, we need this information in cmdstream dumps so that the decoding tools know how to decode them.

---
 drivers/gpu/drm/msm/msm_rd.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/msm/msm_rd.c +4 -0
index 81432ec07012..7e4d6460719e 100644
@@ -62,6 +62,7 @@ enum rd_sect_type {
 	RD_FRAG_SHADER,
 	RD_BUFFER_CONTENTS,
 	RD_GPU_ID,
+	RD_CHIP_ID,
 };
 
 #define BUF_SZ 512  /* should be power of 2 */
@@ -202,6 +203,9 @@ static int rd_open(struct inode *inode, struct file *file)
 
 	rd_write_section(rd, RD_GPU_ID, &gpu_id, sizeof(gpu_id));
 
+	gpu->funcs->get_param(gpu, MSM_PARAM_CHIP_ID, &val);
+	rd_write_section(rd, RD_CHIP_ID, &val, sizeof(val));
+
 out:
 	mutex_unlock(&gpu->lock);
 	return ret;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Rob Clark

From: Rob Clark <[email protected]>

For newer devices which deprecate gpu-id and do matching based on chip-id, we need this information in cmdstream dumps so that the decoding tools know how to decode them.

Quoted 26 lines
---
  drivers/gpu/drm/msm/msm_rd.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/msm/msm_rd.c +4 -0
index 81432ec07012..7e4d6460719e 100644
@@ -62,6 +62,7 @@ enum rd_sect_type {
  	RD_FRAG_SHADER,
  	RD_BUFFER_CONTENTS,
  	RD_GPU_ID,
+	RD_CHIP_ID,
  };
 
  #define BUF_SZ 512  /* should be power of 2 */
@@ -202,6 +203,9 @@ static int rd_open(struct inode *inode, struct file *file)
 
  	rd_write_section(rd, RD_GPU_ID, &gpu_id, sizeof(gpu_id));
 
+	gpu->funcs->get_param(gpu, MSM_PARAM_CHIP_ID, &val);
+	rd_write_section(rd, RD_CHIP_ID, &val, sizeof(val));
+
  out:
  	mutex_unlock(&gpu->lock);
  	return ret;
Signature · 2 lines
With best wishes
Dmitry