radeonfb: fix problem with color expansion & alignment
[sfrench/cifs-2.6.git] / drivers / video / aty / radeon_base.c
index 9a5821c65ebf22fd2d492ee3972002bb2f5cc651..b3ffe8205d2b738b7b567fa80820d2f71c662c25 100644 (file)
@@ -1875,6 +1875,7 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
        info->fbops = &radeonfb_ops;
        info->screen_base = rinfo->fb_base;
        info->screen_size = rinfo->mapped_vram;
+
        /* Fill fix common fields */
        strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id));
         info->fix.smem_start = rinfo->fb_base_phys;
@@ -1889,8 +1890,25 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
         info->fix.mmio_len = RADEON_REGSIZE;
        info->fix.accel = FB_ACCEL_ATI_RADEON;
 
+       /* Allocate colormap */
        fb_alloc_cmap(&info->cmap, 256, 0);
 
+       /* Setup pixmap used for acceleration */
+#define PIXMAP_SIZE    (2048 * 4)
+
+       info->pixmap.addr = kmalloc(PIXMAP_SIZE, GFP_KERNEL);
+       if (!info->pixmap.addr) {
+               printk(KERN_ERR "radeonfb: Failed to allocate pixmap !\n");
+               noaccel = 1;
+               goto bail;
+       }
+       info->pixmap.size = PIXMAP_SIZE;
+       info->pixmap.flags = FB_PIXMAP_SYSTEM;
+       info->pixmap.scan_align = 4;
+       info->pixmap.buf_align = 4;
+       info->pixmap.access_align = 32;
+
+bail:
        if (noaccel)
                info->flags |= FBINFO_HWACCEL_DISABLED;