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
743b21c5
Commit
743b21c5
authored
Feb 26, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FRAMEBUFFER]: cfbcopyarea accesses fb without using FB_{READ,WRITE}L.
parent
ecac8e31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
52 deletions
+52
-52
drivers/video/cfbcopyarea.c
drivers/video/cfbcopyarea.c
+52
-52
No files found.
drivers/video/cfbcopyarea.c
View file @
743b21c5
...
...
@@ -65,14 +65,14 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
// Single word
if
(
last
)
first
&=
last
;
FB_WRITEL
((
*
src
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
}
else
{
// Multiple destination words
// Leading bits
if
(
first
)
{
FB_WRITEL
((
*
src
&
first
)
|
(
FB_READL
(
dst
)
&
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
dst
++
;
src
++
;
...
...
@@ -82,21 +82,21 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
// Main chunk
n
/=
BITS_PER_LONG
;
while
(
n
>=
8
)
{
FB_WRITEL
(
*
src
++
,
dst
++
);
FB_WRITEL
(
*
src
++
,
dst
++
);
FB_WRITEL
(
*
src
++
,
dst
++
);
FB_WRITEL
(
*
src
++
,
dst
++
);
FB_WRITEL
(
*
src
++
,
dst
++
);
FB_WRITEL
(
*
src
++
,
dst
++
);
FB_WRITEL
(
*
src
++
,
dst
++
);
FB_WRITEL
(
*
src
++
,
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
)
,
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
)
,
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
)
,
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
)
,
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
)
,
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
)
,
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
)
,
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
)
,
dst
++
);
n
-=
8
;
}
while
(
n
--
)
FB_WRITEL
(
*
src
++
,
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
)
,
dst
++
);
// Trailing bits
if
(
last
)
FB_WRITEL
((
*
src
&
last
)
|
(
FB_READL
(
dst
)
&
FB_WRITEL
((
FB_READL
(
src
)
&
last
)
|
(
FB_READL
(
dst
)
&
~
last
),
dst
);
}
}
else
{
...
...
@@ -111,22 +111,22 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
first
&=
last
;
if
(
shift
>
0
)
{
// Single source word
FB_WRITEL
(((
*
src
>>
right
)
&
first
)
|
FB_WRITEL
(((
FB_READL
(
src
)
>>
right
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
}
else
if
(
src_idx
+
n
<=
BITS_PER_LONG
)
{
// Single source word
FB_WRITEL
(((
*
src
<<
left
)
&
first
)
|
FB_WRITEL
(((
FB_READL
(
src
)
<<
left
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
}
else
{
// 2 source words
d0
=
*
src
++
;
d1
=
*
src
;
d0
=
FB_READL
(
src
++
)
;
d1
=
FB_READL
(
src
)
;
FB_WRITEL
(((
d0
<<
left
|
d1
>>
right
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
}
}
else
{
// Multiple destination words
d0
=
*
src
++
;
d0
=
FB_READL
(
src
++
)
;
// Leading bits
if
(
shift
>
0
)
{
// Single source word
...
...
@@ -136,7 +136,7 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
n
-=
BITS_PER_LONG
-
dst_idx
;
}
else
{
// 2 source words
d1
=
*
src
++
;
d1
=
FB_READL
(
src
++
)
;
FB_WRITEL
(((
d0
<<
left
|
d1
>>
right
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
d0
=
d1
;
...
...
@@ -148,22 +148,22 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
m
=
n
%
BITS_PER_LONG
;
n
/=
BITS_PER_LONG
;
while
(
n
>=
4
)
{
d1
=
*
src
++
;
d1
=
FB_READL
(
src
++
)
;
FB_WRITEL
(
d0
<<
left
|
d1
>>
right
,
dst
++
);
d0
=
d1
;
d1
=
*
src
++
;
d1
=
FB_READL
(
src
++
)
;
FB_WRITEL
(
d0
<<
left
|
d1
>>
right
,
dst
++
);
d0
=
d1
;
d1
=
*
src
++
;
d1
=
FB_READL
(
src
++
)
;
FB_WRITEL
(
d0
<<
left
|
d1
>>
right
,
dst
++
);
d0
=
d1
;
d1
=
*
src
++
;
d1
=
FB_READL
(
src
++
)
;
FB_WRITEL
(
d0
<<
left
|
d1
>>
right
,
dst
++
);
d0
=
d1
;
n
-=
4
;
}
while
(
n
--
)
{
d1
=
*
src
++
;
d1
=
FB_READL
(
src
++
)
;
FB_WRITEL
(
d0
<<
left
|
d1
>>
right
,
dst
++
);
d0
=
d1
;
}
...
...
@@ -177,7 +177,7 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
dst
);
}
else
{
// 2 source words
d1
=
*
src
;
d1
=
FB_READL
(
src
)
;
FB_WRITEL
(((
d0
<<
left
|
d1
>>
right
)
&
last
)
|
(
FB_READL
(
dst
)
&
~
last
),
dst
);
...
...
@@ -220,13 +220,13 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
// Single word
if
(
last
)
first
&=
last
;
FB_WRITEL
((
*
src
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
}
else
{
// Multiple destination words
// Leading bits
if
(
first
)
{
FB_WRITEL
((
*
src
&
first
)
|
(
FB_READL
(
dst
)
&
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
dst
--
;
src
--
;
...
...
@@ -236,22 +236,22 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
// Main chunk
n
/=
BITS_PER_LONG
;
while
(
n
>=
8
)
{
FB_WRITEL
(
*
src
--
,
dst
--
);
FB_WRITEL
(
*
src
--
,
dst
--
);
FB_WRITEL
(
*
src
--
,
dst
--
);
FB_WRITEL
(
*
src
--
,
dst
--
);
FB_WRITEL
(
*
src
--
,
dst
--
);
FB_WRITEL
(
*
src
--
,
dst
--
);
FB_WRITEL
(
*
src
--
,
dst
--
);
FB_WRITEL
(
*
src
--
,
dst
--
);
FB_WRITEL
(
FB_READL
(
src
--
)
,
dst
--
);
FB_WRITEL
(
FB_READL
(
src
--
)
,
dst
--
);
FB_WRITEL
(
FB_READL
(
src
--
)
,
dst
--
);
FB_WRITEL
(
FB_READL
(
src
--
)
,
dst
--
);
FB_WRITEL
(
FB_READL
(
src
--
)
,
dst
--
);
FB_WRITEL
(
FB_READL
(
src
--
)
,
dst
--
);
FB_WRITEL
(
FB_READL
(
src
--
)
,
dst
--
);
FB_WRITEL
(
FB_READL
(
src
--
)
,
dst
--
);
n
-=
8
;
}
while
(
n
--
)
FB_WRITEL
(
*
src
--
,
dst
--
);
FB_WRITEL
(
FB_READL
(
src
--
)
,
dst
--
);
// Trailing bits
if
(
last
)
FB_WRITEL
((
*
src
&
last
)
|
(
FB_READL
(
dst
)
&
FB_WRITEL
((
FB_READL
(
src
)
&
last
)
|
(
FB_READL
(
dst
)
&
~
last
),
dst
);
}
}
else
{
...
...
@@ -266,22 +266,22 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
first
&=
last
;
if
(
shift
<
0
)
{
// Single source word
FB_WRITEL
((
*
src
<<
left
&
first
)
|
FB_WRITEL
((
FB_READL
(
src
)
<<
left
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
}
else
if
(
1
+
(
unsigned
long
)
src_idx
>=
n
)
{
// Single source word
FB_WRITEL
(((
*
src
>>
right
)
&
first
)
|
FB_WRITEL
(((
FB_READL
(
src
)
>>
right
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
}
else
{
// 2 source words
d0
=
*
src
--
;
d1
=
*
src
;
d0
=
FB_READL
(
src
--
)
;
d1
=
FB_READL
(
src
)
;
FB_WRITEL
(((
d0
>>
right
|
d1
<<
left
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
}
}
else
{
// Multiple destination words
d0
=
*
src
--
;
d0
=
FB_READL
(
src
--
)
;
// Leading bits
if
(
shift
<
0
)
{
// Single source word
...
...
@@ -291,7 +291,7 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
n
-=
dst_idx
+
1
;
}
else
{
// 2 source words
d1
=
*
src
--
;
d1
=
FB_READL
(
src
--
)
;
FB_WRITEL
(((
d0
>>
right
|
d1
<<
left
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
d0
=
d1
;
...
...
@@ -303,22 +303,22 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
m
=
n
%
BITS_PER_LONG
;
n
/=
BITS_PER_LONG
;
while
(
n
>=
4
)
{
d1
=
*
src
--
;
d1
=
FB_READL
(
src
--
)
;
FB_WRITEL
(
d0
>>
right
|
d1
<<
left
,
dst
--
);
d0
=
d1
;
d1
=
*
src
--
;
d1
=
FB_READL
(
src
--
)
;
FB_WRITEL
(
d0
>>
right
|
d1
<<
left
,
dst
--
);
d0
=
d1
;
d1
=
*
src
--
;
d1
=
FB_READL
(
src
--
)
;
FB_WRITEL
(
d0
>>
right
|
d1
<<
left
,
dst
--
);
d0
=
d1
;
d1
=
*
src
--
;
d1
=
FB_READL
(
src
--
)
;
FB_WRITEL
(
d0
>>
right
|
d1
<<
left
,
dst
--
);
d0
=
d1
;
n
-=
4
;
}
while
(
n
--
)
{
d1
=
*
src
--
;
d1
=
FB_READL
(
src
--
)
;
FB_WRITEL
(
d0
>>
right
|
d1
<<
left
,
dst
--
);
d0
=
d1
;
}
...
...
@@ -332,7 +332,7 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
dst
);
}
else
{
// 2 source words
d1
=
*
src
;
d1
=
FB_READL
(
src
)
;
FB_WRITEL
(((
d0
>>
right
|
d1
<<
left
)
&
last
)
|
(
FB_READL
(
dst
)
&
~
last
),
dst
);
...
...
@@ -410,8 +410,8 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
dst_idx
&=
(
BYTES_PER_LONG
-
1
);
src
+=
src_idx
>>
SHIFT_PER_LONG
;
src_idx
&=
(
BYTES_PER_LONG
-
1
);
bitcpy_rev
(
(
unsigned
long
*
)
dst
,
dst_idx
,
(
unsigned
long
*
)
src
,
src_idx
,
bitcpy_rev
(
dst
,
dst_idx
,
src
,
src_idx
,
area
->
width
*
p
->
var
.
bits_per_pixel
);
}
}
else
{
...
...
@@ -420,8 +420,8 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
dst_idx
&=
(
BYTES_PER_LONG
-
1
);
src
+=
src_idx
>>
SHIFT_PER_LONG
;
src_idx
&=
(
BYTES_PER_LONG
-
1
);
bitcpy
(
(
unsigned
long
*
)
dst
,
dst_idx
,
(
unsigned
long
*
)
src
,
src_idx
,
bitcpy
(
dst
,
dst_idx
,
src
,
src_idx
,
area
->
width
*
p
->
var
.
bits_per_pixel
);
dst_idx
+=
next_line
*
8
;
src_idx
+=
next_line
*
8
;
...
...
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