Message ID | 20170119192659.31789-4-chris@chris-wilson.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On to, 2017-01-19 at 19:26 +0000, Chris Wilson wrote: > When pinning into the global GTT, an error from creating the VMA is > unlikely, so mark it so. > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> <SNIP> > vma = i915_vma_instance(obj, vm, view); > - if (IS_ERR(vma)) > + if (unlikely(IS_ERR(vma))) > return vma; I bet we have many spots similar to this, any ideas how we could get some good code coverage testing data from the selftests? I think we only now optimize when it appears during debugging some specific problem. Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Regards, Joonas
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index fdb6e0ece18c..ae13450fcbe2 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3680,7 +3680,7 @@ i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj, lockdep_assert_held(&obj->base.dev->struct_mutex); vma = i915_vma_instance(obj, vm, view); - if (IS_ERR(vma)) + if (unlikely(IS_ERR(vma))) return vma; if (i915_vma_misplaced(vma, size, alignment, flags)) {
When pinning into the global GTT, an error from creating the VMA is unlikely, so mark it so. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- drivers/gpu/drm/i915/i915_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)