Commit 3c077385 authored by James Simmons's avatar James Simmons

ported Mach 64 driver to new fbdev api.

parent fd024c33
...@@ -265,7 +265,7 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -265,7 +265,7 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \ "$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \
"$CONFIG_FB_IGA" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \ "$CONFIG_FB_IGA" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \
"$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ "$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_PM2" = "y" -o \
"$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_SA1100" = "y" ]; then "$CONFIG_FB_SA1100" = "y" ]; then
define_tristate CONFIG_FBCON_CFB8 y define_tristate CONFIG_FBCON_CFB8 y
else else
if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \ if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \
...@@ -292,7 +292,7 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -292,7 +292,7 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \ "$CONFIG_FB_VALKYRIE" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \
"$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \ "$CONFIG_FB_CT65550" = "y" -o "$CONFIG_FB_MATROX" = "y" -o \
"$CONFIG_FB_PM2" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \ "$CONFIG_FB_PM2" = "y" -o "$CONFIG_FB_CYBER2000" = "y" -o \
"$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_SA1100" = "y" ]; then "$CONFIG_FB_SA1100" = "y" ]; then
define_tristate CONFIG_FBCON_CFB16 y define_tristate CONFIG_FBCON_CFB16 y
else else
if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_SIS" = "m" -o \ if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_SIS" = "m" -o \
...@@ -331,7 +331,7 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -331,7 +331,7 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_TGA" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \ "$CONFIG_FB_TGA" = "y" -o "$CONFIG_FB_PLATINUM" = "y" -o \
"$CONFIG_FB_MATROX" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ "$CONFIG_FB_MATROX" = "y" -o "$CONFIG_FB_PM2" = "y" -o \
"$CONFIG_FB_PVR2" = "y" -o "$CONFIG_FB_PM3" = "y" -o \ "$CONFIG_FB_PVR2" = "y" -o "$CONFIG_FB_PM3" = "y" -o \
"$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_ATY" = "y" ]; then "$CONFIG_FB_SIS" = "y" ]; then
define_tristate CONFIG_FBCON_CFB32 y define_tristate CONFIG_FBCON_CFB32 y
else else
if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \
...@@ -352,7 +352,7 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -352,7 +352,7 @@ if [ "$CONFIG_FB" = "y" ]; then
"$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \ "$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \
"$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \ "$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \
"$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_APOLLO" = "y" -o \ "$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_APOLLO" = "y" -o \
"$CONFIG_FB_ATY128" = "y" -o "$CONFIG_FB_MAC" = "y" -o \ "$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
"$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_OF" = "y" -o \ "$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_OF" = "y" -o \
"$CONFIG_FB_SGIVW" = "y" ]; then "$CONFIG_FB_SGIVW" = "y" ]; then
define_tristate CONFIG_FBCON_ACCEL y define_tristate CONFIG_FBCON_ACCEL y
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <video/fbcon.h>
/* /*
* Elements of the hardware specific atyfb_par structure * Elements of the hardware specific atyfb_par structure
...@@ -12,9 +12,6 @@ ...@@ -12,9 +12,6 @@
struct crtc { struct crtc {
u32 vxres; u32 vxres;
u32 vyres; u32 vyres;
u32 xoffset;
u32 yoffset;
u32 bpp;
u32 h_tot_disp; u32 h_tot_disp;
u32 h_sync_strt_wid; u32 h_sync_strt_wid;
u32 v_tot_disp; u32 v_tot_disp;
...@@ -94,7 +91,6 @@ struct atyfb_par { ...@@ -94,7 +91,6 @@ struct atyfb_par {
u8 ram_type; u8 ram_type;
u8 mem_refresh_rate; u8 mem_refresh_rate;
u8 blitter_may_be_busy; u8 blitter_may_be_busy;
u32 accel_flags;
#ifdef __sparc__ #ifdef __sparc__
struct pci_mmap_map *mmap_map; struct pci_mmap_map *mmap_map;
int consolecnt; int consolecnt;
...@@ -281,13 +277,4 @@ static inline void wait_for_idle(struct atyfb_par *par) ...@@ -281,13 +277,4 @@ static inline void wait_for_idle(struct atyfb_par *par)
extern void aty_reset_engine(const struct atyfb_par *par); extern void aty_reset_engine(const struct atyfb_par *par);
extern void aty_init_engine(struct atyfb_par *par, extern void aty_init_engine(struct atyfb_par *par,
struct fb_info *info); struct fb_info *info);
extern void atyfb_fillrect(struct fb_info *info, struct fb_fillrect *rect);
/*
* Text console acceleration
*/
extern struct display_switch fbcon_aty8;
extern struct display_switch fbcon_aty16;
extern struct display_switch fbcon_aty24;
extern struct display_switch fbcon_aty32;
This diff is collapsed.
...@@ -6,26 +6,9 @@ ...@@ -6,26 +6,9 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb8.h>
#include <video/fbcon-cfb16.h>
#include <video/fbcon-cfb24.h>
#include <video/fbcon-cfb32.h>
#include <video/mach64.h> #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
/*
* Text console acceleration
*/
static void fbcon_aty_bmove(struct display *p, int sy, int sx, int dy,
int dx, int height, int width);
static void fbcon_aty_clear(struct vc_data *conp, struct display *p,
int sy, int sx, int height, int width);
/* /*
* Generic Mach64 routines * Generic Mach64 routines
*/ */
...@@ -63,9 +46,9 @@ void aty_init_engine(struct atyfb_par *par, struct fb_info *info) ...@@ -63,9 +46,9 @@ void aty_init_engine(struct atyfb_par *par, struct fb_info *info)
u32 pitch_value; u32 pitch_value;
/* determine modal information from global mode structure */ /* determine modal information from global mode structure */
pitch_value = par->crtc.vxres; pitch_value = info->var.xres_virtual;
if (par->crtc.bpp == 24) { if (info->var.bits_per_pixel == 24) {
/* In 24 bpp, the engine is in 8 bpp - this requires that all */ /* In 24 bpp, the engine is in 8 bpp - this requires that all */
/* horizontal coordinates and widths must be adjusted */ /* horizontal coordinates and widths must be adjusted */
pitch_value = pitch_value * 3; pitch_value = pitch_value * 3;
...@@ -187,7 +170,7 @@ static inline void draw_rect(s16 x, s16 y, u16 width, u16 height, ...@@ -187,7 +170,7 @@ static inline void draw_rect(s16 x, s16 y, u16 width, u16 height,
par->blitter_may_be_busy = 1; par->blitter_may_be_busy = 1;
} }
static void atyfb_copyarea(struct fb_info *info, struct fb_copyarea *area) void atyfb_copyarea(struct fb_info *info, struct fb_copyarea *area)
{ {
struct atyfb_par *par = (struct atyfb_par *) info->par; struct atyfb_par *par = (struct atyfb_par *) info->par;
...@@ -197,8 +180,8 @@ static void atyfb_copyarea(struct fb_info *info, struct fb_copyarea *area) ...@@ -197,8 +180,8 @@ static void atyfb_copyarea(struct fb_info *info, struct fb_copyarea *area)
if (!area->width || !area->height) if (!area->width || !area->height)
return; return;
pitch_value = par->crtc.vxres; pitch_value = info->var.xres_virtual;
if (par->crtc.bpp == 24) { if (info->var.bits_per_pixel == 24) {
/* In 24 bpp, the engine is in 8 bpp - this requires that all */ /* In 24 bpp, the engine is in 8 bpp - this requires that all */
/* horizontal coordinates and widths must be adjusted */ /* horizontal coordinates and widths must be adjusted */
pitch_value *= 3; pitch_value *= 3;
...@@ -237,7 +220,7 @@ void atyfb_fillrect(struct fb_info *info, struct fb_fillrect *rect) ...@@ -237,7 +220,7 @@ void atyfb_fillrect(struct fb_info *info, struct fb_fillrect *rect)
rect->color |= (rect->color << 8); rect->color |= (rect->color << 8);
rect->color |= (rect->color << 16); rect->color |= (rect->color << 16);
if (par->crtc.bpp == 24) { if (info->var.bits_per_pixel == 24) {
/* In 24 bpp, the engine is in 8 bpp - this requires that all */ /* In 24 bpp, the engine is in 8 bpp - this requires that all */
/* horizontal coordinates and widths must be adjusted */ /* horizontal coordinates and widths must be adjusted */
rect->dx *= 3; rect->dx *= 3;
...@@ -255,111 +238,11 @@ void atyfb_fillrect(struct fb_info *info, struct fb_fillrect *rect) ...@@ -255,111 +238,11 @@ void atyfb_fillrect(struct fb_info *info, struct fb_fillrect *rect)
draw_rect(rect->dx, rect->dy, rect->width, rect->height, par); draw_rect(rect->dx, rect->dy, rect->width, rect->height, par);
} }
/* void atyfb_imageblit(struct fb_info *info, struct fb_image *image)
* Text console acceleration
*/
static void fbcon_aty_bmove(struct display *p, int sy, int sx, int dy,
int dx, int height, int width)
{
struct fb_info *info = p->fb_info;
struct fb_copyarea area;
#ifdef __sparc__
struct atyfb_par *par = (struct atyfb_par *) (info->par);
if (par->mmaped && (!info->display_fg
|| info->display_fg->vc_num ==
par->vtconsole))
return;
#endif
area.sx = sx * fontwidth(p);
area.sy = sy * fontheight(p);
area.dx = dx * fontwidth(p);
area.dy = dy * fontheight(p);
area.width = width * fontwidth(p);
area.height = height * fontheight(p);
atyfb_copyarea(info, &area);
}
static void fbcon_aty_clear(struct vc_data *conp, struct display *p,
int sy, int sx, int height, int width)
{ {
struct fb_info *info = p->fb_info; struct atyfb_par *par = (struct atyfb_par *) info->par;
struct fb_fillrect region;
#ifdef __sparc__
struct atyfb_par *par = (struct atyfb_par *) (info->par);
if (par->mmaped && (!info->display_fg
|| info->display_fg->vc_num ==
par->vtconsole))
return;
#endif
region.color = attr_bgcol_ec(p, conp);
region.color |= (region.color << 8);
region.color |= (region.color << 16);
region.dx = sx * fontwidth(p);
region.dy = sy * fontheight(p);
region.width = width * fontwidth(p);
region.height = height * fontheight(p);
region.rop = ROP_COPY;
atyfb_fillrect(info, &region);
}
#ifdef __sparc__ if (par->blitter_may_be_busy)
#define check_access \ wait_for_idle(par);
if (par->mmaped && (!info->display_fg \ cfb_imageblit(info, image);
|| info->display_fg->vc_num == par->vtconsole)) \
return;
#else
#define check_access do { } while (0)
#endif
#define DEF_FBCON_ATY_OP(name, call, args...) \
static void name(struct vc_data *conp, struct display *p, args) \
{ \
struct fb_info *info = p->fb_info; \
struct atyfb_par *par = (struct atyfb_par *) info->par; \
check_access; \
if (par->blitter_may_be_busy) \
wait_for_idle(par); \
call; \
} }
#define DEF_FBCON_ATY(width) \
DEF_FBCON_ATY_OP(fbcon_aty##width##_putc, \
fbcon_cfb##width##_putc(conp, p, c, yy, xx), \
int c, int yy, int xx) \
DEF_FBCON_ATY_OP(fbcon_aty##width##_putcs, \
fbcon_cfb##width##_putcs(conp, p, s, count, yy, xx), \
const unsigned short *s, int count, int yy, int xx) \
DEF_FBCON_ATY_OP(fbcon_aty##width##_clear_margins, \
fbcon_cfb##width##_clear_margins(conp, p, bottom_only), \
int bottom_only) \
\
struct display_switch fbcon_aty##width = { \
setup: fbcon_cfb##width##_setup, \
bmove: fbcon_aty_bmove, \
clear: fbcon_aty_clear, \
putc: fbcon_aty##width##_putc, \
putcs: fbcon_aty##width##_putcs, \
revc: fbcon_cfb##width##_revc, \
clear_margins: fbcon_aty##width##_clear_margins, \
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16) \
};
#ifdef FBCON_HAS_CFB8
DEF_FBCON_ATY(8)
#endif
#ifdef FBCON_HAS_CFB16
DEF_FBCON_ATY(16)
#endif
#ifdef FBCON_HAS_CFB24
DEF_FBCON_ATY(24)
#endif
#ifdef FBCON_HAS_CFB32
DEF_FBCON_ATY(32)
#endif
...@@ -129,7 +129,7 @@ static void aty_set_cursor(struct fb_info *info, int on) ...@@ -129,7 +129,7 @@ static void aty_set_cursor(struct fb_info *info, int on)
#endif #endif
if (on) { if (on) {
x = c->pos.x - c->hot.x - par->crtc.xoffset; x = c->pos.x - c->hot.x - info->var.xoffset;
if (x < 0) { if (x < 0) {
xoff = -x; xoff = -x;
x = 0; x = 0;
...@@ -137,7 +137,7 @@ static void aty_set_cursor(struct fb_info *info, int on) ...@@ -137,7 +137,7 @@ static void aty_set_cursor(struct fb_info *info, int on)
xoff = 0; xoff = 0;
} }
y = c->pos.y - c->hot.y - par->crtc.yoffset; y = c->pos.y - c->hot.y - info->var.yoffset;
if (y < 0) { if (y < 0) {
yoff = -y; yoff = -y;
y = 0; y = 0;
......
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