ChangeSet 1.2072, 2005/03/12 09:13:44-08:00, [EMAIL PROTECTED]

        [PATCH] PA-RISC STI video updates
        
         - currcon seems to have disappeared.  We weren't using it, just 
initialising
           it.
         - parisc_driver names no longer need to be different from pci_driver 
names.
         - DUMMY_CONSOLE_COLUMNS and DUMMY_CONSOLE_ROWS aren't used by the 
STI_CONSOLE
           at all.  In fact, they're used by the DUMMY_CONSOLE as their name 
implies.
         - STI_CONSOLE doesn't need to depend on FRAMEBUFFER_CONSOLE
         - sticore.o uses functions from fonts.o
         - PA-RISC doesn't have an MDA_CONSOLE
        Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]>
        
         - Move STI_CONSOLE after FRAMEBUFFER_CONSOLE
         - Convert sticore.c to using gsc_(read|write)X instead of 
__raw_(read|write)X.
         - Convert pci_device_id table to use PCI_DEVICE().
        Signed-Off-By: Kyle McMartin <[EMAIL PROTECTED]>
        
         - apply patch by Andy Walker <[EMAIL PROTECTED]> to fix stifb=
           bpp:x:y handling
        From: Helge Deller <[EMAIL PROTECTED]>
        
        Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 console/Kconfig   |   51 +++++++++++++++++++-------------------
 console/Makefile  |    4 +--
 console/sticore.c |   48 +++++++++++++++++++++---------------
 stifb.c           |   71 +++++++++++++++++++++++++++---------------------------
 4 files changed, 92 insertions(+), 82 deletions(-)


diff -Nru a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
--- a/drivers/video/console/Kconfig     2005-03-12 21:41:53 -08:00
+++ b/drivers/video/console/Kconfig     2005-03-12 21:41:53 -08:00
@@ -43,7 +43,7 @@
          about the Video mode selection support. If unsure, say N.
 
 config MDA_CONSOLE
-       depends on !M68K && ISA
+       depends on !M68K && !PARISC && ISA
        tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
        ---help---
          Say Y here if you have an old MDA or monochrome Hercules graphics
@@ -65,30 +65,6 @@
           card of your Indy.  Most people say Y here.
 
 #  bool 'IODC console' CONFIG_IODC_CONSOLE
-config STI_CONSOLE
-        tristate "STI text console" 
-        depends on PARISC && FRAMEBUFFER_CONSOLE
-        default y
-        help
-          The STI console is the builtin display/keyboard on HP-PARISC
-          machines.  Say Y here to build support for it into your kernel.
-          The alternative is to use your primary serial port as a console.
-
-config DUMMY_CONSOLE_COLUMNS
-        int "Initial number of console screen columns" if STI_CONSOLE
-        depends on PARISC
-        default "160"
-        help
-          The default value is 160, which should fit a 1280x1024 monitor.
-          Select 80 if you use a 640x480 resolution by default.
-
-config DUMMY_CONSOLE_ROWS
-        int "Initial number of console screen rows" if STI_CONSOLE
-        depends on PARISC
-        default "64"
-        help
-          The default value is 64, which should fit a 1280x1024 monitor.
-          Select 25 if you use a 640x480 resolution by default.
 
 config PROM_CONSOLE
        bool "PROM console"
@@ -102,10 +78,35 @@
        depends on PROM_CONSOLE!=y || VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y 
        default y
 
+config DUMMY_CONSOLE_COLUMNS
+        int "Initial number of console screen columns"
+        depends on PARISC && DUMMY_CONSOLE
+        default "160"
+        help
+          The default value is 160, which should fit a 1280x1024 monitor.
+          Select 80 if you use a 640x480 resolution by default.
+
+config DUMMY_CONSOLE_ROWS
+        int "Initial number of console screen rows"
+        depends on PARISC && DUMMY_CONSOLE
+        default "64"
+        help
+          The default value is 64, which should fit a 1280x1024 monitor.
+          Select 25 if you use a 640x480 resolution by default.
+
 config FRAMEBUFFER_CONSOLE
        tristate "Framebuffer Console support"
        depends on FB
        select CRC32
+
+config STI_CONSOLE
+        tristate "STI text console" 
+        depends on PARISC
+        default y
+        help
+          The STI console is the builtin display/keyboard on HP-PARISC
+          machines.  Say Y here to build support for it into your kernel.
+          The alternative is to use your primary serial port as a console.
 
 config FONTS
        bool "Select compiled-in fonts"
