diff options
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 051c4db7a1d3..9d67b4853030 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -891,7 +891,7 @@ intel_alloc_mchbar_resource(struct drm_device *dev) | |||
891 | int reg = IS_I965G(dev) ? MCHBAR_I965 : MCHBAR_I915; | 891 | int reg = IS_I965G(dev) ? MCHBAR_I965 : MCHBAR_I915; |
892 | u32 temp_lo, temp_hi = 0; | 892 | u32 temp_lo, temp_hi = 0; |
893 | u64 mchbar_addr; | 893 | u64 mchbar_addr; |
894 | int ret = 0; | 894 | int ret; |
895 | 895 | ||
896 | if (IS_I965G(dev)) | 896 | if (IS_I965G(dev)) |
897 | pci_read_config_dword(dev_priv->bridge_dev, reg + 4, &temp_hi); | 897 | pci_read_config_dword(dev_priv->bridge_dev, reg + 4, &temp_hi); |
@@ -901,22 +901,23 @@ intel_alloc_mchbar_resource(struct drm_device *dev) | |||
901 | /* If ACPI doesn't have it, assume we need to allocate it ourselves */ | 901 | /* If ACPI doesn't have it, assume we need to allocate it ourselves */ |
902 | #ifdef CONFIG_PNP | 902 | #ifdef CONFIG_PNP |
903 | if (mchbar_addr && | 903 | if (mchbar_addr && |
904 | pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE)) { | 904 | pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE)) |
905 | ret = 0; | 905 | return 0; |
906 | goto out; | ||
907 | } | ||
908 | #endif | 906 | #endif |
909 | 907 | ||
910 | /* Get some space for it */ | 908 | /* Get some space for it */ |
911 | ret = pci_bus_alloc_resource(dev_priv->bridge_dev->bus, &dev_priv->mch_res, | 909 | dev_priv->mch_res.name = "i915 MCHBAR"; |
910 | dev_priv->mch_res.flags = IORESOURCE_MEM; | ||
911 | ret = pci_bus_alloc_resource(dev_priv->bridge_dev->bus, | ||
912 | &dev_priv->mch_res, | ||
912 | MCHBAR_SIZE, MCHBAR_SIZE, | 913 | MCHBAR_SIZE, MCHBAR_SIZE, |
913 | PCIBIOS_MIN_MEM, | 914 | PCIBIOS_MIN_MEM, |
914 | 0, pcibios_align_resource, | 915 | 0, pcibios_align_resource, |
915 | dev_priv->bridge_dev); | 916 | dev_priv->bridge_dev); |
916 | if (ret) { | 917 | if (ret) { |
917 | DRM_DEBUG_DRIVER("failed bus alloc: %d\n", ret); | 918 | DRM_DEBUG_DRIVER("failed bus alloc: %d\n", ret); |
918 | dev_priv->mch_res.start = 0; | 919 | dev_priv->mch_res.start = 0; |
919 | goto out; | 920 | return ret; |
920 | } | 921 | } |
921 | 922 | ||
922 | if (IS_I965G(dev)) | 923 | if (IS_I965G(dev)) |
@@ -925,8 +926,7 @@ intel_alloc_mchbar_resource(struct drm_device *dev) | |||
925 | 926 | ||
926 | pci_write_config_dword(dev_priv->bridge_dev, reg, | 927 | pci_write_config_dword(dev_priv->bridge_dev, reg, |
927 | lower_32_bits(dev_priv->mch_res.start)); | 928 | lower_32_bits(dev_priv->mch_res.start)); |
928 | out: | 929 | return 0; |
929 | return ret; | ||
930 | } | 930 | } |
931 | 931 | ||
932 | /* Setup MCHBAR if possible, return true if we should disable it again */ | 932 | /* Setup MCHBAR if possible, return true if we should disable it again */ |