iris: don't munmap NULL pointers
This is a regression, the previous commit had this check which was
removed in the patch mentioned below. What happens is that when we
have a buffer that's not mmapped and we try to bo_free it we get some
very funny backtraces. Easily reproducible with fullscreen
gputest.triangle.
Fixes: f62724ccac
("iris: Pick a single mmap mode (WB/WC) at BO allocation time")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4890
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11284>
This commit is contained in:
parent
e8956abe16
commit
7e96ea1294
|
@ -785,7 +785,7 @@ bo_free(struct iris_bo *bo)
|
||||||
{
|
{
|
||||||
struct iris_bufmgr *bufmgr = bo->bufmgr;
|
struct iris_bufmgr *bufmgr = bo->bufmgr;
|
||||||
|
|
||||||
if (!bo->userptr)
|
if (!bo->userptr && bo->map)
|
||||||
bo_unmap(bo);
|
bo_unmap(bo);
|
||||||
|
|
||||||
if (bo->idle) {
|
if (bo->idle) {
|
||||||
|
|
Loading…
Reference in New Issue