diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-02-14 08:01:11 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-02-14 08:16:58 -0500 |
commit | 1ec9e26ddab06459e89a890431b2de064c5d1056 (patch) | |
tree | 6ea1f8cfcffa2acf9ffec2fc12b197cc65e1d978 /drivers/gpu/drm/i915/intel_ringbuffer.c | |
parent | 931c1c26983b4f84e33b78579fc8d57e4a14c6b4 (diff) |
drm/i915: Consolidate binding parameters into flags
Anything more than just one bool parameter is just a pain to read,
symbolic constants are much better.
Split out from Chris' vma-binding rework patch.
v2: Undo the behaviour change in object_pin that Chris spotted.
v3: Split out misplaced hunk to handle set_cache_level errors,
spotted by Jani.
v4: Keep the current over-zealous binding logic in the execbuffer code
working with a quick hack while the overall binding code gets shuffled
around.
v5: Reorder the PIN_ flags for more natural patch splitup.
v6: Pull out the PIN_GLOBAL split-up again.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index ae6d234b8c12..f256d5fe46f8 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -533,7 +533,7 @@ init_pipe_control(struct intel_ring_buffer *ring) | |||
533 | 533 | ||
534 | i915_gem_object_set_cache_level(ring->scratch.obj, I915_CACHE_LLC); | 534 | i915_gem_object_set_cache_level(ring->scratch.obj, I915_CACHE_LLC); |
535 | 535 | ||
536 | ret = i915_gem_obj_ggtt_pin(ring->scratch.obj, 4096, true, false); | 536 | ret = i915_gem_obj_ggtt_pin(ring->scratch.obj, 4096, 0); |
537 | if (ret) | 537 | if (ret) |
538 | goto err_unref; | 538 | goto err_unref; |
539 | 539 | ||
@@ -1273,10 +1273,9 @@ static int init_status_page(struct intel_ring_buffer *ring) | |||
1273 | 1273 | ||
1274 | i915_gem_object_set_cache_level(obj, I915_CACHE_LLC); | 1274 | i915_gem_object_set_cache_level(obj, I915_CACHE_LLC); |
1275 | 1275 | ||
1276 | ret = i915_gem_obj_ggtt_pin(obj, 4096, true, false); | 1276 | ret = i915_gem_obj_ggtt_pin(obj, 4096, PIN_MAPPABLE); |
1277 | if (ret != 0) { | 1277 | if (ret) |
1278 | goto err_unref; | 1278 | goto err_unref; |
1279 | } | ||
1280 | 1279 | ||
1281 | ring->status_page.gfx_addr = i915_gem_obj_ggtt_offset(obj); | 1280 | ring->status_page.gfx_addr = i915_gem_obj_ggtt_offset(obj); |
1282 | ring->status_page.page_addr = kmap(sg_page(obj->pages->sgl)); | 1281 | ring->status_page.page_addr = kmap(sg_page(obj->pages->sgl)); |
@@ -1356,7 +1355,7 @@ static int intel_init_ring_buffer(struct drm_device *dev, | |||
1356 | 1355 | ||
1357 | ring->obj = obj; | 1356 | ring->obj = obj; |
1358 | 1357 | ||
1359 | ret = i915_gem_obj_ggtt_pin(obj, PAGE_SIZE, true, false); | 1358 | ret = i915_gem_obj_ggtt_pin(obj, PAGE_SIZE, PIN_MAPPABLE); |
1360 | if (ret) | 1359 | if (ret) |
1361 | goto err_unref; | 1360 | goto err_unref; |
1362 | 1361 | ||
@@ -1919,7 +1918,7 @@ int intel_init_render_ring_buffer(struct drm_device *dev) | |||
1919 | return -ENOMEM; | 1918 | return -ENOMEM; |
1920 | } | 1919 | } |
1921 | 1920 | ||
1922 | ret = i915_gem_obj_ggtt_pin(obj, 0, true, false); | 1921 | ret = i915_gem_obj_ggtt_pin(obj, 0, PIN_MAPPABLE); |
1923 | if (ret != 0) { | 1922 | if (ret != 0) { |
1924 | drm_gem_object_unreference(&obj->base); | 1923 | drm_gem_object_unreference(&obj->base); |
1925 | DRM_ERROR("Failed to ping batch bo\n"); | 1924 | DRM_ERROR("Failed to ping batch bo\n"); |