On 9/24/25 22:47, [email protected] wrote:
>  }
>  
> +static void virtio_gpu_object_add_restore_list(struct virtio_gpu_device 
> *vgdev,
> +                                            struct virtio_gpu_object *bo,
> +                                            struct virtio_gpu_object_params 
> *params)
> +{
> +     struct virtio_gpu_object_restore *new;
> +
> +     new = kvmalloc(sizeof(*new), GFP_KERNEL);
> +     if (!new) {
> +             DRM_ERROR("Fail to allocate virtio_gpu_object_restore");
> +             return;
> +     }
> +
> +     new->bo = bo;
> +     memcpy(&new->params, params, sizeof(*params));
> +
> +     list_add_tail(&new->node, &vgdev->obj_restore);

Would be good if you could embed struct virtio_gpu_object_restore into
BO itself and don't have extra kmalloc.

-- 
Best regards,
Dmitry

Reply via email to