Skip to content

Commit

Permalink
drm/i915/gem: Prefer drm_WARN* over WARN*
Browse files Browse the repository at this point in the history
struct drm_device specific drm_WARN* macros include device information
in the backtrace, so we know what device the warnings originate from.

Prefer drm_WARN* over WARN* at places where struct drm_device pointer
can be extracted.

Signed-off-by: Pankaj Bharadiya <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
bpankajl authored and jnikula committed May 19, 2020
1 parent ef3929b commit 6db20e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,7 @@ eb_relocate_entry(struct i915_execbuffer *eb,
err = i915_vma_bind(target->vma,
target->vma->obj->cache_level,
PIN_GLOBAL, NULL);
if (WARN_ONCE(err,
if (drm_WARN_ONCE(&i915->drm, err,
"Unexpected failure to bind target VMA!"))
return err;
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/gem/i915_gem_phys.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
void *dst;
int i;

if (WARN_ON(i915_gem_object_needs_bit17_swizzle(obj)))
if (drm_WARN_ON(obj->base.dev,
i915_gem_object_needs_bit17_swizzle(obj)))
return -EINVAL;

/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gem/i915_gem_userptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ i915_gem_userptr_init__mmu_notifier(struct drm_i915_gem_object *obj,
if (flags & I915_USERPTR_UNSYNCHRONIZED)
return capable(CAP_SYS_ADMIN) ? 0 : -EPERM;

if (WARN_ON(obj->userptr.mm == NULL))
if (drm_WARN_ON(obj->base.dev, obj->userptr.mm == NULL))
return -EINVAL;

mn = i915_mmu_notifier_find(obj->userptr.mm);
Expand Down

0 comments on commit 6db20e2

Please sign in to comment.