[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <16a30d03-9c98-47a4-959f-8671f7cb7fab@collabora.com>
Date: Wed, 26 Mar 2025 14:54:00 +0300
From: Dmitry Osipenko <dmitry.osipenko@...labora.com>
To: "Kasireddy, Vivek" <vivek.kasireddy@...el.com>,
David Airlie <airlied@...hat.com>, Gerd Hoffmann <kraxel@...hat.com>,
Gurchetan Singh <gurchetansingh@...omium.org>, Chia-I Wu
<olvaffe@...il.com>,
Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@....com>
Cc: "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"virtualization@...ts.linux.dev" <virtualization@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kernel@...labora.com" <kernel@...labora.com>
Subject: Re: [PATCH v1 2/2] drm/virtio: Fix missed dmabuf unpinning in error
path of prepare_fb()
On 3/26/25 08:14, Kasireddy, Vivek wrote:
...
>> static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane,
>> struct drm_plane_state *new_state)
>> {
>> @@ -376,23 +386,16 @@ static int virtio_gpu_plane_prepare_fb(struct
>> drm_plane *plane,
>> vgplane_st->fence = virtio_gpu_fence_alloc(vgdev,
>> vgdev->fence_drv.context,
>> 0);
>> - if (!vgplane_st->fence)
>> + if (!vgplane_st->fence) {
>> + if (obj->import_attach)
>> + virtio_gpu_cleanup_imported_obj(obj);
> I think checking for fence allocation failure before import would be much better.
> In other words, cleaning up the fence in case of any import errors would be
> much simpler IMO.
>
> Regardless,
> Acked-by: Vivek Kasireddy <vivek.kasireddy@...el.com>
Another question, why do we need this fencing for imported dmabuf?
Fencing isn't done host/guest blobs in this code, while dmabuf is
essentially a guest blob. Could you please clarify why this fence is
needed? Maybe we shouldn't allocate fence in the first place for the dmabuf.
--
Best regards,
Dmitry
Powered by blists - more mailing lists