Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
b30d4608
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b30d4608
编写于
7月 06, 2004
作者:
B
bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
24 bpp fixes
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@984
c046a42c-6fe2-441c-8c8c-71466251a162
上级
81ca7991
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
129 addition
and
69 deletion
+129
-69
hw/cirrus_vga.c
hw/cirrus_vga.c
+60
-45
hw/cirrus_vga_rop2.h
hw/cirrus_vga_rop2.h
+69
-24
未找到文件。
hw/cirrus_vga.c
浏览文件 @
b30d4608
...
...
@@ -456,25 +456,6 @@ static const cirrus_bitblt_rop_t cirrus_colorexpand_transp[16][4] = {
ROP2
(
cirrus_colorexpand_transp_notsrc_and_notdst
),
};
static
const
cirrus_bitblt_rop_t
cirrus_colorexpand_transp_inv
[
16
][
4
]
=
{
ROP2
(
cirrus_colorexpand_transp_inv_0
),
ROP2
(
cirrus_colorexpand_transp_inv_src_and_dst
),
ROP_NOP2
(
cirrus_bitblt_rop_nop
),
ROP2
(
cirrus_colorexpand_transp_inv_src_and_notdst
),
ROP2
(
cirrus_colorexpand_transp_inv_notdst
),
ROP2
(
cirrus_colorexpand_transp_inv_src
),
ROP2
(
cirrus_colorexpand_transp_inv_1
),
ROP2
(
cirrus_colorexpand_transp_inv_notsrc_and_dst
),
ROP2
(
cirrus_colorexpand_transp_inv_src_xor_dst
),
ROP2
(
cirrus_colorexpand_transp_inv_src_or_dst
),
ROP2
(
cirrus_colorexpand_transp_inv_notsrc_or_notdst
),
ROP2
(
cirrus_colorexpand_transp_inv_src_notxor_dst
),
ROP2
(
cirrus_colorexpand_transp_inv_src_or_notdst
),
ROP2
(
cirrus_colorexpand_transp_inv_notsrc
),
ROP2
(
cirrus_colorexpand_transp_inv_notsrc_or_dst
),
ROP2
(
cirrus_colorexpand_transp_inv_notsrc_and_notdst
),
};
static
const
cirrus_bitblt_rop_t
cirrus_colorexpand
[
16
][
4
]
=
{
ROP2
(
cirrus_colorexpand_0
),
ROP2
(
cirrus_colorexpand_src_and_dst
),
...
...
@@ -494,6 +475,44 @@ static const cirrus_bitblt_rop_t cirrus_colorexpand[16][4] = {
ROP2
(
cirrus_colorexpand_notsrc_and_notdst
),
};
static
const
cirrus_bitblt_rop_t
cirrus_colorexpand_pattern_transp
[
16
][
4
]
=
{
ROP2
(
cirrus_colorexpand_pattern_transp_0
),
ROP2
(
cirrus_colorexpand_pattern_transp_src_and_dst
),
ROP_NOP2
(
cirrus_bitblt_rop_nop
),
ROP2
(
cirrus_colorexpand_pattern_transp_src_and_notdst
),
ROP2
(
cirrus_colorexpand_pattern_transp_notdst
),
ROP2
(
cirrus_colorexpand_pattern_transp_src
),
ROP2
(
cirrus_colorexpand_pattern_transp_1
),
ROP2
(
cirrus_colorexpand_pattern_transp_notsrc_and_dst
),
ROP2
(
cirrus_colorexpand_pattern_transp_src_xor_dst
),
ROP2
(
cirrus_colorexpand_pattern_transp_src_or_dst
),
ROP2
(
cirrus_colorexpand_pattern_transp_notsrc_or_notdst
),
ROP2
(
cirrus_colorexpand_pattern_transp_src_notxor_dst
),
ROP2
(
cirrus_colorexpand_pattern_transp_src_or_notdst
),
ROP2
(
cirrus_colorexpand_pattern_transp_notsrc
),
ROP2
(
cirrus_colorexpand_pattern_transp_notsrc_or_dst
),
ROP2
(
cirrus_colorexpand_pattern_transp_notsrc_and_notdst
),
};
static
const
cirrus_bitblt_rop_t
cirrus_colorexpand_pattern
[
16
][
4
]
=
{
ROP2
(
cirrus_colorexpand_pattern_0
),
ROP2
(
cirrus_colorexpand_pattern_src_and_dst
),
ROP_NOP2
(
cirrus_bitblt_rop_nop
),
ROP2
(
cirrus_colorexpand_pattern_src_and_notdst
),
ROP2
(
cirrus_colorexpand_pattern_notdst
),
ROP2
(
cirrus_colorexpand_pattern_src
),
ROP2
(
cirrus_colorexpand_pattern_1
),
ROP2
(
cirrus_colorexpand_pattern_notsrc_and_dst
),
ROP2
(
cirrus_colorexpand_pattern_src_xor_dst
),
ROP2
(
cirrus_colorexpand_pattern_src_or_dst
),
ROP2
(
cirrus_colorexpand_pattern_notsrc_or_notdst
),
ROP2
(
cirrus_colorexpand_pattern_src_notxor_dst
),
ROP2
(
cirrus_colorexpand_pattern_src_or_notdst
),
ROP2
(
cirrus_colorexpand_pattern_notsrc
),
ROP2
(
cirrus_colorexpand_pattern_notsrc_or_dst
),
ROP2
(
cirrus_colorexpand_pattern_notsrc_and_notdst
),
};
static
const
cirrus_fill_t
cirrus_fill
[
16
][
4
]
=
{
ROP2
(
cirrus_fill_0
),
ROP2
(
cirrus_fill_src_and_dst
),
...
...
@@ -584,27 +603,8 @@ static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
static
int
cirrus_bitblt_common_patterncopy
(
CirrusVGAState
*
s
,
const
uint8_t
*
src
)
{
uint8_t
work_colorexp
[
256
];
uint8_t
*
dst
;
int
patternbytes
=
s
->
cirrus_blt_pixelwidth
*
8
;
if
(
s
->
cirrus_blt_mode
&
CIRRUS_BLTMODE_COLOREXPAND
)
{
cirrus_bitblt_rop_t
rop_func
;
cirrus_bitblt_fgcol
(
s
);
cirrus_bitblt_bgcol
(
s
);
rop_func
=
cirrus_colorexpand
[
CIRRUS_ROP_SRC_INDEX
][
s
->
cirrus_blt_pixelwidth
-
1
];
rop_func
(
s
,
work_colorexp
,
src
,
patternbytes
,
1
,
patternbytes
,
8
);
src
=
work_colorexp
;
s
->
cirrus_blt_mode
&=
~
CIRRUS_BLTMODE_COLOREXPAND
;
}
if
(
s
->
cirrus_blt_mode
&
~
CIRRUS_BLTMODE_PATTERNCOPY
)
{
#ifdef DEBUG_BITBLT
printf
(
"cirrus: blt mode %02x (pattercopy) - unimplemented
\n
"
,
s
->
cirrus_blt_mode
);
#endif
return
0
;
}
dst
=
s
->
vram_ptr
+
s
->
cirrus_blt_dstaddr
;
(
*
s
->
cirrus_rop
)
(
s
,
dst
,
src
,
s
->
cirrus_blt_dstpitch
,
0
,
...
...
@@ -728,6 +728,7 @@ static int cirrus_bitblt_cputovideo(CirrusVGAState * s)
if
(
s
->
cirrus_blt_mode
&
CIRRUS_BLTMODE_COLOREXPAND
)
{
s
->
cirrus_blt_srcpitch
=
8
;
}
else
{
/* XXX: check for 24 bpp */
s
->
cirrus_blt_srcpitch
=
8
*
8
*
s
->
cirrus_blt_pixelwidth
;
}
s
->
cirrus_srccounter
=
s
->
cirrus_blt_srcpitch
;
...
...
@@ -848,20 +849,32 @@ static void cirrus_bitblt_start(CirrusVGAState * s)
CIRRUS_BLTMODE_COLOREXPAND
)
{
if
(
s
->
cirrus_blt_mode
&
CIRRUS_BLTMODE_TRANSPARENTCOMP
)
{
if
(
s
->
cirrus_blt_modeext
&
CIRRUS_BLTMODEEXT_COLOREXPINV
)
{
if
(
s
->
cirrus_blt_modeext
&
CIRRUS_BLTMODEEXT_COLOREXPINV
)
cirrus_bitblt_bgcol
(
s
);
s
->
cirrus_rop
=
cirrus_colorexpand_transp_inv
[
rop_to_index
[
blt_rop
]][
s
->
cirrus_blt_pixelwidth
-
1
];
}
else
{
else
cirrus_bitblt_fgcol
(
s
);
s
->
cirrus_rop
=
cirrus_colorexpand_transp
[
rop_to_index
[
blt_rop
]][
s
->
cirrus_blt_pixelwidth
-
1
];
}
s
->
cirrus_rop
=
cirrus_colorexpand_transp
[
rop_to_index
[
blt_rop
]][
s
->
cirrus_blt_pixelwidth
-
1
];
}
else
{
cirrus_bitblt_fgcol
(
s
);
cirrus_bitblt_bgcol
(
s
);
s
->
cirrus_rop
=
cirrus_colorexpand
[
rop_to_index
[
blt_rop
]][
s
->
cirrus_blt_pixelwidth
-
1
];
}
}
else
if
(
s
->
cirrus_blt_mode
&
CIRRUS_BLTMODE_PATTERNCOPY
)
{
s
->
cirrus_rop
=
cirrus_patternfill
[
rop_to_index
[
blt_rop
]][
s
->
cirrus_blt_pixelwidth
-
1
];
if
(
s
->
cirrus_blt_mode
&
CIRRUS_BLTMODE_COLOREXPAND
)
{
if
(
s
->
cirrus_blt_mode
&
CIRRUS_BLTMODE_TRANSPARENTCOMP
)
{
if
(
s
->
cirrus_blt_modeext
&
CIRRUS_BLTMODEEXT_COLOREXPINV
)
cirrus_bitblt_bgcol
(
s
);
else
cirrus_bitblt_fgcol
(
s
);
s
->
cirrus_rop
=
cirrus_colorexpand_pattern_transp
[
rop_to_index
[
blt_rop
]][
s
->
cirrus_blt_pixelwidth
-
1
];
}
else
{
cirrus_bitblt_fgcol
(
s
);
cirrus_bitblt_bgcol
(
s
);
s
->
cirrus_rop
=
cirrus_colorexpand_pattern
[
rop_to_index
[
blt_rop
]][
s
->
cirrus_blt_pixelwidth
-
1
];
}
}
else
{
s
->
cirrus_rop
=
cirrus_patternfill
[
rop_to_index
[
blt_rop
]][
s
->
cirrus_blt_pixelwidth
-
1
];
}
}
else
{
if
(
s
->
cirrus_blt_mode
&
CIRRUS_BLTMODE_BACKWARDS
)
{
s
->
cirrus_blt_dstpitch
=
-
s
->
cirrus_blt_dstpitch
;
...
...
@@ -2793,9 +2806,10 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
vga_io_memory
);
s
->
sr
[
0x06
]
=
0x0f
;
s
->
sr
[
0x1F
]
=
0x22
;
// MemClock
if
(
device_id
==
CIRRUS_ID_CLGD5446
)
{
/* 4MB 64 bit memory config, always PCI */
s
->
sr
[
0x1F
]
=
0x2d
;
// MemClock
s
->
gr
[
0x18
]
=
0x0f
;
// fastest memory configuration
#if 1
s
->
sr
[
0x0f
]
=
0x98
;
s
->
sr
[
0x17
]
=
0x20
;
...
...
@@ -2808,6 +2822,7 @@ static void cirrus_init_common(CirrusVGAState * s, int device_id, int is_pci)
s
->
real_vram_size
=
2048
*
1024
;
#endif
}
else
{
s
->
sr
[
0x1F
]
=
0x22
;
// MemClock
s
->
sr
[
0x0F
]
=
CIRRUS_MEMSIZE_2M
;
if
(
is_pci
)
s
->
sr
[
0x17
]
=
CIRRUS_BUSTYPE_PCI
;
...
...
hw/cirrus_vga_rop2.h
浏览文件 @
b30d4608
...
...
@@ -67,6 +67,12 @@ glue(glue(glue(cirrus_patternfill_, ROP_NAME), _),DEPTH)
#elif DEPTH == 16
col
=
((
uint16_t
*
)(
src1
+
pattern_x
))[
0
];
pattern_x
=
(
pattern_x
+
2
)
&
15
;
#elif DEPTH == 24
{
const
uint8_t
*
src2
=
src1
+
pattern_x
*
3
;
col
=
src2
[
0
]
|
(
src2
[
1
]
<<
8
)
|
(
src2
[
2
]
<<
16
);
pattern_x
=
(
pattern_x
+
1
)
&
7
;
}
#else
col
=
((
uint32_t
*
)(
src1
+
pattern_x
))[
0
];
pattern_x
=
(
pattern_x
+
4
)
&
31
;
...
...
@@ -89,21 +95,28 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH)
{
uint8_t
*
d
;
int
x
,
y
;
unsigned
bits
;
unsigned
bits
,
bits_xor
;
unsigned
int
col
;
unsigned
bitmask
;
unsigned
index
;
int
srcskipleft
=
0
;
col
=
s
->
cirrus_blt_fgcol
;
if
(
s
->
cirrus_blt_modeext
&
CIRRUS_BLTMODEEXT_COLOREXPINV
)
{
bits_xor
=
0xff
;
col
=
s
->
cirrus_blt_bgcol
;
}
else
{
bits_xor
=
0x00
;
col
=
s
->
cirrus_blt_fgcol
;
}
for
(
y
=
0
;
y
<
bltheight
;
y
++
)
{
bitmask
=
0x80
>>
srcskipleft
;
bits
=
*
src
++
;
bits
=
*
src
++
^
bits_xor
;
d
=
dst
;
for
(
x
=
0
;
x
<
bltwidth
;
x
+=
(
DEPTH
/
8
))
{
if
((
bitmask
&
0xff
)
==
0
)
{
bitmask
=
0x80
;
bits
=
*
src
++
;
bits
=
*
src
++
^
bits_xor
;
}
index
=
(
bits
&
bitmask
);
if
(
index
)
{
...
...
@@ -116,23 +129,23 @@ glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH)
}
}
/* NOTE: srcpitch is ignored */
static
void
glue
(
glue
(
glue
(
cirrus_colorexpand_
transp_inv_
,
ROP_NAME
),
_
),
DEPTH
)
glue
(
glue
(
glue
(
cirrus_colorexpand_
,
ROP_NAME
),
_
),
DEPTH
)
(
CirrusVGAState
*
s
,
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
dstpitch
,
int
srcpitch
,
int
bltwidth
,
int
bltheight
)
{
uint32_t
colors
[
2
];
uint8_t
*
d
;
int
x
,
y
;
unsigned
bits
;
unsigned
int
col
;
unsigned
bitmask
;
unsigned
index
;
int
srcskipleft
=
0
;
col
=
s
->
cirrus_blt_bgcol
;
colors
[
0
]
=
s
->
cirrus_blt_bgcol
;
colors
[
1
]
=
s
->
cirrus_blt_fgcol
;
for
(
y
=
0
;
y
<
bltheight
;
y
++
)
{
bitmask
=
0x80
>>
srcskipleft
;
bits
=
*
src
++
;
...
...
@@ -142,19 +155,54 @@ glue(glue(glue(cirrus_colorexpand_transp_inv_, ROP_NAME), _),DEPTH)
bitmask
=
0x80
;
bits
=
*
src
++
;
}
index
=
(
bits
&
bitmask
);
if
(
!
index
)
{
col
=
colors
[
!!
(
bits
&
bitmask
)];
PUTPIXEL
();
d
+=
(
DEPTH
/
8
);
bitmask
>>=
1
;
}
dst
+=
dstpitch
;
}
}
static
void
glue
(
glue
(
glue
(
cirrus_colorexpand_pattern_transp_
,
ROP_NAME
),
_
),
DEPTH
)
(
CirrusVGAState
*
s
,
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
dstpitch
,
int
srcpitch
,
int
bltwidth
,
int
bltheight
)
{
uint8_t
*
d
;
int
x
,
y
,
bitpos
,
pattern_y
;
unsigned
int
bits
,
bits_xor
;
unsigned
int
col
;
if
(
s
->
cirrus_blt_modeext
&
CIRRUS_BLTMODEEXT_COLOREXPINV
)
{
bits_xor
=
0xff
;
col
=
s
->
cirrus_blt_bgcol
;
}
else
{
bits_xor
=
0x00
;
col
=
s
->
cirrus_blt_fgcol
;
}
pattern_y
=
s
->
cirrus_blt_srcaddr
&
7
;
for
(
y
=
0
;
y
<
bltheight
;
y
++
)
{
bits
=
src
[
pattern_y
]
^
bits_xor
;
bitpos
=
7
;
d
=
dst
;
for
(
x
=
0
;
x
<
bltwidth
;
x
+=
(
DEPTH
/
8
))
{
if
((
bits
>>
bitpos
)
&
1
)
{
PUTPIXEL
();
}
d
+=
(
DEPTH
/
8
);
bit
mask
>>=
1
;
bit
pos
=
(
bitpos
-
1
)
&
7
;
}
pattern_y
=
(
pattern_y
+
1
)
&
7
;
dst
+=
dstpitch
;
}
}
static
void
glue
(
glue
(
glue
(
cirrus_colorexpand_
,
ROP_NAME
),
_
),
DEPTH
)
glue
(
glue
(
glue
(
cirrus_colorexpand_
pattern_
,
ROP_NAME
),
_
),
DEPTH
)
(
CirrusVGAState
*
s
,
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
dstpitch
,
int
srcpitch
,
...
...
@@ -162,28 +210,25 @@ glue(glue(glue(cirrus_colorexpand_, ROP_NAME), _),DEPTH)
{
uint32_t
colors
[
2
];
uint8_t
*
d
;
int
x
,
y
;
unsigned
bits
;
int
x
,
y
,
bitpos
,
pattern_y
;
unsigned
int
bits
;
unsigned
int
col
;
unsigned
bitmask
;
int
srcskipleft
=
0
;
colors
[
0
]
=
s
->
cirrus_blt_bgcol
;
colors
[
1
]
=
s
->
cirrus_blt_fgcol
;
pattern_y
=
s
->
cirrus_blt_srcaddr
&
7
;
for
(
y
=
0
;
y
<
bltheight
;
y
++
)
{
bit
mask
=
0x80
>>
srcskipleft
;
bit
s
=
*
src
++
;
bit
s
=
src
[
pattern_y
]
;
bit
pos
=
7
;
d
=
dst
;
for
(
x
=
0
;
x
<
bltwidth
;
x
+=
(
DEPTH
/
8
))
{
if
((
bitmask
&
0xff
)
==
0
)
{
bitmask
=
0x80
;
bits
=
*
src
++
;
}
col
=
colors
[
!!
(
bits
&
bitmask
)];
col
=
colors
[(
bits
>>
bitpos
)
&
1
];
PUTPIXEL
();
d
+=
(
DEPTH
/
8
);
bit
mask
>>=
1
;
bit
pos
=
(
bitpos
-
1
)
&
7
;
}
pattern_y
=
(
pattern_y
+
1
)
&
7
;
dst
+=
dstpitch
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录