From: Ville Syrjälä <[email protected]>

We're currently failing to provide any debug output when the
user passes in a misaligned offset for the clear color plane.
Add some debugs prints to make debugging actually possible.

Cc: Sagar Ghuge <[email protected]>
Cc: Nanley Chery <[email protected]>
Cc: Xi Ruoyao <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_fb.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fb.c 
b/drivers/gpu/drm/i915/display/intel_fb.c
index 223c4218c019..e478d412785e 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -1694,10 +1694,14 @@ int intel_fill_fb_info(struct drm_i915_private *i915, 
struct intel_framebuffer *
                 * arithmetic related to alignment and offset calculation.
                 */
                if (is_gen12_ccs_cc_plane(&fb->base, i)) {
-                       if (IS_ALIGNED(fb->base.offsets[i], 64))
-                               continue;
-                       else
+                       if (!IS_ALIGNED(fb->base.offsets[i], 64)) {
+                               drm_dbg_kms(&i915->drm,
+                                           "fb misaligned clear color plane %d 
offset (0x%x)\n",
+                                           i, fb->base.offsets[i]);
                                return -EINVAL;
+                       }
+
+                       continue;
                }
 
                intel_fb_plane_dims(fb, i, &width, &height);
-- 
2.45.2

Reply via email to