diff mbox

drm/i915: Set stolen reserved to 0 for pre-g4x platforms

Message ID 1441995269-8383-1-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjala Sept. 11, 2015, 6:14 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

This stolen reserved stuff was introduced on g4x, so no need to waste
stolen on older platforms. Unfortunately configdb is no more so I can't
look up the right way to detect this stuff. I do have one hint as to
where the register might be on ctg, but I don't have a ctg to test it,
and on the elk I have here it doesn't contain sensible looking data.
For ilk grits suggegsts it might be in the same place as on snb (the
original PCI reg, not the mirror) but I can't be entirely sure about it
The register shows a round zero on my ilk.

So when there's no really good data for any of these platforms leave the
current "assume 1MiB" approach in place.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Chris Wilson Sept. 12, 2015, 7:55 a.m. UTC | #1
On Fri, Sep 11, 2015 at 09:14:29PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> This stolen reserved stuff was introduced on g4x, so no need to waste
> stolen on older platforms. Unfortunately configdb is no more so I can't
> look up the right way to detect this stuff. I do have one hint as to
> where the register might be on ctg, but I don't have a ctg to test it,
> and on the elk I have here it doesn't contain sensible looking data.
> For ilk grits suggegsts it might be in the same place as on snb (the
> original PCI reg, not the mirror) but I can't be entirely sure about it
> The register shows a round zero on my ilk.
> 
> So when there's no really good data for any of these platforms leave the
> current "assume 1MiB" approach in place.
> 
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

The early platforms definitely do not have the feature for which the
stolen was reserved for. 

Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index f361c4a..bf26ecc 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -281,7 +281,7 @@  static void bdw_get_stolen_reserved(struct drm_i915_private *dev_priv,
 int i915_gem_init_stolen(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	unsigned long reserved_total, reserved_base, reserved_size;
+	unsigned long reserved_total, reserved_base = 0, reserved_size;
 	unsigned long stolen_top;
 
 	mutex_init(&dev_priv->mm.stolen_lock);
@@ -306,6 +306,9 @@  int i915_gem_init_stolen(struct drm_device *dev)
 	case 2:
 	case 3:
 	case 4:
+		if (!IS_G4X(dev))
+			break;
+		/* fall through */
 	case 5:
 		/* Assume the gen6 maximum for the older platforms. */
 		reserved_size = 1024 * 1024;