forked from xuzhongxing/fuchsia-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
virtcon.txt
64 lines (46 loc) · 2.66 KB
/
virtcon.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
vc_display_init()
open("/dev/class/display-controller/000/virtcon", O_RDWR)
handle_display_changed
handle_display_added()
create_layer()
rebind_display()
任选一个display, 在后面Controller::ApplyConfiguration里,
如果device id对不上会跳过
allocate_vmo(size, &vmo)
import_vmo(display, vmo, &image_id)
i915.cpp
Controller::ImportVmoImage(image_t* image, const zx::vmo& vmo, size_t offset)
width_in_tiles(image->type, image->width, image->pixel_format)
gtt_.AllocRegion(length, align, >t_region);
分配一个gtt region
gtt_region->PopulateRegion(vmo.get(), offset / PAGE_SIZE, length);
把vmo对应的内存commit并且固定下来。
把gtt页表项设置好,也就是把graphics虚拟内存对应到vmo的物理地址上
set_display_layer(info->id, info->layer_id)
configure_layer(display, layer_id)
setprimarylayerconfig
Client::HandleSetLayerPrimaryConfig
populate_image(req->image_config, &primary_layer->image);
设置这个layer的primary config
SetLayerPrimaryPosition
SetLayerImage
apply_configuration()
Client::HandleCheckConfig
没有实质性动作
Client::HandleApplyConfig
layer_node.layer->pending_image_->PrepareFences(
GetFence(layer->pending_wait_event_id_),
GetFence(layer->pending_signal_event_id_));
这里应该都是null
ApplyConfig();
controller_->ApplyConfig(dc_configs, dc_idx, is_vc_, client_apply_count_);
image->StartPresent();
ops_.ops->apply_configuration(ops_.ctx, display_configs, display_count);
ReallocatePlaneBuffers(display_config, display_count)
GetPlaneLayer(pipe, plane_num, display_configs, display_count, &layer)
拿到相应的layer
UpdateAllocations(min_allocs, data_rate);
display->ApplyConfiguration(config, ®s);
ConfigurePrimaryPlane(plane, primary, !!config->cc_flags, &scaler_1_claimed, regs);
base_address = static_cast<uint32_t>(region->base());
plane_surface.set_surface_base_addr(base_address >> plane_surface.kRShiftCount);