Commit b58b80ea authored by James Simmons's avatar James Simmons

Updates to STI framebuffer and STI console. Cleanup of include/video and a few minor fixes.

parent 76e97c93
......@@ -63,7 +63,7 @@ obj-$(CONFIG_FB_TCX) += tcxfb.o sbusfb.o
obj-$(CONFIG_FB_CGFOURTEEN) += cgfourteenfb.o sbusfb.o
obj-$(CONFIG_FB_P9100) += p9100fb.o sbusfb.o
obj-$(CONFIG_FB_LEO) += leofb.o sbusfb.o
obj-$(CONFIG_FB_STI) += stifb.o sticore.o
obj-$(CONFIG_FB_STI) += stifb.o console/sticore.o
obj-$(CONFIG_FB_PMAG_BA) += pmag-ba-fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_PMAGB_B) += pmagb-b-fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_MAXINE) += maxinefb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
......
......@@ -17,7 +17,7 @@ if [ "$CONFIG_VT" != "n" ]; then
# fi
# fi
fi
tristate 'MDA text console (dual-headed) ' CONFIG_MDA_CONSOLE
tristate 'MDA text console ' CONFIG_MDA_CONSOLE
if [ "$CONFIG_SGI_IP22" = "y" ]; then
tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE
if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then
......
......@@ -14,7 +14,7 @@ export-objs := fbcon.o fbcon-accel.o fbcon-afb.o fbcon-ilbm.o \
obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o
obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o
obj-$(CONFIG_PROM_CONSOLE) += promcon.o promcon_tbl.o
obj-$(CONFIG_STI_CONSOLE) += sticon.o sticon-bmode.o ../sticore.o
obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o
obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
obj-$(CONFIG_MDA_CONSOLE) += mdacon.o
......
......@@ -17,42 +17,18 @@
#include <linux/string.h>
#include <linux/fb.h>
#include <linux/delay.h>
#include <asm/gsc.h> /* for gsc_read/write */
#include <asm/types.h>
#include "fbcon.h"
#include "fbcon-mfb.h"
#include <video/fbcon.h>
#include <video/fbcon-mfb.h>
#include "sti.h"
/* Translate an address as it would be found in a 2048x2048x1 bit frame
* buffer into a logical address Artist actually expects. Addresses fed
* into Artist look like this:
* fixed Y X
* FFFF FFFF LLLL LLLL LLLC CCCC CCCC CC00
*
* our "RAM" addresses look like this:
*
* FFFF FFFF 0000 0LLL LLLL LLLL CCCC CCCC [CCC]
*
* */
#include "../sticore.h"
static inline u32
ram2log(void * addr)
{
u32 a = (unsigned long) addr;
u32 r;
#if 0
r = a & 0xff000000; /* fixed part */
r += ((a & 0x000000ff) << 5);
r += ((a & 0x00ffff00) << 3);
#else
r = a & 0xff000000; /* fixed part */
r += ((a & 0x000000ff) << 5);
r += ((a & 0x0007ff00) << 5);
#endif
return r;
return (unsigned long) addr;
}
/* All those functions need better names. */
......@@ -74,30 +50,6 @@ memcpy_fromhp_tohp(void *dest, void *src, int count)
}
}
static void
memcpy_tohp(void *dest, void *src, int count)
{
unsigned long d = (unsigned long) dest;
u32 *s = (u32 *)src;
count += 3;
count &= ~3; /* XXX */
d = ram2log(dest);
while(count) {
count--;
gsc_writel(*s++, d);
d += 32*4;
}
}
static void
memcopy_fromhp(void *dest, void *src, int count)
{
/* FIXME */
printk("uhm ...\n");
}
static void
memset_tohp(void *dest, u32 word, int count)
......@@ -139,10 +91,11 @@ writeb_hp(u8 b, void *dst)
static void
fbcon_sti_setup(struct display *p)
{
if (p->line_length)
p->next_line = p->line_length;
else
/* in kernel 2.5 the value of sadly line_length disapeared */
if (p->var.xres_virtual /*line_length*/)
p->next_line = p->var.xres_virtual>>3;
else
p->next_line = 2048; /* default STI value */
p->next_plane = 0;
}
......@@ -152,7 +105,7 @@ fbcon_sti_bmove(struct display *p, int sy, int sx,
int height, int width)
{
#if 0 /* Unfortunately, still broken */
sti_bmove(&default_sti /* FIXME */, sy, sx, dy, dx, height, width);
sti_bmove(default_sti /* FIXME */, sy, sx, dy, dx, height, width);
#else
u8 *src, *dest;
u_int rows;
......@@ -285,7 +238,6 @@ static void fbcon_sti_revc(struct display *p,
u8 *dest, d;
u_int rows;
dest = p->fb_info->screen_base+yy*fontheight(p)*p->next_line+xx;
for (rows = fontheight(p); rows--; dest += p->next_line) {
d = readb_hp(dest);
......
......@@ -99,11 +99,11 @@
#define INCLUDE_LINUX_LOGO_DATA
#include <asm/linux_logo.h>
#include <video/fbcon.h>
#include "fbcon.h"
#ifdef CONFIG_FBCON_ACCEL
#include "fbcon-accel.h"
#endif
#include <video/font.h>
#include "font.h"
#ifdef FBCONDEBUG
# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
......
......@@ -4,7 +4,7 @@
/* */
/**********************************************/
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX (11*256)
......
......@@ -4,7 +4,7 @@
/* */
/**********************************************/
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX 4096
......
......@@ -4,7 +4,7 @@
/* */
/**********************************************/
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX 2048
......
......@@ -2,7 +2,7 @@
#include <linux/config.h>
#include <video/font.h>
#include "font.h"
static unsigned char acorndata_8x8[] = {
/* 00 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */
......
......@@ -39,7 +39,7 @@ __END__;
MSBit to LSBit = left to right.
*/
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX 1536
......
......@@ -9,7 +9,7 @@
/* */
/**********************************************/
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX 2048
......
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX 11264
......
#include <video/font.h>
#include "font.h"
#define FONTDATAMAX 4096
......
......@@ -19,7 +19,7 @@
#if defined(__mc68000__) || defined(CONFIG_APUS)
#include <asm/setup.h>
#endif
#include <video/font.h>
#include "font.h"
#define NO_FONTS
......
......@@ -30,7 +30,7 @@
#define INCLUDE_LINUX_LOGO_DATA
#include <asm/linux_logo.h>
#include <video/font.h>
#include "font.h"
#define LOGO_W 80
#define LOGO_H 80
......
#define STI_REGION_MAX 8
#define STI_DEV_NAME_LENGTH 32
typedef struct {
u8 res[3];
u8 data;
} __attribute__((packed)) sti_u8;
typedef struct {
sti_u8 data[2];
} __attribute__((packed)) sti_u16;
typedef struct {
sti_u8 data[4];
} __attribute__((packed)) sti_u32;
#define STI_U8( u8) ((u8).data)
#define STI_U16(u16) ((STI_U8((u16).data[0])<<8) | STI_U8((u16).data[1]))
#define STI_U32(u32) ((STI_U8((u32).data[0])<<24) | \
(STI_U8((u32).data[1])<<16) | \
(STI_U8((u32).data[2])<< 8) | \
(STI_U8((u32).data[3])<< 0))
struct sti_rom_region {
sti_u32 region;
};
struct sti_rom_font {
sti_u16 first_char;
sti_u16 last_char;
sti_u8 width;
sti_u8 height;
sti_u8 font_type;
sti_u8 bytes_per_char;
sti_u32 next_font;
sti_u8 underline_height;
sti_u8 underline_pos;
sti_u8 res008[2];
};
struct sti_rom {
sti_u8 type;
sti_u8 num_mons;
sti_u8 revno[2];
sti_u8 graphics_id[8]; /* 0x010 */
sti_u32 font_start; /* 0x030 */
sti_u32 statesize;
sti_u32 last_addr;
sti_u32 region_list;
sti_u16 reentsize; /* 0x070 */
sti_u16 maxtime;
sti_u32 mon_tbl_addr;
sti_u32 user_data_addr;
sti_u32 sti_mem_req;
sti_u32 user_data_size; /* 0x0b0 */
sti_u16 power; /* 0x0c0 */
sti_u8 bus_support;
sti_u8 ext_bus_support;
sti_u8 alt_code_type; /* 0x0d0 */
sti_u8 ext_dd_struct[3];
sti_u32 cfb_addr; /* 0x0e0 */
sti_u8 res0f0[4];
sti_u32 init_graph; /* 0x0e0 */
sti_u32 state_mgmt;
sti_u32 font_unpmv;
sti_u32 block_move;
sti_u32 self_test;
sti_u32 excep_hdlr;
sti_u32 inq_conf;
sti_u32 set_cm_entry;
sti_u32 dma_ctrl;
sti_u32 flow_ctrl;
sti_u32 user_timing;
sti_u32 process_mgr;
sti_u32 sti_util;
sti_u32 end_addr;
sti_u32 res0b8;
sti_u32 res0bc;
sti_u32 init_graph_m68k; /* 0x0e0 */
sti_u32 state_mgmt_m68k;
sti_u32 font_unpmv_m68k;
sti_u32 block_move_m68k;
sti_u32 self_test_m68k;
sti_u32 excep_hdlr_m68k;
sti_u32 inq_conf_m68k;
sti_u32 set_cm_entry_m68k;
sti_u32 dma_ctrl_m68k;
sti_u32 flow_ctrl_m68k;
sti_u32 user_timing_m68k;
sti_u32 process_mgr_m68k;
sti_u32 sti_util_m68k;
sti_u32 end_addr_m68k;
sti_u32 res0b8_m68k;
sti_u32 res0bc_m68k;
sti_u8 res040[7 * 4];
};
struct sti_cooked_font {
struct sti_rom_font *raw;
struct sti_cooked_font *next_font;
};
struct sti_cooked_rom {
struct sti_rom *raw;
struct sti_cooked_font *font_start;
u32 *region_list;
};
struct sti_glob_cfg_ext {
u8 curr_mon;
u8 friendly_boot;
s16 power;
s32 freq_ref;
s32 *sti_mem_addr;
s32 *future_ptr;
};
struct sti_glob_cfg {
s32 text_planes;
s16 onscreen_x;
s16 onscreen_y;
s16 offscreen_x;
s16 offscreen_y;
s16 total_x;
s16 total_y;
u32 region_ptrs[STI_REGION_MAX];
s32 reent_lvl;
s32 *save_addr;
struct sti_glob_cfg_ext *ext_ptr;
};
struct sti_init_flags {
u32 wait : 1;
u32 reset : 1;
u32 text : 1;
u32 nontext : 1;
u32 clear : 1;
u32 cmap_blk : 1;
u32 enable_be_timer : 1;
u32 enable_be_int : 1;
u32 no_chg_tx : 1;
u32 no_chg_ntx : 1;
u32 no_chg_bet : 1;
u32 no_chg_bei : 1;
u32 init_cmap_tx : 1;
u32 cmt_chg : 1;
u32 retain_ie : 1;
u32 pad : 17;
s32 *future_ptr;
};
struct sti_init_inptr_ext {
u8 config_mon_type;
u8 pad[1];
u16 inflight_data;
s32 *future_ptr;
};
struct sti_init_inptr {
s32 text_planes;
struct sti_init_inptr_ext *ext_ptr;
};
struct sti_init_outptr {
s32 errno;
s32 text_planes;
s32 *future_ptr;
};
struct sti_conf_flags {
u32 wait : 1;
u32 pad : 31;
s32 *future_ptr;
};
struct sti_conf_inptr {
s32 *future_ptr;
};
struct sti_conf_outptr_ext {
u32 crt_config[3];
u32 crt_hdw[3];
s32 *future_ptr;
};
struct sti_conf_outptr {
s32 errno;
s16 onscreen_x;
s16 onscreen_y;
s16 offscreen_x;
s16 offscreen_y;
s16 total_x;
s16 total_y;
s32 bits_per_pixel;
s32 bits_used;
s32 planes;
u8 dev_name[STI_DEV_NAME_LENGTH];
u32 attributes;
struct sti_conf_outptr_ext *ext_ptr;
};
struct sti_font_inptr {
u32 font_start_addr;
s16 index;
u8 fg_color;
u8 bg_color;
s16 dest_x;
s16 dest_y;
s32 *future_ptr;
};
struct sti_font_flags {
u32 wait : 1;
u32 non_text : 1;
u32 pad : 30;
s32 *future_ptr;
};
struct sti_font_outptr {
s32 errno;
s32 *future_ptr;
};
struct sti_blkmv_flags {
u32 wait : 1;
u32 color : 1;
u32 clear : 1;
u32 non_text : 1;
u32 pad : 28;
s32 *future_ptr;
};
struct sti_blkmv_inptr {
u8 fg_color;
u8 bg_color;
s16 src_x;
s16 src_y;
s16 dest_x;
s16 dest_y;
s16 width;
s16 height;
s32 *future_ptr;
};
struct sti_blkmv_outptr {
s32 errno;
s32 *future_ptr;
};
struct sti_struct {
spinlock_t lock;
struct sti_cooked_rom *rom;
unsigned long font_unpmv;
unsigned long block_move;
unsigned long init_graph;
unsigned long inq_conf;
struct sti_glob_cfg *glob_cfg;
struct sti_rom_font *font;
s32 text_planes;
char **mon_strings;
u32 *regions;
u8 *pci_regions;
};
#define STI_CALL(func, flags, inptr, outptr, glob_cfg) \
({ \
real32_call( func, (unsigned long)STI_PTR(flags), \
STI_PTR(inptr), STI_PTR(outptr), \
glob_cfg); \
})
......@@ -86,6 +86,7 @@ int cfb_cursor(struct fb_info *info, struct fbcursor *cursor)
if (info->fbops->fb_imageblit)
info->fbops->fb_imageblit(info, &image);
}
return 0;
}
int fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
......
......@@ -43,7 +43,7 @@
#include <linux/fb.h>
#ifdef CONFIG_VT
#include <linux/console.h>
#include <video/fbcon.h>
#include "console/fbcon.h"
#endif
/*
......
......@@ -20,7 +20,7 @@
#include <linux/fb.h>
#include <linux/string.h>
#include <video/macmodes.h>
#include "macmodes.h"
/*
* MacOS video mode definitions
......
......@@ -32,7 +32,7 @@
#include <asm/bootx.h>
#endif
#include <video/macmodes.h>
#include "macmodes.h"
/* Supported palette hacks */
enum {
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment