aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bios.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-07-19 21:08:25 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-07-25 21:42:42 -0400
commit03cd06ca9046190e8418749c2c8f636e2625556c (patch)
tree632eaef04358ff0e1e4c0d1078d23d8ca09d4b41 /drivers/gpu/drm/nouveau/nouveau_bios.c
parentd06ab841d14f3747823e88e5172047367e051a32 (diff)
drm/nouveau: No need to lock/unlock the VGA CRTC regs all the time.
Locking only makes sense in the VBIOS parsing code as it's executed before CRTC init. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bios.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 665f0d64f2c6..3b5523eff43a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -6607,7 +6607,6 @@ static bool
6607nouveau_bios_posted(struct drm_device *dev) 6607nouveau_bios_posted(struct drm_device *dev)
6608{ 6608{
6609 struct drm_nouveau_private *dev_priv = dev->dev_private; 6609 struct drm_nouveau_private *dev_priv = dev->dev_private;
6610 bool was_locked;
6611 unsigned htotal; 6610 unsigned htotal;
6612 6611
6613 if (dev_priv->chipset >= NV_50) { 6612 if (dev_priv->chipset >= NV_50) {
@@ -6617,13 +6616,14 @@ nouveau_bios_posted(struct drm_device *dev)
6617 return true; 6616 return true;
6618 } 6617 }
6619 6618
6620 was_locked = NVLockVgaCrtcs(dev, false); 6619 NVLockVgaCrtcs(dev, false);
6621 htotal = NVReadVgaCrtc(dev, 0, 0x06); 6620 htotal = NVReadVgaCrtc(dev, 0, 0x06);
6622 htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x01) << 8; 6621 htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x01) << 8;
6623 htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x20) << 4; 6622 htotal |= (NVReadVgaCrtc(dev, 0, 0x07) & 0x20) << 4;
6624 htotal |= (NVReadVgaCrtc(dev, 0, 0x25) & 0x01) << 10; 6623 htotal |= (NVReadVgaCrtc(dev, 0, 0x25) & 0x01) << 10;
6625 htotal |= (NVReadVgaCrtc(dev, 0, 0x41) & 0x01) << 11; 6624 htotal |= (NVReadVgaCrtc(dev, 0, 0x41) & 0x01) << 11;
6626 NVLockVgaCrtcs(dev, was_locked); 6625 NVLockVgaCrtcs(dev, true);
6626
6627 return (htotal != 0); 6627 return (htotal != 0);
6628} 6628}
6629 6629
@@ -6632,7 +6632,6 @@ nouveau_bios_init(struct drm_device *dev)
6632{ 6632{
6633 struct drm_nouveau_private *dev_priv = dev->dev_private; 6633 struct drm_nouveau_private *dev_priv = dev->dev_private;
6634 struct nvbios *bios = &dev_priv->vbios; 6634 struct nvbios *bios = &dev_priv->vbios;
6635 bool was_locked;
6636 int ret; 6635 int ret;
6637 6636
6638 if (!NVInitVBIOS(dev)) 6637 if (!NVInitVBIOS(dev))
@@ -6667,14 +6666,14 @@ nouveau_bios_init(struct drm_device *dev)
6667 return ret; 6666 return ret;
6668 6667
6669 /* feature_byte on BMP is poor, but init always sets CR4B */ 6668 /* feature_byte on BMP is poor, but init always sets CR4B */
6670 was_locked = NVLockVgaCrtcs(dev, false); 6669 NVLockVgaCrtcs(dev, false);
6671 if (bios->major_version < 5) 6670 if (bios->major_version < 5)
6672 bios->is_mobile = NVReadVgaCrtc(dev, 0, NV_CIO_CRE_4B) & 0x40; 6671 bios->is_mobile = NVReadVgaCrtc(dev, 0, NV_CIO_CRE_4B) & 0x40;
6673 6672
6674 /* all BIT systems need p_f_m_t for digital_min_front_porch */ 6673 /* all BIT systems need p_f_m_t for digital_min_front_porch */
6675 if (bios->is_mobile || bios->major_version >= 5) 6674 if (bios->is_mobile || bios->major_version >= 5)
6676 ret = parse_fp_mode_table(dev, bios); 6675 ret = parse_fp_mode_table(dev, bios);
6677 NVLockVgaCrtcs(dev, was_locked); 6676 NVLockVgaCrtcs(dev, true);
6678 6677
6679 /* allow subsequent scripts to execute */ 6678 /* allow subsequent scripts to execute */
6680 bios->execute = true; 6679 bios->execute = true;