diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-22 11:10:00 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-04-12 15:14:04 -0400 |
commit | 9a5a53b3923d6e8cc4d3b352301059ac6b5c8f68 (patch) | |
tree | a8b5492584e236e4deca2565be0d3db9d066ecaf /drivers/gpu/drm/i915/intel_display.c | |
parent | cce66a283e36e7479774de47ae9f33f7db2b8fcf (diff) |
drm/i915: Reorganise rules for get_fence/put_fence
By simplifying the rules to calling get_fence when writing to the
through the GTT in a tiled manner, and calling put_fence before writing
to the object through the GTT in a linear manner, the code becomes
clearer and there is less chance of making a mistake.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[danvet: fixed up conflict with ppgtt code and spelling in a new
comment.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 37514a52b05c..9dfa1fa39b39 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2152,13 +2152,11 @@ intel_pin_and_fence_fb_obj(struct drm_device *dev, | |||
2152 | * framebuffer compression. For simplicity, we always install | 2152 | * framebuffer compression. For simplicity, we always install |
2153 | * a fence as the cost is not that onerous. | 2153 | * a fence as the cost is not that onerous. |
2154 | */ | 2154 | */ |
2155 | if (obj->tiling_mode != I915_TILING_NONE) { | 2155 | ret = i915_gem_object_get_fence(obj, pipelined); |
2156 | ret = i915_gem_object_get_fence(obj, pipelined); | 2156 | if (ret) |
2157 | if (ret) | 2157 | goto err_unpin; |
2158 | goto err_unpin; | ||
2159 | 2158 | ||
2160 | i915_gem_object_pin_fence(obj); | 2159 | i915_gem_object_pin_fence(obj); |
2161 | } | ||
2162 | 2160 | ||
2163 | dev_priv->mm.interruptible = true; | 2161 | dev_priv->mm.interruptible = true; |
2164 | return 0; | 2162 | return 0; |