diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bios.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index d7f8d8b4a4b8..2cd0fad17dac 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -1865,7 +1865,7 @@ init_compute_mem(struct nvbios *bios, uint16_t offset, struct init_exec *iexec) | |||
1865 | 1865 | ||
1866 | struct drm_nouveau_private *dev_priv = bios->dev->dev_private; | 1866 | struct drm_nouveau_private *dev_priv = bios->dev->dev_private; |
1867 | 1867 | ||
1868 | if (dev_priv->card_type >= NV_50) | 1868 | if (dev_priv->card_type >= NV_40) |
1869 | return 1; | 1869 | return 1; |
1870 | 1870 | ||
1871 | /* | 1871 | /* |
@@ -3765,7 +3765,6 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
3765 | */ | 3765 | */ |
3766 | 3766 | ||
3767 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 3767 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
3768 | struct init_exec iexec = {true, false}; | ||
3769 | struct nvbios *bios = &dev_priv->VBIOS; | 3768 | struct nvbios *bios = &dev_priv->VBIOS; |
3770 | uint8_t *table = &bios->data[bios->display.script_table_ptr]; | 3769 | uint8_t *table = &bios->data[bios->display.script_table_ptr]; |
3771 | uint8_t *otable = NULL; | 3770 | uint8_t *otable = NULL; |
@@ -3845,8 +3844,6 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
3845 | } | 3844 | } |
3846 | } | 3845 | } |
3847 | 3846 | ||
3848 | bios->display.output = dcbent; | ||
3849 | |||
3850 | if (pxclk == 0) { | 3847 | if (pxclk == 0) { |
3851 | script = ROM16(otable[6]); | 3848 | script = ROM16(otable[6]); |
3852 | if (!script) { | 3849 | if (!script) { |
@@ -3855,7 +3852,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
3855 | } | 3852 | } |
3856 | 3853 | ||
3857 | NV_TRACE(dev, "0x%04X: parsing output script 0\n", script); | 3854 | NV_TRACE(dev, "0x%04X: parsing output script 0\n", script); |
3858 | parse_init_table(bios, script, &iexec); | 3855 | nouveau_bios_run_init_table(dev, script, dcbent); |
3859 | } else | 3856 | } else |
3860 | if (pxclk == -1) { | 3857 | if (pxclk == -1) { |
3861 | script = ROM16(otable[8]); | 3858 | script = ROM16(otable[8]); |
@@ -3865,7 +3862,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
3865 | } | 3862 | } |
3866 | 3863 | ||
3867 | NV_TRACE(dev, "0x%04X: parsing output script 1\n", script); | 3864 | NV_TRACE(dev, "0x%04X: parsing output script 1\n", script); |
3868 | parse_init_table(bios, script, &iexec); | 3865 | nouveau_bios_run_init_table(dev, script, dcbent); |
3869 | } else | 3866 | } else |
3870 | if (pxclk == -2) { | 3867 | if (pxclk == -2) { |
3871 | if (table[4] >= 12) | 3868 | if (table[4] >= 12) |
@@ -3878,7 +3875,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
3878 | } | 3875 | } |
3879 | 3876 | ||
3880 | NV_TRACE(dev, "0x%04X: parsing output script 2\n", script); | 3877 | NV_TRACE(dev, "0x%04X: parsing output script 2\n", script); |
3881 | parse_init_table(bios, script, &iexec); | 3878 | nouveau_bios_run_init_table(dev, script, dcbent); |
3882 | } else | 3879 | } else |
3883 | if (pxclk > 0) { | 3880 | if (pxclk > 0) { |
3884 | script = ROM16(otable[table[4] + i*6 + 2]); | 3881 | script = ROM16(otable[table[4] + i*6 + 2]); |
@@ -3890,7 +3887,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
3890 | } | 3887 | } |
3891 | 3888 | ||
3892 | NV_TRACE(dev, "0x%04X: parsing clock script 0\n", script); | 3889 | NV_TRACE(dev, "0x%04X: parsing clock script 0\n", script); |
3893 | parse_init_table(bios, script, &iexec); | 3890 | nouveau_bios_run_init_table(dev, script, dcbent); |
3894 | } else | 3891 | } else |
3895 | if (pxclk < 0) { | 3892 | if (pxclk < 0) { |
3896 | script = ROM16(otable[table[4] + i*6 + 4]); | 3893 | script = ROM16(otable[table[4] + i*6 + 4]); |
@@ -3902,7 +3899,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
3902 | } | 3899 | } |
3903 | 3900 | ||
3904 | NV_TRACE(dev, "0x%04X: parsing clock script 1\n", script); | 3901 | NV_TRACE(dev, "0x%04X: parsing clock script 1\n", script); |
3905 | parse_init_table(bios, script, &iexec); | 3902 | nouveau_bios_run_init_table(dev, script, dcbent); |
3906 | } | 3903 | } |
3907 | 3904 | ||
3908 | return 0; | 3905 | return 0; |
@@ -5864,10 +5861,13 @@ nouveau_bios_run_init_table(struct drm_device *dev, uint16_t table, | |||
5864 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 5861 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
5865 | struct nvbios *bios = &dev_priv->VBIOS; | 5862 | struct nvbios *bios = &dev_priv->VBIOS; |
5866 | struct init_exec iexec = { true, false }; | 5863 | struct init_exec iexec = { true, false }; |
5864 | unsigned long flags; | ||
5867 | 5865 | ||
5866 | spin_lock_irqsave(&bios->lock, flags); | ||
5868 | bios->display.output = dcbent; | 5867 | bios->display.output = dcbent; |
5869 | parse_init_table(bios, table, &iexec); | 5868 | parse_init_table(bios, table, &iexec); |
5870 | bios->display.output = NULL; | 5869 | bios->display.output = NULL; |
5870 | spin_unlock_irqrestore(&bios->lock, flags); | ||
5871 | } | 5871 | } |
5872 | 5872 | ||
5873 | static bool NVInitVBIOS(struct drm_device *dev) | 5873 | static bool NVInitVBIOS(struct drm_device *dev) |
@@ -5876,6 +5876,7 @@ static bool NVInitVBIOS(struct drm_device *dev) | |||
5876 | struct nvbios *bios = &dev_priv->VBIOS; | 5876 | struct nvbios *bios = &dev_priv->VBIOS; |
5877 | 5877 | ||
5878 | memset(bios, 0, sizeof(struct nvbios)); | 5878 | memset(bios, 0, sizeof(struct nvbios)); |
5879 | spin_lock_init(&bios->lock); | ||
5879 | bios->dev = dev; | 5880 | bios->dev = dev; |
5880 | 5881 | ||
5881 | if (!NVShadowVBIOS(dev, bios->data)) | 5882 | if (!NVShadowVBIOS(dev, bios->data)) |