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
86576f53
Commit
86576f53
authored
Mar 04, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge nuts.ninka.net:/home/davem/src/BK/sparcwork-2.5
into nuts.ninka.net:/home/davem/src/BK/sparc-2.5
parents
ebd158e7
20400563
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
163 additions
and
269 deletions
+163
-269
drivers/video/bw2.c
drivers/video/bw2.c
+12
-38
drivers/video/cg14.c
drivers/video/cg14.c
+2
-39
drivers/video/cg3.c
drivers/video/cg3.c
+12
-38
drivers/video/cg6.c
drivers/video/cg6.c
+12
-38
drivers/video/ffb.c
drivers/video/ffb.c
+13
-40
drivers/video/p9100.c
drivers/video/p9100.c
+13
-38
drivers/video/sbuslib.c
drivers/video/sbuslib.c
+82
-0
drivers/video/sbuslib.h
drivers/video/sbuslib.h
+3
-0
drivers/video/tcx.c
drivers/video/tcx.c
+14
-38
No files found.
drivers/video/bw2.c
View file @
86576f53
...
...
@@ -33,11 +33,11 @@
* Local functions.
*/
static
int
bw2_check_var
(
struct
fb_var_screeninfo
*
,
struct
fb_info
*
);
static
int
bw2_set_par
(
struct
fb_info
*
);
static
int
bw2_blank
(
int
,
struct
fb_info
*
);
static
int
bw2_mmap
(
struct
fb_info
*
,
struct
file
*
,
struct
vm_area_struct
*
);
static
int
bw2_ioctl
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
,
struct
fb_info
*
);
/*
* Frame buffer operations
...
...
@@ -45,13 +45,12 @@ static int bw2_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static
struct
fb_ops
bw2_ops
=
{
.
owner
=
THIS_MODULE
,
.
fb_check_var
=
bw2_check_var
,
.
fb_set_par
=
bw2_set_par
,
.
fb_blank
=
bw2_blank
,
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_mmap
=
bw2_mmap
,
.
fb_ioctl
=
bw2_ioctl
,
.
fb_cursor
=
soft_cursor
,
};
...
...
@@ -123,39 +122,6 @@ struct bw2_par {
struct
list_head
list
;
};
/**
* bw2_check_var - Optional function. Validates a var passed in.
* @var: frame buffer variable screen structure
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
bw2_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
{
if
(
var
->
bits_per_pixel
!=
8
)
return
-
EINVAL
;
if
(
var
->
xres_virtual
!=
var
->
xres
||
var
->
yres_virtual
!=
var
->
yres
)
return
-
EINVAL
;
if
(
var
->
nonstd
)
return
-
EINVAL
;
if
((
var
->
vmode
&
FB_VMODE_MASK
)
!=
FB_VMODE_NONINTERLACED
)
return
-
EINVAL
;
if
(
var
->
xres
!=
info
->
var
.
xres
||
var
->
yres
!=
info
->
var
.
yres
)
return
-
EINVAL
;
return
0
;
}
/**
* bw2_set_par - Optional function. Alters the hardware state.
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
bw2_set_par
(
struct
fb_info
*
info
)
{
return
0
;
}
/**
* bw2_blank - Optional function. Blanks the display.
* @blank_mode: the blank mode we want.
...
...
@@ -212,6 +178,15 @@ static int bw2_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma
);
}
static
int
bw2_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
,
struct
fb_info
*
info
)
{
struct
bw2_par
*
par
=
(
struct
bw2_par
*
)
info
->
par
;
return
sbusfb_ioctl_helper
(
cmd
,
arg
,
info
,
FBTYPE_SUN2BW
,
1
,
par
->
fbsize
);
}
/*
* Initialisation
*/
...
...
@@ -387,7 +362,6 @@ static void bw2_init_one(struct sbus_dev *sdev)
bw2_blank
(
0
,
&
all
->
info
);
bw2_set_par
(
&
all
->
info
);
bw2_init_fix
(
&
all
->
info
,
linebytes
);
if
(
register_framebuffer
(
&
all
->
info
)
<
0
)
{
...
...
drivers/video/cg14.c
View file @
86576f53
...
...
@@ -28,8 +28,6 @@
* Local functions.
*/
static
int
cg14_check_var
(
struct
fb_var_screeninfo
*
,
struct
fb_info
*
);
static
int
cg14_set_par
(
struct
fb_info
*
);
static
int
cg14_setcolreg
(
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
struct
fb_info
*
);
...
...
@@ -43,8 +41,6 @@ static int cg14_ioctl(struct inode *, struct file *, unsigned int,
static
struct
fb_ops
cg14_ops
=
{
.
owner
=
THIS_MODULE
,
.
fb_check_var
=
cg14_check_var
,
.
fb_set_par
=
cg14_set_par
,
.
fb_setcolreg
=
cg14_setcolreg
,
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
...
...
@@ -219,39 +215,6 @@ static void __cg14_reset(struct cg14_par *par)
sbus_writeb
(
val
,
&
regs
->
mcr
);
}
/**
* cg14_check_var - Optional function. Validates a var passed in.
* @var: frame buffer variable screen structure
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
cg14_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
{
if
(
var
->
bits_per_pixel
!=
8
)
return
-
EINVAL
;
if
(
var
->
xres_virtual
!=
var
->
xres
||
var
->
yres_virtual
!=
var
->
yres
)
return
-
EINVAL
;
if
(
var
->
nonstd
)
return
-
EINVAL
;
if
((
var
->
vmode
&
FB_VMODE_MASK
)
!=
FB_VMODE_NONINTERLACED
)
return
-
EINVAL
;
if
(
var
->
xres
!=
info
->
var
.
xres
||
var
->
yres
!=
info
->
var
.
yres
)
return
-
EINVAL
;
return
0
;
}
/**
* cg14_set_par - Optional function. Alters the hardware state.
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
cg14_set_par
(
struct
fb_info
*
info
)
{
return
0
;
}
/**
* cg14_setcolreg - Optional function. Sets a color register.
* @regno: boolean, 0 copy local, 1 get_user() function
...
...
@@ -358,7 +321,8 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break
;
default:
ret
=
-
EINVAL
;
ret
=
sbusfb_ioctl_helper
(
cmd
,
arg
,
info
,
FBTYPE_MDICOLOR
,
24
,
par
->
fbsize
);
break
;
};
...
...
@@ -523,7 +487,6 @@ static void cg14_init_one(struct sbus_dev *sdev, int node, int parent_node)
return
;
}
cg14_set_par
(
&
all
->
info
);
cg14_init_fix
(
&
all
->
info
,
linebytes
);
if
(
register_framebuffer
(
&
all
->
info
)
<
0
)
{
...
...
drivers/video/cg3.c
View file @
86576f53
...
...
@@ -29,13 +29,13 @@
* Local functions.
*/
static
int
cg3_check_var
(
struct
fb_var_screeninfo
*
,
struct
fb_info
*
);
static
int
cg3_set_par
(
struct
fb_info
*
);
static
int
cg3_setcolreg
(
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
struct
fb_info
*
);
static
int
cg3_blank
(
int
,
struct
fb_info
*
);
static
int
cg3_mmap
(
struct
fb_info
*
,
struct
file
*
,
struct
vm_area_struct
*
);
static
int
cg3_ioctl
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
,
struct
fb_info
*
);
/*
* Frame buffer operations
...
...
@@ -43,14 +43,13 @@ static int cg3_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static
struct
fb_ops
cg3_ops
=
{
.
owner
=
THIS_MODULE
,
.
fb_check_var
=
cg3_check_var
,
.
fb_set_par
=
cg3_set_par
,
.
fb_setcolreg
=
cg3_setcolreg
,
.
fb_blank
=
cg3_blank
,
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_mmap
=
cg3_mmap
,
.
fb_ioctl
=
cg3_ioctl
,
.
fb_cursor
=
soft_cursor
,
};
...
...
@@ -126,39 +125,6 @@ struct cg3_par {
struct
list_head
list
;
};
/**
* cg3_check_var - Optional function. Validates a var passed in.
* @var: frame buffer variable screen structure
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
cg3_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
{
if
(
var
->
bits_per_pixel
!=
8
)
return
-
EINVAL
;
if
(
var
->
xres_virtual
!=
var
->
xres
||
var
->
yres_virtual
!=
var
->
yres
)
return
-
EINVAL
;
if
(
var
->
nonstd
)
return
-
EINVAL
;
if
((
var
->
vmode
&
FB_VMODE_MASK
)
!=
FB_VMODE_NONINTERLACED
)
return
-
EINVAL
;
if
(
var
->
xres
!=
info
->
var
.
xres
||
var
->
yres
!=
info
->
var
.
yres
)
return
-
EINVAL
;
return
0
;
}
/**
* cg3_set_par - Optional function. Alters the hardware state.
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
cg3_set_par
(
struct
fb_info
*
info
)
{
return
0
;
}
/**
* cg3_setcolreg - Optional function. Sets a color register.
* @regno: boolean, 0 copy local, 1 get_user() function
...
...
@@ -269,6 +235,15 @@ static int cg3_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma
);
}
static
int
cg3_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
,
struct
fb_info
*
info
)
{
struct
cg3_par
*
par
=
(
struct
cg3_par
*
)
info
->
par
;
return
sbusfb_ioctl_helper
(
cmd
,
arg
,
info
,
FBTYPE_SUN3COLOR
,
8
,
par
->
fbsize
);
}
/*
* Initialisation
*/
...
...
@@ -445,7 +420,6 @@ static void cg3_init_one(struct sbus_dev *sdev)
return
;
}
cg3_set_par
(
&
all
->
info
);
cg3_init_fix
(
&
all
->
info
,
linebytes
);
if
(
register_framebuffer
(
&
all
->
info
)
<
0
)
{
...
...
drivers/video/cg6.c
View file @
86576f53
...
...
@@ -29,8 +29,6 @@
* Local functions.
*/
static
int
cg6_check_var
(
struct
fb_var_screeninfo
*
,
struct
fb_info
*
);
static
int
cg6_set_par
(
struct
fb_info
*
);
static
int
cg6_setcolreg
(
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
struct
fb_info
*
);
static
int
cg6_blank
(
int
,
struct
fb_info
*
);
...
...
@@ -39,6 +37,8 @@ static void cg6_imageblit(struct fb_info *, struct fb_image *);
static
void
cg6_fillrect
(
struct
fb_info
*
,
struct
fb_fillrect
*
);
static
int
cg6_sync
(
struct
fb_info
*
);
static
int
cg6_mmap
(
struct
fb_info
*
,
struct
file
*
,
struct
vm_area_struct
*
);
static
int
cg6_ioctl
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
,
struct
fb_info
*
);
/*
* Frame buffer operations
...
...
@@ -46,8 +46,6 @@ static int cg6_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static
struct
fb_ops
cg6_ops
=
{
.
owner
=
THIS_MODULE
,
.
fb_check_var
=
cg6_check_var
,
.
fb_set_par
=
cg6_set_par
,
.
fb_setcolreg
=
cg6_setcolreg
,
.
fb_blank
=
cg6_blank
,
.
fb_fillrect
=
cg6_fillrect
,
...
...
@@ -55,6 +53,7 @@ static struct fb_ops cg6_ops = {
.
fb_imageblit
=
cg6_imageblit
,
.
fb_sync
=
cg6_sync
,
.
fb_mmap
=
cg6_mmap
,
.
fb_ioctl
=
cg6_ioctl
,
.
fb_cursor
=
soft_cursor
,
};
...
...
@@ -405,39 +404,6 @@ static void cg6_imageblit(struct fb_info *info, struct fb_image *image)
spin_unlock_irqrestore
(
&
par
->
lock
,
flags
);
}
/**
* cg6_check_var - Optional function. Validates a var passed in.
* @var: frame buffer variable screen structure
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
cg6_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
{
if
(
var
->
bits_per_pixel
!=
8
)
return
-
EINVAL
;
if
(
var
->
xres_virtual
!=
var
->
xres
||
var
->
yres_virtual
!=
var
->
yres
)
return
-
EINVAL
;
if
(
var
->
nonstd
)
return
-
EINVAL
;
if
((
var
->
vmode
&
FB_VMODE_MASK
)
!=
FB_VMODE_NONINTERLACED
)
return
-
EINVAL
;
if
(
var
->
xres
!=
info
->
var
.
xres
||
var
->
yres
!=
info
->
var
.
yres
)
return
-
EINVAL
;
return
0
;
}
/**
* cg6_set_par - Optional function. Alters the hardware state.
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
cg6_set_par
(
struct
fb_info
*
info
)
{
return
0
;
}
/**
* cg6_setcolreg - Optional function. Sets a color register.
* @regno: boolean, 0 copy local, 1 get_user() function
...
...
@@ -535,6 +501,15 @@ static int cg6_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma
);
}
static
int
cg6_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
,
struct
fb_info
*
info
)
{
struct
cg6_par
*
par
=
(
struct
cg6_par
*
)
info
->
par
;
return
sbusfb_ioctl_helper
(
cmd
,
arg
,
info
,
FBTYPE_SUNFAST_COLOR
,
8
,
par
->
fbsize
);
}
/*
* Initialisation
*/
...
...
@@ -731,7 +706,6 @@ static void cg6_init_one(struct sbus_dev *sdev)
return
;
}
cg6_set_par
(
&
all
->
info
);
cg6_init_fix
(
&
all
->
info
,
linebytes
);
if
(
register_framebuffer
(
&
all
->
info
)
<
0
)
{
...
...
drivers/video/ffb.c
View file @
86576f53
...
...
@@ -20,6 +20,7 @@
#include <asm/io.h>
#include <asm/upa.h>
#include <asm/oplib.h>
#include <asm/fbio.h>
#include "sbuslib.h"
...
...
@@ -27,8 +28,6 @@
* Local functions.
*/
static
int
ffb_check_var
(
struct
fb_var_screeninfo
*
,
struct
fb_info
*
);
static
int
ffb_set_par
(
struct
fb_info
*
);
static
int
ffb_setcolreg
(
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
struct
fb_info
*
);
static
int
ffb_blank
(
int
,
struct
fb_info
*
);
...
...
@@ -39,6 +38,8 @@ static void ffb_fillrect(struct fb_info *, struct fb_fillrect *);
static
void
ffb_copyarea
(
struct
fb_info
*
,
struct
fb_copyarea
*
);
static
int
ffb_sync
(
struct
fb_info
*
);
static
int
ffb_mmap
(
struct
fb_info
*
,
struct
file
*
,
struct
vm_area_struct
*
);
static
int
ffb_ioctl
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
,
struct
fb_info
*
);
/*
* Frame buffer operations
...
...
@@ -46,8 +47,6 @@ static int ffb_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static
struct
fb_ops
ffb_ops
=
{
.
owner
=
THIS_MODULE
,
.
fb_check_var
=
ffb_check_var
,
.
fb_set_par
=
ffb_set_par
,
.
fb_setcolreg
=
ffb_setcolreg
,
.
fb_blank
=
ffb_blank
,
.
fb_fillrect
=
ffb_fillrect
,
...
...
@@ -55,6 +54,7 @@ static struct fb_ops ffb_ops = {
.
fb_imageblit
=
ffb_imageblit
,
.
fb_sync
=
ffb_sync
,
.
fb_mmap
=
ffb_mmap
,
.
fb_ioctl
=
ffb_ioctl
,
/* XXX Use FFB hw cursor once fb cursor API is better understood... */
.
fb_cursor
=
soft_cursor
,
...
...
@@ -672,41 +672,6 @@ static void ffb_fixup_var_rgb(struct fb_var_screeninfo *var)
var
->
transp
.
length
=
0
;
}
/**
* ffb_check_var - Optional function. Validates a var passed in.
* @var: frame buffer variable screen structure
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
ffb_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
{
if
(
var
->
bits_per_pixel
!=
32
)
return
-
EINVAL
;
if
(
var
->
xres_virtual
!=
var
->
xres
||
var
->
yres_virtual
!=
var
->
yres
)
return
-
EINVAL
;
if
(
var
->
nonstd
)
return
-
EINVAL
;
if
((
var
->
vmode
&
FB_VMODE_MASK
)
!=
FB_VMODE_NONINTERLACED
)
return
-
EINVAL
;
if
(
var
->
xres
!=
info
->
var
.
xres
||
var
->
yres
!=
info
->
var
.
yres
)
return
-
EINVAL
;
ffb_fixup_var_rgb
(
var
);
return
0
;
}
/**
* ffb_set_par - Optional function. Alters the hardware state.
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
ffb_set_par
(
struct
fb_info
*
info
)
{
return
0
;
}
/**
* ffb_setcolreg - Optional function. Sets a color register.
* @regno: boolean, 0 copy local, 1 get_user() function
...
...
@@ -818,6 +783,15 @@ static int ffb_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
0
,
vma
);
}
static
int
ffb_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
,
struct
fb_info
*
info
)
{
struct
ffb_par
*
par
=
(
struct
ffb_par
*
)
info
->
par
;
return
sbusfb_ioctl_helper
(
cmd
,
arg
,
info
,
FBTYPE_CREATOR
,
24
,
par
->
fbsize
);
}
/*
* Initialisation
*/
...
...
@@ -972,7 +946,6 @@ static void ffb_init_one(int node, int parent)
return
;
}
ffb_set_par
(
&
all
->
info
);
ffb_init_fix
(
&
all
->
info
);
if
(
register_framebuffer
(
&
all
->
info
)
<
0
)
{
...
...
drivers/video/p9100.c
View file @
86576f53
...
...
@@ -27,13 +27,13 @@
* Local functions.
*/
static
int
p9100_check_var
(
struct
fb_var_screeninfo
*
,
struct
fb_info
*
);
static
int
p9100_set_par
(
struct
fb_info
*
);
static
int
p9100_setcolreg
(
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
struct
fb_info
*
);
static
int
p9100_blank
(
int
,
struct
fb_info
*
);
static
int
p9100_mmap
(
struct
fb_info
*
,
struct
file
*
,
struct
vm_area_struct
*
);
static
int
p9100_ioctl
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
,
struct
fb_info
*
);
/*
* Frame buffer operations
...
...
@@ -41,14 +41,13 @@ static int p9100_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static
struct
fb_ops
p9100_ops
=
{
.
owner
=
THIS_MODULE
,
.
fb_check_var
=
p9100_check_var
,
.
fb_set_par
=
p9100_set_par
,
.
fb_setcolreg
=
p9100_setcolreg
,
.
fb_blank
=
p9100_blank
,
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_mmap
=
p9100_mmap
,
.
fb_ioctl
=
p9100_ioctl
,
.
fb_cursor
=
soft_cursor
,
};
...
...
@@ -142,39 +141,6 @@ struct p9100_par {
struct
list_head
list
;
};
/**
* p9100_check_var - Optional function. Validates a var passed in.
* @var: frame buffer variable screen structure
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
p9100_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
{
if
(
var
->
bits_per_pixel
!=
8
)
return
-
EINVAL
;
if
(
var
->
xres_virtual
!=
var
->
xres
||
var
->
yres_virtual
!=
var
->
yres
)
return
-
EINVAL
;
if
(
var
->
nonstd
)
return
-
EINVAL
;
if
((
var
->
vmode
&
FB_VMODE_MASK
)
!=
FB_VMODE_NONINTERLACED
)
return
-
EINVAL
;
if
(
var
->
xres
!=
info
->
var
.
xres
||
var
->
yres
!=
info
->
var
.
yres
)
return
-
EINVAL
;
return
0
;
}
/**
* p9100_set_par - Optional function. Alters the hardware state.
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
p9100_set_par
(
struct
fb_info
*
info
)
{
return
0
;
}
/**
* p9100_setcolreg - Optional function. Sets a color register.
* @regno: boolean, 0 copy local, 1 get_user() function
...
...
@@ -265,6 +231,16 @@ static int p9100_mmap(struct fb_info *info, struct file *file, struct vm_area_st
vma
);
}
static
int
p9100_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
,
struct
fb_info
*
info
)
{
struct
p9100_par
*
par
=
(
struct
p9100_par
*
)
info
->
par
;
/* Make it look like a cg3. */
return
sbusfb_ioctl_helper
(
cmd
,
arg
,
info
,
FBTYPE_SUN3COLOR
,
8
,
par
->
fbsize
);
}
/*
* Initialisation
*/
...
...
@@ -344,7 +320,6 @@ static void p9100_init_one(struct sbus_dev *sdev)
return
;
}
p9100_set_par
(
&
all
->
info
);
p9100_init_fix
(
&
all
->
info
,
linebytes
);
if
(
register_framebuffer
(
&
all
->
info
)
<
0
)
{
...
...
drivers/video/sbuslib.c
View file @
86576f53
...
...
@@ -9,6 +9,7 @@
#include <linux/fb.h>
#include <asm/oplib.h>
#include <asm/fbio.h>
#include "sbuslib.h"
...
...
@@ -83,3 +84,84 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map,
return
0
;
}
EXPORT_SYMBOL
(
sbusfb_mmap_helper
);
int
sbusfb_ioctl_helper
(
unsigned
long
cmd
,
unsigned
long
arg
,
struct
fb_info
*
info
,
int
type
,
int
fb_depth
,
unsigned
long
fb_size
)
{
switch
(
cmd
)
{
case
FBIOGTYPE
:
{
struct
fbtype
*
f
=
(
struct
fbtype
*
)
arg
;
if
(
put_user
(
type
,
&
f
->
fb_type
)
||
__put_user
(
info
->
var
.
yres
,
&
f
->
fb_height
)
||
__put_user
(
info
->
var
.
xres
,
&
f
->
fb_width
)
||
__put_user
(
fb_depth
,
&
f
->
fb_depth
)
||
__put_user
(
0
,
&
f
->
fb_cmsize
)
||
__put_user
(
fb_size
,
&
f
->
fb_cmsize
))
return
-
EFAULT
;
return
0
;
}
case
FBIOPUTCMAP_SPARC
:
{
struct
fbcmap
*
c
=
(
struct
fbcmap
*
)
arg
;
struct
fb_cmap
cmap
;
u16
red
,
green
,
blue
;
unsigned
char
*
ured
,
*
ugreen
,
*
ublue
;
int
index
,
count
,
i
;
if
(
get_user
(
index
,
&
c
->
index
)
||
__get_user
(
count
,
&
c
->
count
)
||
__get_user
(
ured
,
&
c
->
red
)
||
__get_user
(
ugreen
,
&
c
->
green
)
||
__get_user
(
ublue
,
&
c
->
blue
))
return
-
EFAULT
;
cmap
.
len
=
1
;
cmap
.
red
=
&
red
;
cmap
.
green
=
&
green
;
cmap
.
blue
=
&
blue
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
int
err
;
if
(
get_user
(
red
,
&
ured
[
i
])
||
get_user
(
green
,
&
ugreen
[
i
])
||
get_user
(
blue
,
&
ublue
[
i
]))
return
-
EFAULT
;
cmap
.
start
=
index
+
i
;
err
=
fb_set_cmap
(
&
cmap
,
0
,
info
);
if
(
err
)
return
err
;
}
return
0
;
}
case
FBIOGETCMAP_SPARC
:
{
struct
fbcmap
*
c
=
(
struct
fbcmap
*
)
arg
;
unsigned
char
*
ured
,
*
ugreen
,
*
ublue
;
struct
fb_cmap
*
cmap
=
&
info
->
cmap
;
int
index
,
count
,
i
;
if
(
get_user
(
index
,
&
c
->
index
)
||
__get_user
(
count
,
&
c
->
count
)
||
__get_user
(
ured
,
&
c
->
red
)
||
__get_user
(
ugreen
,
&
c
->
green
)
||
__get_user
(
ublue
,
&
c
->
blue
))
return
-
EFAULT
;
if
(
index
+
count
>
cmap
->
len
)
return
-
EINVAL
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
put_user
(
cmap
->
red
[
index
+
i
],
&
ured
[
i
])
||
put_user
(
cmap
->
green
[
index
+
i
],
&
ugreen
[
i
])
||
put_user
(
cmap
->
blue
[
index
+
i
],
&
ublue
[
i
]))
return
-
EFAULT
;
}
return
0
;
}
default:
return
-
EINVAL
;
};
}
EXPORT_SYMBOL
(
sbusfb_ioctl_helper
);
drivers/video/sbuslib.h
View file @
86576f53
...
...
@@ -17,5 +17,8 @@ extern int sbusfb_mmap_helper(struct sbus_mmap_map *map,
unsigned
long
physbase
,
unsigned
long
fbsize
,
unsigned
long
iospace
,
struct
vm_area_struct
*
vma
);
int
sbusfb_ioctl_helper
(
unsigned
long
cmd
,
unsigned
long
arg
,
struct
fb_info
*
info
,
int
type
,
int
fb_depth
,
unsigned
long
fb_size
);
#endif
/* _SBUSLIB_H */
drivers/video/tcx.c
View file @
86576f53
...
...
@@ -29,13 +29,13 @@
* Local functions.
*/
static
int
tcx_check_var
(
struct
fb_var_screeninfo
*
,
struct
fb_info
*
);
static
int
tcx_set_par
(
struct
fb_info
*
);
static
int
tcx_setcolreg
(
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
struct
fb_info
*
);
static
int
tcx_blank
(
int
,
struct
fb_info
*
);
static
int
tcx_mmap
(
struct
fb_info
*
,
struct
file
*
,
struct
vm_area_struct
*
);
static
int
tcx_ioctl
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
,
struct
fb_info
*
);
/*
* Frame buffer operations
...
...
@@ -43,14 +43,13 @@ static int tcx_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
static
struct
fb_ops
tcx_ops
=
{
.
owner
=
THIS_MODULE
,
.
fb_check_var
=
tcx_check_var
,
.
fb_set_par
=
tcx_set_par
,
.
fb_setcolreg
=
tcx_setcolreg
,
.
fb_blank
=
tcx_blank
,
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_mmap
=
tcx_mmap
,
.
fb_ioctl
=
tcx_ioctl
,
.
fb_cursor
=
soft_cursor
,
};
...
...
@@ -154,39 +153,6 @@ static void tcx_reset (struct fb_info *info)
spin_unlock_irqrestore
(
&
par
->
lock
,
flags
);
}
/**
* tcx_check_var - Optional function. Validates a var passed in.
* @var: frame buffer variable screen structure
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
tcx_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
{
if
(
var
->
bits_per_pixel
!=
8
)
return
-
EINVAL
;
if
(
var
->
xres_virtual
!=
var
->
xres
||
var
->
yres_virtual
!=
var
->
yres
)
return
-
EINVAL
;
if
(
var
->
nonstd
)
return
-
EINVAL
;
if
((
var
->
vmode
&
FB_VMODE_MASK
)
!=
FB_VMODE_NONINTERLACED
)
return
-
EINVAL
;
if
(
var
->
xres
!=
info
->
var
.
xres
||
var
->
yres
!=
info
->
var
.
yres
)
return
-
EINVAL
;
return
0
;
}
/**
* tcx_set_par - Optional function. Alters the hardware state.
* @info: frame buffer structure that represents a single frame buffer
*/
static
int
tcx_set_par
(
struct
fb_info
*
info
)
{
return
0
;
}
/**
* tcx_setcolreg - Optional function. Sets a color register.
* @regno: boolean, 0 copy local, 1 get_user() function
...
...
@@ -298,6 +264,17 @@ static int tcx_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma
);
}
static
int
tcx_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
,
struct
fb_info
*
info
)
{
struct
tcx_par
*
par
=
(
struct
tcx_par
*
)
info
->
par
;
return
sbusfb_ioctl_helper
(
cmd
,
arg
,
info
,
FBTYPE_TCXCOLOR
,
(
par
->
lowdepth
?
8
:
24
),
par
->
fbsize
);
}
/*
* Initialisation
*/
...
...
@@ -431,7 +408,6 @@ static void tcx_init_one(struct sbus_dev *sdev)
return
;
}
tcx_set_par
(
&
all
->
info
);
tcx_init_fix
(
&
all
->
info
,
linebytes
);
if
(
register_framebuffer
(
&
all
->
info
)
<
0
)
{
...
...
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