diff -Nru a/drivers/video/console/Makefile b/drivers/video/console/Makefile
--- a/drivers/video/console/Makefile    2005-03-12 21:41:53 -08:00
+++ b/drivers/video/console/Makefile    2005-03-12 21:41:53 -08:00
@@ -21,7 +21,7 @@
 obj-$(CONFIG_DUMMY_CONSOLE)       += dummycon.o
 obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o font.o
 obj-$(CONFIG_PROM_CONSOLE)        += promcon.o promcon_tbl.o
-obj-$(CONFIG_STI_CONSOLE)         += sticon.o sticore.o
+obj-$(CONFIG_STI_CONSOLE)         += sticon.o sticore.o font.o
 obj-$(CONFIG_VGA_CONSOLE)         += vgacon.o
 obj-$(CONFIG_MDA_CONSOLE)         += mdacon.o
 obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o bitblit.o font.o
@@ -29,7 +29,7 @@
 obj-$(CONFIG_FRAMEBUFFER_CONSOLE)     += tileblit.o
 endif
 
-obj-$(CONFIG_FB_STI)              += sticore.o
+obj-$(CONFIG_FB_STI)              += sticore.o font.o
 
 # Targets that kbuild needs to know about
 targets := promcon_tbl.c
diff -Nru a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
--- a/drivers/video/console/sticore.c   2005-03-12 21:41:53 -08:00
+++ b/drivers/video/console/sticore.c   2005-03-12 21:41:53 -08:00
@@ -249,13 +249,13 @@
        /* this still needs to be revisited (see arch/parisc/mm/init.c:246) ! */
        while (count >= 4) {
                count -= 4;
-               *(u32 *)dest = __raw_readl(base);
+               *(u32 *)dest = gsc_readl(base);
                base += 4;
                dest += 4;
        }
        while (count) {
                count--;
-               *(u8 *)dest = __raw_readb(base);
+               *(u8 *)dest = gsc_readb(base);
                base++;
                dest++;
        }
@@ -460,12 +460,20 @@
                /* remap virtually */
                /* FIXME: add BTLB support if btlb==1 */
                len = sti->regions[i].region_desc.length * 4096;
-               
+
+/* XXX: Enabling IOREMAP debugging causes a crash, so we must be passing
+ * a virtual address to something expecting a physical address that doesn't
+ * go through a readX macro */
+#if 0
                if (len)
                   glob_cfg->region_ptrs[i] = (unsigned long) (
                        sti->regions[i].region_desc.cache ?
                        ioremap(sti->regions_phys[i], len) :
                        ioremap_nocache(sti->regions_phys[i], len) );
+#else
+               if (len)
+                       glob_cfg->region_ptrs[i] = sti->regions_phys[i];
+#endif
                
                DPRINTK(("region #%d: phys %08lx, virt %08x, len=%lukB, "
                         "btlb=%d, sysonly=%d, cache=%d, last=%d\n",
@@ -680,7 +688,7 @@
 
        while (count) {
                count--;
-               *(u8 *)dest = __raw_readl(base);
+               *(u8 *)dest = gsc_readl(base);
                base += 4;
                dest++;
        }
@@ -730,7 +738,7 @@
        unsigned long size;
     
        /* read the ROM size directly from the struct in ROM */ 
-       size = __raw_readl(address + offsetof(struct sti_rom,last_addr));
+       size = gsc_readl(address + offsetof(struct sti_rom,last_addr));
 
        raw = kmalloc(size, GFP_KERNEL);
        if(raw)
@@ -825,13 +833,13 @@
        if (pdc_add_valid(address))
                goto out_err;
 
-       sig = __raw_readl(address);
+       sig = gsc_readl(address);
 
        /* check for a PCI ROM structure */
        if ((le32_to_cpu(sig)==0xaa55)) {
                unsigned int i, rm_offset;
                u32 *rm;
-               i = __raw_readl(address+0x04);
+               i = gsc_readl(address+0x04);
                if (i != 1) {
                        /* The ROM could have multiple architecture 
                         * dependent images (e.g. i386, parisc,...) */
@@ -842,17 +850,17 @@
                
                sti->pd = pd;
 
-               i = __raw_readl(address+0x0c);
+               i = gsc_readl(address+0x0c);
                DPRINTK(("PCI ROM size (from header) = %d kB\n",
                        le16_to_cpu(i>>16)*512/1024));
                rm_offset = le16_to_cpu(i & 0xffff);
                if (rm_offset) { 
                        /* read 16 bytes from the pci region mapper array */
                        rm = (u32*) &sti->rm_entry;
-                       *rm++ = __raw_readl(address+rm_offset+0x00);
-                       *rm++ = __raw_readl(address+rm_offset+0x04);
-                       *rm++ = __raw_readl(address+rm_offset+0x08);
-                       *rm++ = __raw_readl(address+rm_offset+0x0c);
+                       *rm++ = gsc_readl(address+rm_offset+0x00);
+                       *rm++ = gsc_readl(address+rm_offset+0x04);
+                       *rm++ = gsc_readl(address+rm_offset+0x08);
+                       *rm++ = gsc_readl(address+rm_offset+0x0c);
                        DPRINTK(("PCI region Mapper offset = %08x: ",
                                rm_offset));
                        for (i=0; i<16; i++)
@@ -860,7 +868,7 @@
                        DPRINTK(("\n"));
                }
 
-               address += le32_to_cpu(__raw_readl(address+8));
+               address += le32_to_cpu(gsc_readl(address+8));
                DPRINTK(("sig %04x, PCI STI ROM at %08lx\n", sig, address));
                goto test_rom;
        }
@@ -1003,17 +1011,17 @@
 
 
 static struct pci_device_id sti_pci_tbl[] = {
-       { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_EG, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0 },
-       { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX6, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0 },
-       { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX4, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0 },
-       { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX2, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0 },
-       { PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FXE, PCI_ANY_ID, 
PCI_ANY_ID, 0, 0, 0 },
+       { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_EG) },
+       { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX6) },
+       { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX4) },
+       { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FX2) },
+       { PCI_DEVICE(PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_VISUALIZE_FXE) },
        { 0, } /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, sti_pci_tbl);
 
 static struct pci_driver pci_sti_driver = {
-       .name           = "sti (pci)",
+       .name           = "sti",
        .id_table       = sti_pci_tbl,
        .probe          = sticore_pci_init,
        .remove         = sticore_pci_remove,
@@ -1026,7 +1034,7 @@
 };
 
 static struct parisc_driver pa_sti_driver = {
-       .name           = "sti (native)",
+       .name           = "sti",
        .id_table       = sti_pa_tbl,
        .probe          = sticore_pa_init,
 };
diff -Nru a/drivers/video/stifb.c b/drivers/video/stifb.c
--- a/drivers/video/stifb.c     2005-03-12 21:41:53 -08:00
+++ b/drivers/video/stifb.c     2005-03-12 21:41:53 -08:00
@@ -112,11 +112,10 @@
        ngle_rom_t ngle_rom;
        struct sti_struct *sti;
        int deviceSpecificConfig;
-       u32 pseudo_palette[16];
+       u32 pseudo_palette[256];
 };
 
-static int __initdata bpp = 8; /* parameter from modprobe */
-static int __initdata stifb_force_bpp[MAX_STI_ROMS];
+static int __initdata stifb_bpp_pref[MAX_STI_ROMS];
 
 /* ------------------- chipset specific functions -------------------------- */
 
@@ -155,15 +154,15 @@
 #define REG_44         0x210030
 #define REG_45         0x210034
 
-#define READ_BYTE(fb,reg)              __raw_readb((fb)->info.fix.mmio_start + 
(reg))
-#define READ_WORD(fb,reg)              __raw_readl((fb)->info.fix.mmio_start + 
(reg))
+#define READ_BYTE(fb,reg)              gsc_readb((fb)->info.fix.mmio_start + 
(reg))
+#define READ_WORD(fb,reg)              gsc_readl((fb)->info.fix.mmio_start + 
(reg))
 
 
 #ifndef DEBUG_STIFB_REGS
 # define  DEBUG_OFF()
 # define  DEBUG_ON()
-# define WRITE_BYTE(value,fb,reg)      
__raw_writeb((value),(fb)->info.fix.mmio_start + (reg))
-# define WRITE_WORD(value,fb,reg)      
__raw_writel((value),(fb)->info.fix.mmio_start + (reg))
+# define WRITE_BYTE(value,fb,reg)      
gsc_writeb((value),(fb)->info.fix.mmio_start + (reg))
+# define WRITE_WORD(value,fb,reg)      
gsc_writel((value),(fb)->info.fix.mmio_start + (reg))
 #else
   static int debug_on = 1;
 # define  DEBUG_OFF() debug_on=0
