From 61dc7bc99055887614fdee54e04d07f8eee2f32e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Tue, 17 Apr 2018 14:10:47 -0700 Subject: [PATCH] wip --- drivers/gpu/drm/i915/intel_fbdev.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index 7d41d139341b..361402ab55dd 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c @@ -696,6 +696,21 @@ int intel_fbdev_init(struct drm_device *dev) return 0; } +static void intel_fbdev_create_fb_holder(struct intel_fbdev *ifbdev) +{ + struct drm_fb_helper_surface_size sizes; + + sizes.fb_width = 800; + sizes.fb_height = 600; + sizes.surface_width = sizes.fb_width; + sizes.surface_height = sizes.fb_height; + sizes.surface_bpp = 32; + sizes.surface_depth = 24; + + if (intelfb_create(&ifbdev->helper, &sizes)) + DRM_ERROR("Unable to create framebufer holder"); +} + static void intel_fbdev_initial_config(void *data, async_cookie_t cookie) { struct intel_fbdev *ifbdev = data; @@ -704,6 +719,11 @@ static void intel_fbdev_initial_config(void *data, async_cookie_t cookie) if (drm_fb_helper_initial_config(&ifbdev->helper, ifbdev->preferred_bpp)) intel_fbdev_unregister(to_i915(ifbdev->helper.dev)); + + mutex_lock(&ifbdev->helper.lock); + if (!ifbdev->vma) + intel_fbdev_create_fb_holder(ifbdev); + mutex_unlock(&ifbdev->helper.lock); } void intel_fbdev_initial_config_async(struct drm_device *dev) -- 2.17.0