diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-08-19 17:00:09 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-09-11 15:33:28 +0300 |
commit | 01a2a4d85d71b1b7f6f4d5239d207b821ae01b55 (patch) | |
tree | c44acbf81df25a929a5a7fffaefd2171dbfdf4c5 /tools/intel_display_poller.c | |
parent | ba139493a6f8e35ba6cecd5058ff93fb12848465 (diff) |
tools/intel_display_poller: Try to fix pipe<->plane handling on gen2/3
Check the pipe assignment for each plane (excluding plane C since the
kernel doesn't use that one) and pick the first one that's assigned to
the target pipe.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tools/intel_display_poller.c')
-rw-r--r-- | tools/intel_display_poller.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tools/intel_display_poller.c b/tools/intel_display_poller.c index ec3e30e6..8b66b53e 100644 --- a/tools/intel_display_poller.c +++ b/tools/intel_display_poller.c @@ -88,6 +88,11 @@ static void write_reg(uint32_t reg, uint32_t val) OUTREG(vlv_offset + reg, val); } +static char pipe_name(int pipe) +{ + return pipe + 'A'; +} + static int pipe_to_plane(uint32_t devid, int pipe) { if (!IS_GEN2(devid) && !IS_GEN3(devid)) @@ -95,13 +100,21 @@ static int pipe_to_plane(uint32_t devid, int pipe) switch (pipe) { case 0: - if ((read_reg(DSPACNTR) & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_B) + if ((read_reg(DSPACNTR) & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_A) + return 0; + if ((read_reg(DSPBCNTR) & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_A) return 1; - return 0; + fprintf(stderr, "no plane assigned to pipe %c, assuming %c\n", + pipe_name(pipe), pipe_name(pipe)); + return pipe; case 1: - if ((read_reg(DSPACNTR) & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_A) + if ((read_reg(DSPACNTR) & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_B) return 0; - return 1; + if ((read_reg(DSPBCNTR) & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_B) + return 1; + fprintf(stderr, "no plane assigned to pipe %c, assuming %c\n", + pipe_name(pipe), pipe_name(pipe)); + return pipe; } assert(0); @@ -886,11 +899,6 @@ static void poll_dsl_field(int pipe, uint32_t *min, uint32_t *max, const int cou } } -static char pipe_name(int pipe) -{ - return pipe + 'A'; -} - static const char *test_name(enum test test, int pipe, int bit, bool test_pixel_count) { static char str[32]; |