1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include "hdmi.h"
25
26void
27gf119_hdmi_ctrl(struct nvkm_ior *ior, int head, bool enable, u8 max_ac_packet,
28 u8 rekey, u8 *avi, u8 avi_size, u8 *vendor, u8 vendor_size)
29{
30 struct nvkm_device *device = ior->disp->engine.subdev.device;
31 const u32 ctrl = 0x40000000 * enable |
32 max_ac_packet << 16 |
33 rekey;
34 const u32 hoff = head * 0x800;
35 struct packed_hdmi_infoframe avi_infoframe;
36 struct packed_hdmi_infoframe vendor_infoframe;
37
38 pack_hdmi_infoframe(&avi_infoframe, avi, avi_size);
39 pack_hdmi_infoframe(&vendor_infoframe, vendor, vendor_size);
40
41 if (!(ctrl & 0x40000000)) {
42 nvkm_mask(device, 0x616798 + hoff, 0x40000000, 0x00000000);
43 nvkm_mask(device, 0x616730 + hoff, 0x00000001, 0x00000000);
44 nvkm_mask(device, 0x6167a4 + hoff, 0x00000001, 0x00000000);
45 nvkm_mask(device, 0x616714 + hoff, 0x00000001, 0x00000000);
46 return;
47 }
48
49
50 nvkm_mask(device, 0x616714 + hoff, 0x00000001, 0x00000000);
51 if (avi_size) {
52 nvkm_wr32(device, 0x61671c + hoff, avi_infoframe.header);
53 nvkm_wr32(device, 0x616720 + hoff, avi_infoframe.subpack0_low);
54 nvkm_wr32(device, 0x616724 + hoff, avi_infoframe.subpack0_high);
55 nvkm_wr32(device, 0x616728 + hoff, avi_infoframe.subpack1_low);
56 nvkm_wr32(device, 0x61672c + hoff, avi_infoframe.subpack1_high);
57 nvkm_mask(device, 0x616714 + hoff, 0x00000001, 0x00000001);
58 }
59
60
61 nvkm_mask(device, 0x616730 + hoff, 0x00010001, 0x00010000);
62 if (vendor_size) {
63
64
65
66
67
68 nvkm_wr32(device, 0x616738 + hoff, vendor_infoframe.header);
69 nvkm_wr32(device, 0x61673c + hoff, vendor_infoframe.subpack0_low);
70 nvkm_wr32(device, 0x616740 + hoff, vendor_infoframe.subpack0_high);
71
72 nvkm_mask(device, 0x616730 + hoff, 0x00000001, 0x00000001);
73 }
74
75
76 nvkm_mask(device, 0x6167a4 + hoff, 0x00000001, 0x00000000);
77 nvkm_wr32(device, 0x6167ac + hoff, 0x00000010);
78 nvkm_mask(device, 0x6167a4 + hoff, 0x00000001, 0x00000001);
79
80
81 nvkm_mask(device, 0x616798 + hoff, 0x401f007f, ctrl);
82}
83