summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>2016-10-18 17:05:19 -0700
committerVille Syrjälä <ville.syrjala@linux.intel.com>2017-11-21 16:19:17 +0200
commitf8f6db9ced0061229018fa658cf1c80c56464686 (patch)
tree2d28408f1ffacfa155ea710a1d23aadf6c4ed588 /tools
parentaadde840f9d7666b8dfc34f3da6ec5f9111de51e (diff)
tools/intel_watermark: Try not to dump nonexistent planes on SKL+
Having registers for nonexistent planes in the dumpo might end up being rather confusing. Try to only include real planes. Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/intel_watermark.c40
1 files changed, 33 insertions, 7 deletions
diff --git a/tools/intel_watermark.c b/tools/intel_watermark.c
index 9953fe59..c09772ee 100644
--- a/tools/intel_watermark.c
+++ b/tools/intel_watermark.c
@@ -134,23 +134,42 @@ static int is_hsw_plus(uint32_t d)
return !(IS_GEN5(d) || IS_GEN6(d) || IS_IVYBRIDGE(d));
}
+static int skl_num_planes(uint32_t d, int pipe)
+{
+ if (IS_GEN10(d) || IS_GEMINILAKE(d))
+ return 5;
+ else if (IS_BROXTON(d))
+ return pipe == 2 ? 4 : 5;
+ else
+ return 4;
+}
+
+static int skl_max_planes(uint32_t d)
+{
+ if (IS_GEN10(d) || IS_GEMINILAKE(d) || IS_BROXTON(d))
+ return 5;
+ else
+ return 4;
+}
static void skl_wm_dump(void)
{
int pipe, plane, level;
int num_pipes = 3;
- int num_planes = 5;
+ int max_planes = skl_max_planes(devid);
int num_levels = 8;
uint32_t base_addr = 0x70000, addr, wm_offset;
- uint32_t wm[num_levels][num_pipes][num_planes];
- uint32_t wm_trans[num_pipes][num_planes];
- uint32_t buf_cfg[num_pipes][num_planes];
+ uint32_t wm[num_levels][num_pipes][max_planes];
+ uint32_t wm_trans[num_pipes][max_planes];
+ uint32_t buf_cfg[num_pipes][max_planes];
uint32_t wm_linetime[num_pipes];
char reg_name[20];
intel_register_access_init(intel_get_pci_device(), 0, -1);
for (pipe = 0; pipe < num_pipes; pipe++) {
+ int num_planes = skl_num_planes(devid, pipe);
+
wm_linetime[pipe] = read_reg(0x45270 + pipe * 0x4);
for (plane = 0; plane < num_planes; plane++) {
@@ -172,9 +191,11 @@ static void skl_wm_dump(void)
}
printf("\n\n");
- for (plane = 0; plane < num_planes; plane++) {
+ for (plane = 0; plane < max_planes; plane++) {
for (level = 0; level < num_levels; level++) {
for (pipe = 0; pipe < num_pipes; pipe++) {
+ if (plane >= skl_num_planes(devid, pipe))
+ break;
if (plane == 0)
snprintf(reg_name, sizeof(reg_name), "CUR_WM_%c_%1d",
pipe_name(pipe), level);
@@ -189,8 +210,10 @@ static void skl_wm_dump(void)
printf("\n");
}
- for (plane = 0; plane < num_planes; plane++) {
+ for (plane = 0; plane < max_planes; plane++) {
for (pipe = 0; pipe < num_pipes; pipe++) {
+ if (plane >= skl_num_planes(devid, pipe))
+ break;
if (plane == 0)
snprintf(reg_name, sizeof(reg_name), "CUR_WM_TRANS_%c",
pipe_name(pipe));
@@ -204,8 +227,10 @@ static void skl_wm_dump(void)
}
printf("\n");
- for (plane = 0; plane < num_planes; plane++) {
+ for (plane = 0; plane < max_planes; plane++) {
for (pipe = 0; pipe < num_pipes; pipe++) {
+ if (plane >= skl_num_planes(devid, pipe))
+ break;
if (plane == 0)
snprintf(reg_name, sizeof(reg_name), "CUR_BUF_CFG_%c",
pipe_name(pipe));
@@ -223,6 +248,7 @@ static void skl_wm_dump(void)
uint32_t start, end, size;
uint32_t lines, blocks, enable;
uint32_t linetime;
+ int num_planes = skl_num_planes(devid, pipe);
printf("PIPE_%c\n", pipe_name(pipe));