Commit befb51e9 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/disp: parse connector info directly in nouveau_connector.c

Another case where we parsed vbios data to some structs, then again use
that info once to construct another set of data.  Skip the intermediate
step.

This is also slightly improved in that we can now use DCB 3.x connector
table info, which will allow NV4x to gain hotplug support, and to make
quirks for SPWG LVDS panels unnecessary.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent f553b79c
This diff is collapsed.
...@@ -58,6 +58,7 @@ enum dcb_gpio_tag { ...@@ -58,6 +58,7 @@ enum dcb_gpio_tag {
DCB_GPIO_TVDAC1 = 0x2d, DCB_GPIO_TVDAC1 = 0x2d,
DCB_GPIO_PWM_FAN = 0x9, DCB_GPIO_PWM_FAN = 0x9,
DCB_GPIO_FAN_SENSE = 0x3d, DCB_GPIO_FAN_SENSE = 0x3d,
DCB_GPIO_UNUSED = 0xff
}; };
struct dcb_gpio_entry { struct dcb_gpio_entry {
...@@ -89,20 +90,6 @@ enum dcb_connector_type { ...@@ -89,20 +90,6 @@ enum dcb_connector_type {
DCB_CONNECTOR_NONE = 0xff DCB_CONNECTOR_NONE = 0xff
}; };
struct dcb_connector_table_entry {
uint8_t index;
uint32_t entry;
enum dcb_connector_type type;
uint8_t index2;
uint8_t gpio_tag;
void *drm;
};
struct dcb_connector_table {
int entries;
struct dcb_connector_table_entry entry[DCB_MAX_NUM_CONNECTOR_ENTRIES];
};
enum dcb_type { enum dcb_type {
OUTPUT_ANALOG = 0, OUTPUT_ANALOG = 0,
OUTPUT_TV = 1, OUTPUT_TV = 1,
...@@ -161,8 +148,6 @@ struct dcb_table { ...@@ -161,8 +148,6 @@ struct dcb_table {
uint16_t gpio_table_ptr; uint16_t gpio_table_ptr;
struct dcb_gpio_table gpio; struct dcb_gpio_table gpio;
uint16_t connector_table_ptr;
struct dcb_connector_table connector;
}; };
enum nouveau_or { enum nouveau_or {
...@@ -333,5 +318,7 @@ void *dcb_table(struct drm_device *); ...@@ -333,5 +318,7 @@ void *dcb_table(struct drm_device *);
u8 *dcb_outp(struct drm_device *, u8 idx); u8 *dcb_outp(struct drm_device *, u8 idx);
int dcb_outp_foreach(struct drm_device *, void *data, int dcb_outp_foreach(struct drm_device *, void *data,
int (*)(struct drm_device *, void *, int idx, u8 *outp)); int (*)(struct drm_device *, void *, int idx, u8 *outp));
u8 *dcb_conntab(struct drm_device *);
u8 *dcb_conn(struct drm_device *, u8 idx);
#endif #endif
This diff is collapsed.
...@@ -56,8 +56,10 @@ enum nouveau_dithering_depth { ...@@ -56,8 +56,10 @@ enum nouveau_dithering_depth {
struct nouveau_connector { struct nouveau_connector {
struct drm_connector base; struct drm_connector base;
enum dcb_connector_type type;
struct dcb_connector_table_entry *dcb; u8 index;
u8 *dcb;
u8 hpd;
int dithering_mode; int dithering_mode;
int dithering_depth; int dithering_depth;
......
...@@ -587,7 +587,7 @@ nouveau_dp_link_train(struct drm_encoder *encoder, u32 datarate) ...@@ -587,7 +587,7 @@ nouveau_dp_link_train(struct drm_encoder *encoder, u32 datarate)
* we take during link training (DP_SET_POWER is one), we need * we take during link training (DP_SET_POWER is one), we need
* to ignore them for the moment to avoid races. * to ignore them for the moment to avoid races.
*/ */
pgpio->irq_enable(dev, nv_connector->dcb->gpio_tag, false); pgpio->irq_enable(dev, nv_connector->hpd, false);
/* enable down-spreading, if possible */ /* enable down-spreading, if possible */
if (dp.table[1] >= 16) { if (dp.table[1] >= 16) {
...@@ -636,7 +636,7 @@ nouveau_dp_link_train(struct drm_encoder *encoder, u32 datarate) ...@@ -636,7 +636,7 @@ nouveau_dp_link_train(struct drm_encoder *encoder, u32 datarate)
nouveau_bios_run_init_table(dev, ROM16(dp.entry[8]), dp.dcb, dp.crtc); nouveau_bios_run_init_table(dev, ROM16(dp.entry[8]), dp.dcb, dp.crtc);
/* re-enable hotplug detect */ /* re-enable hotplug detect */
pgpio->irq_enable(dev, nv_connector->dcb->gpio_tag, true); pgpio->irq_enable(dev, nv_connector->hpd, true);
return true; return true;
} }
......
...@@ -241,10 +241,10 @@ nv50_display_init(struct drm_device *dev) ...@@ -241,10 +241,10 @@ nv50_display_init(struct drm_device *dev)
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
struct nouveau_connector *conn = nouveau_connector(connector); struct nouveau_connector *conn = nouveau_connector(connector);
if (conn->dcb->gpio_tag == 0xff) if (conn->hpd == DCB_GPIO_UNUSED)
continue; continue;
pgpio->irq_enable(dev, conn->dcb->gpio_tag, true); pgpio->irq_enable(dev, conn->hpd, true);
} }
ret = nv50_evo_init(dev); ret = nv50_evo_init(dev);
...@@ -581,7 +581,7 @@ nv50_display_script_select(struct drm_device *dev, struct dcb_entry *dcb, ...@@ -581,7 +581,7 @@ nv50_display_script_select(struct drm_device *dev, struct dcb_entry *dcb,
} else { } else {
/* determine number of lvds links */ /* determine number of lvds links */
if (nv_connector && nv_connector->edid && if (nv_connector && nv_connector->edid &&
nv_connector->dcb->type == DCB_CONNECTOR_LVDS_SPWG) { nv_connector->type == DCB_CONNECTOR_LVDS_SPWG) {
/* http://www.spwg.org */ /* http://www.spwg.org */
if (((u8 *)nv_connector->edid)[121] == 2) if (((u8 *)nv_connector->edid)[121] == 2)
script |= 0x0100; script |= 0x0100;
......
...@@ -1285,7 +1285,7 @@ nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode, ...@@ -1285,7 +1285,7 @@ nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
if (bios->fp.if_is_24bit) if (bios->fp.if_is_24bit)
or_config |= 0x0200; or_config |= 0x0200;
} else { } else {
if (nv_connector->dcb->type == DCB_CONNECTOR_LVDS_SPWG) { if (nv_connector->type == DCB_CONNECTOR_LVDS_SPWG) {
if (((u8 *)nv_connector->edid)[121] == 2) if (((u8 *)nv_connector->edid)[121] == 2)
or_config |= 0x0100; or_config |= 0x0100;
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment