From patchwork Thu Sep 19 14:19:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 11152563 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A5AC1747 for ; Thu, 19 Sep 2019 14:19:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 629B820882 for ; Thu, 19 Sep 2019 14:19:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 629B820882 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9E636F966; Thu, 19 Sep 2019 14:19:10 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id A16726F96C; Thu, 19 Sep 2019 14:19:09 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 07:19:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,523,1559545200"; d="scan'208";a="271229197" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga001.jf.intel.com with SMTP; 19 Sep 2019 07:19:05 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 17:19:04 +0300 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Date: Thu, 19 Sep 2019 17:19:02 +0300 Message-Id: <20190919141904.15840-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/3] drm/rect: Return scaling factor and error code separately X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, Jeykumar Sankaran Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä We may want to dump out the calculated scaling factor(s) when they exceed the limits. To achieve that we need to return the error code and scaling factor separately. Side note: the code in dpu_plane_validate_multirect_v2() looks rather dubious on account of it not using fixed point numbers. Not sure the rounding behaviour we have really satisfies what it's trying to do. Maybe it should just do (src_w!=dst_w || src_h!=dst_h) ? Cc: Jeykumar Sankaran Suggested-by: Sean Paul Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic_helper.c | 8 ++--- drivers/gpu/drm/drm_rect.c | 34 ++++++++++++--------- drivers/gpu/drm/i915/display/intel_sprite.c | 12 ++++---- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 8 +++-- include/drm/drm_rect.h | 6 ++-- 5 files changed, 39 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index c861a871299d..c60db3bf2a83 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -765,7 +765,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, struct drm_rect *dst = &plane_state->dst; unsigned int rotation = plane_state->rotation; struct drm_rect clip = {}; - int hscale, vscale; + int hscale, vscale, ret; WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc); @@ -791,9 +791,9 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, drm_rect_rotate(src, fb->width << 16, fb->height << 16, rotation); /* Check scaling */ - hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale); - vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale); - if (hscale < 0 || vscale < 0) { + ret = drm_rect_calc_hscale(src, dst, min_scale, max_scale, &hscale); + ret |= drm_rect_calc_vscale(src, dst, min_scale, max_scale, &vscale); + if (ret) { DRM_DEBUG_KMS("Invalid scaling of plane\n"); drm_rect_debug_print("src: ", &plane_state->src, true); drm_rect_debug_print("dst: ", &plane_state->dst, false); diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c index b8363aaa9032..f014107d11a5 100644 --- a/drivers/gpu/drm/drm_rect.c +++ b/drivers/gpu/drm/drm_rect.c @@ -145,6 +145,7 @@ static int drm_calc_scale(int src, int dst) * @dst: destination window rectangle * @min_hscale: minimum allowed horizontal scaling factor * @max_hscale: maximum allowed horizontal scaling factor + * @hscale: calculated horizontal scaling factor * * Calculate the horizontal scaling factor as * (@src width) / (@dst width). @@ -154,23 +155,25 @@ static int drm_calc_scale(int src, int dst) * pessimistic limit calculation. * * RETURNS: - * The horizontal scaling factor, or errno of out of limits. + * Zero on success, or errno on out of limits. */ int drm_rect_calc_hscale(const struct drm_rect *src, const struct drm_rect *dst, - int min_hscale, int max_hscale) + int min_hscale, int max_hscale, + int *hscale) { int src_w = drm_rect_width(src); int dst_w = drm_rect_width(dst); - int hscale = drm_calc_scale(src_w, dst_w); - if (hscale < 0 || dst_w == 0) - return hscale; + *hscale = drm_calc_scale(src_w, dst_w); - if (hscale < min_hscale || hscale > max_hscale) + if (*hscale < 0 || dst_w == 0) + return *hscale; + + if (*hscale < min_hscale || *hscale > max_hscale) return -ERANGE; - return hscale; + return 0; } EXPORT_SYMBOL(drm_rect_calc_hscale); @@ -180,6 +183,7 @@ EXPORT_SYMBOL(drm_rect_calc_hscale); * @dst: destination window rectangle * @min_vscale: minimum allowed vertical scaling factor * @max_vscale: maximum allowed vertical scaling factor + * @hscale: calculated vertical scaling factor * * Calculate the vertical scaling factor as * (@src height) / (@dst height). @@ -189,23 +193,25 @@ EXPORT_SYMBOL(drm_rect_calc_hscale); * pessimistic limit calculation. * * RETURNS: - * The vertical scaling factor, or errno of out of limits. + * Zero on success, or errno on out of limits. */ int drm_rect_calc_vscale(const struct drm_rect *src, const struct drm_rect *dst, - int min_vscale, int max_vscale) + int min_vscale, int max_vscale, + int *vscale) { int src_h = drm_rect_height(src); int dst_h = drm_rect_height(dst); - int vscale = drm_calc_scale(src_h, dst_h); - if (vscale < 0 || dst_h == 0) - return vscale; + *vscale = drm_calc_scale(src_h, dst_h); + + if (*vscale < 0 || dst_h == 0) + return *vscale; - if (vscale < min_vscale || vscale > max_vscale) + if (*vscale < min_vscale || *vscale > max_vscale) return -ERANGE; - return vscale; + return 0; } EXPORT_SYMBOL(drm_rect_calc_vscale); diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c index 7a7078d0ba23..a854bd5194dc 100644 --- a/drivers/gpu/drm/i915/display/intel_sprite.c +++ b/drivers/gpu/drm/i915/display/intel_sprite.c @@ -361,12 +361,12 @@ skl_program_scaler(struct intel_plane *plane, u16 y_vphase, uv_rgb_vphase; int hscale, vscale; - hscale = drm_rect_calc_hscale(&plane_state->base.src, - &plane_state->base.dst, - 0, INT_MAX); - vscale = drm_rect_calc_vscale(&plane_state->base.src, - &plane_state->base.dst, - 0, INT_MAX); + drm_rect_calc_hscale(&plane_state->base.src, + &plane_state->base.dst, + 0, INT_MAX, &hscale); + drm_rect_calc_vscale(&plane_state->base.src, + &plane_state->base.dst, + 0, INT_MAX, &vscale); /* TODO: handle sub-pixel coordinates */ if (drm_format_info_is_yuv_semiplanar(fb->format) && diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 58d5acbcfc5c..528242052118 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -658,7 +658,7 @@ int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane) } for (i = 0; i < R_MAX; i++) { - int width_threshold; + int width_threshold, ret, hscale, vscale; pstate[i] = to_dpu_plane_state(drm_state[i]); dpu_plane[i] = to_dpu_plane(drm_state[i]->plane); @@ -676,8 +676,10 @@ int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane) dst[i] = drm_plane_state_dest(drm_state[i]); - if (drm_rect_calc_hscale(&src[i], &dst[i], 1, 1) != 1 || - drm_rect_calc_vscale(&src[i], &dst[i], 1, 1) != 1) { + ret = drm_rect_calc_hscale(&src[i], &dst[i], 1, 1, &hscale); + ret |= drm_rect_calc_vscale(&src[i], &dst[i], 1, 1, &vscale); + + if (ret || hscale != 1 || vscale != 1) { DPU_ERROR_PLANE(dpu_plane[i], "scaling is not supported in multirect mode\n"); return -EINVAL; diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h index 6195820aa5c5..34a88ba9ca7b 100644 --- a/include/drm/drm_rect.h +++ b/include/drm/drm_rect.h @@ -178,10 +178,12 @@ bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst, const struct drm_rect *clip); int drm_rect_calc_hscale(const struct drm_rect *src, const struct drm_rect *dst, - int min_hscale, int max_hscale); + int min_hscale, int max_hscale, + int *hscale); int drm_rect_calc_vscale(const struct drm_rect *src, const struct drm_rect *dst, - int min_vscale, int max_vscale); + int min_vscale, int max_vscale, + int *vscale); void drm_rect_debug_print(const char *prefix, const struct drm_rect *r, bool fixed_point); void drm_rect_rotate(struct drm_rect *r, From patchwork Thu Sep 19 14:19:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 11152567 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A79131745 for ; Thu, 19 Sep 2019 14:19:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90182208C0 for ; Thu, 19 Sep 2019 14:19:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90182208C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0799D6F95A; Thu, 19 Sep 2019 14:19:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 06E066F95A; Thu, 19 Sep 2019 14:19:12 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 07:19:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,523,1559545200"; d="scan'208";a="192059115" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga006.jf.intel.com with SMTP; 19 Sep 2019 07:19:10 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 17:19:09 +0300 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Date: Thu, 19 Sep 2019 17:19:03 +0300 Message-Id: <20190919141904.15840-2-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919141904.15840-1-ville.syrjala@linux.intel.com> References: <20190919141904.15840-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/3] drm/atomic: Pimp the debugs for scaling fails X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä When the calculate scaling factors are out of range let's print out the calculated value and the min/max. Should make life a bit less confusing when decoding failure logs. I decided to print them in decimal rather than hex. Not sure which people prefer but maybe this is less confusing to the casual reader at least. Also write out the magic 15625 constant we use in the binary->decimal conversion as '1000000 >> (16-10)' to make it more clear how it relates to the final '>> 10'. Suggested-by: Sean Paul Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic_helper.c | 19 ++++++++++++++++--- include/drm/drm_rect.h | 29 ++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index c60db3bf2a83..9de39da54c48 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -760,6 +760,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, bool can_position, bool can_update_disabled) { + struct drm_plane *plane = plane_state->plane; struct drm_framebuffer *fb = plane_state->fb; struct drm_rect *src = &plane_state->src; struct drm_rect *dst = &plane_state->dst; @@ -792,12 +793,24 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, /* Check scaling */ ret = drm_rect_calc_hscale(src, dst, min_scale, max_scale, &hscale); - ret |= drm_rect_calc_vscale(src, dst, min_scale, max_scale, &vscale); if (ret) { - DRM_DEBUG_KMS("Invalid scaling of plane\n"); + DRM_DEBUG_KMS("[PLANE:%d:%s] Invalid horizontal scaling factor: " + DRM_FP_FMT " (limits: " DRM_FP_FMT " - " DRM_FP_FMT ")\n", + plane->base.id, plane->name, DRM_FP_ARG(hscale), + DRM_FP_ARG(min_scale), DRM_FP_ARG(max_scale)); drm_rect_debug_print("src: ", &plane_state->src, true); drm_rect_debug_print("dst: ", &plane_state->dst, false); - return -ERANGE; + return ret; + } + ret = drm_rect_calc_vscale(src, dst, min_scale, max_scale, &vscale); + if (ret) { + DRM_DEBUG_KMS("[PLANE:%d:%s] Invalid vertical scaling factor: " + DRM_FP_FMT " (limits: " DRM_FP_FMT " - " DRM_FP_FMT ")\n", + plane->base.id, plane->name, DRM_FP_ARG(vscale), + DRM_FP_ARG(min_scale), DRM_FP_ARG(max_scale)); + drm_rect_debug_print("src: ", &plane_state->src, true); + drm_rect_debug_print("dst: ", &plane_state->dst, false); + return ret; } if (crtc_state->enable) diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h index 34a88ba9ca7b..f700ef39f328 100644 --- a/include/drm/drm_rect.h +++ b/include/drm/drm_rect.h @@ -53,21 +53,36 @@ struct drm_rect { #define DRM_RECT_ARG(r) drm_rect_width(r), drm_rect_height(r), (r)->x1, (r)->y1 /** - * DRM_RECT_FP_FMT - printf string for &struct drm_rect in 16.16 fixed point + * DRM_FP_FMT - printf string for 16.16 binary fixed point + * + * Format a 16.16 binary fixed point number as .6 decimal fixed point. + */ +#define DRM_FP_FMT "%d.%06u" +/** + * DRM_FP_ARG - printf arguments for 16.16 binary fixed point + * @f: 16.16 binary fixed point number + * + * This is useful for e.g. printing plane scaling factors, which are in 16.16 + * binary fixed point. + */ +#define DRM_FP_ARG(f) (f) >> 16, (((f) & 0xffff) * (1000000 >> (16 - 10))) >> 10 + +/** + * DRM_RECT_FP_FMT - printf string for &struct drm_rect in 16.16 binary fixed point + * + * Format a 16.16 binary fixed point rectangle as .6 decimal fixed point. */ #define DRM_RECT_FP_FMT "%d.%06ux%d.%06u%+d.%06u%+d.%06u" /** - * DRM_RECT_FP_ARG - printf arguments for &struct drm_rect in 16.16 fixed point + * DRM_RECT_FP_ARG - printf arguments for &struct drm_rect in 16.16 binary fixed point * @r: rectangle struct * * This is useful for e.g. printing plane source rectangles, which are in 16.16 - * fixed point. + * binary fixed point. */ #define DRM_RECT_FP_ARG(r) \ - drm_rect_width(r) >> 16, ((drm_rect_width(r) & 0xffff) * 15625) >> 10, \ - drm_rect_height(r) >> 16, ((drm_rect_height(r) & 0xffff) * 15625) >> 10, \ - (r)->x1 >> 16, (((r)->x1 & 0xffff) * 15625) >> 10, \ - (r)->y1 >> 16, (((r)->y1 & 0xffff) * 15625) >> 10 + DRM_FP_ARG(drm_rect_width(r)), DRM_FP_ARG(drm_rect_height(r)), \ + DRM_FP_ARG((r)->x1), DRM_FP_ARG((r)->y1) /** * drm_rect_adjust_size - adjust the size of the rectangle From patchwork Thu Sep 19 14:19:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 11152573 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 312B41745 for ; Thu, 19 Sep 2019 14:19:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 186F320882 for ; Thu, 19 Sep 2019 14:19:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 186F320882 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9BB26F97E; Thu, 19 Sep 2019 14:19:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9E1516F975; Thu, 19 Sep 2019 14:19:16 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 07:19:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,523,1559545200"; d="scan'208";a="217314140" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga002.fm.intel.com with SMTP; 19 Sep 2019 07:19:13 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Sep 2019 17:19:12 +0300 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Date: Thu, 19 Sep 2019 17:19:04 +0300 Message-Id: <20190919141904.15840-3-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190919141904.15840-1-ville.syrjala@linux.intel.com> References: <20190919141904.15840-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/3] drm/atomic-helper: Improve drm_atomic_helper_check_plane_state() debugs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä Dump out the plane/crtc id/name in the failure debug messages. Makes a bit easier to figure out which plane exactly has failed when you have tons of them. Cc: Sean Paul Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic_helper.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 9de39da54c48..86a2839dbfdd 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -761,6 +761,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, bool can_update_disabled) { struct drm_plane *plane = plane_state->plane; + struct drm_crtc *crtc = crtc_state->crtc; struct drm_framebuffer *fb = plane_state->fb; struct drm_rect *src = &plane_state->src; struct drm_rect *dst = &plane_state->dst; @@ -785,7 +786,9 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, } if (!crtc_state->enable && !can_update_disabled) { - DRM_DEBUG_KMS("Cannot update plane of a disabled CRTC.\n"); + DRM_DEBUG_KMS("Cannot update [PLANE:%d:%s] of disabled [CRTC:%d:%s].\n", + plane->base.id, plane->name, + crtc->base.id, crtc->name); return -EINVAL; } @@ -831,7 +834,9 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, return 0; if (!can_position && !drm_rect_equals(dst, &clip)) { - DRM_DEBUG_KMS("Plane must cover entire CRTC\n"); + DRM_DEBUG_KMS("[PLANE:%d:%s] must cover entire [CRTC:%d:%s]\n", + plane->base.id, plane->name, + crtc->base.id, crtc->name); drm_rect_debug_print("dst: ", dst, false); drm_rect_debug_print("clip: ", &clip, false); return -EINVAL;