aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-02-23 19:31:39 -0500
committerBen Skeggs <bskeggs@redhat.com>2010-02-25 00:09:23 -0500
commite7cc51c5652a8195bc638ce52987fb265ace2a9a (patch)
treef376a443222e094118aa0c2cd3e44f7d8df14497
parent04a39c577f4114a3f098ee8ef0e20f7778b5ddad (diff)
drm/nouveau: reorganise bios header, add dcb connector type enums
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.h102
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c3
3 files changed, 63 insertions, 44 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index ea71ce4267e1..ca65a5b11fa8 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -5388,6 +5388,8 @@ parse_dcb20_entry(struct drm_device *dev, struct dcb_table *dcb,
5388 /* weird g80 mobile type that "nv" treats as a terminator */ 5388 /* weird g80 mobile type that "nv" treats as a terminator */
5389 dcb->entries--; 5389 dcb->entries--;
5390 return false; 5390 return false;
5391 default:
5392 break;
5391 } 5393 }
5392 5394
5393 /* unsure what DCB version introduces this, 3.0? */ 5395 /* unsure what DCB version introduces this, 3.0? */
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h
index 38c856fae141..e3163f1123bd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.h
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.h
@@ -34,9 +34,66 @@
34 34
35#define DCB_LOC_ON_CHIP 0 35#define DCB_LOC_ON_CHIP 0
36 36
37struct dcb_i2c_entry {
38 uint8_t port_type;
39 uint8_t read, write;
40 struct nouveau_i2c_chan *chan;
41};
42
43enum dcb_gpio_tag {
44 DCB_GPIO_TVDAC0 = 0xc,
45 DCB_GPIO_TVDAC1 = 0x2d,
46};
47
48struct dcb_gpio_entry {
49 enum dcb_gpio_tag tag;
50 int line;
51 bool invert;
52};
53
54struct dcb_gpio_table {
55 int entries;
56 struct dcb_gpio_entry entry[DCB_MAX_NUM_GPIO_ENTRIES];
57};
58
59enum dcb_connector_type {
60 DCB_CONNECTOR_VGA = 0x00,
61 DCB_CONNECTOR_TV_0 = 0x10,
62 DCB_CONNECTOR_TV_1 = 0x11,
63 DCB_CONNECTOR_TV_3 = 0x13,
64 DCB_CONNECTOR_DVI_I = 0x30,
65 DCB_CONNECTOR_DVI_D = 0x31,
66 DCB_CONNECTOR_LVDS = 0x40,
67 DCB_CONNECTOR_DP = 0x46,
68 DCB_CONNECTOR_eDP = 0x47,
69 DCB_CONNECTOR_HDMI_0 = 0x60,
70 DCB_CONNECTOR_HDMI_1 = 0x61,
71};
72
73struct dcb_connector_table_entry {
74 uint32_t entry;
75 enum dcb_connector_type type;
76 uint8_t index;
77 uint8_t gpio_tag;
78};
79
80struct dcb_connector_table {
81 int entries;
82 struct dcb_connector_table_entry entry[DCB_MAX_NUM_CONNECTOR_ENTRIES];
83};
84
85enum dcb_type {
86 OUTPUT_ANALOG = 0,
87 OUTPUT_TV = 1,
88 OUTPUT_TMDS = 2,
89 OUTPUT_LVDS = 3,
90 OUTPUT_DP = 6,
91 OUTPUT_ANY = -1
92};
93
37struct dcb_entry { 94struct dcb_entry {
38 int index; /* may not be raw dcb index if merging has happened */ 95 int index; /* may not be raw dcb index if merging has happened */
39 uint8_t type; 96 enum dcb_type type;
40 uint8_t i2c_index; 97 uint8_t i2c_index;
41 uint8_t heads; 98 uint8_t heads;
42 uint8_t connector; 99 uint8_t connector;
@@ -71,40 +128,6 @@ struct dcb_entry {
71 bool i2c_upper_default; 128 bool i2c_upper_default;
72}; 129};
73 130
74struct dcb_i2c_entry {
75 uint8_t port_type;
76 uint8_t read, write;
77 struct nouveau_i2c_chan *chan;
78};
79
80enum dcb_gpio_tag {
81 DCB_GPIO_TVDAC0 = 0xc,
82 DCB_GPIO_TVDAC1 = 0x2d,
83};
84
85struct dcb_gpio_entry {
86 enum dcb_gpio_tag tag;
87 int line;
88 bool invert;
89};
90
91struct dcb_gpio_table {
92 int entries;
93 struct dcb_gpio_entry entry[DCB_MAX_NUM_GPIO_ENTRIES];
94};
95
96struct dcb_connector_table_entry {
97 uint32_t entry;
98 uint8_t type;
99 uint8_t index;
100 uint8_t gpio_tag;
101};
102
103struct dcb_connector_table {
104 int entries;
105 struct dcb_connector_table_entry entry[DCB_MAX_NUM_CONNECTOR_ENTRIES];
106};
107
108struct dcb_table { 131struct dcb_table {
109 uint8_t version; 132 uint8_t version;
110 133
@@ -121,15 +144,6 @@ struct dcb_table {
121 struct dcb_connector_table connector; 144 struct dcb_connector_table connector;
122}; 145};
123 146
124enum nouveau_encoder_type {
125 OUTPUT_ANALOG = 0,
126 OUTPUT_TV = 1,
127 OUTPUT_TMDS = 2,
128 OUTPUT_LVDS = 3,
129 OUTPUT_DP = 6,
130 OUTPUT_ANY = -1
131};
132
133enum nouveau_or { 147enum nouveau_or {
134 OUTPUT_A = (1 << 0), 148 OUTPUT_A = (1 << 0),
135 OUTPUT_B = (1 << 1), 149 OUTPUT_B = (1 << 1),
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index e73ce240c4b5..36a9692c4654 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -613,6 +613,9 @@ nouveau_connector_mode_valid(struct drm_connector *connector,
613 613
614 clock *= 3; 614 clock *= 3;
615 break; 615 break;
616 default:
617 BUG_ON(1);
618 return MODE_BAD;
616 } 619 }
617 620
618 if (clock < min_clock) 621 if (clock < min_clock)