@@ -171,11 +170,11 @@
 # define WRITE_BYTE(value,fb,reg)      do { if (debug_on) \
                                                printk(KERN_DEBUG "%30s: 
WRITE_BYTE(0x%06x) = 0x%02x (old=0x%02x)\n", \
                                                        __FUNCTION__, reg, 
value, READ_BYTE(fb,reg));             \
-                                       
__raw_writeb((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
+                                       
gsc_writeb((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
 # define WRITE_WORD(value,fb,reg)      do { if (debug_on) \
                                                printk(KERN_DEBUG "%30s: 
WRITE_WORD(0x%06x) = 0x%08x (old=0x%08x)\n", \
                                                        __FUNCTION__, reg, 
value, READ_WORD(fb,reg));             \
-                                       
__raw_writel((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
+                                       
gsc_writel((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
 #endif /* DEBUG_STIFB_REGS */
 
 
@@ -1018,6 +1017,15 @@
                         (blue));
        }
 
+       if (info->var.bits_per_pixel == 32) {
+               ((u32 *)(info->pseudo_palette))[regno] =
+                       (red   << info->var.red.offset)   |
+                       (green << info->var.green.offset) |
+                       (blue  << info->var.blue.offset);
+       } else {
+               ((u32 *)(info->pseudo_palette))[regno] = regno;
+       }
+
        WRITE_IMAGE_COLOR(fb, regno, color);
        
        if (fb->id == S9000_ID_HCRX) {
@@ -1031,14 +1039,6 @@
                                /* 0x100 is same as used in WRITE_IMAGE_COLOR() 
*/
                START_COLORMAPLOAD(fb, lutBltCtl.all);
                SETUP_FB(fb);
-
-               /* info->var.bits_per_pixel == 32 */
-               if (regno < 16) 
-                 ((u32 *)(info->pseudo_palette))[regno] =
-                       (red   << info->var.red.offset)   |
-                       (green << info->var.green.offset) |
-                       (blue  << info->var.blue.offset);
-
        } else {
                /* cleanup colormap hardware */
                FINISH_IMAGE_COLORMAP_ACCESS(fb);
@@ -1156,7 +1156,7 @@
  */
 
 int __init
-stifb_init_fb(struct sti_struct *sti, int force_bpp)
+stifb_init_fb(struct sti_struct *sti, int bpp_pref)
 {
        struct fb_fix_screeninfo *fix;
        struct fb_var_screeninfo *var;
@@ -1257,10 +1257,10 @@
 #ifdef __LP64__
                sti_rom_address |= 0xffffffff00000000;
 #endif
-               fb->deviceSpecificConfig = __raw_readl(sti_rom_address);
+               fb->deviceSpecificConfig = gsc_readl(sti_rom_address);
                if (IS_24_DEVICE(fb)) {
-                       if (force_bpp == 8 || force_bpp == 32)
-                               bpp = force_bpp;
+                       if (bpp_pref == 8 || bpp_pref == 32)
+                               bpp = bpp_pref;
                        else
                                bpp = 32;
                } else
@@ -1409,21 +1409,24 @@
        
        def_sti = sti_get_rom(0);
        if (def_sti) {
-               for (i = 1; i < MAX_STI_ROMS; i++) {
+               for (i = 1; i <= MAX_STI_ROMS; i++) {
                        sti = sti_get_rom(i);
-                       if (sti == def_sti && bpp > 0)
-                               stifb_force_bpp[i] = bpp;
+                       if (!sti)
+                               break;
+                       if (sti == def_sti) {
+                               stifb_init_fb(sti, stifb_bpp_pref[i - 1]);
+                               break;
+                       }
                }
-               stifb_init_fb(def_sti, stifb_force_bpp[i]);
        }
 
-       for (i = 1; i < MAX_STI_ROMS; i++) {
+       for (i = 1; i <= MAX_STI_ROMS; i++) {
                sti = sti_get_rom(i);
-               if (!sti || sti==def_sti)
+               if (!sti)
                        break;
-               if (bpp > 0)
-                       stifb_force_bpp[i] = bpp;
-               stifb_init_fb(sti, stifb_force_bpp[i]);
+               if (sti == def_sti)
+                       continue;
+               stifb_init_fb(sti, stifb_bpp_pref[i - 1]);
        }
        return 0;
 }
@@ -1438,7 +1441,7 @@
        struct sti_struct *sti;
        int i;
        
-       for (i = 1; i < MAX_STI_ROMS; i++) {
+       for (i = 1; i <= MAX_STI_ROMS; i++) {
                sti = sti_get_rom(i);
                if (!sti)
                        break;
@@ -1470,11 +1473,9 @@
        if (strncmp(options, "bpp", 3) == 0) {
                options += 3;
                for (i = 0; i < MAX_STI_ROMS; i++) {
-                       if (*options++ == ':') {
-                               stifb_force_bpp[i] = simple_strtoul(options, 
&options, 10);
-                               bpp = -1;
-                       } else
+                       if (*options++ != ':')
                                break;
+                       stifb_bpp_pref[i] = simple_strtoul(options, &options, 
10);
                }
        }
        return 0;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to