forked from Minki/linux
drm/i915: Widen return value for reservation_object_wait_timeout_rcu to long.
This fixes a spurious warning from an integer overflow on 64-bits systems. The function may return MAX_SCHEDULE_TIMEOUT which gets truncated to -1. Explicitly handling this by casting to lret fixes it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reported-and-tested-by: Joseph Yasi <joe.yasi@gmail.com> Tested-by: Andreas Reis <andreas.reis@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: drm-intel-fixes@lists.freedesktop.org Fixes:3c28ff22f6
("i915: wait for fence in prepare_plane_fb") Link: http://patchwork.freedesktop.org/patch/msgid/5666EEC8.2000403@linux.intel.com (cherry picked from commitbcf8be279c
) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
2dc2f761de
commit
de0513365c
@ -13765,13 +13765,15 @@ intel_prepare_plane_fb(struct drm_plane *plane,
|
||||
|
||||
/* For framebuffer backed by dmabuf, wait for fence */
|
||||
if (obj && obj->base.dma_buf) {
|
||||
ret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
|
||||
false, true,
|
||||
MAX_SCHEDULE_TIMEOUT);
|
||||
if (ret == -ERESTARTSYS)
|
||||
return ret;
|
||||
long lret;
|
||||
|
||||
WARN_ON(ret < 0);
|
||||
lret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
|
||||
false, true,
|
||||
MAX_SCHEDULE_TIMEOUT);
|
||||
if (lret == -ERESTARTSYS)
|
||||
return lret;
|
||||
|
||||
WARN(lret < 0, "waiting returns %li\n", lret);
|
||||
}
|
||||
|
||||
if (!obj) {
|
||||
|
Loading…
Reference in New Issue
Block a user