Update of /cvsroot/linux-mips/linux/drivers/video
In directory usw-pr-cvs1:/tmp/cvs-serv31938/drivers/video
Modified Files:
au1100fb.c au1100fb.h
Log Message:
Au1100 fb driver bug fixes. Microwindows and tinyX now work.
Index: au1100fb.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/drivers/video/au1100fb.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- au1100fb.c 11 Apr 2002 00:12:57 -0000 1.2
+++ au1100fb.c 15 Apr 2002 23:30:13 -0000 1.3
@@ -68,6 +68,7 @@
unsigned long fb_virt_start;
unsigned long fb_size;
unsigned long fb_phys;
+ int mmaped;
struct { unsigned red, green, blue, pad; } palette[256];
@@ -141,7 +142,8 @@
fix->ywrapstep = 0;
fix->xpanstep = 1;
fix->ypanstep = 1;
- fix->line_length = par->line_length;
+ //fix->line_length = par->line_length;
+ fix->line_length = current_par.line_length;
return 0;
}
@@ -190,11 +192,9 @@
var->yres != p_lcd->yres ||
var->xres != p_lcd->xres ||
var->yres != p_lcd->yres) {
- printk("bad resolution selected\n");
return -EINVAL;
}
if(var->bits_per_pixel != p_lcd->bpp) {
- printk("bad bpp\n");
return -EINVAL;
}
@@ -246,7 +246,7 @@
struct au1100fb_info* i = (struct au1100fb_info*)info;
- if (regno > 256)
+ if (regno > 255)
return 1;
*red = i->palette[regno].red;
@@ -262,6 +262,7 @@
struct fb_info *info)
{
struct au1100fb_info* i = (struct au1100fb_info *)info;
+ u32 rgbcol;
if (regno > 255)
return 1;
@@ -273,18 +274,25 @@
switch(p_lcd->bpp) {
#ifdef FBCON_HAS_CFB8
case 8:
- /* FIXME */
- printk("cfb8??\n");
+ red >>= 10;
+ green >>= 10;
+ blue >>= 10;
+ p_lcd_reg->lcd_pallettebase[regno] = (blue&0x1f) |
+ ((green&0x3f)<<5) | ((red&0x1f)<<11);
break;
#endif
#ifdef FBCON_HAS_CFB16
case 16:
- i->fbcon_cmap16[regno] = (regno << 10) | (regno << 5) | regno;
+ i->fbcon_cmap16[regno] =
+ ((red & 0xf800) >> 0) |
+ ((green & 0xfc00) >> 5) |
+ ((blue & 0xf800) >> 11);
break;
#endif
default:
break;
}
+
return 0;
}
@@ -294,15 +302,21 @@
switch (blank_mode) {
case VESA_NO_BLANKING:
- printk("Au1100fb: assert go\n");
+ /* turn off panel */
+ writew(readw(PB1500_G_CONTROL) & ~p_lcd->mode_backlight,
+ PB1500_G_CONTROL);
p_lcd_reg->lcd_control |= LCD_CONTROL_GO;
+ au_sync();
break;
case VESA_VSYNC_SUSPEND:
case VESA_HSYNC_SUSPEND:
case VESA_POWERDOWN:
- printk("Au1100fb: deassert go\n");
p_lcd_reg->lcd_control &= ~LCD_CONTROL_GO;
+ /* turn on panel */
+ writew(readw(PB1500_G_CONTROL) & ~p_lcd->mode_backlight,
+ PB1500_G_CONTROL);
+ au_sync();
break;
default:
printk("Au1100fb: unknown blank mode %d\n",
@@ -338,12 +352,13 @@
}
static int
-au1100fb_mmap(struct fb_info *fb,
+au1100fb_mmap(struct fb_info *_fb,
struct file *file,
struct vm_area_struct *vma)
{
unsigned int len;
unsigned long start=0, off;
+ struct au1100fb_info *fb = (struct au1100fb_info *)_fb;
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
return -EINVAL;
@@ -362,16 +377,18 @@
vma->vm_pgoff = off >> PAGE_SHIFT;
pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
- pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED;
+ pgprot_val(vma->vm_page_prot) |= _CACHE_CACHABLE_NONCOHERENT;
/* This is an IO map - tell maydump to skip this VMA */
vma->vm_flags |= VM_IO;
if (io_remap_page_range(vma->vm_start, off,
vma->vm_end - vma->vm_start,
- vma->vm_page_prot))
+ vma->vm_page_prot)) {
return -EAGAIN;
+ }
+ fb->mmaped = 1;
return 0;
}
Index: au1100fb.h
===================================================================
RCS file: /cvsroot/linux-mips/linux/drivers/video/au1100fb.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- au1100fb.h 15 Apr 2002 15:33:04 -0000 1.2
+++ au1100fb.h 15 Apr 2002 23:30:13 -0000 1.3
@@ -189,7 +189,7 @@
{ /* 0: Pb1100 LCDA: Sharp 320x240 TFT panel */
320, /* xres */
240, /* yres */
- 8, /* bpp */
+ 16, /* bpp */
"Sharp_320x240_16",
/* mode_control */
@@ -205,7 +205,7 @@
/*LCD_CONTROL_MPI*/
| LCD_CONTROL_PT
| LCD_CONTROL_PC
- | LCD_CONTROL_BPP_8 ),
+ | LCD_CONTROL_BPP_16 ),
/* mode_horztiming */
( LCD_HORZTIMING_HN2_N(8)
|