diff options
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_display.c')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_display.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index afd0f9200f90..f84b7e61311b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -172,8 +172,6 @@ static int virtio_gpu_conn_get_modes(struct drm_connector *connector) count = drm_add_modes_noedid(connector, XRES_MAX, YRES_MAX); if (width == 0 || height == 0) { - width = XRES_DEF; - height = YRES_DEF; drm_set_preferred_mode(connector, XRES_DEF, YRES_DEF); } else { DRM_DEBUG("add mode: %dx%d\n", width, height); @@ -327,11 +325,14 @@ static const struct drm_mode_config_funcs virtio_gpu_mode_funcs = { .atomic_commit = drm_atomic_helper_commit, }; -void virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev) +int virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev) { - int i; + int i, ret; + + ret = drmm_mode_config_init(vgdev->ddev); + if (ret) + return ret; - drm_mode_config_init(vgdev->ddev); vgdev->ddev->mode_config.quirk_addfb_prefer_host_byte_order = true; vgdev->ddev->mode_config.funcs = &virtio_gpu_mode_funcs; @@ -345,6 +346,7 @@ void virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev) vgdev_output_init(vgdev, i); drm_mode_config_reset(vgdev->ddev); + return 0; } void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev) @@ -353,5 +355,4 @@ void virtio_gpu_modeset_fini(struct virtio_gpu_device *vgdev) for (i = 0 ; i < vgdev->num_scanouts; ++i) kfree(vgdev->outputs[i].edid); - drm_mode_config_cleanup(vgdev->ddev); } |