aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_gtt.c
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2014-01-09 13:02:46 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-09-24 08:47:39 -0400
commit663750141ed953c42b6b0e3cfb2450453bc38151 (patch)
treee5d875ae7f8cfcf45720e4dafb1cd7e7c6b77226 /drivers/gpu/drm/i915/i915_gem_gtt.c
parent1b1aad754cb26fd073b82eb860126cb812157ae9 (diff)
drm/i915/skl: Add the additional graphics stolen sizes
Skylake introduces new stolen memory sizes starting at 0xf0 (4MB) and growing by 4MB increments from there. v2: Rebase on top of the early-quirk changes from Ville. v3: Rebase on top of the PCI_IDS/IDS macro rename Reviewed-by: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 6f410cfb0510..d78695de8101 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1847,6 +1847,18 @@ static size_t chv_get_stolen_size(u16 gmch_ctrl)
1847 return (gmch_ctrl - 0x17 + 9) << 22; 1847 return (gmch_ctrl - 0x17 + 9) << 22;
1848} 1848}
1849 1849
1850static size_t gen9_get_stolen_size(u16 gen9_gmch_ctl)
1851{
1852 gen9_gmch_ctl >>= BDW_GMCH_GMS_SHIFT;
1853 gen9_gmch_ctl &= BDW_GMCH_GMS_MASK;
1854
1855 if (gen9_gmch_ctl < 0xf0)
1856 return gen9_gmch_ctl << 25; /* 32 MB units */
1857 else
1858 /* 4MB increments starting at 0xf0 for 4MB */
1859 return (gen9_gmch_ctl - 0xf0 + 1) << 22;
1860}
1861
1850static int ggtt_probe_common(struct drm_device *dev, 1862static int ggtt_probe_common(struct drm_device *dev,
1851 size_t gtt_size) 1863 size_t gtt_size)
1852{ 1864{
@@ -1943,7 +1955,10 @@ static int gen8_gmch_probe(struct drm_device *dev,
1943 1955
1944 pci_read_config_word(dev->pdev, SNB_GMCH_CTRL, &snb_gmch_ctl); 1956 pci_read_config_word(dev->pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
1945 1957
1946 if (IS_CHERRYVIEW(dev)) { 1958 if (INTEL_INFO(dev)->gen >= 9) {
1959 *stolen = gen9_get_stolen_size(snb_gmch_ctl);
1960 gtt_size = gen8_get_total_gtt_size(snb_gmch_ctl);
1961 } else if (IS_CHERRYVIEW(dev)) {
1947 *stolen = chv_get_stolen_size(snb_gmch_ctl); 1962 *stolen = chv_get_stolen_size(snb_gmch_ctl);
1948 gtt_size = chv_get_total_gtt_size(snb_gmch_ctl); 1963 gtt_size = chv_get_total_gtt_size(snb_gmch_ctl);
1949 } else { 1964 } else {