diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index e7e69ccce5c9..61d932261356 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -6205,6 +6205,30 @@ nouveau_bios_i2c_devices_takedown(struct drm_device *dev) | |||
6205 | nouveau_i2c_fini(dev, entry); | 6205 | nouveau_i2c_fini(dev, entry); |
6206 | } | 6206 | } |
6207 | 6207 | ||
6208 | static bool | ||
6209 | nouveau_bios_posted(struct drm_device *dev) | ||
6210 | { | ||
6211 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
6212 | bool was_locked; | ||
6213 | unsigned htotal; | ||
6214 | |||
6215 | if (dev_priv->chipset >= NV_50) { | ||
6216 | if (NVReadVgaCrtc(dev, 0, 0x00) == 0 && | ||
6217 | NVReadVgaCrtc(dev, 0, 0x1a) == 0) | ||
6218 | return false; | ||
6219 | return true; | ||
6220 | } | ||
6221 | |||
6222 | was_locked = NVLockVgaCrtcs(dev, false); | ||
6223 | htotal = NVReadVgaCrtc(dev, 0, 0x06); | ||
6224 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x01) << 8; | ||
6225 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x20) << 4; | ||
6226 | htotal |= (NVReadVgaCrtc(dev, 0, 0x25) & 0x01) << 10; | ||
6227 | htotal |= (NVReadVgaCrtc(dev, 0, 0x41) & 0x01) << 11; | ||
6228 | NVLockVgaCrtcs(dev, was_locked); | ||
6229 | return (htotal != 0); | ||
6230 | } | ||
6231 | |||
6208 | int | 6232 | int |
6209 | nouveau_bios_init(struct drm_device *dev) | 6233 | nouveau_bios_init(struct drm_device *dev) |
6210 | { | 6234 | { |
@@ -6239,9 +6263,7 @@ nouveau_bios_init(struct drm_device *dev) | |||
6239 | bios->execute = false; | 6263 | bios->execute = false; |
6240 | 6264 | ||
6241 | /* ... unless card isn't POSTed already */ | 6265 | /* ... unless card isn't POSTed already */ |
6242 | if (dev_priv->card_type >= NV_10 && | 6266 | if (!nouveau_bios_posted(dev)) { |
6243 | NVReadVgaCrtc(dev, 0, 0x00) == 0 && | ||
6244 | NVReadVgaCrtc(dev, 0, 0x1a) == 0) { | ||
6245 | NV_INFO(dev, "Adaptor not initialised\n"); | 6267 | NV_INFO(dev, "Adaptor not initialised\n"); |
6246 | if (dev_priv->card_type < NV_50) { | 6268 | if (dev_priv->card_type < NV_50) { |
6247 | NV_ERROR(dev, "Unable to POST this chipset\n"); | 6269 | NV_ERROR(dev, "Unable to POST this chipset\n"); |