qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 10/13] virtio-gpu: Add helpers to create and destroy dmabu


From: Gerd Hoffmann
Subject: Re: [PATCH v5 10/13] virtio-gpu: Add helpers to create and destroy dmabuf objects
Date: Wed, 19 May 2021 08:17:28 +0200

> +int virtio_gpu_update_dmabuf(VirtIOGPU *g,
> +                             uint32_t scanout_id,
> +                             struct virtio_gpu_simple_resource *res,
> +                             struct virtio_gpu_framebuffer *fb)
> +{
> +    struct virtio_gpu_scanout *scanout = &g->parent_obj.scanout[scanout_id];
> +    VGPUDMABuf *new_primary, *old_primary;
> +
> +    new_primary = virtio_gpu_create_dmabuf(g, scanout_id, res, fb);
> +    if (!new_primary) {
> +        return -EINVAL;
> +    }
> +
> +    if (g->dmabuf.primary) {
> +        old_primary = g->dmabuf.primary;
> +    }
> +
> +    g->dmabuf.primary = new_primary;
> +    qemu_console_resize(scanout->con,
> +                     new_primary->buf.width,
> +                        new_primary->buf.height);
> +    dpy_gl_scanout_dmabuf(scanout->con, &new_primary->buf);
> +
> +    if (old_primary) {
> +        virtio_gpu_free_dmabuf(g, old_primary);
> +    }
> +
> +    return 0;
> +}

../../hw/display/virtio-gpu-udmabuf.c: In function ‘virtio_gpu_update_dmabuf’:
/home/kraxel/projects/qemu/include/qemu/queue.h:456:62: error: ‘old_primary’ 
may be used uninitialized in this function [-Werror=maybe-uninitialized]

take care,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]