Quoting Deepak Rawat (2018-09-28 01:43:45) > vmwgfx does not support GEM interface so calling gem_close on vmwgfx > results in error. > > v2: Use drmIoctl with error when ioctl() failed. > > Signed-off-by: Deepak Rawat <drawat@xxxxxxxxxx> > --- > lib/igt_fb.c | 5 ++++- > lib/igt_kms.c | 13 +++++++++++++ > lib/igt_kms.h | 1 + > 3 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/lib/igt_fb.c b/lib/igt_fb.c > index 486b5d30..0248637c 100644 > --- a/lib/igt_fb.c > +++ b/lib/igt_fb.c > @@ -1933,7 +1933,10 @@ void igt_remove_fb(int fd, struct igt_fb *fb) > > cairo_surface_destroy(fb->cairo_surface); > do_or_die(drmModeRmFB(fd, fb->fb_id)); > - gem_close(fd, fb->gem_handle); > + if (fb->is_dumb) > + kmstest_dumb_destroy(fd, fb->gem_handle); > + else > + gem_close(fd, fb->gem_handle); > fb->fb_id = 0; > } > > diff --git a/lib/igt_kms.c b/lib/igt_kms.c > index 4563bfd9..6c6c6441 100644 > --- a/lib/igt_kms.c > +++ b/lib/igt_kms.c > @@ -639,6 +639,19 @@ void *kmstest_dumb_map_buffer(int fd, uint32_t handle, uint64_t size, > return ptr; > } > > +/** > + * kmstest_dumb_destroy: > + * @fd: Opened drm file descriptor > + * @handle: Offset in the file referred to by fd > + */ > +void kmstest_dumb_destroy(int fd, uint32_t handle) > +{ > + struct drm_mode_destroy_dumb arg = { handle }; > + > + if (drmIoctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &arg)) > + igt_warn("Destroying dumb buffer failed.\n"); The sop is to int __kmstest_dumb_destroy() (why would this be kmstest if it is just a kms ioctl wrapper???) { int err = 0; if (drmIoctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &handle)) err = -errno; errno = 0; return err; } void kmstest_dumb_destroy(int fd, u32 handle) { igt_assert_eq(__kmstest_dumb_destroy(fd, handle), 0); } -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx