mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-07-23 18:06:18 +00:00
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>
This commit is contained in:
parent
ba139493a6
commit
01a2a4d85d
@ -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)
|
||||
return 1;
|
||||
return 0;
|
||||
case 1:
|
||||
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;
|
||||
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_B)
|
||||
return 0;
|
||||
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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user