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
1ea48bea
Commit
1ea48bea
authored
Mar 02, 2003
by
James Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GENRIC ACCEL] Megred David Millers changes with my own.
[FBCON] Small scrolling fix.
parent
cbb7f426
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
153 additions
and
137 deletions
+153
-137
drivers/video/cfbcopyarea.c
drivers/video/cfbcopyarea.c
+31
-36
drivers/video/cfbimgblt.c
drivers/video/cfbimgblt.c
+88
-67
drivers/video/console/fbcon.c
drivers/video/console/fbcon.c
+34
-34
No files found.
drivers/video/cfbcopyarea.c
View file @
1ea48bea
...
@@ -65,15 +65,14 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
...
@@ -65,15 +65,14 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
// Single word
// Single word
if
(
last
)
if
(
last
)
first
&=
last
;
first
&=
last
;
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
dst
);
}
else
{
}
else
{
// Multiple destination words
// Multiple destination words
// Leading bits
// Leading bits
if
(
first
)
{
if
(
first
)
{
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
~
first
),
dst
);
(
FB_READL
(
dst
)
&
~
first
),
dst
);
dst
++
;
dst
++
;
src
++
;
src
++
;
n
-=
BITS_PER_LONG
-
dst_idx
;
n
-=
BITS_PER_LONG
-
dst_idx
;
...
@@ -96,8 +95,7 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
...
@@ -96,8 +95,7 @@ static void bitcpy(unsigned long *dst, int dst_idx, const unsigned long *src,
FB_WRITEL
(
FB_READL
(
src
++
),
dst
++
);
FB_WRITEL
(
FB_READL
(
src
++
),
dst
++
);
// Trailing bits
// Trailing bits
if
(
last
)
if
(
last
)
FB_WRITEL
((
FB_READL
(
src
)
&
last
)
|
(
FB_READL
(
dst
)
&
FB_WRITEL
((
FB_READL
(
src
)
&
last
)
|
(
FB_READL
(
dst
)
&
~
last
),
dst
);
~
last
),
dst
);
}
}
}
else
{
}
else
{
// Different alignment for source and dest
// Different alignment for source and dest
...
@@ -220,14 +218,12 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
...
@@ -220,14 +218,12 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
// Single word
// Single word
if
(
last
)
if
(
last
)
first
&=
last
;
first
&=
last
;
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
dst
);
}
else
{
}
else
{
// Multiple destination words
// Multiple destination words
// Leading bits
// Leading bits
if
(
first
)
{
if
(
first
)
{
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
FB_WRITEL
((
FB_READL
(
src
)
&
first
)
|
(
FB_READL
(
dst
)
&
~
first
),
dst
);
~
first
),
dst
);
dst
--
;
dst
--
;
src
--
;
src
--
;
n
-=
dst_idx
+
1
;
n
-=
dst_idx
+
1
;
...
@@ -251,8 +247,7 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
...
@@ -251,8 +247,7 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
// Trailing bits
// Trailing bits
if
(
last
)
if
(
last
)
FB_WRITEL
((
FB_READL
(
src
)
&
last
)
|
(
FB_READL
(
dst
)
&
FB_WRITEL
((
FB_READL
(
src
)
&
last
)
|
(
FB_READL
(
dst
)
&
~
last
),
dst
);
~
last
),
dst
);
}
}
}
else
{
}
else
{
// Different alignment for source and dest
// Different alignment for source and dest
...
@@ -342,8 +337,10 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
...
@@ -342,8 +337,10 @@ static void bitcpy_rev(unsigned long *dst, int dst_idx,
}
}
}
}
void
cfb_copyarea
(
struct
fb_info
*
p
,
struct
fb_copyarea
*
area
)
void
cfb_copyarea
(
struct
fb_info
*
p
,
const
struct
fb_copyarea
*
area
)
{
{
u32
dx
=
area
->
dx
,
dy
=
area
->
dy
,
sx
=
area
->
sx
,
sy
=
area
->
sy
;
u32
height
=
area
->
height
,
width
=
area
->
width
;
int
x2
,
y2
,
old_dx
,
old_dy
,
vxres
,
vyres
;
int
x2
,
y2
,
old_dx
,
old_dy
,
vxres
,
vyres
;
unsigned
long
next_line
=
p
->
fix
.
line_length
;
unsigned
long
next_line
=
p
->
fix
.
line_length
;
int
dst_idx
=
0
,
src_idx
=
0
,
rev_copy
=
0
;
int
dst_idx
=
0
,
src_idx
=
0
,
rev_copy
=
0
;
...
@@ -370,59 +367,57 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
...
@@ -370,59 +367,57 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
*/
*/
x2
=
area
->
dx
+
area
->
width
;
x2
=
area
->
dx
+
area
->
width
;
y2
=
area
->
dy
+
area
->
height
;
y2
=
area
->
dy
+
area
->
height
;
area
->
dx
=
area
->
dx
>
0
?
area
->
dx
:
0
;
dx
=
area
->
dx
>
0
?
area
->
dx
:
0
;
area
->
dy
=
area
->
dy
>
0
?
area
->
dy
:
0
;
dy
=
area
->
dy
>
0
?
area
->
dy
:
0
;
x2
=
x2
<
vxres
?
x2
:
vxres
;
x2
=
x2
<
vxres
?
x2
:
vxres
;
y2
=
y2
<
vyres
?
y2
:
vyres
;
y2
=
y2
<
vyres
?
y2
:
vyres
;
area
->
width
=
x2
-
area
->
dx
;
width
=
x2
-
dx
;
area
->
height
=
y2
-
area
->
dy
;
height
=
y2
-
dy
;
/* update sx1,sy1 */
/* update sx1,sy1 */
area
->
sx
+=
(
area
->
dx
-
old_dx
);
sx
+=
(
dx
-
old_dx
);
area
->
sy
+=
(
area
->
dy
-
old_dy
);
sy
+=
(
dy
-
old_dy
);
/* the source must be completely inside the virtual screen */
/* the source must be completely inside the virtual screen */
if
(
area
->
sx
<
0
||
area
->
sy
<
0
||
if
(
sx
<
0
||
sy
<
0
||
(
area
->
sx
+
area
->
width
)
>
vxres
||
(
sx
+
width
)
>
vxres
||
(
area
->
sy
+
area
->
height
)
>
vyres
)
(
sy
+
height
)
>
vyres
)
return
;
return
;
if
((
area
->
dy
==
area
->
sy
&&
area
->
dx
>
area
->
sx
)
||
if
((
dy
==
sy
&&
dx
>
sx
)
||
(
area
->
dy
>
area
->
sy
))
{
(
dy
>
sy
))
{
area
->
dy
+=
area
->
height
;
dy
+=
height
;
area
->
sy
+=
area
->
height
;
sy
+=
height
;
rev_copy
=
1
;
rev_copy
=
1
;
}
}
dst
=
src
=
(
unsigned
long
*
)((
unsigned
long
)
p
->
screen_base
&
dst
=
src
=
(
unsigned
long
*
)((
unsigned
long
)
p
->
screen_base
&
~
(
BYTES_PER_LONG
-
1
));
~
(
BYTES_PER_LONG
-
1
));
dst_idx
=
src_idx
=
(
unsigned
long
)
p
->
screen_base
&
(
BYTES_PER_LONG
-
1
);
dst_idx
=
src_idx
=
(
unsigned
long
)
p
->
screen_base
&
(
BYTES_PER_LONG
-
1
);
dst_idx
+=
area
->
dy
*
next_line
*
8
+
area
->
dx
*
p
->
var
.
bits_per_pixel
;
dst_idx
+=
dy
*
next_line
*
8
+
dx
*
p
->
var
.
bits_per_pixel
;
src_idx
+=
area
->
sy
*
next_line
*
8
+
area
->
sx
*
p
->
var
.
bits_per_pixel
;
src_idx
+=
sy
*
next_line
*
8
+
sx
*
p
->
var
.
bits_per_pixel
;
if
(
p
->
fbops
->
fb_sync
)
if
(
p
->
fbops
->
fb_sync
)
p
->
fbops
->
fb_sync
(
p
);
p
->
fbops
->
fb_sync
(
p
);
if
(
rev_copy
)
{
if
(
rev_copy
)
{
while
(
area
->
height
--
)
{
while
(
height
--
)
{
dst_idx
-=
next_line
*
8
;
dst_idx
-=
next_line
*
8
;
src_idx
-=
next_line
*
8
;
src_idx
-=
next_line
*
8
;
dst
+=
dst_idx
>>
SHIFT_PER_LONG
;
dst
+=
dst_idx
>>
SHIFT_PER_LONG
;
dst_idx
&=
(
BYTES_PER_LONG
-
1
);
dst_idx
&=
(
BYTES_PER_LONG
-
1
);
src
+=
src_idx
>>
SHIFT_PER_LONG
;
src
+=
src_idx
>>
SHIFT_PER_LONG
;
src_idx
&=
(
BYTES_PER_LONG
-
1
);
src_idx
&=
(
BYTES_PER_LONG
-
1
);
bitcpy_rev
(
dst
,
dst_idx
,
bitcpy_rev
(
dst
,
dst_idx
,
src
,
src_idx
,
src
,
src_idx
,
width
*
p
->
var
.
bits_per_pixel
);
area
->
width
*
p
->
var
.
bits_per_pixel
);
}
}
}
else
{
}
else
{
while
(
area
->
height
--
)
{
while
(
height
--
)
{
dst
+=
dst_idx
>>
SHIFT_PER_LONG
;
dst
+=
dst_idx
>>
SHIFT_PER_LONG
;
dst_idx
&=
(
BYTES_PER_LONG
-
1
);
dst_idx
&=
(
BYTES_PER_LONG
-
1
);
src
+=
src_idx
>>
SHIFT_PER_LONG
;
src
+=
src_idx
>>
SHIFT_PER_LONG
;
src_idx
&=
(
BYTES_PER_LONG
-
1
);
src_idx
&=
(
BYTES_PER_LONG
-
1
);
bitcpy
(
dst
,
dst_idx
,
bitcpy
(
dst
,
dst_idx
,
src
,
src_idx
,
src
,
src_idx
,
width
*
p
->
var
.
bits_per_pixel
);
area
->
width
*
p
->
var
.
bits_per_pixel
);
dst_idx
+=
next_line
*
8
;
dst_idx
+=
next_line
*
8
;
src_idx
+=
next_line
*
8
;
src_idx
+=
next_line
*
8
;
}
}
...
...
drivers/video/cfbimgblt.c
View file @
1ea48bea
...
@@ -73,41 +73,57 @@ static u32 cfb_tab32[] = {
...
@@ -73,41 +73,57 @@ static u32 cfb_tab32[] = {
0x00000000
,
0xffffffff
0x00000000
,
0xffffffff
};
};
#define FB_WRITEL fb_writel
#define FB_READL fb_readl
#if defined (__BIG_ENDIAN)
#if defined (__BIG_ENDIAN)
#define LEFT_POS(bpp) (32 - bpp)
#define LEFT_POS(bpp) (BITS_PER_LONG - bpp)
#define NEXT_POS(pos, bpp) ((pos) -= (bpp))
#define SHIFT_HIGH(val, bits) ((val) >> (bits))
#define SHIFT_HIGH(val, bits) ((val) >> (bits))
#define SHIFT_LOW(val, bits) ((val) << (bits))
#define SHIFT_LOW(val, bits) ((val) << (bits))
#else
#else
#define LEFT_POS(bpp) (0)
#define LEFT_POS(bpp) (0)
#define NEXT_POS(pos, bpp) ((pos) += (bpp))
#define SHIFT_HIGH(val, bits) ((val) << (bits))
#define SHIFT_HIGH(val, bits) ((val) << (bits))
#define SHIFT_LOW(val, bits) ((val) >> (bits))
#define SHIFT_LOW(val, bits) ((val) >> (bits))
#endif
#endif
static
inline
void
color_imageblit
(
struct
fb_image
*
image
,
struct
fb_info
*
p
,
#if BITS_PER_LONG == 32
u8
*
dst1
,
u32
start_index
,
#define FB_WRITEL fb_writel
u32
pitch_index
)
#define FB_READL fb_readl
#define INIT_FASTPATH {}
#define FASTPATH fb_writel((end_mask & eorx)^bgx, dst++)
#else
#define FB_WRITEL fb_writeq
#define FB_READL fb_readq
#define INIT_FASTPATH unsigned long val = 0, bpl = 0
#define FASTPATH { \
val |= SHIFT_HIGH((end_mask & eorx)^bgx, bpl); \
bpl += 32; \
bpl &= BITS_PER_LONG - 1; \
if (!bpl) { \
FB_WRITEL(val, dst++); \
val = 0; \
} \
}
#endif
static
inline
void
color_imageblit
(
const
struct
fb_image
*
image
,
struct
fb_info
*
p
,
u8
*
dst1
,
unsigned
long
start_index
,
unsigned
long
pitch_index
)
{
{
/* Draw the penguin */
/* Draw the penguin */
u
32
*
dst
,
*
dst2
,
color
=
0
,
val
,
shift
;
u
nsigned
long
*
dst
,
*
dst2
,
color
=
0
,
val
,
shift
;
int
i
,
n
,
bpp
=
p
->
var
.
bits_per_pixel
;
int
i
,
n
,
bpp
=
p
->
var
.
bits_per_pixel
;
u
32
null_bits
=
32
-
bpp
;
u
nsigned
long
null_bits
=
BITS_PER_LONG
-
bpp
;
u32
*
palette
=
(
u32
*
)
p
->
pseudo_palette
;
u32
*
palette
=
(
u32
*
)
p
->
pseudo_palette
;
u8
*
src
=
image
->
data
;
u8
*
src
=
(
u8
*
)
image
->
data
;
dst2
=
(
u
32
*
)
dst1
;
dst2
=
(
u
nsigned
long
*
)
dst1
;
for
(
i
=
image
->
height
;
i
--
;
)
{
for
(
i
=
image
->
height
;
i
--
;
)
{
dst
=
(
unsigned
long
*
)
dst1
;
n
=
image
->
width
;
n
=
image
->
width
;
dst
=
(
u32
*
)
dst1
;
shift
=
val
=
0
;
shift
=
0
;
val
=
0
;
if
(
start_index
)
{
if
(
start_index
)
{
u32
start_mask
=
~
(
SHIFT_HIGH
(
~
(
u32
)
0
,
start_index
));
unsigned
long
start_mask
=
~
(
SHIFT_HIGH
(
~
0UL
,
start_index
));
val
=
FB_READL
(
dst
)
&
start_mask
;
val
=
FB_READL
(
dst
)
&
start_mask
;
shift
=
start_index
;
shift
=
start_index
;
}
}
...
@@ -123,14 +139,14 @@ static inline void color_imageblit(struct fb_image *image, struct fb_info *p,
...
@@ -123,14 +139,14 @@ static inline void color_imageblit(struct fb_image *image, struct fb_info *p,
FB_WRITEL
(
val
,
dst
++
);
FB_WRITEL
(
val
,
dst
++
);
val
=
(
shift
==
null_bits
)
?
0
:
val
=
(
shift
==
null_bits
)
?
0
:
SHIFT_LOW
(
color
,
32
-
shift
);
SHIFT_LOW
(
color
,
BITS_PER_LONG
-
shift
);
}
}
shift
+=
bpp
;
shift
+=
bpp
;
shift
&=
(
32
-
1
);
shift
&=
(
BITS_PER_LONG
-
1
);
src
++
;
src
++
;
}
}
if
(
shift
)
{
if
(
shift
)
{
u
32
end_mask
=
SHIFT_HIGH
(
~
(
u32
)
0
,
shift
);
u
nsigned
long
end_mask
=
SHIFT_HIGH
(
~
0UL
,
shift
);
FB_WRITEL
((
FB_READL
(
dst
)
&
end_mask
)
|
val
,
dst
);
FB_WRITEL
((
FB_READL
(
dst
)
&
end_mask
)
|
val
,
dst
);
}
}
...
@@ -138,39 +154,41 @@ static inline void color_imageblit(struct fb_image *image, struct fb_info *p,
...
@@ -138,39 +154,41 @@ static inline void color_imageblit(struct fb_image *image, struct fb_info *p,
if
(
pitch_index
)
{
if
(
pitch_index
)
{
dst2
+=
p
->
fix
.
line_length
;
dst2
+=
p
->
fix
.
line_length
;
dst1
=
(
char
*
)
dst2
;
dst1
=
(
char
*
)
dst2
;
(
unsigned
long
)
dst1
&=
~
(
sizeof
(
u
32
)
-
1
);
(
unsigned
long
)
dst1
&=
~
(
sizeof
(
u
nsigned
long
)
-
1
);
start_index
+=
pitch_index
;
start_index
+=
pitch_index
;
start_index
&=
32
-
1
;
start_index
&=
BITS_PER_LONG
-
1
;
}
}
}
}
}
}
static
inline
void
slow_imageblit
(
struct
fb_image
*
image
,
struct
fb_info
*
p
,
static
inline
void
slow_imageblit
(
const
struct
fb_image
*
image
,
u8
*
dst1
,
u32
fgcolor
,
struct
fb_info
*
p
,
u8
*
dst1
,
u32
bgcolor
,
unsigned
long
fgcolor
,
u32
start_index
,
unsigned
long
bgcolor
,
u32
pitch_index
)
unsigned
long
start_index
,
unsigned
long
pitch_index
)
{
{
u
32
shift
,
color
=
0
,
bpp
=
p
->
var
.
bits_per_pixel
;
u
nsigned
long
shift
,
color
=
0
,
bpp
=
p
->
var
.
bits_per_pixel
;
u
32
*
dst
,
*
dst2
,
val
,
pitch
=
p
->
fix
.
line_length
;
u
nsigned
long
*
dst
,
*
dst2
,
val
,
pitch
=
p
->
fix
.
line_length
;
u
32
null_bits
=
32
-
bpp
;
u
nsigned
long
null_bits
=
BITS_PER_LONG
-
bpp
;
u
32
spitch
=
(
image
->
width
+
7
)
/
8
;
u
nsigned
long
spitch
=
(
image
->
width
+
7
)
/
8
;
u8
*
src
=
image
->
data
,
*
s
;
const
char
*
src
=
image
->
data
,
*
s
;
u
32
i
,
j
,
l
;
u
nsigned
long
i
,
j
,
l
;
dst2
=
(
u
32
*
)
dst1
;
dst2
=
(
u
nsigned
long
*
)
dst1
;
for
(
i
=
image
->
height
;
i
--
;
)
{
for
(
i
=
image
->
height
;
i
--
;
)
{
shift
=
val
=
0
;
dst
=
(
unsigned
long
*
)
dst1
;
l
=
8
;
j
=
image
->
width
;
j
=
image
->
width
;
dst
=
(
u32
*
)
dst1
;
shift
=
val
=
0
;
s
=
src
;
s
=
src
;
l
=
8
;
/* write leading bits */
/* write leading bits */
if
(
start_index
)
{
if
(
start_index
)
{
u32
start_mask
=
~
(
SHIFT_HIGH
(
~
(
u32
)
0
,
start_index
));
unsigned
long
start_mask
=
~
(
SHIFT_HIGH
(
~
0UL
,
start_index
));
val
=
FB_READL
(
dst
)
&
start_mask
;
val
=
FB_READL
(
dst
)
&
start_mask
;
shift
=
start_index
;
shift
=
start_index
;
}
}
...
@@ -185,16 +203,16 @@ static inline void slow_imageblit(struct fb_image *image, struct fb_info *p,
...
@@ -185,16 +203,16 @@ static inline void slow_imageblit(struct fb_image *image, struct fb_info *p,
if
(
shift
>=
null_bits
)
{
if
(
shift
>=
null_bits
)
{
FB_WRITEL
(
val
,
dst
++
);
FB_WRITEL
(
val
,
dst
++
);
val
=
(
shift
==
null_bits
)
?
0
:
val
=
(
shift
==
null_bits
)
?
0
:
SHIFT_LOW
(
color
,
32
-
shift
);
SHIFT_LOW
(
color
,
BITS_PER_LONG
-
shift
);
}
}
shift
+=
bpp
;
shift
+=
bpp
;
shift
&=
(
32
-
1
);
shift
&=
(
BITS_PER_LONG
-
1
);
if
(
!
l
)
{
l
=
8
;
s
++
;
};
if
(
!
l
)
{
l
=
8
;
s
++
;
};
}
}
/* write trailing bits */
/* write trailing bits */
if
(
shift
)
{
if
(
shift
)
{
u
32
end_mask
=
SHIFT_HIGH
(
~
(
u32
)
0
,
shift
);
u
nsigned
long
end_mask
=
SHIFT_HIGH
(
~
0UL
,
shift
);
FB_WRITEL
((
FB_READL
(
dst
)
&
end_mask
)
|
val
,
dst
);
FB_WRITEL
((
FB_READL
(
dst
)
&
end_mask
)
|
val
,
dst
);
}
}
...
@@ -204,10 +222,10 @@ static inline void slow_imageblit(struct fb_image *image, struct fb_info *p,
...
@@ -204,10 +222,10 @@ static inline void slow_imageblit(struct fb_image *image, struct fb_info *p,
if
(
pitch_index
)
{
if
(
pitch_index
)
{
dst2
+=
pitch
;
dst2
+=
pitch
;
dst1
=
(
char
*
)
dst2
;
dst1
=
(
char
*
)
dst2
;
(
unsigned
long
)
dst1
&=
~
(
sizeof
(
u
32
)
-
1
);
(
unsigned
long
)
dst1
&=
~
(
sizeof
(
u
nsigned
long
)
-
1
);
start_index
+=
pitch_index
;
start_index
+=
pitch_index
;
start_index
&=
32
-
1
;
start_index
&=
BITS_PER_LONG
-
1
;
}
}
}
}
...
@@ -221,15 +239,15 @@ static inline void slow_imageblit(struct fb_image *image, struct fb_info *p,
...
@@ -221,15 +239,15 @@ static inline void slow_imageblit(struct fb_image *image, struct fb_info *p,
* fix->line_legth is divisible by 4;
* fix->line_legth is divisible by 4;
* beginning and end of a scanline is dword aligned
* beginning and end of a scanline is dword aligned
*/
*/
static
inline
void
fast_imageblit
(
struct
fb_image
*
image
,
struct
fb_info
*
p
,
static
inline
void
fast_imageblit
(
const
struct
fb_image
*
image
,
u8
*
dst1
,
u32
fgcolor
,
struct
fb_info
*
p
,
u8
*
dst1
,
u32
bgcolor
)
u32
fgcolor
,
u32
bgcolor
)
{
{
u32
fgx
=
fgcolor
,
bgx
=
bgcolor
,
bpp
=
p
->
var
.
bits_per_pixel
;
u32
fgx
=
fgcolor
,
bgx
=
bgcolor
,
bpp
=
p
->
var
.
bits_per_pixel
;
u32
ppw
=
32
/
bpp
,
spitch
=
(
image
->
width
+
7
)
/
8
;
u32
ppw
=
BITS_PER_LONG
/
bpp
,
spitch
=
(
image
->
width
+
7
)
/
8
;
u32
bit_mask
,
end_mask
,
eorx
,
shift
;
u32
bit_mask
,
end_mask
,
eorx
,
shift
;
char
*
s
=
image
->
data
,
*
src
;
c
onst
c
har
*
s
=
image
->
data
,
*
src
;
u
32
*
dst
;
u
nsigned
long
*
dst
;
u32
*
tab
=
NULL
;
u32
*
tab
=
NULL
;
int
i
,
j
,
k
;
int
i
,
j
,
k
;
...
@@ -257,12 +275,13 @@ static inline void fast_imageblit(struct fb_image *image, struct fb_info *p,
...
@@ -257,12 +275,13 @@ static inline void fast_imageblit(struct fb_image *image, struct fb_info *p,
k
=
image
->
width
/
ppw
;
k
=
image
->
width
/
ppw
;
for
(
i
=
image
->
height
;
i
--
;
)
{
for
(
i
=
image
->
height
;
i
--
;
)
{
dst
=
(
u32
*
)
dst1
,
shift
=
8
;
src
=
s
;
dst
=
(
unsigned
long
*
)
dst1
,
shift
=
8
;
src
=
s
;
INIT_FASTPATH
;
for
(
j
=
k
;
j
--
;
)
{
for
(
j
=
k
;
j
--
;
)
{
shift
-=
ppw
;
shift
-=
ppw
;
end_mask
=
tab
[(
*
src
>>
shift
)
&
bit_mask
];
end_mask
=
tab
[(
*
src
>>
shift
)
&
bit_mask
];
F
B_WRITEL
((
end_mask
&
eorx
)
^
bgx
,
dst
++
)
;
F
ASTPATH
;
if
(
!
shift
)
{
shift
=
8
;
src
++
;
}
if
(
!
shift
)
{
shift
=
8
;
src
++
;
}
}
}
dst1
+=
p
->
fix
.
line_length
;
dst1
+=
p
->
fix
.
line_length
;
...
@@ -270,10 +289,12 @@ static inline void fast_imageblit(struct fb_image *image, struct fb_info *p,
...
@@ -270,10 +289,12 @@ static inline void fast_imageblit(struct fb_image *image, struct fb_info *p,
}
}
}
}
void
cfb_imageblit
(
struct
fb_info
*
p
,
struct
fb_image
*
image
)
void
cfb_imageblit
(
struct
fb_info
*
p
,
const
struct
fb_image
*
image
)
{
{
u32
fgcolor
,
bgcolor
,
start_index
,
bitstart
,
pitch_index
=
0
;
unsigned
long
fgcolor
,
bgcolor
,
start_index
,
bitstart
,
pitch_index
=
0
;
u32
bpl
=
sizeof
(
u32
),
bpp
=
p
->
var
.
bits_per_pixel
;
unsigned
long
bpl
=
sizeof
(
unsigned
long
),
bpp
=
p
->
var
.
bits_per_pixel
;
u32
width
=
image
->
width
,
height
=
image
->
height
;
u32
dx
=
image
->
dx
,
dy
=
image
->
dy
;
int
x2
,
y2
,
vxres
,
vyres
;
int
x2
,
y2
,
vxres
,
vyres
;
u8
*
dst1
;
u8
*
dst1
;
...
@@ -289,15 +310,15 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
...
@@ -289,15 +310,15 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
x2
=
image
->
dx
+
image
->
width
;
x2
=
image
->
dx
+
image
->
width
;
y2
=
image
->
dy
+
image
->
height
;
y2
=
image
->
dy
+
image
->
height
;
image
->
dx
=
image
->
dx
>
0
?
image
->
dx
:
0
;
dx
=
image
->
dx
>
0
?
image
->
dx
:
0
;
image
->
dy
=
image
->
dy
>
0
?
image
->
dy
:
0
;
dy
=
image
->
dy
>
0
?
image
->
dy
:
0
;
x2
=
x2
<
vxres
?
x2
:
vxres
;
x2
=
x2
<
vxres
?
x2
:
vxres
;
y2
=
y2
<
vyres
?
y2
:
vyres
;
y2
=
y2
<
vyres
?
y2
:
vyres
;
image
->
width
=
x2
-
image
->
dx
;
width
=
x2
-
dx
;
image
->
height
=
y2
-
image
->
dy
;
height
=
y2
-
dy
;
bitstart
=
(
image
->
dy
*
p
->
fix
.
line_length
*
8
)
+
(
image
->
dx
*
bpp
);
bitstart
=
(
dy
*
p
->
fix
.
line_length
*
8
)
+
(
dx
*
bpp
);
start_index
=
bitstart
&
(
32
-
1
);
start_index
=
bitstart
&
(
BITS_PER_LONG
-
1
);
pitch_index
=
(
p
->
fix
.
line_length
&
(
bpl
-
1
))
*
8
;
pitch_index
=
(
p
->
fix
.
line_length
&
(
bpl
-
1
))
*
8
;
bitstart
/=
8
;
bitstart
/=
8
;
...
@@ -307,7 +328,7 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
...
@@ -307,7 +328,7 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
if
(
p
->
fbops
->
fb_sync
)
if
(
p
->
fbops
->
fb_sync
)
p
->
fbops
->
fb_sync
(
p
);
p
->
fbops
->
fb_sync
(
p
);
if
(
image
->
depth
==
1
)
{
if
(
image
->
depth
==
0
)
{
if
(
p
->
fix
.
visual
==
FB_VISUAL_TRUECOLOR
||
if
(
p
->
fix
.
visual
==
FB_VISUAL_TRUECOLOR
||
p
->
fix
.
visual
==
FB_VISUAL_DIRECTCOLOR
)
{
p
->
fix
.
visual
==
FB_VISUAL_DIRECTCOLOR
)
{
fgcolor
=
((
u32
*
)(
p
->
pseudo_palette
))[
image
->
fg_color
];
fgcolor
=
((
u32
*
)(
p
->
pseudo_palette
))[
image
->
fg_color
];
...
@@ -317,14 +338,14 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
...
@@ -317,14 +338,14 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
bgcolor
=
image
->
bg_color
;
bgcolor
=
image
->
bg_color
;
}
}
if
(
32
%
bpp
==
0
&&
!
start_index
&&
!
pitch_index
&&
if
(
BITS_PER_LONG
%
bpp
==
0
&&
!
start_index
&&
!
pitch_index
&&
((
image
->
width
&
(
32
/
bpp
-
1
))
==
0
)
&&
((
width
&
(
BITS_PER_LONG
/
bpp
-
1
))
==
0
)
&&
bpp
>=
8
&&
bpp
<=
32
)
bpp
>=
8
&&
bpp
<=
32
)
fast_imageblit
(
image
,
p
,
dst1
,
fgcolor
,
bgcolor
);
fast_imageblit
(
image
,
p
,
dst1
,
fgcolor
,
bgcolor
);
else
else
slow_imageblit
(
image
,
p
,
dst1
,
fgcolor
,
bgcolor
,
start_index
,
pitch_index
);
slow_imageblit
(
image
,
p
,
dst1
,
fgcolor
,
bgcolor
,
}
start_index
,
pitch_index
);
else
if
(
image
->
depth
==
bpp
)
}
else
if
(
image
->
depth
==
bpp
)
color_imageblit
(
image
,
p
,
dst1
,
start_index
,
pitch_index
);
color_imageblit
(
image
,
p
,
dst1
,
start_index
,
pitch_index
);
}
}
...
...
drivers/video/console/fbcon.c
View file @
1ea48bea
...
@@ -517,41 +517,41 @@ static void accel_putc(struct vc_data *vc, struct display *p,
...
@@ -517,41 +517,41 @@ static void accel_putc(struct vc_data *vc, struct display *p,
int
c
,
int
ypos
,
int
xpos
)
int
c
,
int
ypos
,
int
xpos
)
{
{
struct
fb_image
image
;
struct
fb_image
image
;
struct
fb_info
*
info
=
p
->
fb_info
;
struct
fb_info
*
info
=
p
->
fb_info
;
unsigned
short
charmask
=
p
->
charmask
;
unsigned
short
charmask
=
p
->
charmask
;
unsigned
int
width
=
(
vc
->
vc_font
.
width
+
7
)
/
8
;
unsigned
int
width
=
(
vc
->
vc_font
.
width
+
7
)
/
8
;
unsigned
int
size
,
pitch
;
unsigned
int
size
,
pitch
;
unsigned
int
scan_align
=
info
->
pixmap
.
scan_align
-
1
;
unsigned
int
scan_align
=
info
->
pixmap
.
scan_align
-
1
;
unsigned
int
buf_align
=
info
->
pixmap
.
buf_align
-
1
;
unsigned
int
buf_align
=
info
->
pixmap
.
buf_align
-
1
;
void
(
*
move_data
)(
u8
*
dst
,
u8
*
src
,
u32
s_pitch
,
u32
d_pitch
,
void
(
*
move_data
)(
u8
*
dst
,
u8
*
src
,
u32
s_pitch
,
u32
d_pitch
,
u32
height
,
struct
fb_info
*
info
);
u32
height
,
struct
fb_info
*
info
);
u8
*
src
,
*
dst
;
u8
*
src
,
*
dst
;
if
(
info
->
pixmap
.
outbuf
!=
NULL
)
move_data
=
iomove_buf_aligned
;
else
move_data
=
sysmove_buf_aligned
;
if
(
info
->
pixmap
.
outbuf
!=
NULL
)
image
.
dx
=
xpos
*
vc
->
vc_font
.
width
;
move_data
=
iomove_buf_aligned
;
image
.
dy
=
ypos
*
vc
->
vc_font
.
height
;
else
image
.
width
=
vc
->
vc_font
.
width
;
move_data
=
sysmove_buf_aligned
;
image
.
height
=
vc
->
vc_font
.
height
;
image
.
fg_color
=
attr_fgcol
(
p
,
c
);
image
.
bg_color
=
attr_bgcol
(
p
,
c
);
image
.
depth
=
0
;
pitch
=
width
+
scan_align
;
pitch
&=
~
scan_align
;
size
=
pitch
*
vc
->
vc_font
.
height
;
size
+=
buf_align
;
size
&=
~
buf_align
;
dst
=
info
->
pixmap
.
addr
+
fb_get_buffer_offset
(
info
,
size
);
image
.
data
=
dst
;
src
=
p
->
fontdata
+
(
c
&
charmask
)
*
vc
->
vc_font
.
height
*
width
;
move_data
(
dst
,
src
,
pitch
,
width
,
image
.
height
,
info
);
image
.
dx
=
xpos
*
vc
->
vc_font
.
width
;
info
->
fbops
->
fb_imageblit
(
info
,
&
image
);
image
.
dy
=
ypos
*
vc
->
vc_font
.
height
;
image
.
width
=
vc
->
vc_font
.
width
;
image
.
height
=
vc
->
vc_font
.
height
;
image
.
fg_color
=
attr_fgcol
(
p
,
c
);
image
.
bg_color
=
attr_bgcol
(
p
,
c
);
image
.
depth
=
0
;
pitch
=
width
+
scan_align
;
pitch
&=
~
scan_align
;
size
=
pitch
*
vc
->
vc_font
.
height
;
size
+=
buf_align
;
size
&=
~
buf_align
;
dst
=
info
->
pixmap
.
addr
+
fb_get_buffer_offset
(
info
,
size
);
image
.
data
=
dst
;
src
=
p
->
fontdata
+
(
c
&
charmask
)
*
vc
->
vc_font
.
height
*
width
;
move_data
(
dst
,
src
,
pitch
,
width
,
image
.
height
,
info
);
info
->
fbops
->
fb_imageblit
(
info
,
&
image
);
}
}
void
accel_putcs
(
struct
vc_data
*
vc
,
struct
display
*
p
,
void
accel_putcs
(
struct
vc_data
*
vc
,
struct
display
*
p
,
...
@@ -589,7 +589,7 @@ void accel_clear_margins(struct vc_data *vc, struct display *p,
...
@@ -589,7 +589,7 @@ void accel_clear_margins(struct vc_data *vc, struct display *p,
region
.
color
=
attr_bgcol_ec
(
p
,
vc
);
region
.
color
=
attr_bgcol_ec
(
p
,
vc
);
region
.
rop
=
ROP_COPY
;
region
.
rop
=
ROP_COPY
;
if
(
rw
&
!
bottom_only
)
{
if
(
rw
&
&
!
bottom_only
)
{
region
.
dx
=
info
->
var
.
xoffset
+
rs
;
region
.
dx
=
info
->
var
.
xoffset
+
rs
;
region
.
dy
=
0
;
region
.
dy
=
0
;
region
.
width
=
rw
;
region
.
width
=
rw
;
...
...
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