drm/i915: checking IS_ERR() instead of NULL
Subsystems (3)
PATCH 1/1 drm/i915: checking IS_ERR() instead of NULL
We switched from calling i915_gem_alloc_context_obj() to calling i915_gem_alloc_object() so the error handling needs to be updated to check for NULL instead of IS_ERR().
drivers/gpu/drm/i915/intel_lrc.c +3 -4
@@ -1895,10 +1895,9 @@ int intel_lr_context_deferred_create(struct intel_context *ctx, context_size =round_up (get_lr_context_size (ring),4096 ); ctx_obj =i915_gem_alloc_object (dev, context_size); -if (IS_ERR (ctx_obj)) { - ret =PTR_ERR (ctx_obj); -DRM_DEBUG_DRIVER ("Alloc LRC backing obj failed: %d\n" , ret); -return ret; +if (!ctx_obj) { +DRM_DEBUG_DRIVER ("Alloc LRC backing obj failed.\n" ); +return -ENOMEM ; }if (is_global_default_ctx) {
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 3 lines · Dan Carpenter
We switched from calling
i915_gem_alloc_context_obj()to callingi915_gem_alloc_object()so the error handling needs to be updated to check for NULL instead ofIS_ERR().
I had a patch to change i915_gem_alloc_object() to report the correct error rather than NULL - which can come in surprisingly handy at times...
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · Chris Wilson
Quoted 3 lines · Dan Carpenter
We switched from calling
i915_gem_alloc_context_obj()to callingi915_gem_alloc_object()so the error handling needs to be updated to check for NULL instead ofIS_ERR().I had a patch to change
i915_gem_alloc_object()to report the correct error rather than NULL - which can come in surprisingly handy at times...
That also works, of course. Send it. :)
regards,
dan carpenter
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Dan Carpenter
Quoted 8 lines · Chris Wilson
Quoted 3 lines · Dan Carpenter
We switched from calling
i915_gem_alloc_context_obj()to callingi915_gem_alloc_object()so the error handling needs to be updated to check for NULL instead ofIS_ERR().I had a patch to change
i915_gem_alloc_object()to report the correct error rather than NULL - which can come in surprisingly handy at times...That also works, of course. Send it. :)
Doesn't seem to have shown up yet, I applied your patch meanwhile.
Thanks, Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel