All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chia-I Wu <olvaffe@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: David Airlie <airlied@linux.ie>,
	open list <linux-kernel@vger.kernel.org>,
	Daniel Vetter <daniel@ffwll.ch>,
	ML dri-devel <dri-devel@lists.freedesktop.org>,
	"open list:VIRTIO GPU DRIVER"
	<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH] drm/virtio: fix command submission with objects but without fence.
Date: Wed, 4 Sep 2019 16:10:30 -0700	[thread overview]
Message-ID: <CAPaKu7RWiEr5n_DWcg0H2PPnRs9CUn-ZgQV3NYe8VrdZgEAhTQ__31187.6211942703$1567638682$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <20190904074828.32502-1-kraxel@redhat.com>

On Wed, Sep 4, 2019 at 12:48 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> Only call virtio_gpu_array_add_fence if we actually have a fence.
>
> Fixes: da758d51968a ("drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing")
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  drivers/gpu/drm/virtio/virtgpu_vq.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c
> index 595fa6ec2d58..7fd2851f7b97 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_vq.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
> @@ -339,11 +339,12 @@ static void virtio_gpu_queue_fenced_ctrl_buffer(struct virtio_gpu_device *vgdev,
>                 goto again;
>         }
>
> -       if (fence)
> +       if (fence) {
>                 virtio_gpu_fence_emit(vgdev, hdr, fence);
> -       if (vbuf->objs) {
> -               virtio_gpu_array_add_fence(vbuf->objs, &fence->f);
> -               virtio_gpu_array_unlock_resv(vbuf->objs);
> +               if (vbuf->objs) {
> +                       virtio_gpu_array_add_fence(vbuf->objs, &fence->f);
> +                       virtio_gpu_array_unlock_resv(vbuf->objs);
> +               }
This leaks when fence == NULL and vbuf->objs != NULL (which can really
happen IIRC... not at my desk to check).


>         }
>         notify = virtio_gpu_queue_ctrl_buffer_locked(vgdev, vbuf);
>         spin_unlock(&vgdev->ctrlq.qlock);
> --
> 2.18.1
>

  reply	other threads:[~2019-09-04 23:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04  7:48 [PATCH] drm/virtio: fix command submission with objects but without fence Gerd Hoffmann
2019-09-04  7:48 ` Gerd Hoffmann
2019-09-04 23:10 ` Chia-I Wu [this message]
2019-09-04 23:10 ` Chia-I Wu
2019-09-04 23:10   ` Chia-I Wu
2019-09-05  5:23   ` Gerd Hoffmann
2019-09-05  5:23     ` Gerd Hoffmann
2019-09-05 17:14     ` Chia-I Wu
2019-09-05 17:14       ` Chia-I Wu
2019-09-05 17:14     ` Chia-I Wu
2019-09-05  5:23   ` Gerd Hoffmann
  -- strict thread matches above, loose matches on Subject: below --
2019-09-04  7:48 Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPaKu7RWiEr5n_DWcg0H2PPnRs9CUn-ZgQV3NYe8VrdZgEAhTQ__31187.6211942703$1567638682$gmane$org@mail.gmail.com' \
    --to=olvaffe@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.