]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/pvr2fb.c
slub statistics: Fix check for DEACTIVATE_REMOTE_FREES
[linux-2.6-omap-h63xx.git] / drivers / video / pvr2fb.c
index f9300266044d8f8e910e1421cad7484f8ef181c7..6a3d0b574897f5da14a6840b0dfc07926506387f 100644 (file)
@@ -72,7 +72,7 @@
 #endif
 
 #ifdef CONFIG_SH_STORE_QUEUES
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <asm/cpu/sq.h>
 #endif
 
@@ -94,6 +94,7 @@
 #define DISP_DIWCONF (DISP_BASE + 0xe8)
 #define DISP_DIWHSTRT (DISP_BASE + 0xec)
 #define DISP_DIWVSTRT (DISP_BASE + 0xf0)
+#define DISP_PIXDEPTH (DISP_BASE + 0x108)
 
 /* Pixel clocks, one for TV output, doubled for VGA output */
 #define TV_CLK 74239
@@ -143,6 +144,7 @@ static struct pvr2fb_par {
        unsigned char is_lowres;        /* Is horizontal pixel-doubling enabled? */
 
        unsigned long mmio_base;        /* MMIO base */
+       u32 palette[16];
 } *currentpar;
 
 static struct fb_info *fb_info;
@@ -599,6 +601,7 @@ static void pvr2_init_display(struct fb_info *info)
 
        /* bits per pixel */
        fb_writel(fb_readl(DISP_DIWMODE) | (--bytesperpixel << 2), DISP_DIWMODE);
+       fb_writel(bytesperpixel << 2, DISP_PIXDEPTH);
 
        /* video enable, color sync, interlace,
         * hsync and vsync polarity (currently unused) */
@@ -664,6 +667,8 @@ static int pvr2_init_cable(void)
          related */
        if (cable_type == CT_COMPOSITE)
                fb_writel(3 << 8, VOUTC);
+       else if (cable_type == CT_RGB)
+               fb_writel(1 << 9, VOUTC);
        else
                fb_writel(0, VOUTC);
 
@@ -790,7 +795,7 @@ static int __devinit pvr2fb_common_init(void)
        fb_info->fbops          = &pvr2fb_ops;
        fb_info->fix            = pvr2_fix;
        fb_info->par            = currentpar;
-       fb_info->pseudo_palette = (void *)(fb_info->par + 1);
+       fb_info->pseudo_palette = currentpar->palette;
        fb_info->flags          = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
 
        if (video_output == VO_VGA)
@@ -807,6 +812,8 @@ static int __devinit pvr2fb_common_init(void)
 
        if (register_framebuffer(fb_info) < 0)
                goto out_err;
+       /*Must write PIXDEPTH to register before anything is displayed - so force init */
+       pvr2_init_display(fb_info);
 
        modememused = get_line_length(fb_info->var.xres_virtual,
                                      fb_info->var.bits_per_pixel);
@@ -885,7 +892,7 @@ static int __init pvr2fb_dc_init(void)
        pvr2_fix.mmio_start     = 0xa05f8000;   /* registers start here */
        pvr2_fix.mmio_len       = 0x2000;
 
-       if (request_irq(HW_EVENT_VSYNC, pvr2fb_interrupt, 0,
+       if (request_irq(HW_EVENT_VSYNC, pvr2fb_interrupt, IRQF_SHARED,
                        "pvr2 VBL handler", fb_info)) {
                return -EBUSY;
        }
@@ -1082,14 +1089,15 @@ static int __init pvr2fb_init(void)
 #endif
        size = sizeof(struct fb_info) + sizeof(struct pvr2fb_par) + 16 * sizeof(u32);
 
-       fb_info = kzalloc(size, GFP_KERNEL);
+       fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par), NULL);
+
        if (!fb_info) {
                printk(KERN_ERR "Failed to allocate memory for fb_info\n");
                return -ENOMEM;
        }
 
 
-       currentpar = (struct pvr2fb_par *)(fb_info + 1);
+       currentpar = fb_info->par;
 
        for (i = 0; i < ARRAY_SIZE(board_driver); i++) {
                struct pvr2_board *pvr_board = board_driver + i;
@@ -1102,7 +1110,7 @@ static int __init pvr2fb_init(void)
                if (ret != 0) {
                        printk(KERN_ERR "pvr2fb: Failed init of %s device\n",
                                pvr_board->name);
-                       kfree(fb_info);
+                       framebuffer_release(fb_info);
                        break;
                }
        }
@@ -1126,7 +1134,7 @@ static void __exit pvr2fb_exit(void)
 #endif
 
        unregister_framebuffer(fb_info);
-       kfree(fb_info);
+       framebuffer_release(fb_info);
 }
 
 module_init(pvr2fb_init);