mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
drm/i915/fbdev: Make WARN* drm specific where drm_device ptr is available
Drm specific drm_WARN* calls include device information in the backtrace, so we know what device the warnings originate from. Covert all the calls of WARN* with device specific drm_WARN* variants in functions where drm_device struct pointer is readily available. The conversion was done automatically with below coccinelle semantic patch. checkpatch errors/warnings are fixed manually. @rule1@ identifier func, T; @@ func(...) { ... struct drm_device *T = ...; <... ( -WARN( +drm_WARN(T, ...) | -WARN_ON( +drm_WARN_ON(T, ...) | -WARN_ONCE( +drm_WARN_ONCE(T, ...) | -WARN_ON_ONCE( +drm_WARN_ON_ONCE(T, ...) ) ...> } @rule2@ identifier func, T; @@ func(struct drm_device *T,...) { <... ( -WARN( +drm_WARN(T, ...) | -WARN_ON( +drm_WARN_ON(T, ...) | -WARN_ONCE( +drm_WARN_ONCE(T, ...) | -WARN_ON_ONCE( +drm_WARN_ON_ONCE(T, ...) ) ...> } Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200128181603.27767-12-pankaj.laxminarayan.bharadiya@intel.com
This commit is contained in:
parent
6a0e032fb5
commit
5836019a87
1 changed files with 7 additions and 6 deletions
|
@ -191,7 +191,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
||||||
drm_framebuffer_put(&intel_fb->base);
|
drm_framebuffer_put(&intel_fb->base);
|
||||||
intel_fb = ifbdev->fb = NULL;
|
intel_fb = ifbdev->fb = NULL;
|
||||||
}
|
}
|
||||||
if (!intel_fb || WARN_ON(!intel_fb_obj(&intel_fb->base))) {
|
if (!intel_fb || drm_WARN_ON(dev, !intel_fb_obj(&intel_fb->base))) {
|
||||||
DRM_DEBUG_KMS("no BIOS fb, allocating a new one\n");
|
DRM_DEBUG_KMS("no BIOS fb, allocating a new one\n");
|
||||||
ret = intelfb_alloc(helper, sizes);
|
ret = intelfb_alloc(helper, sizes);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -410,7 +410,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
|
||||||
if (!crtc->state->active)
|
if (!crtc->state->active)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
WARN(!crtc->primary->state->fb,
|
drm_WARN(dev, !crtc->primary->state->fb,
|
||||||
"re-used BIOS config but lost an fb on crtc %d\n",
|
"re-used BIOS config but lost an fb on crtc %d\n",
|
||||||
crtc->base.id);
|
crtc->base.id);
|
||||||
}
|
}
|
||||||
|
@ -439,7 +439,8 @@ int intel_fbdev_init(struct drm_device *dev)
|
||||||
struct intel_fbdev *ifbdev;
|
struct intel_fbdev *ifbdev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (WARN_ON(!HAS_DISPLAY(dev_priv) || !INTEL_DISPLAY_ENABLED(dev_priv)))
|
if (drm_WARN_ON(dev, !HAS_DISPLAY(dev_priv) ||
|
||||||
|
!INTEL_DISPLAY_ENABLED(dev_priv)))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
|
ifbdev = kzalloc(sizeof(struct intel_fbdev), GFP_KERNEL);
|
||||||
|
@ -569,7 +570,7 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
|
||||||
* to all the printk activity. Try to keep it out of the hot
|
* to all the printk activity. Try to keep it out of the hot
|
||||||
* path of resume if possible.
|
* path of resume if possible.
|
||||||
*/
|
*/
|
||||||
WARN_ON(state != FBINFO_STATE_RUNNING);
|
drm_WARN_ON(dev, state != FBINFO_STATE_RUNNING);
|
||||||
if (!console_trylock()) {
|
if (!console_trylock()) {
|
||||||
/* Don't block our own workqueue as this can
|
/* Don't block our own workqueue as this can
|
||||||
* be run in parallel with other i915.ko tasks.
|
* be run in parallel with other i915.ko tasks.
|
||||||
|
|
Loading…
Reference in a new issue