Spice代码阅读二:Primary surface 创建过程
2013-08-05 18:54
274 查看
Spice 主窗口表面的创建应该由虚拟机的QXL驱动发起,经由QEMU将相关参数传递给spice server(主要由负责显示的red_worker.c完成),最后spice server将SPICE_SURFACE_FLAGS_PRIMARY 消息发给spice client完成。上图中省略了QXL driver与 spice client相关部分的过程,用文字来说明。
文件 | 方法 | 描述 |
QEMU Qxl.c | ioport_write | 接受CPU QXL部分的模拟指令,当指令是QXL_IO_CREATE_PRIMARY 的时候调用qxl_create_guest_primary()进行处理 |
qxl_create_guest_primary() | 第一个参数是PCIQXLDevice,里面包含了primary surface的信息,负责将其转换成surface数据结构的形式,然后调用qemu_spice_create_primary_surface继续(同步的话是调用(qxl_create_guest_primary_complete),下面都以异步来说明 | |
QEMU Spice-display.c | qemu_spice_create_primary_surface() | 调用RedWorker的create_primary_surface方法,但是由于这是个回调函数,实际调用的是Red_dispatcher.c的qxl_worker_create_primary_surface 方法 |
LibSpice Red_dispatcher.c | qxl_worker_create_primary_surface() | 简单调用 red_dispatcher_create_primary_surface() |
red_dispatcher_create_primary_surface() | 根据同步异步设置,调用相应的方法,这里默认是同步,调用red_dispatcher_create_primary_surface_sync | |
red_dispatcher_create_primary_surface_sync() | Dispatcher与Red_worker之间是通过双向的socketpair发消息通信的,因此这里Dispatcher发了一个RED_WORKER_MESSAGE_CREATE_PRIMARY_SURFACE消息给Red_worker | |
LibSpice Red_worker.c | handle_dev_create_primary_surface() | Red_worker收到创建Primary surface的消息后开始在handle_dev_create_primary_surface()进行处理,简单转给dev_create_primary_surface() |
dev_create_primary_surface() | 主要做了三件事情: 1. 调用red_create_surface()创建primary surface(通过调用PIXMAN的API完成)并发送SPICE_SURFACE_FLAGS_PRIMARY消息给spice client,由spice client的Display_channel.cpp处理完成; 2. 调用red_worker_push_monitors_config 发送监视器的配置给spice client; 3. 调用red_channel_pipes_add_type 发送PIPE_ITEM_TYPE_CURSOR_INIT消息给spice client,spice client调用Cursor_channel.cpp的handle_init进行光标的初始化处理。 |
相关文章推荐
- Spice代码阅读二:Primary surface 创建过程
- Spice代码阅读一:Spice Client 与 Spice Server 通道建立过程
- spice server主表面(primary surface)创建过程
- Spice代码阅读一:Spice Client 与 Spice Server 通道建立过程
- Spice代码阅读一:Spice Client 与 Spice Server 通道建立过程
- Android应用程序窗口(Activity)的绘图表面(Surface)的创建过程分析
- CLR基础,CLR运行过程,使用dos命令创建、编译、运行C#文件,查看IL代码
- ucos在s3c2410上运行过程整体剖析--创建任务到多任务调度及运行 分类: μc /os ii 系统有关知识 2012-03-13 21:38 1565人阅读 评论(1) 收藏
- SQLServer存储过程创建和修改的实现代码
- Android应用程序请求SurfaceFlinger服务创建Surface的过程分析
- Discuz!NT 代码阅读笔记(8)--DNT的几个分页存储过程解析
- Spring MVC的创建过程(SpringMVC源码阅读系列之一)
- Android应用程序创建Surface过程源码分析
- Android应用程序请求SurfaceFlinger服务创建Surface的过程分析
- Chromium网页绘图表面(Output Surface)创建过程分析
- Android应用程序请求SurfaceFlinger服务创建Surface的过程分析
- Discuz!NT 代码阅读笔记(8.1)--DNT的几个分页存储过程解析
- Android应用程序请求SurfaceFlinger服务创建Surface的过程分析
- Android应用程序请求SurfaceFlinger服务创建Surface的过程分析
- 存储过程代码阅读