diff mbox series

[v4,01/19] drm/virtio: blob prep: refactor getting pages and attaching backing

Message ID 20200924003214.662-1-gurchetansingh@chromium.org (mailing list archive)
State New, archived
Headers show
Series [v4,01/19] drm/virtio: blob prep: refactor getting pages and attaching backing | expand

Commit Message

Gurchetan Singh Sept. 24, 2020, 12:31 a.m. UTC
Useful for upcoming blob resources.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
 drivers/gpu/drm/virtio/virtgpu_object.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Gerd Hoffmann Sept. 29, 2020, 9:32 a.m. UTC | #1
On Wed, Sep 23, 2020 at 05:31:56PM -0700, Gurchetan Singh wrote:
> Useful for upcoming blob resources.

Pushed to drm-misc-next (whole series).

thanks,
  Gerd
Gurchetan Singh Sept. 29, 2020, 9:56 p.m. UTC | #2
On Tue, Sep 29, 2020 at 2:33 AM Gerd Hoffmann <kraxel@redhat.com> wrote:

> On Wed, Sep 23, 2020 at 05:31:56PM -0700, Gurchetan Singh wrote:
> > Useful for upcoming blob resources.
>
> Pushed to drm-misc-next (whole series).
>

Thanks -- sent over a 32-bit/64-bit bug fix and requested a virtio-spec
vote.


>
> thanks,
>   Gerd
>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c
index 842f8b61aa897..4c107b53e81a0 100644
--- a/drivers/gpu/drm/virtio/virtgpu_object.c
+++ b/drivers/gpu/drm/virtio/virtgpu_object.c
@@ -228,22 +228,22 @@  int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
 			goto err_put_objs;
 	}
 
+	ret = virtio_gpu_object_shmem_init(vgdev, bo, &ents, &nents);
+	if (ret != 0) {
+		virtio_gpu_free_object(&shmem_obj->base);
+		return ret;
+	}
+
 	if (params->virgl) {
 		virtio_gpu_cmd_resource_create_3d(vgdev, bo, params,
 						  objs, fence);
+		virtio_gpu_object_attach(vgdev, bo, ents, nents);
 	} else {
 		virtio_gpu_cmd_create_resource(vgdev, bo, params,
 					       objs, fence);
+		virtio_gpu_object_attach(vgdev, bo, ents, nents);
 	}
 
-	ret = virtio_gpu_object_shmem_init(vgdev, bo, &ents, &nents);
-	if (ret != 0) {
-		virtio_gpu_free_object(&shmem_obj->base);
-		return ret;
-	}
-
-	virtio_gpu_object_attach(vgdev, bo, ents, nents);
-
 	*bo_ptr = bo;
 	return 0;