diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2013-05-08 13:45:14 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-05-10 15:56:37 -0400 |
commit | 3727d55e4d85836aa6cb759a965daaef88074150 (patch) | |
tree | b07b6410282d0d81efcd1c8b6641a5927df693c2 /drivers/gpu/drm/i915/i915_gem_stolen.c | |
parent | c9cddffc669408a361c62353a36dd40b469dd9c2 (diff) |
drm/i915: allow stolen, pre-allocated objects to avoid GTT allocation v2
In some cases, we may not need GTT address space allocated to a stolen
object, so allow passing -1 to the preallocated function to indicate as
much.
v2: remove BUG_ON(gtt_offset & 4095) now that -1 is allowed (Ville)
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_stolen.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_stolen.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index 913994cd0a3a..89cbfab9570e 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c | |||
@@ -339,7 +339,6 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, | |||
339 | 339 | ||
340 | /* KISS and expect everything to be page-aligned */ | 340 | /* KISS and expect everything to be page-aligned */ |
341 | BUG_ON(stolen_offset & 4095); | 341 | BUG_ON(stolen_offset & 4095); |
342 | BUG_ON(gtt_offset & 4095); | ||
343 | BUG_ON(size & 4095); | 342 | BUG_ON(size & 4095); |
344 | 343 | ||
345 | if (WARN_ON(size == 0)) | 344 | if (WARN_ON(size == 0)) |
@@ -360,6 +359,10 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, | |||
360 | return NULL; | 359 | return NULL; |
361 | } | 360 | } |
362 | 361 | ||
362 | /* Some objects just need physical mem from stolen space */ | ||
363 | if (gtt_offset == -1) | ||
364 | return obj; | ||
365 | |||
363 | /* To simplify the initialisation sequence between KMS and GTT, | 366 | /* To simplify the initialisation sequence between KMS and GTT, |
364 | * we allow construction of the stolen object prior to | 367 | * we allow construction of the stolen object prior to |
365 | * setting up the GTT space. The actual reservation will occur | 368 | * setting up the GTT space. The actual reservation will occur |