From patchwork Thu Dec 19 13:08:20 2024 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: 13915054 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 81B1EE7718B for ; Thu, 19 Dec 2024 13:08:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F2EB010E49D; Thu, 19 Dec 2024 13:08:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="EPFYtFC9"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id C8A0210E49D for ; Thu, 19 Dec 2024 13:08:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734613713; x=1766149713; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=I56P6a/IowPOOeKUDA+oQHGkxrY9kaBBjN/rDRJfB08=; b=EPFYtFC97BRSEuykfTTI5SJkwpP+msA/wR5q/dclE7vJH56lUfjhnBWf 6UKFAdxVto8wDj6RglXIBs90Mpdba11Q3D4JBZAy3H3p/5RvM1/7OBIIm Oq7NKOEhfEwd+81XI7sFKPgqRsfF9/EMfEHuLA9lw/c/vLCx4z91fX4U1 +o4Xf0E1KwdtiCdCoUV/gs8r7okQvM0CLyLr+0mUnfiWQWDLYy91a7dAm XpKBnOYpXPv35QdAwgW4rXIEQPgqt6ZVnKwdEdAFh79VRfiMW13yJp8qM c+uq9NwYdMSF0lfv3dPApZ39WJ0qoTcAjt2A90Ize0BIXOLmNAgKfSQHe g==; X-CSE-ConnectionGUID: YrusyMzhR1C0aR1boBQYPg== X-CSE-MsgGUID: DpIAq9MjTDORQKFrM9p6BA== X-IronPort-AV: E=McAfee;i="6700,10204,11290"; a="38798120" X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="38798120" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2024 05:08:32 -0800 X-CSE-ConnectionGUID: 4uvWBBaqSd2VU9jd1WeFHA== X-CSE-MsgGUID: UnUJgGvgS36NqDfQyMVNHw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="98403286" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 19 Dec 2024 05:08:30 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Dec 2024 15:08:30 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 1/8] drm/i915/scaler: Extract skl_scaler_min_src_size() Date: Thu, 19 Dec 2024 15:08:20 +0200 Message-ID: <20241219130827.22830-2-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241219130827.22830-1-ville.syrjala@linux.intel.com> References: <20241219130827.22830-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä The SKL_MIN_*SRC_* defines just make things hard to read. Get rid of them and introduce an easy to read function in their place. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/skl_scaler.c | 25 ++++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index ae21fce534dc..8b5b7993a492 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -76,9 +76,7 @@ static u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_cosited) return ((phase >> 2) & PS_PHASE_MASK) | trip; } -#define SKL_MIN_SRC_W 8 #define SKL_MAX_SRC_W 4096 -#define SKL_MIN_SRC_H 8 #define SKL_MAX_SRC_H 4096 #define SKL_MIN_DST_W 8 #define SKL_MAX_DST_W 4096 @@ -96,8 +94,18 @@ static u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_cosited) #define MTL_MAX_SRC_H 8192 #define MTL_MAX_DST_W 8192 #define MTL_MAX_DST_H 8192 -#define SKL_MIN_YUV_420_SRC_W 16 -#define SKL_MIN_YUV_420_SRC_H 16 + +static void skl_scaler_min_src_size(const struct drm_format_info *format, + u64 modifier, int *min_w, int *min_h) +{ + if (format && intel_format_info_is_yuv_semiplanar(format, modifier)) { + *min_w = 16; + *min_h = 16; + } else { + *min_w = 8; + *min_h = 8; + } +} static int skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, @@ -163,15 +171,8 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, return 0; } - if (format && intel_format_info_is_yuv_semiplanar(format, modifier) && - (src_h < SKL_MIN_YUV_420_SRC_H || src_w < SKL_MIN_YUV_420_SRC_W)) { - drm_dbg_kms(display->drm, - "Planar YUV: src dimensions not met\n"); - return -EINVAL; - } + skl_scaler_min_src_size(format, modifier, &min_src_w, &min_src_h); - min_src_w = SKL_MIN_SRC_W; - min_src_h = SKL_MIN_SRC_H; min_dst_w = SKL_MIN_DST_W; min_dst_h = SKL_MIN_DST_H; From patchwork Thu Dec 19 13:08:21 2024 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: 13915055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CA4CCE77184 for ; Thu, 19 Dec 2024 13:08:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 72D2910ED0A; Thu, 19 Dec 2024 13:08:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="eByqPZZJ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 81F5110ECE9 for ; Thu, 19 Dec 2024 13:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734613715; x=1766149715; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=E33fMEt6qw8rvt+fjt0wQ5/VpbS2nOUejReI7bEW4CE=; b=eByqPZZJApsSKlHKxj8QPoDXyV2Nt5bzuxiB1TME0KDgqXhQkhvDFEbD xdKLToESYGnYtaQYRyH8GsaWzGz0hA4+BilyzB6518ncC+gN6Wt26G+2e zKWApY8j+acu7XLp8reakrYBJ1wbTfECkWb2IGf28LzOg96kftx4KMJ4/ TMGOAJ7StIozL4694M/pMDJCewRysYYNPMDshapgVdt0ujjyWyfzmONZs 9c8NuvBy3K0QYLQTWvJ1gx0JWf7bqpDrY2ujFITo7pV91AZb95O7PQhiw ZfEwnZHImNrApUt4qe+M3LFycOJFHgyEjhKyo9ft8HtfPaoonNaY1ldaV w==; X-CSE-ConnectionGUID: 2gHMu7KKQK+fSpygcvpFQg== X-CSE-MsgGUID: VzK2o+ZFRkicl+ebtYew+g== X-IronPort-AV: E=McAfee;i="6700,10204,11290"; a="38798126" X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="38798126" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2024 05:08:35 -0800 X-CSE-ConnectionGUID: jNOcmD2IQc29Gd2HSB639w== X-CSE-MsgGUID: YbK35H6oSVuPIVhbwy144A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="98403294" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 19 Dec 2024 05:08:33 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Dec 2024 15:08:32 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/8] drm/i915/scaler: Extract skl_scaler_max_src_size() Date: Thu, 19 Dec 2024 15:08:21 +0200 Message-ID: <20241219130827.22830-3-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241219130827.22830-1-ville.syrjala@linux.intel.com> References: <20241219130827.22830-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä The SKL_MAX_SRC_* defines just make things hard to read. Get rid of them and introduce an easy to read function in their place. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/skl_scaler.c | 37 +++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index 8b5b7993a492..d6bef6578867 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -76,22 +76,14 @@ static u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_cosited) return ((phase >> 2) & PS_PHASE_MASK) | trip; } -#define SKL_MAX_SRC_W 4096 -#define SKL_MAX_SRC_H 4096 #define SKL_MIN_DST_W 8 #define SKL_MAX_DST_W 4096 #define SKL_MIN_DST_H 8 #define SKL_MAX_DST_H 4096 -#define ICL_MAX_SRC_W 5120 -#define ICL_MAX_SRC_H 4096 #define ICL_MAX_DST_W 5120 #define ICL_MAX_DST_H 4096 -#define TGL_MAX_SRC_W 5120 -#define TGL_MAX_SRC_H 8192 #define TGL_MAX_DST_W 8192 #define TGL_MAX_DST_H 8192 -#define MTL_MAX_SRC_W 4096 -#define MTL_MAX_SRC_H 8192 #define MTL_MAX_DST_W 8192 #define MTL_MAX_DST_H 8192 @@ -107,6 +99,26 @@ static void skl_scaler_min_src_size(const struct drm_format_info *format, } } +static void skl_scaler_max_src_size(struct intel_crtc *crtc, + int *max_w, int *max_h) +{ + struct intel_display *display = to_intel_display(crtc); + + if (DISPLAY_VER(display) >= 14) { + *max_w = 4096; + *max_h = 8192; + } else if (DISPLAY_VER(display) >= 12) { + *max_w = 5120; + *max_h = 8192; + } else if (DISPLAY_VER(display) == 11) { + *max_w = 5120; + *max_h = 4096; + } else { + *max_w = 4096; + *max_h = 4096; + } +} + static int skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, unsigned int scaler_user, int *scaler_id, @@ -172,28 +184,21 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, } skl_scaler_min_src_size(format, modifier, &min_src_w, &min_src_h); + skl_scaler_max_src_size(crtc, &max_src_w, &max_src_h); min_dst_w = SKL_MIN_DST_W; min_dst_h = SKL_MIN_DST_H; if (DISPLAY_VER(display) < 11) { - max_src_w = SKL_MAX_SRC_W; - max_src_h = SKL_MAX_SRC_H; max_dst_w = SKL_MAX_DST_W; max_dst_h = SKL_MAX_DST_H; } else if (DISPLAY_VER(display) < 12) { - max_src_w = ICL_MAX_SRC_W; - max_src_h = ICL_MAX_SRC_H; max_dst_w = ICL_MAX_DST_W; max_dst_h = ICL_MAX_DST_H; } else if (DISPLAY_VER(display) < 14) { - max_src_w = TGL_MAX_SRC_W; - max_src_h = TGL_MAX_SRC_H; max_dst_w = TGL_MAX_DST_W; max_dst_h = TGL_MAX_DST_H; } else { - max_src_w = MTL_MAX_SRC_W; - max_src_h = MTL_MAX_SRC_H; max_dst_w = MTL_MAX_DST_W; max_dst_h = MTL_MAX_DST_H; } From patchwork Thu Dec 19 13:08:22 2024 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: 13915056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BCDE2E7718A for ; Thu, 19 Dec 2024 13:08:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 60C8D10ED10; Thu, 19 Dec 2024 13:08:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="E6PLiGo/"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8E5E010ECFC for ; Thu, 19 Dec 2024 13:08:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734613718; x=1766149718; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=KURH6+rmoigTFknkxhEZkEK4az2RgcTlD6WFQQ/e26s=; b=E6PLiGo/4C5TTXIl08YEwKfIFUlrumE/1AQucic9SiXaytvEoDm3FyAj 6JD9QRSVHQE3j+f16R7zwkRvrJ5qjywbUI8PlrdQc/EMnsMDIawgRZ1v5 zsWr+e9a43hzVydPqJjXBCWsRAai/4T6xpZ5XaePobWTD4zoxTgAgXoaY PjmglHGJKIYU5vUcL0ElRRpnNwrfE0DGbW7rPb+upB68fFoNP0Xxe4drg 1POzSRo4srWhoaT/6ZQpWCCWKtR59Ez8gvW3sec/u+q95v7Dsof7qtWRk CH2Ft6/qNdln/UKXe55pDCTmH7bJn+1N7XPVD6gAXCcIthbLb8A1mq91a w==; X-CSE-ConnectionGUID: iVWcfXoYSeaZycyf2gSomA== X-CSE-MsgGUID: v5iwm72/QAGKfvZ1s456uA== X-IronPort-AV: E=McAfee;i="6700,10204,11290"; a="38798131" X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="38798131" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2024 05:08:38 -0800 X-CSE-ConnectionGUID: ew0IFvrVRHKVdq43lMeZdA== X-CSE-MsgGUID: 3tbV7os7QoOchCa6WqNwqg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="98403303" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 19 Dec 2024 05:08:36 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Dec 2024 15:08:35 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 3/8] drm/i915/scaler: Extract skl_scaler_min_dst_size() Date: Thu, 19 Dec 2024 15:08:22 +0200 Message-ID: <20241219130827.22830-4-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241219130827.22830-1-ville.syrjala@linux.intel.com> References: <20241219130827.22830-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä The SKL_MIN_DST_* defines just make things hard to read. Get rid of them and introduce an easy to read function in their place. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/skl_scaler.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index d6bef6578867..cabbf4860cb3 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -76,9 +76,7 @@ static u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_cosited) return ((phase >> 2) & PS_PHASE_MASK) | trip; } -#define SKL_MIN_DST_W 8 #define SKL_MAX_DST_W 4096 -#define SKL_MIN_DST_H 8 #define SKL_MAX_DST_H 4096 #define ICL_MAX_DST_W 5120 #define ICL_MAX_DST_H 4096 @@ -119,6 +117,12 @@ static void skl_scaler_max_src_size(struct intel_crtc *crtc, } } +static void skl_scaler_min_dst_size(int *min_w, int *min_h) +{ + *min_w = 8; + *min_h = 8; +} + static int skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, unsigned int scaler_user, int *scaler_id, @@ -186,8 +190,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, skl_scaler_min_src_size(format, modifier, &min_src_w, &min_src_h); skl_scaler_max_src_size(crtc, &max_src_w, &max_src_h); - min_dst_w = SKL_MIN_DST_W; - min_dst_h = SKL_MIN_DST_H; + skl_scaler_min_dst_size(&min_dst_w, &min_dst_h); if (DISPLAY_VER(display) < 11) { max_dst_w = SKL_MAX_DST_W; From patchwork Thu Dec 19 13:08:23 2024 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: 13915057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DB457E7718A for ; Thu, 19 Dec 2024 13:08:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 794D910ECFC; Thu, 19 Dec 2024 13:08:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="IDwn39bd"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB05710ECE9 for ; Thu, 19 Dec 2024 13:08:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734613722; x=1766149722; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=AiOcs48M3ZzxC+NUsvK42wW0CnPVcwkVKKYEgwSIssc=; b=IDwn39bdMH/IL3pm4VsCPUpWK8G20C6PiTHNjMq1ONg2Pu/i6K3k8BA4 JN6PxMYShcPoFgrySp0YJ5MJIhmd/PWxMrKb68fMUaPg3xzlRyxfmZBLG IFbwuuuuDutkRVi4tDQv0nhmid8mVbjk8h608bmQC/jgi3N6k3eGuuNmi X6VxyJNnVSt88naXE/c+LbXUVg+VG+I2QpKKQiYF8pejyWM0oMomWxMlB mGXGvfdzz5JA0IsI62xTsaOG68gIKNkg4bbcdXgvaTvGovvU35KD60ngp RKHVrSJ02S2D4msGtnQEIH8CpEhHxLciszQjXhVsot0xHP7ent1WtN3W9 g==; X-CSE-ConnectionGUID: CZ77lkjtTa6HWK+TRiXENw== X-CSE-MsgGUID: OsfTjp7nTb+MQip4uusl5g== X-IronPort-AV: E=McAfee;i="6700,10204,11290"; a="38798136" X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="38798136" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2024 05:08:41 -0800 X-CSE-ConnectionGUID: vuCsn738QiqdIRVBz68/TA== X-CSE-MsgGUID: e99XlBiaTJWiLyMC2JVkpQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="98403311" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 19 Dec 2024 05:08:39 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Dec 2024 15:08:38 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 4/8] drm/i915/scaler: Extract skl_scaler_max_dst_size() Date: Thu, 19 Dec 2024 15:08:23 +0200 Message-ID: <20241219130827.22830-5-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241219130827.22830-1-ville.syrjala@linux.intel.com> References: <20241219130827.22830-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä The SKL_MAX_DST_* defines just make things hard to read. Get rid of them and introduce an easy to read function in their place. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/skl_scaler.c | 44 +++++++++++------------ 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index cabbf4860cb3..0bc82a047510 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -76,15 +76,6 @@ static u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_cosited) return ((phase >> 2) & PS_PHASE_MASK) | trip; } -#define SKL_MAX_DST_W 4096 -#define SKL_MAX_DST_H 4096 -#define ICL_MAX_DST_W 5120 -#define ICL_MAX_DST_H 4096 -#define TGL_MAX_DST_W 8192 -#define TGL_MAX_DST_H 8192 -#define MTL_MAX_DST_W 8192 -#define MTL_MAX_DST_H 8192 - static void skl_scaler_min_src_size(const struct drm_format_info *format, u64 modifier, int *min_w, int *min_h) { @@ -123,6 +114,26 @@ static void skl_scaler_min_dst_size(int *min_w, int *min_h) *min_h = 8; } +static void skl_scaler_max_dst_size(struct intel_crtc *crtc, + int *max_w, int *max_h) +{ + struct intel_display *display = to_intel_display(crtc); + + if (DISPLAY_VER(display) >= 14) { + *max_w = 8192; + *max_h = 8192; + } else if (DISPLAY_VER(display) >= 12) { + *max_w = 8192; + *max_h = 8192; + } else if (DISPLAY_VER(display) == 11) { + *max_w = 5120; + *max_h = 4096; + } else { + *max_w = 4096; + *max_h = 4096; + } +} + static int skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, unsigned int scaler_user, int *scaler_id, @@ -191,20 +202,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, skl_scaler_max_src_size(crtc, &max_src_w, &max_src_h); skl_scaler_min_dst_size(&min_dst_w, &min_dst_h); - - if (DISPLAY_VER(display) < 11) { - max_dst_w = SKL_MAX_DST_W; - max_dst_h = SKL_MAX_DST_H; - } else if (DISPLAY_VER(display) < 12) { - max_dst_w = ICL_MAX_DST_W; - max_dst_h = ICL_MAX_DST_H; - } else if (DISPLAY_VER(display) < 14) { - max_dst_w = TGL_MAX_DST_W; - max_dst_h = TGL_MAX_DST_H; - } else { - max_dst_w = MTL_MAX_DST_W; - max_dst_h = MTL_MAX_DST_H; - } + skl_scaler_max_dst_size(crtc, &max_dst_w, &max_dst_h); /* range checks */ if (src_w < min_src_w || src_h < min_src_h || From patchwork Thu Dec 19 13:08:24 2024 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: 13915058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9885CE77184 for ; Thu, 19 Dec 2024 13:08:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F3CA10ECE9; Thu, 19 Dec 2024 13:08:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="VX9hHmew"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6829110ECE9 for ; Thu, 19 Dec 2024 13:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734613724; x=1766149724; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=zztPfKfn12sK1Kz/sJgkNa0hJlqqma5LVD3HcCKrcaI=; b=VX9hHmew0Q3S7JWpA4qi8yGSGJf6pwbtsvNXCpiqWrNjNBraWO+Pmvq0 XIAKqsOYCJQh+99luLStCs0nzLHVYTtYeQc29whIEBb4DGXbpyUfNs/PZ +laaosvyFnXHPcs9ZQxikYcYv/xqKzspj9wUGa4oVHCloDFqzAnX3hpUD li7BI5820RVf4YTuEW6nWpASHyHsqjWGChDcBGWw1KRvQYhQPQwUP4zA8 H122J/S0RSg6d3NeUqwWjksLpTcnKma/yTYps3abq4+4mQxF0yj+tpq/9 ltjgMNs3E02XI35p0B1P2hlrfcOG+iJLh8RulB/24ns0SNkknyefzdYIp Q==; X-CSE-ConnectionGUID: vxQjDgGWTICv83sjmKHUuQ== X-CSE-MsgGUID: WAa2HYQ1RueZ8GpRPxJWXg== X-IronPort-AV: E=McAfee;i="6700,10204,11290"; a="38798140" X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="38798140" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2024 05:08:44 -0800 X-CSE-ConnectionGUID: dVycB6O1SVa/xz3UA6LiPA== X-CSE-MsgGUID: yu/jR0HTRUCYibWE8U9Ghw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="98403315" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 19 Dec 2024 05:08:42 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Dec 2024 15:08:41 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 5/8] drm/i915/scaler: Nuke redundant code Date: Thu, 19 Dec 2024 15:08:24 +0200 Message-ID: <20241219130827.22830-6-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241219130827.22830-1-ville.syrjala@linux.intel.com> References: <20241219130827.22830-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä The tgl+ and mtl+ numbers in skl_scaler_max_dst_size() are identical. Combine them to a single piece of code. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/skl_scaler.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index 0bc82a047510..cbc71e44fcbb 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -119,10 +119,7 @@ static void skl_scaler_max_dst_size(struct intel_crtc *crtc, { struct intel_display *display = to_intel_display(crtc); - if (DISPLAY_VER(display) >= 14) { - *max_w = 8192; - *max_h = 8192; - } else if (DISPLAY_VER(display) >= 12) { + if (DISPLAY_VER(display) >= 12) { *max_w = 8192; *max_h = 8192; } else if (DISPLAY_VER(display) == 11) { From patchwork Thu Dec 19 13:08:25 2024 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: 13915059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 596F1E7718B for ; Thu, 19 Dec 2024 13:08:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 08E0310ED01; Thu, 19 Dec 2024 13:08:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="VJ+zMq2K"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3745A10ED01 for ; Thu, 19 Dec 2024 13:08:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734613727; x=1766149727; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=APgqNDVby90F59SjCPCpgA9pfMr5qFkzA/mwwMR9WWo=; b=VJ+zMq2KcJHcl7VS1nymlN1YhsnN4ZvlfDxsxgZSJ3ADTnIN+ec6nKOP 3yRRt5BHFHYdCbKBe7kEY07+7o0J+bqzyPqRDtrgfdkMhag1OUDsqyF33 JvZovtDWuJaKNxgDS8kzLTJ235VIeQPKkHfa/WCJeQSKYHte6/h9rZQWH ejp9PqZX1VFjddX4kyr8p+4cfSXgkDobTST80s27uSbuzJvKajM91NubK Fd16BIBvRHdV75k203PtujIiJXDHZoTlzzv6big+Qcga9EmCW32Cn9RCR Z6DGyAYiNmsHjkmiKkj5dwQ5YnzNEyowR75EMnXaW64ZNSSaC3P4DEA4p Q==; X-CSE-ConnectionGUID: LcG6lBYVQkmEqHBvN6QAKQ== X-CSE-MsgGUID: DcpZdsQSRTWBd+VAB28Bgw== X-IronPort-AV: E=McAfee;i="6700,10204,11290"; a="38798146" X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="38798146" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2024 05:08:47 -0800 X-CSE-ConnectionGUID: e9oZjrZySFWidJf6gOFqtA== X-CSE-MsgGUID: RuPGljHLQJKrX5QE7LI1tg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="98403321" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 19 Dec 2024 05:08:45 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Dec 2024 15:08:44 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 6/8] drm/i915/scaler: Pimp scaler debugs Date: Thu, 19 Dec 2024 15:08:25 +0200 Message-ID: <20241219130827.22830-7-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241219130827.22830-1-ville.syrjala@linux.intel.com> References: <20241219130827.22830-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä Include the standard "[CRTC:...]" information in the scaler debugs to make life easier. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/skl_scaler.c | 25 +++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index cbc71e44fcbb..f6d76ef1a854 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -166,7 +166,8 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, if (DISPLAY_VER(display) >= 9 && crtc_state->hw.enable && need_scaler && adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) { drm_dbg_kms(display->drm, - "Pipe/Plane scaling not supported with IF-ID mode\n"); + "[CRTC:%d:%s] scaling not supported with IF-ID mode\n", + crtc->base.base.id, crtc->base.name); return -EINVAL; } @@ -186,8 +187,9 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, scaler_state->scalers[*scaler_id].in_use = false; drm_dbg_kms(display->drm, - "scaler_user index %u.%u: " + "[CRTC:%d:%s] scaler_user index %u.%u: " "Staged freeing scaler id %d scaler_users = 0x%x\n", + crtc->base.base.id, crtc->base.name, crtc->pipe, scaler_user, *scaler_id, scaler_state->scaler_users); *scaler_id = -1; @@ -207,8 +209,9 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, src_w > max_src_w || src_h > max_src_h || dst_w > max_dst_w || dst_h > max_dst_h) { drm_dbg_kms(display->drm, - "scaler_user index %u.%u: src %ux%u dst %ux%u " + "[CRTC:%d:%s] scaler_user index %u.%u: src %ux%u dst %ux%u " "size is out of scaler range\n", + crtc->base.base.id, crtc->base.name, crtc->pipe, scaler_user, src_w, src_h, dst_w, dst_h); return -EINVAL; @@ -224,16 +227,18 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, */ if (pipe_src_w > max_dst_w || pipe_src_h > max_dst_h) { drm_dbg_kms(display->drm, - "scaler_user index %u.%u: pipe src size %ux%u " + "[CRTC:%d:%s] scaler_user index %u.%u: pipe src size %ux%u " "is out of scaler range\n", + crtc->base.base.id, crtc->base.name, crtc->pipe, scaler_user, pipe_src_w, pipe_src_h); return -EINVAL; } /* mark this plane as a scaler user in crtc_state */ scaler_state->scaler_users |= (1 << scaler_user); - drm_dbg_kms(display->drm, "scaler_user index %u.%u: " + drm_dbg_kms(display->drm, "[CRTC:%d:%s] scaler_user index %u.%u: " "staged scaling request for %ux%u->%ux%u scaler_users = 0x%x\n", + crtc->base.base.id, crtc->base.name, crtc->pipe, scaler_user, src_w, src_h, dst_w, dst_h, scaler_state->scaler_users); @@ -421,8 +426,8 @@ static int intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_stat if (hscale < 0 || vscale < 0) { drm_dbg_kms(display->drm, - "Scaler %d doesn't support required plane scaling\n", - *scaler_id); + "[CRTC:%d:%s] scaler %d doesn't support required plane scaling\n", + crtc->base.base.id, crtc->base.name, *scaler_id); drm_rect_debug_print("src: ", src, true); drm_rect_debug_print("dst: ", dst, false); @@ -430,7 +435,8 @@ static int intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_stat } } - drm_dbg_kms(display->drm, "Attached scaler id %u.%u to %s:%d\n", + drm_dbg_kms(display->drm, "[CRTC:%d:%s] attached scaler id %u.%u to %s:%d\n", + crtc->base.base.id, crtc->base.name, crtc->pipe, *scaler_id, name, idx); scaler_state->scalers[*scaler_id].mode = mode; @@ -530,7 +536,8 @@ int intel_atomic_setup_scalers(struct intel_atomic_state *state, /* fail if required scalers > available scalers */ if (num_scalers_need > crtc->num_scalers) { drm_dbg_kms(display->drm, - "Too many scaling requests %d > %d\n", + "[CRTC:%d:%s] too many scaling requests %d > %d\n", + crtc->base.base.id, crtc->base.name, num_scalers_need, crtc->num_scalers); return -EINVAL; } From patchwork Thu Dec 19 13:08:26 2024 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: 13915060 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 24DB7E77184 for ; Thu, 19 Dec 2024 13:08:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C281710ED05; Thu, 19 Dec 2024 13:08:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="a2HCHB70"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 042BB10ED07 for ; Thu, 19 Dec 2024 13:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734613730; x=1766149730; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=FoDAi0ZTti5fMIbv+nSTVN1sRU+3ABUR9ruD0scbGfY=; b=a2HCHB70iiQX/s7b0tSx0d/IjrB6Vjs9iYpOBak8Z6Qi+KDxBGG7hM32 DxaCgz2F67pSas5p1a6+6BIpwVIgKVFInkAG8c2wQAv0JR1kemXmjMqHk c5V9aarzdMLmcTz/J1BJPBqzD0aMs7gtF6DgYCwZNdMmeT49tswUUBgHC IhLuuroa4bSGd7fAQ9ufJZRND7UzbAHsX9/cw1emIwo4y03d/bOoFzuMK 3KyOk+bAawo3L4hPURCsTg+jfutXuM5pAEq9py2iqJ/rR/aN5h9ODhCLZ HhVsfJAArHZNKr6WGzUoRDyIl/7cFp25Nn2IqXbh/KB7fqwA0mIjHxfgu g==; X-CSE-ConnectionGUID: gni+rPvKTTaHpQUC9VEcWw== X-CSE-MsgGUID: 5gsqXwOFTFCUwlDRsLqdaQ== X-IronPort-AV: E=McAfee;i="6700,10204,11290"; a="38798150" X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="38798150" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2024 05:08:50 -0800 X-CSE-ConnectionGUID: RiiOZNXzTWK4mM/DD9hQ+Q== X-CSE-MsgGUID: JILhYbvORQ+Pg9ezhtfCLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="98403326" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 19 Dec 2024 05:08:48 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Dec 2024 15:08:47 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 7/8] drm/i915/scaler: s/excdeed/exceed/ Date: Thu, 19 Dec 2024 15:08:26 +0200 Message-ID: <20241219130827.22830-8-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241219130827.22830-1-ville.syrjala@linux.intel.com> References: <20241219130827.22830-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä Fix typo s/excdeed/exceed/ Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- drivers/gpu/drm/i915/display/skl_scaler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index f6d76ef1a854..79739357162c 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -64,7 +64,7 @@ static u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_cosited) /* * Hardware initial phase limited to [-0.5:1.5]. * Since the max hardware scale factor is 3.0, we - * should never actually excdeed 1.0 here. + * should never actually exceed 1.0 here. */ WARN_ON(phase < -0x8000 || phase > 0x18000); From patchwork Thu Dec 19 13:08:27 2024 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: 13915061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3C151E7718B for ; Thu, 19 Dec 2024 13:08:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D3AA110ED07; Thu, 19 Dec 2024 13:08:53 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="XzBCx0yu"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0871010ED07 for ; Thu, 19 Dec 2024 13:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734613733; x=1766149733; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=N+54sbI9uj7zSNZuRv1Lv+MKzArXpvjL6UdcksDz6TI=; b=XzBCx0yuuImAZXk5fuAFg1qqv92rNmlso6zNHQtz0YsZyVj9reHdgbmk 6PaOaW97D/bAJFrIryzrXfwPzDUs0fU+gs61qP/xmxRtOa64WON/qNEPr IP/d8JZ3OEUgKOqRhelLG1IZ+9e5zFgkihebMMTXaSf4qrJTRcxuxlXok vmwJiz3qOtuMdIvEPNH8P6xQs/r5RCyZ1ikfZ5a2nBrgMQujyVQ/EEKWq sgl736bhTLMpAlbRfQeXO+8rvbsTNVZFEjgIcDJuIJqq24+AQrsl2/9qs 3Xs3+cfEdC8eq3OOJ0DZrxprloIQQs8p9M3ULT6tF8pKhpKZSKyTnS6D8 Q==; X-CSE-ConnectionGUID: AoxOyD19QJmOrm0913DP3Q== X-CSE-MsgGUID: PDcMQWqhT/ein1ZYM+akfg== X-IronPort-AV: E=McAfee;i="6700,10204,11290"; a="38798158" X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="38798158" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2024 05:08:52 -0800 X-CSE-ConnectionGUID: +YXJDOiNSfSyvMkpK1Bhxw== X-CSE-MsgGUID: t2MFwsYCSgGd8MIoFiomxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,247,1728975600"; d="scan'208";a="98403332" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 19 Dec 2024 05:08:50 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 19 Dec 2024 15:08:50 +0200 From: Ville Syrjala To: intel-gfx@lists.freedesktop.org Subject: [PATCH 8/8] drm/i915/scaler: Add scaler tracepoints Date: Thu, 19 Dec 2024 15:08:27 +0200 Message-ID: <20241219130827.22830-9-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241219130827.22830-1-ville.syrjala@linux.intel.com> References: <20241219130827.22830-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Ville Syrjälä Add some tracpoints around skl+ scaler programming to help with debugging. Signed-off-by: Ville Syrjälä Reviewed-by: Luca Coelho --- .../drm/i915/display/intel_display_trace.h | 99 +++++++++++++++++++ drivers/gpu/drm/i915/display/skl_scaler.c | 8 ++ 2 files changed, 107 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display_trace.h b/drivers/gpu/drm/i915/display/intel_display_trace.h index 338b9f7b20b8..54a6e2a46b82 100644 --- a/drivers/gpu/drm/i915/display/intel_display_trace.h +++ b/drivers/gpu/drm/i915/display/intel_display_trace.h @@ -489,6 +489,105 @@ TRACE_EVENT(intel_plane_disable_arm, __entry->frame, __entry->scanline) ); +TRACE_EVENT(intel_plane_scaler_update_arm, + TP_PROTO(struct intel_plane *plane, + int scaler_id, int x, int y, int w, int h), + TP_ARGS(plane, scaler_id, x, y, w, h), + + TP_STRUCT__entry( + __string(dev, __dev_name_kms(plane)) + __field(char, pipe_name) + __field(int, scaler_id) + __field(u32, frame) + __field(u32, scanline) + __field(int, x) + __field(int, y) + __field(int, w) + __field(int, h) + __string(name, plane->base.name) + ), + + TP_fast_assign( + struct intel_display *display = to_intel_display(plane); + struct intel_crtc *crtc = intel_crtc_for_pipe(display, plane->pipe); + __assign_str(dev); + __assign_str(name); + __entry->pipe_name = pipe_name(crtc->pipe); + __entry->scaler_id = scaler_id; + __entry->frame = intel_crtc_get_vblank_counter(crtc); + __entry->scanline = intel_get_crtc_scanline(crtc); + __entry->x = x; + __entry->y = y; + __entry->w = w; + __entry->h = h; + ), + + TP_printk("dev %s, pipe %c, scaler %d, plane %s, frame=%u, scanline=%u, " DRM_RECT_FMT, + __get_str(dev), __entry->pipe_name, __entry->scaler_id, + __get_str(name), __entry->frame, __entry->scanline, + __entry->w, __entry->h, __entry->x, __entry->y) +); + +TRACE_EVENT(intel_pipe_scaler_update_arm, + TP_PROTO(struct intel_crtc *crtc, int scaler_id, + int x, int y, int w, int h), + TP_ARGS(crtc, scaler_id, x, y, w, h), + + TP_STRUCT__entry( + __string(dev, __dev_name_kms(crtc)) + __field(char, pipe_name) + __field(int, scaler_id) + __field(u32, frame) + __field(u32, scanline) + __field(int, x) + __field(int, y) + __field(int, w) + __field(int, h) + ), + + TP_fast_assign( + __assign_str(dev); + __entry->pipe_name = pipe_name(crtc->pipe); + __entry->scaler_id = scaler_id; + __entry->frame = intel_crtc_get_vblank_counter(crtc); + __entry->scanline = intel_get_crtc_scanline(crtc); + __entry->x = x; + __entry->y = y; + __entry->w = w; + __entry->h = h; + ), + + TP_printk("dev %s, pipe %c, scaler %d frame=%u, scanline=%u, " DRM_RECT_FMT, + __get_str(dev), __entry->pipe_name, __entry->scaler_id, + __entry->frame, __entry->scanline, + __entry->w, __entry->h, __entry->x, __entry->y) +); + +TRACE_EVENT(intel_scaler_disable_arm, + TP_PROTO(struct intel_crtc *crtc, int scaler_id), + TP_ARGS(crtc, scaler_id), + + TP_STRUCT__entry( + __string(dev, __dev_name_kms(crtc)) + __field(char, pipe_name) + __field(int, scaler_id) + __field(u32, frame) + __field(u32, scanline) + ), + + TP_fast_assign( + __assign_str(dev); + __entry->pipe_name = pipe_name(crtc->pipe); + __entry->scaler_id = scaler_id; + __entry->frame = intel_crtc_get_vblank_counter(crtc); + __entry->scanline = intel_get_crtc_scanline(crtc); + ), + + TP_printk("dev %s, pipe %c, scaler %d, frame=%u, scanline=%u", + __get_str(dev), __entry->pipe_name, __entry->scaler_id, + __entry->frame, __entry->scanline) +); + TRACE_EVENT(intel_fbc_activate, TP_PROTO(struct intel_plane *plane), TP_ARGS(plane), diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index 79739357162c..a11e09a15e23 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -6,6 +6,7 @@ #include "i915_drv.h" #include "i915_reg.h" #include "intel_de.h" +#include "intel_display_trace.h" #include "intel_display_types.h" #include "intel_fb.h" #include "skl_scaler.h" @@ -706,6 +707,8 @@ void skl_pfit_enable(const struct intel_crtc_state *crtc_state) ps_ctrl = PS_SCALER_EN | PS_BINDING_PIPE | scaler_state->scalers[id].mode | skl_scaler_get_filter_select(crtc_state->hw.scaling_filter, 0); + trace_intel_pipe_scaler_update_arm(crtc, id, x, y, width, height); + skl_scaler_setup_filter(display, pipe, id, 0, crtc_state->hw.scaling_filter); @@ -770,6 +773,9 @@ skl_program_plane_scaler(struct intel_plane *plane, ps_ctrl = PS_SCALER_EN | PS_BINDING_PLANE(plane->id) | scaler->mode | skl_scaler_get_filter_select(plane_state->hw.scaling_filter, 0); + trace_intel_plane_scaler_update_arm(plane, scaler_id, + crtc_x, crtc_y, crtc_w, crtc_h); + skl_scaler_setup_filter(display, pipe, scaler_id, 0, plane_state->hw.scaling_filter); @@ -788,6 +794,8 @@ static void skl_detach_scaler(struct intel_crtc *crtc, int id) { struct intel_display *display = to_intel_display(crtc); + trace_intel_scaler_disable_arm(crtc, id); + intel_de_write_fw(display, SKL_PS_CTRL(crtc->pipe, id), 0); intel_de_write_fw(display, SKL_PS_WIN_POS(crtc->pipe, id), 0); intel_de_write_fw(display, SKL_PS_WIN_SZ(crtc->pipe, id), 0);