diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-07-24 11:41:48 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-07-25 21:43:43 -0400 |
commit | 946fd35f88ae7ef910229e7995ab0c32d52517b4 (patch) | |
tree | 81458483bf8d1be8a579844a1a735ac37426b425 | |
parent | c88c2e0631b03ffb1485f8790a5b659beb1ac0be (diff) |
drm/nouveau: Get rid of the remaining VGA CRTC locking.
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_i2c.c | 9 |
2 files changed, 5 insertions, 17 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index aae29cc0cd80..40231cea465e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -6550,11 +6550,8 @@ nouveau_run_vbios_init(struct drm_device *dev) | |||
6550 | struct nvbios *bios = &dev_priv->vbios; | 6550 | struct nvbios *bios = &dev_priv->vbios; |
6551 | int i, ret = 0; | 6551 | int i, ret = 0; |
6552 | 6552 | ||
6553 | NVLockVgaCrtcs(dev, false); | 6553 | /* Reset the BIOS head to 0. */ |
6554 | if (nv_two_heads(dev)) { | 6554 | bios->state.crtchead = 0; |
6555 | bios->state.crtchead = 0; | ||
6556 | NVSetOwner(dev, 0); | ||
6557 | } | ||
6558 | 6555 | ||
6559 | if (bios->major_version < 5) /* BMP only */ | 6556 | if (bios->major_version < 5) /* BMP only */ |
6560 | load_nv17_hw_sequencer_ucode(dev, bios); | 6557 | load_nv17_hw_sequencer_ucode(dev, bios); |
@@ -6587,8 +6584,6 @@ nouveau_run_vbios_init(struct drm_device *dev) | |||
6587 | } | 6584 | } |
6588 | } | 6585 | } |
6589 | 6586 | ||
6590 | NVLockVgaCrtcs(dev, true); | ||
6591 | |||
6592 | return ret; | 6587 | return ret; |
6593 | } | 6588 | } |
6594 | 6589 | ||
@@ -6618,13 +6613,11 @@ nouveau_bios_posted(struct drm_device *dev) | |||
6618 | return true; | 6613 | return true; |
6619 | } | 6614 | } |
6620 | 6615 | ||
6621 | NVLockVgaCrtcs(dev, false); | ||
6622 | htotal = NVReadVgaCrtc(dev, 0, 0x06); | 6616 | htotal = NVReadVgaCrtc(dev, 0, 0x06); |
6623 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x01) << 8; | 6617 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x01) << 8; |
6624 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x20) << 4; | 6618 | htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x20) << 4; |
6625 | htotal |= (NVReadVgaCrtc(dev, 0, 0x25) & 0x01) << 10; | 6619 | htotal |= (NVReadVgaCrtc(dev, 0, 0x25) & 0x01) << 10; |
6626 | htotal |= (NVReadVgaCrtc(dev, 0, 0x41) & 0x01) << 11; | 6620 | htotal |= (NVReadVgaCrtc(dev, 0, 0x41) & 0x01) << 11; |
6627 | NVLockVgaCrtcs(dev, true); | ||
6628 | 6621 | ||
6629 | return (htotal != 0); | 6622 | return (htotal != 0); |
6630 | } | 6623 | } |
@@ -6668,14 +6661,12 @@ nouveau_bios_init(struct drm_device *dev) | |||
6668 | return ret; | 6661 | return ret; |
6669 | 6662 | ||
6670 | /* feature_byte on BMP is poor, but init always sets CR4B */ | 6663 | /* feature_byte on BMP is poor, but init always sets CR4B */ |
6671 | NVLockVgaCrtcs(dev, false); | ||
6672 | if (bios->major_version < 5) | 6664 | if (bios->major_version < 5) |
6673 | bios->is_mobile = NVReadVgaCrtc(dev, 0, NV_CIO_CRE_4B) & 0x40; | 6665 | bios->is_mobile = NVReadVgaCrtc(dev, 0, NV_CIO_CRE_4B) & 0x40; |
6674 | 6666 | ||
6675 | /* all BIT systems need p_f_m_t for digital_min_front_porch */ | 6667 | /* all BIT systems need p_f_m_t for digital_min_front_porch */ |
6676 | if (bios->is_mobile || bios->major_version >= 5) | 6668 | if (bios->is_mobile || bios->major_version >= 5) |
6677 | ret = parse_fp_mode_table(dev, bios); | 6669 | ret = parse_fp_mode_table(dev, bios); |
6678 | NVLockVgaCrtcs(dev, true); | ||
6679 | 6670 | ||
6680 | /* allow subsequent scripts to execute */ | 6671 | /* allow subsequent scripts to execute */ |
6681 | bios->execute = true; | 6672 | bios->execute = true; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c index 5588e66dd9fc..cb0cb34440c6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.c +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c | |||
@@ -305,21 +305,18 @@ nouveau_i2c_identify(struct drm_device *dev, const char *what, | |||
305 | struct i2c_board_info *info, int index) | 305 | struct i2c_board_info *info, int index) |
306 | { | 306 | { |
307 | struct nouveau_i2c_chan *i2c = nouveau_i2c_find(dev, index); | 307 | struct nouveau_i2c_chan *i2c = nouveau_i2c_find(dev, index); |
308 | int was_locked, i; | 308 | int i; |
309 | 309 | ||
310 | was_locked = NVLockVgaCrtcs(dev, false); | ||
311 | NV_DEBUG(dev, "Probing %ss on I2C bus: %d\n", what, index); | 310 | NV_DEBUG(dev, "Probing %ss on I2C bus: %d\n", what, index); |
312 | 311 | ||
313 | for (i = 0; info[i].addr; i++) { | 312 | for (i = 0; info[i].addr; i++) { |
314 | if (nouveau_probe_i2c_addr(i2c, info[i].addr)) { | 313 | if (nouveau_probe_i2c_addr(i2c, info[i].addr)) { |
315 | NV_INFO(dev, "Detected %s: %s\n", what, info[i].type); | 314 | NV_INFO(dev, "Detected %s: %s\n", what, info[i].type); |
316 | goto out; | 315 | return i; |
317 | } | 316 | } |
318 | } | 317 | } |
319 | 318 | ||
320 | NV_DEBUG(dev, "No devices found.\n"); | 319 | NV_DEBUG(dev, "No devices found.\n"); |
321 | out: | ||
322 | NVLockVgaCrtcs(dev, was_locked); | ||
323 | 320 | ||
324 | return info[i].addr ? i : -ENODEV; | 321 | return -ENODEV; |
325 | } | 322 | } |