aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio/virtgpu_fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_fb.c')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_fb.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_fb.c b/drivers/gpu/drm/virtio/virtgpu_fb.c
index b9678c4082ac..cea749f4ec39 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fb.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fb.c
@@ -95,7 +95,7 @@ static int virtio_gpu_dirty_update(struct virtio_gpu_framebuffer *fb,
95 95
96 offset = (y * fb->base.pitches[0]) + x * bpp; 96 offset = (y * fb->base.pitches[0]) + x * bpp;
97 97
98 virtio_gpu_cmd_transfer_to_host_2d(vgdev, obj->hw_res_handle, 98 virtio_gpu_cmd_transfer_to_host_2d(vgdev, obj,
99 offset, 99 offset,
100 cpu_to_le32(w), 100 cpu_to_le32(w),
101 cpu_to_le32(h), 101 cpu_to_le32(h),
@@ -203,12 +203,6 @@ static struct fb_ops virtio_gpufb_ops = {
203 .fb_imageblit = virtio_gpu_3d_imageblit, 203 .fb_imageblit = virtio_gpu_3d_imageblit,
204}; 204};
205 205
206static int virtio_gpu_vmap_fb(struct virtio_gpu_device *vgdev,
207 struct virtio_gpu_object *obj)
208{
209 return virtio_gpu_object_kmap(obj, NULL);
210}
211
212static int virtio_gpufb_create(struct drm_fb_helper *helper, 206static int virtio_gpufb_create(struct drm_fb_helper *helper,
213 struct drm_fb_helper_surface_size *sizes) 207 struct drm_fb_helper_surface_size *sizes)
214{ 208{
@@ -226,7 +220,7 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
226 mode_cmd.width = sizes->surface_width; 220 mode_cmd.width = sizes->surface_width;
227 mode_cmd.height = sizes->surface_height; 221 mode_cmd.height = sizes->surface_height;
228 mode_cmd.pitches[0] = mode_cmd.width * 4; 222 mode_cmd.pitches[0] = mode_cmd.width * 4;
229 mode_cmd.pixel_format = drm_mode_legacy_fb_format(32, 24); 223 mode_cmd.pixel_format = DRM_FORMAT_HOST_XRGB8888;
230 224
231 format = virtio_gpu_translate_format(mode_cmd.pixel_format); 225 format = virtio_gpu_translate_format(mode_cmd.pixel_format);
232 if (format == 0) 226 if (format == 0)
@@ -241,9 +235,9 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
241 virtio_gpu_cmd_create_resource(vgdev, resid, format, 235 virtio_gpu_cmd_create_resource(vgdev, resid, format,
242 mode_cmd.width, mode_cmd.height); 236 mode_cmd.width, mode_cmd.height);
243 237
244 ret = virtio_gpu_vmap_fb(vgdev, obj); 238 ret = virtio_gpu_object_kmap(obj);
245 if (ret) { 239 if (ret) {
246 DRM_ERROR("failed to vmap fb %d\n", ret); 240 DRM_ERROR("failed to kmap fb %d\n", ret);
247 goto err_obj_vmap; 241 goto err_obj_vmap;
248 } 242 }
249 243