aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-05-31 23:40:41 -0400
committerDave Airlie <airlied@redhat.com>2010-06-07 21:02:38 -0400
commit1eb38100abc467f1133e548d82ab171cab34292b (patch)
tree5dd2ce9a1a4cb9aa34839d403f8f3294ae47f4ba /drivers/gpu
parentf712d0c7e726ccbf2ab668cc30f307ecf37adf4f (diff)
drm/nouveau: match U/DP script against SOR link
It appears version 0x21 'U' and 'd' tables require us to take the SOR link into account when selecting the appropriate table for a particular output. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 9ba2deaadcc..47a27a4728d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -3920,7 +3920,8 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b
3920 3920
3921static uint8_t * 3921static uint8_t *
3922bios_output_config_match(struct drm_device *dev, struct dcb_entry *dcbent, 3922bios_output_config_match(struct drm_device *dev, struct dcb_entry *dcbent,
3923 uint16_t record, int record_len, int record_nr) 3923 uint16_t record, int record_len, int record_nr,
3924 bool match_link)
3924{ 3925{
3925 struct drm_nouveau_private *dev_priv = dev->dev_private; 3926 struct drm_nouveau_private *dev_priv = dev->dev_private;
3926 struct nvbios *bios = &dev_priv->vbios; 3927 struct nvbios *bios = &dev_priv->vbios;
@@ -3928,12 +3929,28 @@ bios_output_config_match(struct drm_device *dev, struct dcb_entry *dcbent,
3928 uint16_t table; 3929 uint16_t table;
3929 int i, v; 3930 int i, v;
3930 3931
3932 switch (dcbent->type) {
3933 case OUTPUT_TMDS:
3934 case OUTPUT_LVDS:
3935 case OUTPUT_DP:
3936 break;
3937 default:
3938 match_link = false;
3939 break;
3940 }
3941
3931 for (i = 0; i < record_nr; i++, record += record_len) { 3942 for (i = 0; i < record_nr; i++, record += record_len) {
3932 table = ROM16(bios->data[record]); 3943 table = ROM16(bios->data[record]);
3933 if (!table) 3944 if (!table)
3934 continue; 3945 continue;
3935 entry = ROM32(bios->data[table]); 3946 entry = ROM32(bios->data[table]);
3936 3947
3948 if (match_link) {
3949 v = (entry & 0x00c00000) >> 22;
3950 if (!(v & dcbent->sorconf.link))
3951 continue;
3952 }
3953
3937 v = (entry & 0x000f0000) >> 16; 3954 v = (entry & 0x000f0000) >> 16;
3938 if (!(v & dcbent->or)) 3955 if (!(v & dcbent->or))
3939 continue; 3956 continue;
@@ -3975,7 +3992,7 @@ nouveau_bios_dp_table(struct drm_device *dev, struct dcb_entry *dcbent,
3975 *length = table[4]; 3992 *length = table[4];
3976 return bios_output_config_match(dev, dcbent, 3993 return bios_output_config_match(dev, dcbent,
3977 bios->display.dp_table_ptr + table[1], 3994 bios->display.dp_table_ptr + table[1],
3978 table[2], table[3]); 3995 table[2], table[3], table[0] >= 0x21);
3979} 3996}
3980 3997
3981int 3998int
@@ -4064,7 +4081,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent,
4064 dcbent->type, dcbent->location, dcbent->or); 4081 dcbent->type, dcbent->location, dcbent->or);
4065 otable = bios_output_config_match(dev, dcbent, table[1] + 4082 otable = bios_output_config_match(dev, dcbent, table[1] +
4066 bios->display.script_table_ptr, 4083 bios->display.script_table_ptr,
4067 table[2], table[3]); 4084 table[2], table[3], table[0] >= 0x21);
4068 if (!otable) { 4085 if (!otable) {
4069 NV_ERROR(dev, "Couldn't find matching output script table\n"); 4086 NV_ERROR(dev, "Couldn't find matching output script table\n");
4070 return 1; 4087 return 1;