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
nexedi
linux
Commits
c69d3a9c
Commit
c69d3a9c
authored
Mar 03, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SBUSFB]: Implement enough ioctls to get X working.
parent
8fe573f2
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
158 additions
and
1 deletion
+158
-1
drivers/video/bw2.c
drivers/video/bw2.c
+12
-0
drivers/video/cg14.c
drivers/video/cg14.c
+2
-1
drivers/video/cg3.c
drivers/video/cg3.c
+12
-0
drivers/video/cg6.c
drivers/video/cg6.c
+12
-0
drivers/video/ffb.c
drivers/video/ffb.c
+13
-0
drivers/video/p9100.c
drivers/video/p9100.c
+13
-0
drivers/video/sbuslib.c
drivers/video/sbuslib.c
+78
-0
drivers/video/sbuslib.h
drivers/video/sbuslib.h
+2
-0
drivers/video/tcx.c
drivers/video/tcx.c
+14
-0
No files found.
drivers/video/bw2.c
View file @
c69d3a9c
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
static
int
bw2_blank
(
int
,
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_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
* Frame buffer operations
...
@@ -48,6 +50,7 @@ static struct fb_ops bw2_ops = {
...
@@ -48,6 +50,7 @@ static struct fb_ops bw2_ops = {
.
fb_copyarea
=
cfb_copyarea
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_mmap
=
bw2_mmap
,
.
fb_mmap
=
bw2_mmap
,
.
fb_ioctl
=
bw2_ioctl
,
.
fb_cursor
=
soft_cursor
,
.
fb_cursor
=
soft_cursor
,
};
};
...
@@ -175,6 +178,15 @@ static int bw2_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
...
@@ -175,6 +178,15 @@ static int bw2_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma
);
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
,
info
,
FBTYPE_SUN2BW
,
1
,
par
->
fbsize
);
}
/*
/*
* Initialisation
* Initialisation
*/
*/
...
...
drivers/video/cg14.c
View file @
c69d3a9c
...
@@ -321,7 +321,8 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
...
@@ -321,7 +321,8 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break
;
break
;
default:
default:
ret
=
-
EINVAL
;
ret
=
sbusfb_ioctl_helper
(
cmd
,
info
,
FBTYPE_MDICOLOR
,
24
,
par
->
fbsize
);
break
;
break
;
};
};
...
...
drivers/video/cg3.c
View file @
c69d3a9c
...
@@ -34,6 +34,8 @@ static int cg3_setcolreg(unsigned, unsigned, unsigned, unsigned,
...
@@ -34,6 +34,8 @@ static int cg3_setcolreg(unsigned, unsigned, unsigned, unsigned,
static
int
cg3_blank
(
int
,
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_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
* Frame buffer operations
...
@@ -47,6 +49,7 @@ static struct fb_ops cg3_ops = {
...
@@ -47,6 +49,7 @@ static struct fb_ops cg3_ops = {
.
fb_copyarea
=
cfb_copyarea
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_mmap
=
cg3_mmap
,
.
fb_mmap
=
cg3_mmap
,
.
fb_ioctl
=
cg3_ioctl
,
.
fb_cursor
=
soft_cursor
,
.
fb_cursor
=
soft_cursor
,
};
};
...
@@ -232,6 +235,15 @@ static int cg3_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
...
@@ -232,6 +235,15 @@ static int cg3_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma
);
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
,
info
,
FBTYPE_SUN3COLOR
,
8
,
par
->
fbsize
);
}
/*
/*
* Initialisation
* Initialisation
*/
*/
...
...
drivers/video/cg6.c
View file @
c69d3a9c
...
@@ -37,6 +37,8 @@ static void cg6_imageblit(struct fb_info *, struct fb_image *);
...
@@ -37,6 +37,8 @@ static void cg6_imageblit(struct fb_info *, struct fb_image *);
static
void
cg6_fillrect
(
struct
fb_info
*
,
struct
fb_fillrect
*
);
static
void
cg6_fillrect
(
struct
fb_info
*
,
struct
fb_fillrect
*
);
static
int
cg6_sync
(
struct
fb_info
*
);
static
int
cg6_sync
(
struct
fb_info
*
);
static
int
cg6_mmap
(
struct
fb_info
*
,
struct
file
*
,
struct
vm_area_struct
*
);
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
* Frame buffer operations
...
@@ -51,6 +53,7 @@ static struct fb_ops cg6_ops = {
...
@@ -51,6 +53,7 @@ static struct fb_ops cg6_ops = {
.
fb_imageblit
=
cg6_imageblit
,
.
fb_imageblit
=
cg6_imageblit
,
.
fb_sync
=
cg6_sync
,
.
fb_sync
=
cg6_sync
,
.
fb_mmap
=
cg6_mmap
,
.
fb_mmap
=
cg6_mmap
,
.
fb_ioctl
=
cg6_ioctl
,
.
fb_cursor
=
soft_cursor
,
.
fb_cursor
=
soft_cursor
,
};
};
...
@@ -498,6 +501,15 @@ static int cg6_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
...
@@ -498,6 +501,15 @@ static int cg6_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma
);
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
,
info
,
FBTYPE_SUNFAST_COLOR
,
8
,
par
->
fbsize
);
}
/*
/*
* Initialisation
* Initialisation
*/
*/
...
...
drivers/video/ffb.c
View file @
c69d3a9c
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <asm/io.h>
#include <asm/io.h>
#include <asm/upa.h>
#include <asm/upa.h>
#include <asm/oplib.h>
#include <asm/oplib.h>
#include <asm/fbio.h>
#include "sbuslib.h"
#include "sbuslib.h"
...
@@ -37,6 +38,8 @@ static void ffb_fillrect(struct fb_info *, struct fb_fillrect *);
...
@@ -37,6 +38,8 @@ static void ffb_fillrect(struct fb_info *, struct fb_fillrect *);
static
void
ffb_copyarea
(
struct
fb_info
*
,
struct
fb_copyarea
*
);
static
void
ffb_copyarea
(
struct
fb_info
*
,
struct
fb_copyarea
*
);
static
int
ffb_sync
(
struct
fb_info
*
);
static
int
ffb_sync
(
struct
fb_info
*
);
static
int
ffb_mmap
(
struct
fb_info
*
,
struct
file
*
,
struct
vm_area_struct
*
);
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
* Frame buffer operations
...
@@ -51,6 +54,7 @@ static struct fb_ops ffb_ops = {
...
@@ -51,6 +54,7 @@ static struct fb_ops ffb_ops = {
.
fb_imageblit
=
ffb_imageblit
,
.
fb_imageblit
=
ffb_imageblit
,
.
fb_sync
=
ffb_sync
,
.
fb_sync
=
ffb_sync
,
.
fb_mmap
=
ffb_mmap
,
.
fb_mmap
=
ffb_mmap
,
.
fb_ioctl
=
ffb_ioctl
,
/* XXX Use FFB hw cursor once fb cursor API is better understood... */
/* XXX Use FFB hw cursor once fb cursor API is better understood... */
.
fb_cursor
=
soft_cursor
,
.
fb_cursor
=
soft_cursor
,
...
@@ -779,6 +783,15 @@ static int ffb_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
...
@@ -779,6 +783,15 @@ static int ffb_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
0
,
vma
);
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
,
info
,
FBTYPE_CREATOR
,
24
,
par
->
fbsize
);
}
/*
/*
* Initialisation
* Initialisation
*/
*/
...
...
drivers/video/p9100.c
View file @
c69d3a9c
...
@@ -32,6 +32,8 @@ static int p9100_setcolreg(unsigned, unsigned, unsigned, unsigned,
...
@@ -32,6 +32,8 @@ static int p9100_setcolreg(unsigned, unsigned, unsigned, unsigned,
static
int
p9100_blank
(
int
,
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_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
* Frame buffer operations
...
@@ -45,6 +47,7 @@ static struct fb_ops p9100_ops = {
...
@@ -45,6 +47,7 @@ static struct fb_ops p9100_ops = {
.
fb_copyarea
=
cfb_copyarea
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_mmap
=
p9100_mmap
,
.
fb_mmap
=
p9100_mmap
,
.
fb_ioctl
=
p9100_ioctl
,
.
fb_cursor
=
soft_cursor
,
.
fb_cursor
=
soft_cursor
,
};
};
...
@@ -228,6 +231,16 @@ static int p9100_mmap(struct fb_info *info, struct file *file, struct vm_area_st
...
@@ -228,6 +231,16 @@ static int p9100_mmap(struct fb_info *info, struct file *file, struct vm_area_st
vma
);
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
,
info
,
FBTYPE_SUN3COLOR
,
8
,
par
->
fbsize
);
}
/*
/*
* Initialisation
* Initialisation
*/
*/
...
...
drivers/video/sbuslib.c
View file @
c69d3a9c
...
@@ -83,3 +83,81 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map,
...
@@ -83,3 +83,81 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map,
return
0
;
return
0
;
}
}
EXPORT_SYMBOL
(
sbusfb_mmap_helper
);
int
sbusfb_ioctl_helper
(
unsigned
long
cmd
,
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
,
err
;
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
++
)
{
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
)
break
;
}
return
err
;
}
case
FBIOGETCMAP_SPARC
:
{
struct
fbcmap
*
c
=
(
struct
fbcmap
*
)
arg
;
unsigned
char
*
ured
,
*
ugreen
,
*
ublue
;
struct
fb_cmap
*
cmap
=
&
info
->
cmap
;
int
index
,
count
,
i
,
err
;
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
err
;
}
default:
return
-
EINVAL
;
};
}
EXPORT_SYMBOL
(
sbusfb_ioctl_helper
);
drivers/video/sbuslib.h
View file @
c69d3a9c
...
@@ -17,5 +17,7 @@ extern int sbusfb_mmap_helper(struct sbus_mmap_map *map,
...
@@ -17,5 +17,7 @@ extern int sbusfb_mmap_helper(struct sbus_mmap_map *map,
unsigned
long
physbase
,
unsigned
long
fbsize
,
unsigned
long
physbase
,
unsigned
long
fbsize
,
unsigned
long
iospace
,
unsigned
long
iospace
,
struct
vm_area_struct
*
vma
);
struct
vm_area_struct
*
vma
);
int
sbusfb_ioctl_helper
(
unsigned
long
cmd
,
struct
fb_info
*
info
,
int
type
,
int
fb_depth
,
unsigned
long
fb_size
);
#endif
/* _SBUSLIB_H */
#endif
/* _SBUSLIB_H */
drivers/video/tcx.c
View file @
c69d3a9c
...
@@ -34,6 +34,8 @@ static int tcx_setcolreg(unsigned, unsigned, unsigned, unsigned,
...
@@ -34,6 +34,8 @@ static int tcx_setcolreg(unsigned, unsigned, unsigned, unsigned,
static
int
tcx_blank
(
int
,
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_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
* Frame buffer operations
...
@@ -47,6 +49,7 @@ static struct fb_ops tcx_ops = {
...
@@ -47,6 +49,7 @@ static struct fb_ops tcx_ops = {
.
fb_copyarea
=
cfb_copyarea
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_mmap
=
tcx_mmap
,
.
fb_mmap
=
tcx_mmap
,
.
fb_ioctl
=
tcx_ioctl
,
.
fb_cursor
=
soft_cursor
,
.
fb_cursor
=
soft_cursor
,
};
};
...
@@ -261,6 +264,17 @@ static int tcx_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
...
@@ -261,6 +264,17 @@ static int tcx_mmap(struct fb_info *info, struct file *file, struct vm_area_stru
vma
);
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
,
info
,
FBTYPE_TCXCOLOR
,
(
par
->
lowdepth
?
8
:
24
),
par
->
fbsize
);
}
/*
/*
* Initialisation
* Initialisation
*/
*/
...
...
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