mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-24 23:00:05 +01:00
xwayland: Call drmFreeDevice for dma-buf default feedback
Fixes leaks: ==13712== 144 bytes in 1 blocks are definitely lost in loss record 4,827 of 7,462 ==13712== at 0x48459F3: calloc (vg_replace_malloc.c:1340) ==13712== by 0x49BE94D: drmDeviceAlloc (xf86drm.c:4072) ==13712== by 0x49BFAC9: drmProcessPciDevice (xf86drm.c:4104) ==13712== by 0x49BFAC9: process_device (xf86drm.c:4508) ==13712== by 0x49C35FB: drmGetDeviceFromDevId (xf86drm.c:4670) ==13712== by 0x1AD370: xwl_dmabuf_feedback_main_device (xwayland-dmabuf.c:477) ==13712== by 0x53C03FD: ffi_call_unix64 (unix64.S:104) ==13712== by 0x53BF70C: ffi_call_int (ffi64.c:673) ==13712== by 0x53BFEE2: ffi_call (ffi64.c:710) ==13712== by 0x49AC920: wl_closure_invoke (connection.c:1025) ==13712== by 0x49A8C08: dispatch_event.isra.0 (wayland-client.c:1631) ==13712== by 0x49AA5AB: dispatch_queue (wayland-client.c:1777) ==13712== by 0x49AA5AB: wl_display_dispatch_queue_pending (wayland-client.c:2019) ==13712== by 0x49AAB5E: wl_display_roundtrip_queue (wayland-client.c:1403) ==13712== 576 bytes in 4 blocks are definitely lost in loss record 6,289 of 7,462 ==13712== at 0x48459F3: calloc (vg_replace_malloc.c:1340) ==13712== by 0x49BE94D: drmDeviceAlloc (xf86drm.c:4072) ==13712== by 0x49BFAC9: drmProcessPciDevice (xf86drm.c:4104) ==13712== by 0x49BFAC9: process_device (xf86drm.c:4508) ==13712== by 0x49C35FB: drmGetDeviceFromDevId (xf86drm.c:4670) ==13712== by 0x1AD583: xwl_dmabuf_feedback_main_device (xwayland-dmabuf.c:477) ==13712== by 0x1AD583: xwl_window_dmabuf_feedback_main_device (xwayland-dmabuf.c:691) ==13712== by 0x53C03FD: ffi_call_unix64 (unix64.S:104) ==13712== by 0x53BF70C: ffi_call_int (ffi64.c:673) ==13712== by 0x53BFEE2: ffi_call (ffi64.c:710) ==13712== by 0x49AC920: wl_closure_invoke (connection.c:1025) ==13712== by 0x49A8C08: dispatch_event.isra.0 (wayland-client.c:1631) ==13712== by 0x49AA5AB: dispatch_queue (wayland-client.c:1777) ==13712== by 0x49AA5AB: wl_display_dispatch_queue_pending (wayland-client.c:2019) ==13712== by 0x1A1842: xwl_read_events (xwayland-screen.c:566) ==13712== by 0x1A1842: xwl_read_events (xwayland-screen.c:553) Fixes:6f0b9deed6("xwayland: use drmDevice to compare DRM devices") (cherry picked from commit82d3b8ff05) Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1515>
This commit is contained in:
parent
19d05769b6
commit
2b26051425
2 changed files with 3 additions and 0 deletions
|
|
@ -513,6 +513,8 @@ xwl_dmabuf_feedback_main_device(void *data,
|
|||
assert(dev->size == sizeof(dev_t));
|
||||
memcpy(&devid, dev->data, sizeof(dev_t));
|
||||
|
||||
drmFreeDevice(&xwl_feedback->main_dev);
|
||||
|
||||
if (drmGetDeviceFromDevId(devid, 0, &xwl_feedback->main_dev) != 0)
|
||||
ErrorF("linux_dmabuf_feedback.main_device: Failed to fetch DRM device\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1131,6 +1131,7 @@ xwl_dmabuf_feedback_destroy(struct xwl_dmabuf_feedback *xwl_feedback)
|
|||
zwp_linux_dmabuf_feedback_v1_destroy(xwl_feedback->dmabuf_feedback);
|
||||
|
||||
xwl_feedback->dmabuf_feedback = NULL;
|
||||
drmFreeDevice(&xwl_feedback->main_dev);
|
||||
}
|
||||
|
||||
Bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue