From: Ville Syrjälä Date: Fri, 18 Nov 2016 19:52:52 +0000 (+0200) Subject: drm/virtio: Call drm_helper_mode_fill_fb_struct() before drm_framebuffer_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9d020467a1c2f79a3efa3eeefcebdfdda2c1c625;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/virtio: Call drm_helper_mode_fill_fb_struct() before drm_framebuffer_init() We want framebuffers to be mostly useable already before drm_framebuffer_init() get called, and so we will start demanding that all the interesting format/size/etc. information be filled in before drm_framebuffer_init(). drm_helper_mode_fill_fb_struct() will do that for us, so let's make sure it gets called before drm_framebuffer_init(). Cc: Dave Airlie Cc: Gerd Hoffmann Signed-off-by: Ville Syrjälä Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-17-git-send-email-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 8b80fdd0e0a8..fad5a1cc5903 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -88,12 +88,13 @@ virtio_gpu_framebuffer_init(struct drm_device *dev, bo = gem_to_virtio_gpu_obj(obj); + drm_helper_mode_fill_fb_struct(dev, &vgfb->base, mode_cmd); + ret = drm_framebuffer_init(dev, &vgfb->base, &virtio_gpu_fb_funcs); if (ret) { vgfb->obj = NULL; return ret; } - drm_helper_mode_fill_fb_struct(dev, &vgfb->base, mode_cmd); spin_lock_init(&vgfb->dirty_lock); vgfb->x1 = vgfb->y1 = INT_MAX;