diff options
author | Keith Packard <keithp@keithp.com> | 2014-12-19 19:34:34 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-12-25 12:59:46 -0800 |
commit | 7804305673ca63720e8736c0c88afa711ebe208a (patch) | |
tree | a99df00f89605785960cae23f13d65736e427bea | |
parent | 826e7c2b36f192fbbe7ddff37eb559f4d6301146 (diff) |
modesetting: Fix damage tracking auto-disable code
dispatch_dirty_region was only returning -EINVAL error codes,
otherwise it would return 0. The kernel returns -ENOSYS when the
driver doesn't support damage tracking, so dispatch_dirty would never
see the error and never disable damage tracking.
Pass all errors back from dispatch_dirty_region and let dispatch_dirty
deal with them.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
-rw-r--r-- | hw/xfree86/drivers/modesetting/driver.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index d9a29827c..5929c0356 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -453,11 +453,12 @@ dispatch_dirty_region(ScrnInfoPtr scrn, modesettingPtr ms = modesettingPTR(scrn); RegionPtr dirty = DamageRegion(damage); unsigned num_cliprects = REGION_NUM_RECTS(dirty); + int ret = 0; if (num_cliprects) { drmModeClip *clip = malloc(num_cliprects * sizeof(drmModeClip)); BoxPtr rect = REGION_RECTS(dirty); - int i, ret; + int i; if (!clip) return -ENOMEM; @@ -474,12 +475,8 @@ dispatch_dirty_region(ScrnInfoPtr scrn, ret = drmModeDirtyFB(ms->fd, fb_id, clip, num_cliprects); free(clip); DamageEmpty(damage); - if (ret) { - if (ret == -EINVAL) - return ret; - } } - return 0; + return ret; } static void |