mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
In region_unmap(), check if region is mapped before decrementing refcount.
This commit is contained in:
parent
bb3d61551c
commit
7c8b2f7ce3
2 changed files with 14 additions and 8 deletions
|
|
@ -59,10 +59,13 @@ i915_region_unmap(struct pipe_context *pipe, struct pipe_region *region)
|
|||
{
|
||||
struct i915_context *i915 = i915_context( pipe );
|
||||
|
||||
if (!--region->map_refcount) {
|
||||
i915->pipe.winsys->buffer_unmap( i915->pipe.winsys,
|
||||
region->buffer );
|
||||
region->map = NULL;
|
||||
if (region->map_refcount > 0) {
|
||||
assert(region->map);
|
||||
if (!--region->map_refcount) {
|
||||
i915->pipe.winsys->buffer_unmap( i915->pipe.winsys,
|
||||
region->buffer );
|
||||
region->map = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,10 +69,13 @@ sp_region_unmap(struct pipe_context *pipe, struct pipe_region *region)
|
|||
{
|
||||
struct softpipe_context *sp = softpipe_context( pipe );
|
||||
|
||||
if (!--region->map_refcount) {
|
||||
sp->pipe.winsys->buffer_unmap( sp->pipe.winsys,
|
||||
region->buffer );
|
||||
region->map = NULL;
|
||||
if (region->map_refcount > 0) {
|
||||
assert(region->map);
|
||||
if (!--region->map_refcount) {
|
||||
sp->pipe.winsys->buffer_unmap( sp->pipe.winsys,
|
||||
region->buffer );
|
||||
region->map = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue