trace_dbus_scanout_texture(tex_id, backing_y_0_top,
backing_width, backing_height, x, y, w, h);
#ifdef CONFIG_GBM
- QemuDmaBuf dmabuf = {
- .width = w,
- .height = h,
- .y0_top = backing_y_0_top,
- .x = x,
- .y = y,
- .backing_width = backing_width,
- .backing_height = backing_height,
- };
+ g_autoptr(QemuDmaBuf) dmabuf = NULL;
+ int fd;
+ uint32_t stride, fourcc;
+ uint64_t modifier;
assert(tex_id);
- dmabuf.fd = egl_get_fd_for_texture(
- tex_id, (EGLint *)&dmabuf.stride,
- (EGLint *)&dmabuf.fourcc,
- &dmabuf.modifier);
- if (dmabuf.fd < 0) {
+ fd = egl_get_fd_for_texture(tex_id, (EGLint *)&stride, (EGLint *)&fourcc,
+ &modifier);
+ if (fd < 0) {
error_report("%s: failed to get fd for texture", __func__);
return;
}
+ dmabuf = qemu_dmabuf_new(w, h, stride, x, y, backing_width,
+ backing_height, fourcc, modifier, fd,
+ false, backing_y_0_top);
- dbus_scanout_dmabuf(dcl, &dmabuf);
- close(dmabuf.fd);
+ dbus_scanout_dmabuf(dcl, dmabuf);
+ qemu_dmabuf_close(dmabuf);
#endif
#ifdef WIN32