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
0caf4186
Commit
0caf4186
authored
Apr 11, 2003
by
James Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[RIVA FBDEV] Cursor fixes. Almost done. At least it looks normal most of the time.
parent
b4936449
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
22 deletions
+42
-22
drivers/video/riva/fbdev.c
drivers/video/riva/fbdev.c
+42
-22
No files found.
drivers/video/riva/fbdev.c
View file @
0caf4186
...
@@ -489,28 +489,50 @@ static inline void reverse_order(u32 *l)
...
@@ -489,28 +489,50 @@ static inline void reverse_order(u32 *l)
* rivafb_cursor()
* rivafb_cursor()
*/
*/
static
void
rivafb_load_cursor_image
(
struct
riva_par
*
par
,
u8
*
data
,
static
void
rivafb_load_cursor_image
(
struct
riva_par
*
par
,
u8
*
data
,
u16
bg
,
u16
fg
,
u32
w
,
u32
h
)
u
8
*
mask
,
u
16
bg
,
u16
fg
,
u32
w
,
u32
h
)
{
{
int
i
,
j
,
k
=
0
;
int
i
,
j
,
k
=
0
;
u32
b
,
tmp
;
u32
b
,
m
,
tmp
;
for
(
i
=
0
;
i
<
h
;
i
++
)
{
for
(
i
=
0
;
i
<
h
;
i
++
)
{
b
=
*
((
u32
*
)
data
)
++
;
b
=
*
((
u32
*
)
data
)
++
;
m
=
*
((
u32
*
)
mask
)
++
;
reverse_order
(
&
b
);
reverse_order
(
&
b
);
for
(
j
=
0
;
j
<
w
/
2
;
j
++
)
{
for
(
j
=
0
;
j
<
w
/
2
;
j
++
)
{
tmp
=
0
;
tmp
=
0
;
#if defined (__BIG_ENDIAN)
#if defined (__BIG_ENDIAN)
if
(
m
&
(
1
<<
31
))
{
fg
|=
1
<<
15
;
bg
|=
1
<<
15
;
}
tmp
=
(
b
&
(
1
<<
31
))
?
fg
<<
16
:
bg
<<
16
;
tmp
=
(
b
&
(
1
<<
31
))
?
fg
<<
16
:
bg
<<
16
;
b
<<=
1
;
b
<<=
1
;
m
<<=
1
;
if
(
m
&
(
1
<<
31
))
{
fg
|=
1
<<
15
;
bg
|=
1
<<
15
;
}
tmp
|=
(
b
&
(
1
<<
31
))
?
fg
:
bg
;
tmp
|=
(
b
&
(
1
<<
31
))
?
fg
:
bg
;
b
<<=
1
;
b
<<=
1
;
m
<<=
1
;
#else
#else
if
(
m
&
1
)
{
fg
|=
1
<<
15
;
bg
|=
1
<<
15
;
}
tmp
=
(
b
&
1
)
?
fg
:
bg
;
tmp
=
(
b
&
1
)
?
fg
:
bg
;
b
>>=
1
;
b
>>=
1
;
m
>>=
1
;
if
(
m
&
1
)
{
fg
|=
1
<<
15
;
bg
|=
1
<<
15
;
}
tmp
|=
(
b
&
1
)
?
fg
<<
16
:
bg
<<
16
;
tmp
|=
(
b
&
1
)
?
fg
<<
16
:
bg
<<
16
;
b
>>=
1
;
b
>>=
1
;
m
>>=
1
;
#endif
#endif
writel
(
tmp
,
par
->
riva
.
CURSOR
+
k
++
);
writel
(
tmp
,
par
->
riva
.
CURSOR
+
k
++
);
}
}
...
@@ -1449,7 +1471,8 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
...
@@ -1449,7 +1471,8 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
struct
riva_par
*
par
=
(
struct
riva_par
*
)
info
->
par
;
struct
riva_par
*
par
=
(
struct
riva_par
*
)
info
->
par
;
int
i
,
j
,
d_idx
=
0
,
s_idx
=
0
;
int
i
,
j
,
d_idx
=
0
,
s_idx
=
0
;
u8
data
[
MAX_CURS
*
MAX_CURS
/
8
];
u8
data
[
MAX_CURS
*
MAX_CURS
/
8
];
u16
fg
,
bg
,
size
=
0
;
u8
mask
[
MAX_CURS
*
MAX_CURS
/
8
];
u16
fg
,
bg
;
par
->
riva
.
ShowHideCursor
(
&
par
->
riva
,
0
);
par
->
riva
.
ShowHideCursor
(
&
par
->
riva
,
0
);
...
@@ -1480,43 +1503,40 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
...
@@ -1480,43 +1503,40 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
if
(
cursor
->
set
&
(
FB_CUR_SETSHAPE
|
FB_CUR_SETCMAP
))
{
if
(
cursor
->
set
&
(
FB_CUR_SETSHAPE
|
FB_CUR_SETCMAP
))
{
u32
bg_idx
=
info
->
cursor
.
image
.
bg_color
;
u32
bg_idx
=
info
->
cursor
.
image
.
bg_color
;
u32
fg_idx
=
info
->
cursor
.
image
.
fg_color
;
u32
fg_idx
=
info
->
cursor
.
image
.
fg_color
;
u32
width
=
(
info
->
cursor
.
image
.
width
+
7
)
>>
3
;
u32
s_pitch
=
(
info
->
cursor
.
image
.
width
+
7
)
>>
3
;
u32
d_pitch
=
MAX_CURS
/
8
;
u8
*
dat
=
(
u8
*
)
cursor
->
image
.
data
;
u8
*
dat
=
(
u8
*
)
cursor
->
image
.
data
;
u8
*
msk
=
(
u8
*
)
info
->
cursor
.
mask
;
u8
*
msk
=
(
u8
*
)
info
->
cursor
.
mask
;
u8
src
[
64
];
switch
(
info
->
cursor
.
rop
)
{
switch
(
info
->
cursor
.
rop
)
{
case
ROP_XOR
:
case
ROP_XOR
:
for
(
i
=
0
;
i
<
info
->
cursor
.
image
.
height
;
i
++
)
{
for
(
i
=
0
;
i
<
s_pitch
*
info
->
cursor
.
image
.
height
;
i
++
)
for
(
j
=
0
;
j
<
width
;
j
++
)
{
src
[
i
]
=
dat
[
i
]
^
msk
[
i
];
d_idx
=
i
*
MAX_CURS
/
8
+
j
;
data
[
d_idx
]
=
dat
[
s_idx
]
^
msk
[
s_idx
];
s_idx
++
;
}
}
break
;
break
;
case
ROP_COPY
:
case
ROP_COPY
:
default:
default:
for
(
i
=
0
;
i
<
info
->
cursor
.
image
.
height
;
i
++
)
{
for
(
i
=
0
;
i
<
s_pitch
*
info
->
cursor
.
image
.
height
;
i
++
)
for
(
j
=
0
;
j
<
width
;
j
++
)
{
d_idx
=
i
*
MAX_CURS
/
8
+
j
;
src
[
i
]
=
dat
[
i
]
&
msk
[
i
];
data
[
d_idx
]
=
dat
[
s_idx
]
&
msk
[
s_idx
];
s_idx
++
;
}
}
break
;
break
;
}
}
move_buf_aligned
(
info
,
data
,
src
,
d_pitch
,
s_pitch
,
info
->
cursor
.
image
.
height
);
move_buf_aligned
(
info
,
mask
,
msk
,
d_pitch
,
s_pitch
,
info
->
cursor
.
image
.
height
);
bg
=
((
info
->
cmap
.
red
[
bg_idx
]
&
0xf8
)
<<
7
)
|
bg
=
((
info
->
cmap
.
red
[
bg_idx
]
&
0xf8
)
<<
7
)
|
((
info
->
cmap
.
green
[
bg_idx
]
&
0xf8
)
<<
2
)
|
((
info
->
cmap
.
green
[
bg_idx
]
&
0xf8
)
<<
2
)
|
((
info
->
cmap
.
blue
[
bg_idx
]
&
0xf8
)
>>
3
)
|
1
<<
15
;
((
info
->
cmap
.
blue
[
bg_idx
]
&
0xf8
)
>>
3
);
fg
=
((
info
->
cmap
.
red
[
fg_idx
]
&
0xf8
)
<<
7
)
|
fg
=
((
info
->
cmap
.
red
[
fg_idx
]
&
0xf8
)
<<
7
)
|
((
info
->
cmap
.
green
[
fg_idx
]
&
0xf8
)
<<
2
)
|
((
info
->
cmap
.
green
[
fg_idx
]
&
0xf8
)
<<
2
)
|
((
info
->
cmap
.
blue
[
fg_idx
]
&
0xf8
)
>>
3
)
|
1
<<
15
;
((
info
->
cmap
.
blue
[
fg_idx
]
&
0xf8
)
>>
3
);
par
->
riva
.
LockUnlock
(
&
par
->
riva
,
0
);
par
->
riva
.
LockUnlock
(
&
par
->
riva
,
0
);
rivafb_load_cursor_image
(
par
,
data
,
bg
,
fg
,
rivafb_load_cursor_image
(
par
,
data
,
mask
,
bg
,
fg
,
info
->
cursor
.
image
.
width
,
info
->
cursor
.
image
.
width
,
info
->
cursor
.
image
.
height
);
info
->
cursor
.
image
.
height
);
}
}
...
...
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