summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2020-12-16 15:25:55 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2021-10-19 12:50:58 +0300
commit9b0881254557edeaf273b2196309fc4e22ea0312 (patch)
tree29bd5dc28a26e2807123d0cf84db54be0782bed4 /tools
parentdd237eea7ef2def7c8f28bb307d75a711fa7d80e (diff)
tools/intel_display_poller: Add vrr-push test
Add another VRR test, this time to dermine on which scanline the hardware will clear the push bit. Reviewed-by: Manasi Navare <manasi.d.navare@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/intel_display_poller.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/tools/intel_display_poller.c b/tools/intel_display_poller.c
index 37383dc8..30d9242c 100644
--- a/tools/intel_display_poller.c
+++ b/tools/intel_display_poller.c
@@ -60,6 +60,7 @@ enum test {
TEST_SURFLIVE,
TEST_WRAP,
TEST_FIELD,
+ TEST_VRR_PUSH,
};
static uint32_t vlv_offset;
@@ -1213,6 +1214,50 @@ static void poll_dsl_field(int pipe, uint32_t *min, uint32_t *max, const int cou
}
}
+static void poll_dsl_vrr_push(uint32_t devid, int pipe,
+ uint32_t *min, uint32_t *max, const int count,
+ int vrr_push_scanline)
+{
+ uint32_t dsl, dsl1, dsl2;
+ uint32_t vrr, vrr1, vrr2;
+ bool field1, field2;
+ int i[2] = {};
+
+ dsl = PIPE_REG(pipe, PIPEA_DSL);
+ vrr = trans_reg(devid, pipe, TRANS_PUSH_A);
+
+ while (!quit) {
+ push_vrr(devid, pipe, vrr_push_scanline);
+
+ while (!quit) {
+ dsl1 = read_reg(dsl);
+ vrr1 = read_reg(vrr);
+ vrr2 = read_reg(vrr);
+ dsl2 = read_reg(dsl);
+
+ field1 = dsl1 & 0x80000000;
+ field2 = dsl2 & 0x80000000;
+ dsl1 &= ~0x80000000;
+ dsl2 &= ~0x80000000;
+
+ if (!(vrr2 & 0x40000000))
+ break;
+ }
+
+ if (!(vrr1 & 0x40000000))
+ continue;
+
+ if (field1 != field2)
+ printf("fields are different (%u:%u -> %u:%u)\n",
+ field1, dsl1, field2, dsl2);
+
+ min[field1*count+i[field1]] = dsl1;
+ max[field1*count+i[field1]] = dsl2;
+ if (++i[field1] >= count)
+ break;
+ }
+}
+
static const char *test_name(enum test test, int pipe, int bit, bool test_pixel_count)
{
static char str[64];
@@ -1267,6 +1312,9 @@ static const char *test_name(enum test test, int pipe, int bit, bool test_pixel_
case TEST_FIELD:
snprintf(str, sizeof str, "%s / pipe %c / Field", type, pipe_name(pipe));
return str;
+ case TEST_VRR_PUSH:
+ snprintf(str, sizeof str, "%s / pipe %c / VRR push", type, pipe_name(pipe));
+ return str;
default:
return "";
}
@@ -1275,7 +1323,7 @@ static const char *test_name(enum test test, int pipe, int bit, bool test_pixel_
static void __attribute__((noreturn)) usage(const char *name)
{
fprintf(stderr, "Usage: %s [options]\n"
- " -t,--test <pipestat|iir|framecount|flipcount|frametimestamp|timestamp|pan|flip|flipdone|surflive|wrap|field>\n"
+ " -t,--test <pipestat|iir|framecount|flipcount|frametimestamp|timestamp|pan|flip|flipdone|surflive|wrap|field|vrr-push>\n"
" -p,--pipe <pipe>\n"
" -b,--bit <bit>\n"
" -l,--line <target scanline/pixel>\n"
@@ -1345,6 +1393,8 @@ int main(int argc, char *argv[])
test = TEST_WRAP;
else if (!strcmp(optarg, "field"))
test = TEST_FIELD;
+ else if (!strcmp(optarg, "vrr-push"))
+ test = TEST_VRR_PUSH;
else
usage(argv[0]);
break;
@@ -1527,6 +1577,12 @@ int main(int argc, char *argv[])
case TEST_FLIPDONE:
test = TEST_FLIPDONE_DEIIR;
break;
+ case TEST_VRR_PUSH:
+ if (vrr_push_scanline < 0)
+ usage(argv[0]);
+ if (intel_gen(devid) < 11)
+ usage(argv[0]);
+ break;
case TEST_FLIPCOUNT:
case TEST_PAN:
case TEST_FLIP:
@@ -1638,6 +1694,9 @@ int main(int argc, char *argv[])
case TEST_FIELD:
poll_dsl_field(pipe, min, max, count);
break;
+ case TEST_VRR_PUSH:
+ poll_dsl_vrr_push(devid, pipe, min, max, count, vrr_push_scanline);
+ break;
default:
assert(0);
}