blob: aa67eb4f00ff69650c435bb6e853d6598e43e621 [file] [log] [blame]
Nico Huber7ad2d652016-12-07 15:19:32 +01001--
2-- Copyright (C) 2015-2016 secunet Security Networks AG
3--
4-- This program is free software; you can redistribute it and/or modify
5-- it under the terms of the GNU General Public License as published by
6-- the Free Software Foundation; either version 2 of the License, or
7-- (at your option) any later version.
8--
9-- This program is distributed in the hope that it will be useful,
10-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-- GNU General Public License for more details.
13--
14
15with HW.GFX.GMA.Registers;
16
17private package HW.GFX.GMA.Transcoder
18is
19
20 procedure Setup (Pipe : Pipe_Index; Port_Cfg : Port_Config);
21 procedure On (Pipe : Pipe_Index; Port_Cfg : Port_Config; Dither : Boolean);
22
23 procedure Off (Pipe : Pipe_Index);
24 procedure Clk_Off (Pipe : Pipe_Index);
25
26 function BPC_Conf (BPC : BPC_Type; Dither : Boolean) return Word32;
27
28private
29
30 type Transcoder_Index is (Trans_EDP, Trans_A, Trans_B, Trans_C);
31
32 type Transcoder_Regs is
33 record
34 HTOTAL : Registers.Registers_Index;
35 HBLANK : Registers.Registers_Index;
36 HSYNC : Registers.Registers_Index;
37 VTOTAL : Registers.Registers_Index;
38 VBLANK : Registers.Registers_Index;
39 VSYNC : Registers.Registers_Index;
40 CONF : Registers.Registers_Index;
41 DATA_M1 : Registers.Registers_Index;
42 DATA_N1 : Registers.Registers_Index;
43 LINK_M1 : Registers.Registers_Index;
44 LINK_N1 : Registers.Registers_Index;
45 DDI_FUNC_CTL : Registers.Registers_Index;
46 MSA_MISC : Registers.Registers_Index;
47 CLK_SEL : Registers.Registers_Invalid_Index;
48 end record;
49
50 type Transcoder_Array is array (Transcoder_Index) of Transcoder_Regs;
51
52 Transcoders : constant Transcoder_Array :=
53 (Trans_EDP =>
54 (HTOTAL => Registers.HTOTAL_EDP,
55 HBLANK => Registers.HBLANK_EDP,
56 HSYNC => Registers.HSYNC_EDP,
57 VTOTAL => Registers.VTOTAL_EDP,
58 VBLANK => Registers.VBLANK_EDP,
59 VSYNC => Registers.VSYNC_EDP,
60 CONF => Registers.PIPE_EDP_CONF,
61 DATA_M1 => Registers.PIPE_EDP_DATA_M1,
62 DATA_N1 => Registers.PIPE_EDP_DATA_N1,
63 LINK_M1 => Registers.PIPE_EDP_LINK_M1,
64 LINK_N1 => Registers.PIPE_EDP_LINK_N1,
65 DDI_FUNC_CTL => Registers.PIPE_EDP_DDI_FUNC_CTL,
66 MSA_MISC => Registers.PIPE_EDP_MSA_MISC,
67 CLK_SEL => Registers.Invalid_Register),
68 Trans_A =>
69 (HTOTAL => Registers.HTOTAL_A,
70 HBLANK => Registers.HBLANK_A,
71 HSYNC => Registers.HSYNC_A,
72 VTOTAL => Registers.VTOTAL_A,
73 VBLANK => Registers.VBLANK_A,
74 VSYNC => Registers.VSYNC_A,
75 CONF => Registers.PIPEACONF,
76 DATA_M1 => Registers.PIPEA_DATA_M1,
77 DATA_N1 => Registers.PIPEA_DATA_N1,
78 LINK_M1 => Registers.PIPEA_LINK_M1,
79 LINK_N1 => Registers.PIPEA_LINK_N1,
80 DDI_FUNC_CTL => Registers.PIPEA_DDI_FUNC_CTL,
81 MSA_MISC => Registers.PIPEA_MSA_MISC,
82 CLK_SEL => Registers.TRANSA_CLK_SEL),
83 Trans_B =>
84 (HTOTAL => Registers.HTOTAL_B,
85 HBLANK => Registers.HBLANK_B,
86 HSYNC => Registers.HSYNC_B,
87 VTOTAL => Registers.VTOTAL_B,
88 VBLANK => Registers.VBLANK_B,
89 VSYNC => Registers.VSYNC_B,
90 CONF => Registers.PIPEBCONF,
91 DATA_M1 => Registers.PIPEB_DATA_M1,
92 DATA_N1 => Registers.PIPEB_DATA_N1,
93 LINK_M1 => Registers.PIPEB_LINK_M1,
94 LINK_N1 => Registers.PIPEB_LINK_N1,
95 DDI_FUNC_CTL => Registers.PIPEB_DDI_FUNC_CTL,
96 MSA_MISC => Registers.PIPEB_MSA_MISC,
97 CLK_SEL => Registers.TRANSB_CLK_SEL),
98 Trans_C =>
99 (HTOTAL => Registers.HTOTAL_C,
100 HBLANK => Registers.HBLANK_C,
101 HSYNC => Registers.HSYNC_C,
102 VTOTAL => Registers.VTOTAL_C,
103 VBLANK => Registers.VBLANK_C,
104 VSYNC => Registers.VSYNC_C,
105 CONF => Registers.PIPECCONF,
106 DATA_M1 => Registers.PIPEC_DATA_M1,
107 DATA_N1 => Registers.PIPEC_DATA_N1,
108 LINK_M1 => Registers.PIPEC_LINK_M1,
109 LINK_N1 => Registers.PIPEC_LINK_N1,
110 DDI_FUNC_CTL => Registers.PIPEC_DDI_FUNC_CTL,
111 MSA_MISC => Registers.PIPEC_MSA_MISC,
112 CLK_SEL => Registers.TRANSC_CLK_SEL));
113
114end HW.GFX.GMA.Transcoder;