renderer/native: Reset all fields of MetaDumbBuffer

release_dumb_fb () checks 'map' to see if anything needs freeing. Other places
are checking fb_id instead. The checks maybe redundant, but let's reset all
fields here while at it, so that all the checks work as expected.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/810
This commit is contained in:
Pekka Paalanen 2019-09-17 13:20:36 +03:00 committed by Jonas Ådahl
parent 40408150f0
commit fe76e6a228

View File

@ -2679,7 +2679,6 @@ release_dumb_fb (MetaDumbBuffer *dumb_fb,
close (dumb_fb->dmabuf_fd);
munmap (dumb_fb->map, dumb_fb->map_size);
dumb_fb->map = NULL;
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
@ -2689,6 +2688,10 @@ release_dumb_fb (MetaDumbBuffer *dumb_fb,
.handle = dumb_fb->handle
};
drmIoctl (kms_fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_arg);
*dumb_fb = (MetaDumbBuffer) {
.dmabuf_fd = -1,
};
}
static gboolean