mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Rob Clark <robdclark@gmail.com>
Cc: "David Airlie" <airlied@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Gurchetan Singh" <gurchetansingh@chromium.org>,
	"Chia-I Wu" <olvaffe@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Marek Olšák" <maraeo@gmail.com>,
	"Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v2 1/2] drm/virtio: Refactor job submission code path
Date: Thu, 23 Mar 2023 00:45:10 +0300	[thread overview]
Message-ID: <ffdc843c-86ae-4838-9201-9028f2624933@collabora.com> (raw)
In-Reply-To: <CAF6AEGu0WNgX+T2sjrA_-sgvO35wNjz39p6hc9zh02goPrkExQ@mail.gmail.com>

On 3/23/23 00:25, Rob Clark wrote:
...
>> +static int virtio_gpu_dma_fence_wait(struct virtio_gpu_submit *submit,
>> +                                    struct dma_fence *fence)
>> +{
>> +       struct dma_fence *itr;
>> +       int idx, err;
>> +
>> +       dma_fence_array_for_each(itr, idx, fence) {
> 
> I guess unwrapping is for the later step of host waits?
> 
> At any rate, I think you should use dma_fence_unwrap_for_each() to
> handle the fence-chain case as well?

Yes, seems so. I actually missed the dma_fence_unwrap, thanks!

...
>> +static int virtio_gpu_init_submit(struct virtio_gpu_submit *submit,
>> +                                 struct drm_virtgpu_execbuffer *exbuf,
>> +                                 struct drm_device *dev,
>> +                                 struct drm_file *file,
>> +                                 uint64_t fence_ctx, uint32_t ring_idx)
>> +{
>> +       struct virtio_gpu_fpriv *vfpriv = file->driver_priv;
>> +       struct virtio_gpu_device *vgdev = dev->dev_private;
>> +       struct virtio_gpu_fence *out_fence;
>> +       int err;
>> +
>> +       memset(submit, 0, sizeof(*submit));
>> +
>> +       out_fence = virtio_gpu_fence_alloc(vgdev, fence_ctx, ring_idx);
>> +       if (!out_fence)
>> +               return -ENOMEM;
>> +
>> +       err = virtio_gpu_fence_event_create(dev, file, out_fence, ring_idx);
>> +       if (err) {
>> +               dma_fence_put(&out_fence->f);
>> +               return err;
>> +       }
> 
> If we fail at any point after here, where is the out_fence referenced dropped?

Good catch, don't see either where it's dropped. Perhaps the drop got
lost after moving the code around, will fix.

...
>> +/*
>> + * Usage of execbuffer:
>> + * Relocations need to take into account the full VIRTIO_GPUDrawable size.
>> + * However, the command as passed from user space must *not* contain the initial
>> + * VIRTIO_GPUReleaseInfo struct (first XXX bytes)
>> + */
> 
> I know this is just getting moved from the old location, but I'm not
> even sure what this comment means ;-)
> 
> At least it doesn't make any sense for non-virgl contexts.. I haven't
> looked too closely at virgl protocol itself

Had exactly the same thought :) Well, if nobody will clarify, then I'm
happy with removing it in v3.

-- 
Best regards,
Dmitry


  reply	other threads:[~2023-03-22 21:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19 16:08 [PATCH v2 0/2] Add sync object UAPI support to VirtIO-GPU driver Dmitry Osipenko
2023-03-19 16:08 ` [PATCH v2 1/2] drm/virtio: Refactor job submission code path Dmitry Osipenko
2023-03-22 21:25   ` Rob Clark
2023-03-22 21:45     ` Dmitry Osipenko [this message]
2023-03-19 16:08 ` [PATCH v2 2/2] drm/virtio: Support sync objects Dmitry Osipenko

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=ffdc843c-86ae-4838-9201-9028f2624933@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gurchetansingh@chromium.org \
    --cc=kernel@collabora.com \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maraeo@gmail.com \
    --cc=olvaffe@gmail.com \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    --cc=robdclark@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®