Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
110fc086
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
110fc086
编写于
11月 01, 2011
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'spice/spice.v46' into staging
上级
59623530
54825d2e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
45 addition
and
20 deletion
+45
-20
hw/qxl-render.c
hw/qxl-render.c
+24
-12
hw/qxl.c
hw/qxl.c
+19
-7
hw/qxl.h
hw/qxl.h
+2
-1
未找到文件。
hw/qxl-render.c
浏览文件 @
110fc086
...
...
@@ -28,16 +28,16 @@ static void qxl_flip(PCIQXLDevice *qxl, QXLRect *rect)
int
len
,
i
;
src
+=
(
qxl
->
guest_primary
.
surface
.
height
-
rect
->
top
-
1
)
*
qxl
->
guest_primary
.
stride
;
dst
+=
rect
->
top
*
qxl
->
guest_primary
.
stride
;
qxl
->
guest_primary
.
abs_
stride
;
dst
+=
rect
->
top
*
qxl
->
guest_primary
.
abs_
stride
;
src
+=
rect
->
left
*
qxl
->
guest_primary
.
bytes_pp
;
dst
+=
rect
->
left
*
qxl
->
guest_primary
.
bytes_pp
;
len
=
(
rect
->
right
-
rect
->
left
)
*
qxl
->
guest_primary
.
bytes_pp
;
for
(
i
=
rect
->
top
;
i
<
rect
->
bottom
;
i
++
)
{
memcpy
(
dst
,
src
,
len
);
dst
+=
qxl
->
guest_primary
.
stride
;
src
-=
qxl
->
guest_primary
.
stride
;
dst
+=
qxl
->
guest_primary
.
abs_
stride
;
src
-=
qxl
->
guest_primary
.
abs_
stride
;
}
}
...
...
@@ -45,7 +45,8 @@ void qxl_render_resize(PCIQXLDevice *qxl)
{
QXLSurfaceCreate
*
sc
=
&
qxl
->
guest_primary
.
surface
;
qxl
->
guest_primary
.
stride
=
sc
->
stride
;
qxl
->
guest_primary
.
qxl_stride
=
sc
->
stride
;
qxl
->
guest_primary
.
abs_stride
=
abs
(
sc
->
stride
);
qxl
->
guest_primary
.
resized
++
;
switch
(
sc
->
format
)
{
case
SPICE_SURFACE_FMT_16_555
:
...
...
@@ -75,7 +76,14 @@ void qxl_render_update(PCIQXLDevice *qxl)
VGACommonState
*
vga
=
&
qxl
->
vga
;
QXLRect
dirty
[
32
],
update
;
void
*
ptr
;
int
i
;
int
i
,
redraw
=
0
;
if
(
!
is_buffer_shared
(
vga
->
ds
->
surface
))
{
dprint
(
qxl
,
1
,
"%s: restoring shared displaysurface
\n
"
,
__func__
);
qxl
->
guest_primary
.
resized
++
;
qxl
->
guest_primary
.
commands
++
;
redraw
=
1
;
}
if
(
qxl
->
guest_primary
.
resized
)
{
qxl
->
guest_primary
.
resized
=
0
;
...
...
@@ -87,11 +95,11 @@ void qxl_render_update(PCIQXLDevice *qxl)
qemu_free_displaysurface
(
vga
->
ds
);
qxl
->
guest_primary
.
data
=
memory_region_get_ram_ptr
(
&
qxl
->
vga
.
vram
);
if
(
qxl
->
guest_primary
.
stride
<
0
)
{
if
(
qxl
->
guest_primary
.
qxl_
stride
<
0
)
{
/* spice surface is upside down -> need extra buffer to flip */
qxl
->
guest_primary
.
stride
=
-
qxl
->
guest_primary
.
stride
;
qxl
->
guest_primary
.
flipped
=
g_malloc
(
qxl
->
guest_primary
.
surface
.
width
*
qxl
->
guest_primary
.
stride
);
qxl
->
guest_primary
.
flipped
=
g_malloc
(
qxl
->
guest_primary
.
surface
.
width
*
qxl
->
guest_primary
.
abs_
stride
);
ptr
=
qxl
->
guest_primary
.
flipped
;
}
else
{
ptr
=
qxl
->
guest_primary
.
data
;
...
...
@@ -100,7 +108,7 @@ void qxl_render_update(PCIQXLDevice *qxl)
__FUNCTION__
,
qxl
->
guest_primary
.
surface
.
width
,
qxl
->
guest_primary
.
surface
.
height
,
qxl
->
guest_primary
.
stride
,
qxl
->
guest_primary
.
qxl_
stride
,
qxl
->
guest_primary
.
bytes_pp
,
qxl
->
guest_primary
.
bits_pp
,
qxl
->
guest_primary
.
flipped
?
"yes"
:
"no"
);
...
...
@@ -108,7 +116,7 @@ void qxl_render_update(PCIQXLDevice *qxl)
qemu_create_displaysurface_from
(
qxl
->
guest_primary
.
surface
.
width
,
qxl
->
guest_primary
.
surface
.
height
,
qxl
->
guest_primary
.
bits_pp
,
qxl
->
guest_primary
.
stride
,
qxl
->
guest_primary
.
abs_
stride
,
ptr
);
dpy_resize
(
vga
->
ds
);
}
...
...
@@ -126,6 +134,10 @@ void qxl_render_update(PCIQXLDevice *qxl)
memset
(
dirty
,
0
,
sizeof
(
dirty
));
qxl_spice_update_area
(
qxl
,
0
,
&
update
,
dirty
,
ARRAY_SIZE
(
dirty
),
1
,
QXL_SYNC
);
if
(
redraw
)
{
memset
(
dirty
,
0
,
sizeof
(
dirty
));
dirty
[
0
]
=
update
;
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dirty
);
i
++
)
{
if
(
qemu_spice_rect_is_empty
(
dirty
+
i
))
{
...
...
hw/qxl.c
浏览文件 @
110fc086
...
...
@@ -1663,12 +1663,25 @@ static int qxl_pre_load(void *opaque)
return
0
;
}
static
void
qxl_create_memslots
(
PCIQXLDevice
*
d
)
{
int
i
;
for
(
i
=
0
;
i
<
NUM_MEMSLOTS
;
i
++
)
{
if
(
!
d
->
guest_slots
[
i
].
active
)
{
continue
;
}
dprint
(
d
,
1
,
"%s: restoring guest slot %d
\n
"
,
__func__
,
i
);
qxl_add_memslot
(
d
,
i
,
0
,
QXL_SYNC
);
}
}
static
int
qxl_post_load
(
void
*
opaque
,
int
version
)
{
PCIQXLDevice
*
d
=
opaque
;
uint8_t
*
ram_start
=
d
->
vga
.
vram_ptr
;
QXLCommandExt
*
cmds
;
int
in
,
out
,
i
,
newmode
;
int
in
,
out
,
newmode
;
dprint
(
d
,
1
,
"%s: start
\n
"
,
__FUNCTION__
);
...
...
@@ -1685,19 +1698,16 @@ static int qxl_post_load(void *opaque, int version)
qxl_mode_to_string
(
d
->
mode
));
newmode
=
d
->
mode
;
d
->
mode
=
QXL_MODE_UNDEFINED
;
switch
(
newmode
)
{
case
QXL_MODE_UNDEFINED
:
break
;
case
QXL_MODE_VGA
:
qxl_create_memslots
(
d
);
qxl_enter_vga_mode
(
d
);
break
;
case
QXL_MODE_NATIVE
:
for
(
i
=
0
;
i
<
NUM_MEMSLOTS
;
i
++
)
{
if
(
!
d
->
guest_slots
[
i
].
active
)
{
continue
;
}
qxl_add_memslot
(
d
,
i
,
0
,
QXL_SYNC
);
}
qxl_create_memslots
(
d
);
qxl_create_guest_primary
(
d
,
1
,
QXL_SYNC
);
/* replay surface-create and cursor-set commands */
...
...
@@ -1722,6 +1732,8 @@ static int qxl_post_load(void *opaque, int version)
break
;
case
QXL_MODE_COMPAT
:
/* note: no need to call qxl_create_memslots, qxl_set_mode
* creates the mem slot. */
qxl_set_mode
(
d
,
d
->
shadow_rom
.
mode
,
1
);
break
;
}
...
...
hw/qxl.h
浏览文件 @
110fc086
...
...
@@ -48,7 +48,8 @@ typedef struct PCIQXLDevice {
QXLSurfaceCreate
surface
;
uint32_t
commands
;
uint32_t
resized
;
int32_t
stride
;
int32_t
qxl_stride
;
uint32_t
abs_stride
;
uint32_t
bits_pp
;
uint32_t
bytes_pp
;
uint8_t
*
data
,
*
flipped
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录