summaryrefslogtreecommitdiff
path: root/hw/xfree86/drivers
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-07-18 12:46:51 -0400
committerAdam Jackson <ajax@redhat.com>2016-07-18 16:35:16 -0400
commit4b311d23e84356bd0e9e736aeed7448dd6382118 (patch)
tree87081b6789f06b25f36eb0ef1cf016bd179127ad /hw/xfree86/drivers
parent8d3a368d8980e37e7e8c57065dc901ce809887c6 (diff)
modesetting: resubmit dirty rects on EINVAL (v2)
This error code can mean we're submitting more rects at once than the driver can handle. If that happens, resubmit one at a time. v2: Make the rect submit loop more error-proof (Walter Harms) Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Michael Thayer <michael.thayer@oracle.com>
Diffstat (limited to 'hw/xfree86/drivers')
-rw-r--r--hw/xfree86/drivers/modesetting/driver.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index f2620821b..5ebb39485 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -515,6 +515,15 @@ dispatch_dirty_region(ScrnInfoPtr scrn,
/* TODO query connector property to see if this is needed */
ret = drmModeDirtyFB(ms->fd, fb_id, clip, num_cliprects);
+
+ /* if we're swamping it with work, try one at a time */
+ if (ret == -EINVAL) {
+ for (i = 0; i < num_cliprects; i++) {
+ if ((ret = drmModeDirtyFB(ms->fd, fb_id, &clip[i], 1)) < 0)
+ break;
+ }
+ }
+
free(clip);
DamageEmpty(damage);
}