diff options
author | Hans de Goede <hdegoede@redhat.com> | 2016-08-24 15:00:13 +0200 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-09-13 11:18:43 -0400 |
commit | d8e05c04758cbcd7b5c11362cb28ce017d50098b (patch) | |
tree | c6cd4487b59e98b583ede7385ff7685c6c6b5931 /hw/xfree86/drivers/modesetting | |
parent | 7ade8ba10e1e767bb510343c86573bc5d4804b92 (diff) |
modesetting: Fall back to primary crtc for vblank for drawables on slave outputs
This fixes glxgears running at 1 fps when fully covering a slave-output
and the modesetting driver is used for the master gpu.
Reported-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'hw/xfree86/drivers/modesetting')
-rw-r--r-- | hw/xfree86/drivers/modesetting/vblank.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/drivers/modesetting/vblank.c index 35924c370..04a895269 100644 --- a/hw/xfree86/drivers/modesetting/vblank.c +++ b/hw/xfree86/drivers/modesetting/vblank.c @@ -128,6 +128,32 @@ ms_covering_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms) best_coverage = coverage; } } + + /* Fallback to primary crtc for drawable's on slave outputs */ + if (best_crtc == NULL && !pScreen->isGPU) { + RROutputPtr primary_output = NULL; + ScreenPtr slave; + + if (dixPrivateKeyRegistered(rrPrivKey)) + primary_output = RRFirstOutput(scrn->pScreen); + if (!primary_output || !primary_output->crtc) + return NULL; + + crtc = primary_output->crtc->devPrivate; + if (!ms_crtc_on(crtc)) + return NULL; + + xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) { + if (!slave->is_output_slave) + continue; + + if (ms_covering_crtc(slave, box, FALSE)) { + /* The drawable is on a slave output, return primary crtc */ + return crtc; + } + } + } + return best_crtc; } |