|
@@ -104,9 +104,9 @@ static struct fb_ops intelfb_ops = {
|
|
.owner = THIS_MODULE,
|
|
.owner = THIS_MODULE,
|
|
.fb_check_var = drm_fb_helper_check_var,
|
|
.fb_check_var = drm_fb_helper_check_var,
|
|
.fb_set_par = intel_fbdev_set_par,
|
|
.fb_set_par = intel_fbdev_set_par,
|
|
- .fb_fillrect = cfb_fillrect,
|
|
|
|
- .fb_copyarea = cfb_copyarea,
|
|
|
|
- .fb_imageblit = cfb_imageblit,
|
|
|
|
|
|
+ .fb_fillrect = drm_fb_helper_cfb_fillrect,
|
|
|
|
+ .fb_copyarea = drm_fb_helper_cfb_copyarea,
|
|
|
|
+ .fb_imageblit = drm_fb_helper_cfb_imageblit,
|
|
.fb_pan_display = intel_fbdev_pan_display,
|
|
.fb_pan_display = intel_fbdev_pan_display,
|
|
.fb_blank = intel_fbdev_blank,
|
|
.fb_blank = intel_fbdev_blank,
|
|
.fb_setcmap = drm_fb_helper_setcmap,
|
|
.fb_setcmap = drm_fb_helper_setcmap,
|
|
@@ -215,9 +215,9 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
|
obj = intel_fb->obj;
|
|
obj = intel_fb->obj;
|
|
size = obj->base.size;
|
|
size = obj->base.size;
|
|
|
|
|
|
- info = framebuffer_alloc(0, &dev->pdev->dev);
|
|
|
|
- if (!info) {
|
|
|
|
- ret = -ENOMEM;
|
|
|
|
|
|
+ info = drm_fb_helper_alloc_fbi(helper);
|
|
|
|
+ if (IS_ERR(info)) {
|
|
|
|
+ ret = PTR_ERR(info);
|
|
goto out_unpin;
|
|
goto out_unpin;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -226,24 +226,13 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
|
fb = &ifbdev->fb->base;
|
|
fb = &ifbdev->fb->base;
|
|
|
|
|
|
ifbdev->helper.fb = fb;
|
|
ifbdev->helper.fb = fb;
|
|
- ifbdev->helper.fbdev = info;
|
|
|
|
|
|
|
|
strcpy(info->fix.id, "inteldrmfb");
|
|
strcpy(info->fix.id, "inteldrmfb");
|
|
|
|
|
|
info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
|
|
info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
|
|
info->fbops = &intelfb_ops;
|
|
info->fbops = &intelfb_ops;
|
|
|
|
|
|
- ret = fb_alloc_cmap(&info->cmap, 256, 0);
|
|
|
|
- if (ret) {
|
|
|
|
- ret = -ENOMEM;
|
|
|
|
- goto out_unpin;
|
|
|
|
- }
|
|
|
|
/* setup aperture base/size for vesafb takeover */
|
|
/* setup aperture base/size for vesafb takeover */
|
|
- info->apertures = alloc_apertures(1);
|
|
|
|
- if (!info->apertures) {
|
|
|
|
- ret = -ENOMEM;
|
|
|
|
- goto out_unpin;
|
|
|
|
- }
|
|
|
|
info->apertures->ranges[0].base = dev->mode_config.fb_base;
|
|
info->apertures->ranges[0].base = dev->mode_config.fb_base;
|
|
info->apertures->ranges[0].size = dev_priv->gtt.mappable_end;
|
|
info->apertures->ranges[0].size = dev_priv->gtt.mappable_end;
|
|
|
|
|
|
@@ -255,7 +244,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
|
size);
|
|
size);
|
|
if (!info->screen_base) {
|
|
if (!info->screen_base) {
|
|
ret = -ENOSPC;
|
|
ret = -ENOSPC;
|
|
- goto out_unpin;
|
|
|
|
|
|
+ goto out_destroy_fbi;
|
|
}
|
|
}
|
|
info->screen_size = size;
|
|
info->screen_size = size;
|
|
|
|
|
|
@@ -282,6 +271,8 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
|
vga_switcheroo_client_fb_set(dev->pdev, info);
|
|
vga_switcheroo_client_fb_set(dev->pdev, info);
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
|
|
+out_destroy_fbi:
|
|
|
|
+ drm_fb_helper_release_fbi(helper);
|
|
out_unpin:
|
|
out_unpin:
|
|
i915_gem_object_ggtt_unpin(obj);
|
|
i915_gem_object_ggtt_unpin(obj);
|
|
drm_gem_object_unreference(&obj->base);
|
|
drm_gem_object_unreference(&obj->base);
|
|
@@ -523,16 +514,9 @@ static const struct drm_fb_helper_funcs intel_fb_helper_funcs = {
|
|
static void intel_fbdev_destroy(struct drm_device *dev,
|
|
static void intel_fbdev_destroy(struct drm_device *dev,
|
|
struct intel_fbdev *ifbdev)
|
|
struct intel_fbdev *ifbdev)
|
|
{
|
|
{
|
|
- if (ifbdev->helper.fbdev) {
|
|
|
|
- struct fb_info *info = ifbdev->helper.fbdev;
|
|
|
|
|
|
|
|
- unregister_framebuffer(info);
|
|
|
|
- iounmap(info->screen_base);
|
|
|
|
- if (info->cmap.len)
|
|
|
|
- fb_dealloc_cmap(&info->cmap);
|
|
|
|
-
|
|
|
|
- framebuffer_release(info);
|
|
|
|
- }
|
|
|
|
|
|
+ drm_fb_helper_unregister_fbi(&ifbdev->helper);
|
|
|
|
+ drm_fb_helper_release_fbi(&ifbdev->helper);
|
|
|
|
|
|
drm_fb_helper_fini(&ifbdev->helper);
|
|
drm_fb_helper_fini(&ifbdev->helper);
|
|
|
|
|
|
@@ -781,7 +765,7 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
|
|
if (state == FBINFO_STATE_RUNNING && ifbdev->fb->obj->stolen)
|
|
if (state == FBINFO_STATE_RUNNING && ifbdev->fb->obj->stolen)
|
|
memset_io(info->screen_base, 0, info->screen_size);
|
|
memset_io(info->screen_base, 0, info->screen_size);
|
|
|
|
|
|
- fb_set_suspend(info, state);
|
|
|
|
|
|
+ drm_fb_helper_set_suspend(&ifbdev->helper, state);
|
|
console_unlock();
|
|
console_unlock();
|
|
}
|
|
}
|
|
|
|
|