]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/display/display: Prefer drm_WARN_ON over WARN_ON
authorPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Mon, 6 Apr 2020 11:27:46 +0000 (16:57 +0530)
committerJani Nikula <jani.nikula@intel.com>
Tue, 21 Apr 2020 06:50:40 +0000 (09:50 +0300)
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_ON over WARN_ON at places where struct drm_device
pointer can be extracted.

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/20200406112800.23762-5-pankaj.laxminarayan.bharadiya@intel.com
drivers/gpu/drm/i915/display/intel_display.c

index 3cfedeaf084606071fc00105e7115ccf94dab13a..adb08a00bb578ba108d22c35eb3162bd32c47aa7 100644 (file)
@@ -1973,16 +1973,16 @@ static bool is_aux_plane(const struct drm_framebuffer *fb, int plane)
 
 static int main_to_ccs_plane(const struct drm_framebuffer *fb, int main_plane)
 {
-       WARN_ON(!is_ccs_modifier(fb->modifier) ||
-               (main_plane && main_plane >= fb->format->num_planes / 2));
+       drm_WARN_ON(fb->dev, !is_ccs_modifier(fb->modifier) ||
+                   (main_plane && main_plane >= fb->format->num_planes / 2));
 
        return fb->format->num_planes / 2 + main_plane;
 }
 
 static int ccs_to_main_plane(const struct drm_framebuffer *fb, int ccs_plane)
 {
-       WARN_ON(!is_ccs_modifier(fb->modifier) ||
-               ccs_plane < fb->format->num_planes / 2);
+       drm_WARN_ON(fb->dev, !is_ccs_modifier(fb->modifier) ||
+                   ccs_plane < fb->format->num_planes / 2);
 
        return ccs_plane - fb->format->num_planes / 2;
 }
@@ -2992,7 +2992,7 @@ setup_fb_rotation(int plane, const struct intel_remapped_plane_info *plane_info,
            fb->modifier != I915_FORMAT_MOD_Yf_TILED)
                return 0;
 
-       if (WARN_ON(plane >= ARRAY_SIZE(rot_info->plane)))
+       if (drm_WARN_ON(fb->dev, plane >= ARRAY_SIZE(rot_info->plane)))
                return 0;
 
        rot_info->plane[plane] = *plane_info;
@@ -6626,7 +6626,7 @@ intel_connector_primary_encoder(struct intel_connector *connector)
                return &dp_to_dig_port(connector->mst_port)->base;
 
        encoder = intel_attached_encoder(connector);
-       WARN_ON(!encoder);
+       drm_WARN_ON(connector->base.dev, !encoder);
 
        return encoder;
 }
@@ -7958,7 +7958,8 @@ static u32 ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config)
                if (pipe_h < pfit_h)
                        pipe_h = pfit_h;
 
-               if (WARN_ON(!pfit_w || !pfit_h))
+               if (drm_WARN_ON(pipe_config->uapi.crtc->dev,
+                               !pfit_w || !pfit_h))
                        return pixel_rate;
 
                pixel_rate = div_u64(mul_u32_u32(pixel_rate, pipe_w * pipe_h),
@@ -12438,8 +12439,10 @@ static int icl_add_linked_planes(struct intel_atomic_state *state)
                if (IS_ERR(linked_plane_state))
                        return PTR_ERR(linked_plane_state);
 
-               WARN_ON(linked_plane_state->planar_linked_plane != plane);
-               WARN_ON(linked_plane_state->planar_slave == plane_state->planar_slave);
+               drm_WARN_ON(state->base.dev,
+                           linked_plane_state->planar_linked_plane != plane);
+               drm_WARN_ON(state->base.dev,
+                           linked_plane_state->planar_slave == plane_state->planar_slave);
        }
 
        return 0;
@@ -13162,7 +13165,8 @@ static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state
 {
        crtc_state->uapi.enable = crtc_state->hw.enable;
        crtc_state->uapi.active = crtc_state->hw.active;
-       WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, &crtc_state->hw.mode) < 0);
+       drm_WARN_ON(crtc_state->uapi.crtc->dev,
+                   drm_atomic_set_mode_for_crtc(&crtc_state->uapi, &crtc_state->hw.mode) < 0);
 
        crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;