Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
07224480
Commit
07224480
authored
Dec 04, 2002
by
James Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
POrted iga fbdev driver to new api. Untested.
parent
dcaf9fd7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
365 deletions
+127
-365
drivers/video/Makefile
drivers/video/Makefile
+1
-1
drivers/video/igafb.c
drivers/video/igafb.c
+126
-359
include/video/iga.h
include/video/iga.h
+0
-5
No files found.
drivers/video/Makefile
View file @
07224480
...
@@ -29,7 +29,7 @@ obj-$(CONFIG_FB_ATARI) += atafb.o
...
@@ -29,7 +29,7 @@ obj-$(CONFIG_FB_ATARI) += atafb.o
obj-$(CONFIG_FB_ATY128)
+=
aty128fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_ATY128)
+=
aty128fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_RADEON)
+=
radeonfb.o
obj-$(CONFIG_FB_RADEON)
+=
radeonfb.o
obj-$(CONFIG_FB_NEOMAGIC)
+=
neofb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_NEOMAGIC)
+=
neofb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_IGA)
+=
igafb.o
obj-$(CONFIG_FB_IGA)
+=
igafb.o
cfbfillrect.o cfbcopyarea.o cfbimgblit.o
obj-$(CONFIG_FB_CONTROL)
+=
controlfb.o
obj-$(CONFIG_FB_CONTROL)
+=
controlfb.o
obj-$(CONFIG_FB_PLATINUM)
+=
platinumfb.o
obj-$(CONFIG_FB_PLATINUM)
+=
platinumfb.o
obj-$(CONFIG_FB_VALKYRIE)
+=
valkyriefb.o
obj-$(CONFIG_FB_VALKYRIE)
+=
valkyriefb.o
...
...
drivers/video/igafb.c
View file @
07224480
...
@@ -39,13 +39,9 @@
...
@@ -39,13 +39,9 @@
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/fb.h>
#include <linux/fb.h>
#include <linux/selection.h>
#include <linux/console.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/pci.h>
#include <linux/nvram.h>
#include <linux/nvram.h>
#include <linux/kd.h>
#include <linux/vt_kern.h>
#include <asm/io.h>
#include <asm/io.h>
...
@@ -54,16 +50,7 @@
...
@@ -54,16 +50,7 @@
#include <asm/pcic.h>
#include <asm/pcic.h>
#endif
#endif
#include <video/fbcon.h>
#include <video/iga.h>
#include <video/fbcon-cfb8.h>
#include <video/fbcon-cfb16.h>
#include <video/fbcon-cfb24.h>
#include <video/fbcon-cfb32.h>
#include "iga.h"
static
char
igafb_name
[
16
]
=
"IGA 1682"
;
static
char
fontname
[
40
]
__initdata
=
{
0
};
struct
pci_mmap_map
{
struct
pci_mmap_map
{
unsigned
long
voff
;
unsigned
long
voff
;
...
@@ -73,35 +60,18 @@ struct pci_mmap_map {
...
@@ -73,35 +60,18 @@ struct pci_mmap_map {
unsigned
long
prot_mask
;
unsigned
long
prot_mask
;
};
};
struct
fb_info_iga
{
struct
iga_par
{
struct
fb_info
fb_info
;
struct
pci_mmap_map
*
mmap_map
;
unsigned
long
frame_buffer_phys
;
unsigned
long
frame_buffer_phys
;
char
*
frame_buffer
;
unsigned
long
io_base_phys
;
unsigned
long
io_base
;
unsigned
long
io_base
;
u32
total_vram
;
};
struct
pci_mmap_map
*
mmap_map
;
struct
{
u_short
blue
,
green
,
red
,
pad
;
}
palette
[
256
];
struct
fb_info
fb_info
;
int
video_cmap_len
;
struct
display
disp
;
struct
fb_fix_screeninfo
igafb_fix
__initdata
=
{
struct
display_switch
dispsw
;
.
id
=
"IGA 1682"
,
union
{
.
type
=
FB_TYPE_PACKED_PIXELS
;
#ifdef FBCON_HAS_CFB16
.
mmio_len
=
1000
;
u16
cfb16
[
16
];
#endif
#ifdef FBCON_HAS_CFB24
u32
cfb24
[
16
];
#endif
#ifdef FBCON_HAS_CFB32
u32
cfb32
[
16
];
#endif
}
fbcon_cmap
;
#ifdef __sparc__
u8
open
;
u8
mmaped
;
int
vtconsole
;
int
consolecnt
;
#endif
};
};
struct
fb_var_screeninfo
default_var
=
{
struct
fb_var_screeninfo
default_var
=
{
...
@@ -142,21 +112,21 @@ struct fb_var_screeninfo default_var_1280x1024 __initdata = {
...
@@ -142,21 +112,21 @@ struct fb_var_screeninfo default_var_1280x1024 __initdata = {
*
*
* On sparc we happen to access I/O with memory mapped functions too.
* On sparc we happen to access I/O with memory mapped functions too.
*/
*/
#define pci_inb(
info, reg) readb(info
->io_base+(reg))
#define pci_inb(
par, reg) readb(par
->io_base+(reg))
#define pci_outb(
info, val, reg) writeb(val, info
->io_base+(reg))
#define pci_outb(
par, val, reg) writeb(val, par
->io_base+(reg))
static
inline
unsigned
int
iga_inb
(
struct
fb_info_iga
*
info
,
static
inline
unsigned
int
iga_inb
(
struct
iga_par
*
par
,
unsigned
int
reg
,
unsigned
int
reg
,
unsigned
int
idx
)
unsigned
int
idx
)
{
{
pci_outb
(
info
,
idx
,
reg
);
pci_outb
(
par
,
idx
,
reg
);
return
pci_inb
(
info
,
reg
+
1
);
return
pci_inb
(
par
,
reg
+
1
);
}
}
static
inline
void
iga_outb
(
struct
fb_info_iga
*
info
,
unsigned
char
val
,
static
inline
void
iga_outb
(
struct
iga_par
*
par
,
unsigned
char
val
,
unsigned
int
reg
,
unsigned
int
idx
)
unsigned
int
reg
,
unsigned
int
idx
)
{
{
pci_outb
(
info
,
idx
,
reg
);
pci_outb
(
par
,
idx
,
reg
);
pci_outb
(
info
,
val
,
reg
+
1
);
pci_outb
(
par
,
val
,
reg
+
1
);
}
}
#endif
/* __sparc__ */
#endif
/* __sparc__ */
...
@@ -165,20 +135,19 @@ static inline void iga_outb(struct fb_info_iga *info, unsigned char val,
...
@@ -165,20 +135,19 @@ static inline void iga_outb(struct fb_info_iga *info, unsigned char val,
* Very important functionality for the JavaEngine1 computer:
* Very important functionality for the JavaEngine1 computer:
* make screen border black (usign special IGA registers)
* make screen border black (usign special IGA registers)
*/
*/
static
void
iga_blank_border
(
struct
fb_info_iga
*
info
)
static
void
iga_blank_border
(
struct
iga_par
*
par
)
{
{
int
i
;
int
i
;
#if 0
#if 0
/*
/*
* PROM does this for us, so keep this code as a reminder
* PROM does this for us, so keep this code as a reminder
* about required read from 0x3DA and writing of 0x20 in the end.
* about required read from 0x3DA and writing of 0x20 in the end.
*/
*/
(void) pci_inb(
info
, 0x3DA); /* required for every access */
(void) pci_inb(
par
, 0x3DA); /* required for every access */
pci_outb(
info
, IGA_IDX_VGA_OVERSCAN, IGA_ATTR_CTL);
pci_outb(
par
, IGA_IDX_VGA_OVERSCAN, IGA_ATTR_CTL);
(void) pci_inb(
info
, IGA_ATTR_CTL+1);
(void) pci_inb(
par
, IGA_ATTR_CTL+1);
pci_outb(
info
, 0x38, IGA_ATTR_CTL);
pci_outb(
par
, 0x38, IGA_ATTR_CTL);
pci_outb(
info
, 0x20, IGA_ATTR_CTL); /* re-enable visual */
pci_outb(
par
, 0x20, IGA_ATTR_CTL); /* re-enable visual */
#endif
#endif
/*
/*
* This does not work as it was designed because the overscan
* This does not work as it was designed because the overscan
...
@@ -186,68 +155,19 @@ static void iga_blank_border(struct fb_info_iga *info)
...
@@ -186,68 +155,19 @@ static void iga_blank_border(struct fb_info_iga *info)
* overscan changes color.
* overscan changes color.
*/
*/
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
i
=
0
;
i
<
3
;
i
++
)
iga_outb
(
info
,
0
,
IGA_EXT_CNTRL
,
IGA_IDX_OVERSCAN_COLOR
+
i
);
iga_outb
(
par
,
0
,
IGA_EXT_CNTRL
,
IGA_IDX_OVERSCAN_COLOR
+
i
);
}
/*
* Frame buffer device API
*/
static
int
igafb_update_var
(
int
con
,
struct
fb_info
*
info
)
{
return
0
;
}
static
int
igafb_get_fix
(
struct
fb_fix_screeninfo
*
fix
,
int
con
,
struct
fb_info
*
info
)
{
struct
fb_info_iga
*
fb
=
(
struct
fb_info_iga
*
)
info
;
memset
(
fix
,
0
,
sizeof
(
struct
fb_fix_screeninfo
));
strcpy
(
fix
->
id
,
igafb_name
);
fix
->
smem_start
=
(
unsigned
long
)
fb
->
frame_buffer
;
fix
->
smem_len
=
fb
->
total_vram
;
fix
->
xpanstep
=
0
;
fix
->
ypanstep
=
0
;
fix
->
ywrapstep
=
0
;
fix
->
type
=
FB_TYPE_PACKED_PIXELS
;
fix
->
type_aux
=
0
;
fix
->
line_length
=
default_var
.
xres
*
(
default_var
.
bits_per_pixel
/
8
);
fix
->
visual
=
default_var
.
bits_per_pixel
<=
8
?
FB_VISUAL_PSEUDOCOLOR
:
FB_VISUAL_DIRECTCOLOR
;
return
0
;
}
static
int
igafb_get_var
(
struct
fb_var_screeninfo
*
var
,
int
con
,
struct
fb_info
*
info
)
{
if
(
con
==
-
1
)
memcpy
(
var
,
&
default_var
,
sizeof
(
struct
fb_var_screeninfo
));
else
*
var
=
fb_display
[
con
].
var
;
return
0
;
}
static
int
igafb_set_var
(
struct
fb_var_screeninfo
*
var
,
int
con
,
struct
fb_info
*
info
)
{
memcpy
(
var
,
&
default_var
,
sizeof
(
struct
fb_var_screeninfo
));
return
0
;
}
}
#ifdef __sparc__
#ifdef __sparc__
static
int
igafb_mmap
(
struct
fb_info
*
info
,
struct
file
*
file
,
static
int
igafb_mmap
(
struct
fb_info
*
info
,
struct
file
*
file
,
struct
vm_area_struct
*
vma
)
struct
vm_area_struct
*
vma
)
{
{
struct
fb_info_iga
*
fb
=
(
struct
fb_info_iga
*
)
info
;
struct
iga_par
*
par
=
(
struct
iga_par
*
)
info
->
par
;
unsigned
int
size
,
page
,
map_size
=
0
;
unsigned
int
size
,
page
,
map_size
=
0
;
unsigned
long
map_offset
=
0
;
unsigned
long
map_offset
=
0
;
int
i
;
int
i
;
if
(
!
fb
->
mmap_map
)
if
(
!
par
->
mmap_map
)
return
-
ENXIO
;
return
-
ENXIO
;
size
=
vma
->
vm_end
-
vma
->
vm_start
;
size
=
vma
->
vm_end
-
vma
->
vm_start
;
...
@@ -258,9 +178,9 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
...
@@ -258,9 +178,9 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
/* Each page, see which map applies */
/* Each page, see which map applies */
for
(
page
=
0
;
page
<
size
;
)
{
for
(
page
=
0
;
page
<
size
;
)
{
map_size
=
0
;
map_size
=
0
;
for
(
i
=
0
;
fb
->
mmap_map
[
i
].
size
;
i
++
)
{
for
(
i
=
0
;
par
->
mmap_map
[
i
].
size
;
i
++
)
{
unsigned
long
start
=
fb
->
mmap_map
[
i
].
voff
;
unsigned
long
start
=
par
->
mmap_map
[
i
].
voff
;
unsigned
long
end
=
start
+
fb
->
mmap_map
[
i
].
size
;
unsigned
long
end
=
start
+
par
->
mmap_map
[
i
].
size
;
unsigned
long
offset
=
(
vma
->
vm_pgoff
<<
PAGE_SHIFT
)
+
page
;
unsigned
long
offset
=
(
vma
->
vm_pgoff
<<
PAGE_SHIFT
)
+
page
;
if
(
start
>
offset
)
if
(
start
>
offset
)
...
@@ -268,8 +188,8 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
...
@@ -268,8 +188,8 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
if
(
offset
>=
end
)
if
(
offset
>=
end
)
continue
;
continue
;
map_size
=
fb
->
mmap_map
[
i
].
size
-
(
offset
-
start
);
map_size
=
par
->
mmap_map
[
i
].
size
-
(
offset
-
start
);
map_offset
=
fb
->
mmap_map
[
i
].
poff
+
(
offset
-
start
);
map_offset
=
par
->
mmap_map
[
i
].
poff
+
(
offset
-
start
);
break
;
break
;
}
}
if
(
!
map_size
)
{
if
(
!
map_size
)
{
...
@@ -279,8 +199,8 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
...
@@ -279,8 +199,8 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
if
(
page
+
map_size
>
size
)
if
(
page
+
map_size
>
size
)
map_size
=
size
-
page
;
map_size
=
size
-
page
;
pgprot_val
(
vma
->
vm_page_prot
)
&=
~
(
fb
->
mmap_map
[
i
].
prot_mask
);
pgprot_val
(
vma
->
vm_page_prot
)
&=
~
(
par
->
mmap_map
[
i
].
prot_mask
);
pgprot_val
(
vma
->
vm_page_prot
)
|=
fb
->
mmap_map
[
i
].
prot_flag
;
pgprot_val
(
vma
->
vm_page_prot
)
|=
par
->
mmap_map
[
i
].
prot_flag
;
if
(
remap_page_range
(
vma
,
vma
->
vm_start
+
page
,
map_offset
,
if
(
remap_page_range
(
vma
,
vma
->
vm_start
+
page
,
map_offset
,
map_size
,
vma
->
vm_page_prot
))
map_size
,
vma
->
vm_page_prot
))
...
@@ -293,46 +213,13 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
...
@@ -293,46 +213,13 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
return
-
EINVAL
;
return
-
EINVAL
;
vma
->
vm_flags
|=
VM_IO
;
vma
->
vm_flags
|=
VM_IO
;
if
(
!
fb
->
mmaped
)
{
int
lastconsole
=
0
;
if
(
info
->
display_fg
)
lastconsole
=
info
->
display_fg
->
vc_num
;
fb
->
mmaped
=
1
;
if
(
fb
->
consolecnt
&&
fb_display
[
lastconsole
].
fb_info
==
info
)
{
fb
->
vtconsole
=
lastconsole
;
vt_cons
[
lastconsole
]
->
vc_mode
=
KD_GRAPHICS
;
}
}
return
0
;
return
0
;
}
}
#endif
/* __sparc__ */
#endif
/* __sparc__ */
static
int
iga_getcolreg
(
unsigned
regno
,
unsigned
*
red
,
unsigned
*
green
,
unsigned
*
blue
,
unsigned
*
transp
,
struct
fb_info
*
fb_info
)
{
/*
* Read a single color register and split it into colors/transparent.
* Return != 0 for invalid regno.
*/
struct
fb_info_iga
*
info
=
(
struct
fb_info_iga
*
)
fb_info
;
if
(
regno
>=
info
->
video_cmap_len
)
return
1
;
*
red
=
info
->
palette
[
regno
].
red
;
*
green
=
info
->
palette
[
regno
].
green
;
*
blue
=
info
->
palette
[
regno
].
blue
;
*
transp
=
0
;
return
0
;
}
static
int
igafb_setcolreg
(
unsigned
regno
,
unsigned
red
,
unsigned
green
,
static
int
igafb_setcolreg
(
unsigned
regno
,
unsigned
red
,
unsigned
green
,
unsigned
blue
,
unsigned
transp
,
unsigned
blue
,
unsigned
transp
,
struct
fb_info
*
fb_
info
)
struct
fb_info
*
info
)
{
{
/*
/*
* Set a single color register. The values supplied are
* Set a single color register. The values supplied are
...
@@ -340,221 +227,100 @@ static int igafb_setcolreg(unsigned regno, unsigned red, unsigned green,
...
@@ -340,221 +227,100 @@ static int igafb_setcolreg(unsigned regno, unsigned red, unsigned green,
* (according to the entries in the `var' structure). Return
* (according to the entries in the `var' structure). Return
* != 0 for invalid regno.
* != 0 for invalid regno.
*/
*/
struct
iga_par
*
par
=
(
struct
iga_par
*
)
info
->
par
;
struct
fb_info_iga
*
info
=
(
struct
fb_info_iga
*
)
fb_info
;
if
(
regno
>=
info
->
cmap
.
len
)
if
(
regno
>=
info
->
video_cmap_len
)
return
1
;
return
1
;
info
->
palette
[
regno
].
red
=
red
;
pci_outb
(
par
,
regno
,
DAC_W_INDEX
);
info
->
palette
[
regno
].
green
=
green
;
pci_outb
(
par
,
red
,
DAC_DATA
);
info
->
palette
[
regno
].
blue
=
blue
;
pci_outb
(
par
,
green
,
DAC_DATA
);
pci_outb
(
par
,
blue
,
DAC_DATA
);
pci_outb
(
info
,
regno
,
DAC_W_INDEX
);
pci_outb
(
info
,
red
,
DAC_DATA
);
pci_outb
(
info
,
green
,
DAC_DATA
);
pci_outb
(
info
,
blue
,
DAC_DATA
);
if
(
regno
<
16
)
{
if
(
regno
<
16
)
{
switch
(
default_var
.
bits_per_pixel
)
{
switch
(
info
->
var
.
bits_per_pixel
)
{
#ifdef FBCON_HAS_CFB16
case
16
:
case
16
:
info
->
fbcon_cmap
.
cfb16
[
regno
]
=
info
->
pseudo_palette
[
regno
]
=
(
regno
<<
10
)
|
(
regno
<<
5
)
|
regno
;
(
regno
<<
10
)
|
(
regno
<<
5
)
|
regno
;
break
;
break
;
#endif
#ifdef FBCON_HAS_CFB24
case
24
:
case
24
:
info
->
fbcon_cmap
.
cfb24
[
regno
]
=
info
->
pseudo_palette
[
regno
]
=
(
regno
<<
16
)
|
(
regno
<<
8
)
|
regno
;
(
regno
<<
16
)
|
(
regno
<<
8
)
|
regno
;
break
;
break
;
#endif
#ifdef FBCON_HAS_CFB32
case
32
:
case
32
:
{
int
i
;
{
int
i
;
i
=
(
regno
<<
8
)
|
regno
;
i
=
(
regno
<<
8
)
|
regno
;
info
->
fbcon_cmap
.
cfb32
[
regno
]
=
(
i
<<
16
)
|
i
;
info
->
pseudo_palette
[
regno
]
=
(
i
<<
16
)
|
i
;
}
}
break
;
break
;
#endif
}
}
}
}
return
0
;
return
0
;
}
}
static
int
igafb_get_cmap
(
struct
fb_cmap
*
cmap
,
int
kspc
,
int
con
,
struct
fb_info
*
fb_info
)
{
struct
fb_info_iga
*
info
=
(
struct
fb_info_iga
*
)
fb_info
;
if
(
con
==
fb_info
->
currcon
)
/* current console? */
return
fb_get_cmap
(
cmap
,
kspc
,
iga_getcolreg
,
&
info
->
fb_info
);
else
if
(
fb_display
[
con
].
cmap
.
len
)
/* non default colormap? */
fb_copy_cmap
(
&
fb_display
[
con
].
cmap
,
cmap
,
kspc
?
0
:
2
);
else
fb_copy_cmap
(
fb_default_cmap
(
info
->
video_cmap_len
),
cmap
,
kspc
?
0
:
2
);
return
0
;
}
/*
/*
* Framebuffer option structure
* Framebuffer option structure
*/
*/
static
struct
fb_ops
igafb_ops
=
{
static
struct
fb_ops
igafb_ops
=
{
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
.
fb_get_fix
=
igafb_get_fix
,
.
fb_get_var
=
igafb_get_var
,
.
fb_set_var
=
igafb_set_var
,
.
fb_get_cmap
=
igafb_get_cmap
,
.
fb_set_cmap
=
gen_set_cmap
,
.
fb_setcolreg
=
igafb_setcolreg
,
.
fb_setcolreg
=
igafb_setcolreg
,
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
#ifdef __sparc__
#ifdef __sparc__
.
fb_mmap
=
igafb_mmap
,
.
fb_mmap
=
igafb_mmap
,
#endif
#endif
};
};
static
void
igafb_set_disp
(
int
con
,
struct
fb_info_iga
*
info
)
static
int
__init
iga_init
(
struct
fb_info
*
info
,
struct
iga_par
*
par
)
{
{
struct
fb_fix_screeninfo
fix
;
char
vramsz
=
iga_inb
(
par
,
IGA_EXT_CNTRL
,
IGA_IDX_EXT_BUS_CNTL
)
struct
display
*
display
;
struct
display_switch
*
sw
;
if
(
con
>=
0
)
display
=
&
fb_display
[
con
];
else
display
=
&
info
->
disp
;
/* used during initialization */
igafb_get_fix
(
&
fix
,
con
,
&
info
->
fb_info
);
memset
(
display
,
0
,
sizeof
(
struct
display
));
display
->
visual
=
fix
.
visual
;
display
->
type
=
fix
.
type
;
display
->
type_aux
=
fix
.
type_aux
;
display
->
ypanstep
=
fix
.
ypanstep
;
display
->
ywrapstep
=
fix
.
ywrapstep
;
display
->
line_length
=
fix
.
line_length
;
display
->
next_line
=
fix
.
line_length
;
display
->
can_soft_blank
=
0
;
display
->
inverse
=
0
;
igafb_get_var
(
&
display
->
var
,
-
1
,
&
info
->
fb_info
);
switch
(
default_var
.
bits_per_pixel
)
{
#ifdef FBCON_HAS_CFB8
case
8
:
sw
=
&
fbcon_cfb8
;
break
;
#endif
#ifdef FBCON_HAS_CFB16
case
15
:
case
16
:
sw
=
&
fbcon_cfb16
;
display
->
dispsw_data
=
info
->
fbcon_cmap
.
cfb16
;
break
;
#endif
#ifdef FBCON_HAS_CFB24
case
24
:
sw
=
&
fbcon_cfb24
;
display
->
dispsw_data
=
info
->
fbcon_cmap
.
cfb24
;
break
;
#endif
#ifdef FBCON_HAS_CFB32
case
32
:
sw
=
&
fbcon_cfb32
;
display
->
dispsw_data
=
info
->
fbcon_cmap
.
cfb32
;
break
;
#endif
default:
printk
(
KERN_WARNING
"igafb_set_disp: unknown resolution %d
\n
"
,
default_var
.
bits_per_pixel
);
return
;
}
memcpy
(
&
info
->
dispsw
,
sw
,
sizeof
(
*
sw
));
display
->
dispsw
=
&
info
->
dispsw
;
display
->
scrollmode
=
SCROLL_YREDRAW
;
info
->
dispsw
.
bmove
=
fbcon_redraw_bmove
;
}
static
int
igafb_switch
(
int
con
,
struct
fb_info
*
fb_info
)
{
struct
fb_info_iga
*
info
=
(
struct
fb_info_iga
*
)
fb_info
;
/* Do we have to save the colormap? */
if
(
fb_display
[
fb_info
->
currcon
].
cmap
.
len
)
fb_get_cmap
(
&
fb_display
[
fb_info
->
currcon
].
cmap
,
1
,
iga_getcolreg
,
fb_info
);
fb_info
->
currcon
=
con
;
/* Install new colormap */
do_install_cmap
(
con
,
fb_info
);
igafb_update_var
(
con
,
fb_info
);
return
1
;
}
static
int
__init
iga_init
(
struct
fb_info_iga
*
info
)
{
char
vramsz
=
iga_inb
(
info
,
IGA_EXT_CNTRL
,
IGA_IDX_EXT_BUS_CNTL
)
&
MEM_SIZE_ALIAS
;
&
MEM_SIZE_ALIAS
;
int
video_cmap_len
;
switch
(
vramsz
)
{
switch
(
vramsz
)
{
case
MEM_SIZE_1M
:
case
MEM_SIZE_1M
:
info
->
total_vram
=
0x100000
;
info
->
fix
.
smem_len
=
0x100000
;
break
;
break
;
case
MEM_SIZE_2M
:
case
MEM_SIZE_2M
:
info
->
total_vram
=
0x200000
;
info
->
fix
.
smem_len
=
0x200000
;
break
;
break
;
case
MEM_SIZE_4M
:
case
MEM_SIZE_4M
:
case
MEM_SIZE_RESERVED
:
case
MEM_SIZE_RESERVED
:
info
->
total_vram
=
0x400000
;
info
->
fix
.
smem_len
=
0x400000
;
break
;
break
;
}
}
if
(
default_var
.
bits_per_pixel
>
8
)
{
if
(
info
->
var
.
bits_per_pixel
>
8
)
info
->
video_cmap_len
=
16
;
video_cmap_len
=
16
;
}
else
{
else
info
->
video_cmap_len
=
256
;
video_cmap_len
=
256
;
}
{
info
->
node
=
NODEV
;
int
j
,
k
;
info
->
fbops
=
&
igafb_ops
;
for
(
j
=
0
;
j
<
16
;
j
++
)
{
info
->
flags
=
FBINFO_FLAG_DEFAULT
;
k
=
color_table
[
j
];
info
->
palette
[
j
].
red
=
default_red
[
k
];
info
->
palette
[
j
].
green
=
default_grn
[
k
];
info
->
palette
[
j
].
blue
=
default_blu
[
k
];
}
}
strcpy
(
info
->
fb_info
.
modename
,
igafb_name
);
fb_alloc_cmap
(
info
->
cmap
,
video_cmap_len
,
0
);
info
->
fb_info
.
node
=
NODEV
;
info
->
fb_info
.
fbops
=
&
igafb_ops
;
if
(
register_framebuffer
(
info
)
<
0
)
info
->
fb_info
.
disp
=
&
info
->
disp
;
info
->
fb_info
.
screen_base
=
info
->
frame_buffer
;
info
->
fb_info
.
currcon
=
-
1
;
strcpy
(
info
->
fb_info
.
fontname
,
fontname
);
info
->
fb_info
.
changevar
=
NULL
;
info
->
fb_info
.
switch_con
=
&
igafb_switch
;
info
->
fb_info
.
updatevar
=
&
igafb_update_var
;
info
->
fb_info
.
flags
=
FBINFO_FLAG_DEFAULT
;
igafb_set_disp
(
-
1
,
info
);
if
(
register_framebuffer
(
&
info
->
fb_info
)
<
0
)
return
0
;
return
0
;
printk
(
"fb%d: %s frame buffer device at 0x%08lx [%dMB VRAM]
\n
"
,
printk
(
"fb%d: %s frame buffer device at 0x%08lx [%dMB VRAM]
\n
"
,
minor
(
info
->
fb_info
.
node
),
igafb_name
,
minor
(
info
->
node
),
info
->
fix
.
id
,
info
->
frame_buffer_phys
,
info
->
total_vram
>>
20
);
par
->
frame_buffer_phys
,
info
->
fix
.
smem_len
>>
20
);
iga_blank_border
(
info
);
iga_blank_border
(
par
);
return
1
;
return
1
;
}
}
int
__init
igafb_init
(
void
)
int
__init
igafb_init
(
void
)
{
{
extern
int
con_is_present
(
void
);
struct
fb_info
*
info
;
struct
pci_dev
*
pdev
;
struct
pci_dev
*
pdev
;
struct
fb_info_iga
*
info
;
struct
iga_par
*
par
;
unsigned
long
addr
;
unsigned
long
addr
;
extern
int
con_is_present
(
void
);
int
size
,
iga2000
=
0
;
int
iga2000
=
0
;
/* Do not attach when we have a serial console. */
/* Do not attach when we have a serial console. */
if
(
!
con_is_present
())
if
(
!
con_is_present
())
...
@@ -574,12 +340,17 @@ int __init igafb_init(void)
...
@@ -574,12 +340,17 @@ int __init igafb_init(void)
iga2000
=
1
;
iga2000
=
1
;
}
}
info
=
kmalloc
(
sizeof
(
struct
fb_info_iga
),
GFP_ATOMIC
);
size
=
sizeof
(
struct
fb_info
)
+
sizeof
(
struct
iga_par
)
+
sizeof
(
u32
)
*
16
;
info
=
kmalloc
(
size
,
GFP_ATOMIC
);
if
(
!
info
)
{
if
(
!
info
)
{
printk
(
"igafb_init: can't alloc fb_info
_iga
\n
"
);
printk
(
"igafb_init: can't alloc fb_info
\n
"
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
memset
(
info
,
0
,
sizeof
(
struct
fb_info_iga
));
memset
(
info
,
0
,
size
);
par
=
(
struct
iga_par
*
)
(
info
+
1
);
if
((
addr
=
pdev
->
resource
[
0
].
start
)
==
0
)
{
if
((
addr
=
pdev
->
resource
[
0
].
start
)
==
0
)
{
printk
(
"igafb_init: no memory start
\n
"
);
printk
(
"igafb_init: no memory start
\n
"
);
...
@@ -587,13 +358,13 @@ int __init igafb_init(void)
...
@@ -587,13 +358,13 @@ int __init igafb_init(void)
return
-
ENXIO
;
return
-
ENXIO
;
}
}
if
((
info
->
frame_buffer
=
ioremap
(
addr
,
1024
*
1024
*
2
))
==
0
)
{
if
((
info
->
screen_base
=
ioremap
(
addr
,
1024
*
1024
*
2
))
==
0
)
{
printk
(
"igafb_init: can't remap %lx[2M]
\n
"
,
addr
);
printk
(
"igafb_init: can't remap %lx[2M]
\n
"
,
addr
);
kfree
(
info
);
kfree
(
info
);
return
-
ENXIO
;
return
-
ENXIO
;
}
}
info
->
frame_buffer_phys
=
addr
&
PCI_BASE_ADDRESS_MEM_MASK
;
par
->
frame_buffer_phys
=
addr
&
PCI_BASE_ADDRESS_MEM_MASK
;
#ifdef __sparc__
#ifdef __sparc__
/*
/*
...
@@ -616,13 +387,13 @@ int __init igafb_init(void)
...
@@ -616,13 +387,13 @@ int __init igafb_init(void)
* I/O addresses are.
* I/O addresses are.
*/
*/
if
(
iga2000
)
{
if
(
iga2000
)
{
i
nfo
->
io_base_phys
=
info
->
frame_buffer_phys
|
0x00800000
;
i
gafb_fix
.
mmio_start
=
par
->
frame_buffer_phys
|
0x00800000
;
}
else
{
}
else
{
i
nfo
->
io_base_phys
=
0x30000000
;
/* XXX */
i
gafb_fix
.
mmio_start
=
0x30000000
;
/* XXX */
}
}
if
((
info
->
io_base
=
(
int
)
ioremap
(
info
->
io_base_phys
,
0x1000
))
==
0
)
{
if
((
par
->
io_base
=
(
int
)
ioremap
(
igafb_fix
.
mmio_start
,
igafb_fix
.
smem_len
))
==
0
)
{
printk
(
"igafb_init: can't remap %lx[4K]
\n
"
,
i
nfo
->
io_base_phys
);
printk
(
"igafb_init: can't remap %lx[4K]
\n
"
,
i
gafb_fix
.
mmio_start
);
iounmap
((
void
*
)
info
->
frame_buffer
);
iounmap
((
void
*
)
info
->
screen_base
);
kfree
(
info
);
kfree
(
info
);
return
-
ENXIO
;
return
-
ENXIO
;
}
}
...
@@ -635,16 +406,16 @@ int __init igafb_init(void)
...
@@ -635,16 +406,16 @@ int __init igafb_init(void)
* one additional region with size == 0.
* one additional region with size == 0.
*/
*/
info
->
mmap_map
=
kmalloc
(
4
*
sizeof
(
*
info
->
mmap_map
),
GFP_ATOMIC
);
par
->
mmap_map
=
kmalloc
(
4
*
sizeof
(
*
par
->
mmap_map
),
GFP_ATOMIC
);
if
(
!
info
->
mmap_map
)
{
if
(
!
par
->
mmap_map
)
{
printk
(
"igafb_init: can't alloc mmap_map
\n
"
);
printk
(
"igafb_init: can't alloc mmap_map
\n
"
);
iounmap
((
void
*
)
info
->
io_base
);
iounmap
((
void
*
)
par
->
io_base
);
iounmap
(
info
->
frame_buffer
);
iounmap
(
info
->
screen_base
);
kfree
(
info
);
kfree
(
info
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
memset
(
info
->
mmap_map
,
0
,
4
*
sizeof
(
*
info
->
mmap_map
));
memset
(
par
->
mmap_map
,
0
,
4
*
sizeof
(
*
par
->
mmap_map
));
/*
/*
* Set default vmode and cmode from PROM properties.
* Set default vmode and cmode from PROM properties.
...
@@ -691,12 +462,19 @@ int __init igafb_init(void)
...
@@ -691,12 +462,19 @@ int __init igafb_init(void)
}
}
#endif
#endif
igafb_fix
.
smem_start
=
(
unsigned
long
)
info
->
screen_base
;
if
(
!
iga_init
(
info
))
{
igafb_fix
.
line_length
=
default_var
.
xres
*
(
default_var
.
bits_per_pixel
/
8
);
iounmap
((
void
*
)
info
->
io_base
);
igafb_fix
.
visual
=
default_var
.
bits_per_pixel
<=
8
?
FB_VISUAL_PSEUDOCOLOR
:
FB_VISUAL_DIRECTCOLOR
;
iounmap
(
info
->
frame_buffer
);
if
(
info
->
mmap_map
)
info
->
var
=
default_var
;
kfree
(
info
->
mmap_map
);
info
->
fix
=
igafb_fix
;
info
->
pseudo_palette
=
(
void
*
)(
par
+
1
);
if
(
!
iga_init
(
info
,
par
))
{
iounmap
((
void
*
)
par
->
io_base
);
iounmap
(
info
->
screen_base
);
if
(
par
->
mmap_map
)
kfree
(
par
->
mmap_map
);
kfree
(
info
);
kfree
(
info
);
}
}
...
@@ -706,18 +484,18 @@ int __init igafb_init(void)
...
@@ -706,18 +484,18 @@ int __init igafb_init(void)
*/
*/
/* First region is for video memory */
/* First region is for video memory */
info
->
mmap_map
[
0
].
voff
=
0x0
;
par
->
mmap_map
[
0
].
voff
=
0x0
;
info
->
mmap_map
[
0
].
poff
=
info
->
frame_buffer_phys
&
PAGE_MASK
;
par
->
mmap_map
[
0
].
poff
=
par
->
frame_buffer_phys
&
PAGE_MASK
;
info
->
mmap_map
[
0
].
size
=
info
->
total_vram
&
PAGE_MASK
;
par
->
mmap_map
[
0
].
size
=
info
->
fix
.
smem_len
&
PAGE_MASK
;
info
->
mmap_map
[
0
].
prot_mask
=
SRMMU_CACHE
;
par
->
mmap_map
[
0
].
prot_mask
=
SRMMU_CACHE
;
info
->
mmap_map
[
0
].
prot_flag
=
SRMMU_WRITE
;
par
->
mmap_map
[
0
].
prot_flag
=
SRMMU_WRITE
;
/* Second region is for I/O ports */
/* Second region is for I/O ports */
info
->
mmap_map
[
1
].
voff
=
info
->
frame_buffer_phys
&
PAGE_MASK
;
par
->
mmap_map
[
1
].
voff
=
par
->
frame_buffer_phys
&
PAGE_MASK
;
info
->
mmap_map
[
1
].
poff
=
info
->
io_base_phys
&
PAGE_MASK
;
par
->
mmap_map
[
1
].
poff
=
info
->
fix
.
smem_start
&
PAGE_MASK
;
info
->
mmap_map
[
1
].
size
=
PAGE_SIZE
*
2
;
/* X wants 2 pages */
par
->
mmap_map
[
1
].
size
=
PAGE_SIZE
*
2
;
/* X wants 2 pages */
info
->
mmap_map
[
1
].
prot_mask
=
SRMMU_CACHE
;
par
->
mmap_map
[
1
].
prot_mask
=
SRMMU_CACHE
;
info
->
mmap_map
[
1
].
prot_flag
=
SRMMU_WRITE
;
par
->
mmap_map
[
1
].
prot_flag
=
SRMMU_WRITE
;
#endif
/* __sparc__ */
#endif
/* __sparc__ */
return
0
;
return
0
;
...
@@ -731,17 +509,6 @@ int __init igafb_setup(char *options)
...
@@ -731,17 +509,6 @@ int __init igafb_setup(char *options)
return
0
;
return
0
;
while
((
this_opt
=
strsep
(
&
options
,
","
))
!=
NULL
)
{
while
((
this_opt
=
strsep
(
&
options
,
","
))
!=
NULL
)
{
if
(
!
strncmp
(
this_opt
,
"font:"
,
5
))
{
char
*
p
;
int
i
;
p
=
this_opt
+
5
;
for
(
i
=
0
;
i
<
sizeof
(
fontname
)
-
1
;
i
++
)
if
(
!*
p
||
*
p
==
' '
||
*
p
==
','
)
break
;
memcpy
(
fontname
,
this_opt
+
5
,
i
);
fontname
[
i
]
=
0
;
}
}
}
return
0
;
return
0
;
}
}
...
...
drivers
/video/iga.h
→
include
/video/iga.h
View file @
07224480
...
@@ -7,11 +7,6 @@
...
@@ -7,11 +7,6 @@
#ifndef _IGA1682_H
#ifndef _IGA1682_H
#define _IGA1682_H 1
#define _IGA1682_H 1
struct
iga1682_info
{
unsigned
int
total_vram
;
};
#define IGA_ATTR_CTL 0x3C0
#define IGA_ATTR_CTL 0x3C0
#define IGA_IDX_VGA_OVERSCAN 0x11
#define IGA_IDX_VGA_OVERSCAN 0x11
#define DAC_W_INDEX 0x03C8
#define DAC_W_INDEX 0x03C8
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment