gallium: Fix the ->set_damage_region() implementation
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 8 Nov 2019 23:02:54 +0000 (00:02 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Fri, 29 Nov 2019 09:20:29 +0000 (10:20 +0100)
commitb196e1a8cfbd2c6b53f688542bcda5bb8f7f8888
tree7d0488a1b62ddd5d21edfc262f6e393f10c7f7f8
parent5fcb503c730e556714cc395f8c6ab76bc3acd179
gallium: Fix the ->set_damage_region() implementation

BACK_LEFT attachment can be outdated when the user calls
KHR_partial_update() (->lastStamp != ->texture_stamp), leading to a
damage region update on the wrong pipe_resource object.
Let's delay the ->set_damage_region() call until the attachments are
updated when we're in that case.

Reported-by: Carsten Haitzler <raster@rasterman.com>
Fixes: 492ffbed63a2 ("st/dri2: Implement DRI2bufferDamageExtension")
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/state_trackers/dri/dri2.c
src/gallium/state_trackers/dri/dri_drawable.c
src/gallium/state_trackers/dri/dri_drawable.h