drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpufb_create()
[sfrench/cifs-2.6.git] / drivers / gpu / drm / virtio / virtgpu_fb.c
index d39f4f3350d0cb522c0fd53e10d470a0ad0e14f0..800960bdd9c661a3a9bedc98a60c543d58d98504 100644 (file)
@@ -214,7 +214,7 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
        struct drm_framebuffer *fb;
        struct drm_mode_fb_cmd2 mode_cmd = {};
        struct virtio_gpu_object *obj;
-       uint32_t resid, format, size;
+       uint32_t format, size;
        int ret;
 
        mode_cmd.width = sizes->surface_width;
@@ -231,8 +231,8 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
        if (IS_ERR(obj))
                return PTR_ERR(obj);
 
-       virtio_gpu_resource_id_get(vgdev, &resid);
-       virtio_gpu_cmd_create_resource(vgdev, obj, resid, format,
+       virtio_gpu_resource_id_get(vgdev, &obj->hw_res_handle);
+       virtio_gpu_cmd_create_resource(vgdev, obj, obj->hw_res_handle, format,
                                       mode_cmd.width, mode_cmd.height);
 
        ret = virtio_gpu_object_kmap(obj);
@@ -242,7 +242,7 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
        }
 
        /* attach the object to the resource */
-       ret = virtio_gpu_object_attach(vgdev, obj, resid, NULL);
+       ret = virtio_gpu_object_attach(vgdev, obj, obj->hw_res_handle, NULL);
        if (ret)
                goto err_obj_attach;