const struct fb_copyarea *a)
{
struct psb_fbdev *fbdev = info->par;
- struct drm_device *dev = fbdev->fb.dev;
struct drm_framebuffer *fb = fbdev->psb_fb_helper.fb;
+ struct drm_device *dev = fb->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
uint32_t offset;
uint32_t stride;
int psbfb_sync(struct fb_info *info)
{
struct psb_fbdev *fbdev = info->par;
- struct drm_device *dev = fbdev->fb.dev;
+ struct drm_framebuffer *fb = fbdev->psb_fb_helper.fb;
+ struct drm_device *dev = fb->dev;
struct drm_psb_private *dev_priv = dev->dev_private;
unsigned long _end = jiffies + HZ;
int busy = 0;
static int psbfb_pan(struct fb_var_screeninfo *var, struct fb_info *info)
{
struct psb_fbdev *fbdev = info->par;
- struct drm_framebuffer *fb = &fbdev->fb;
+ struct drm_framebuffer *fb = fbdev->psb_fb_helper.fb;
struct drm_device *dev = fb->dev;
struct gtt_range *gtt = to_gtt_range(fb->obj[0]);
static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct psb_fbdev *fbdev = info->par;
- struct drm_framebuffer *fb = &fbdev->fb;
+ struct drm_framebuffer *fb = fbdev->psb_fb_helper.fb;
if (vma->vm_pgoff != 0)
return -EINVAL;
struct drm_device *dev = fbdev->psb_fb_helper.dev;
struct drm_psb_private *dev_priv = dev->dev_private;
struct fb_info *info;
- struct drm_framebuffer *fb = &fbdev->fb;
+ struct drm_framebuffer *fb;
struct drm_mode_fb_cmd2 mode_cmd;
int size;
int ret;
mode_cmd.pixel_format = drm_mode_legacy_fb_format(bpp, depth);
- ret = psb_framebuffer_init(dev, fb, &mode_cmd, &backing->gem);
- if (ret)
+ fb = psb_framebuffer_create(dev, &mode_cmd, &backing->gem);
+ if (IS_ERR(fb)) {
+ ret = PTR_ERR(fb);
goto out;
+ }
fbdev->psb_fb_helper.fb = fb;
static int psb_fbdev_destroy(struct drm_device *dev, struct psb_fbdev *fbdev)
{
- struct drm_framebuffer *fb = &fbdev->fb;
+ struct drm_framebuffer *fb = fbdev->psb_fb_helper.fb;
drm_fb_helper_unregister_fbi(&fbdev->psb_fb_helper);
if (fb->obj[0])
drm_gem_object_put_unlocked(fb->obj[0]);
+ kfree(fb);
+
return 0;
}