From patchwork Wed Nov 27 12:07:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Govindapillai X-Patchwork-Id: 13886943 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 B5C98D6ACC3 for ; Wed, 27 Nov 2024 12:07:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6481A10EAAD; Wed, 27 Nov 2024 12:07:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Li17yQkM"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id E74A910EAAD; Wed, 27 Nov 2024 12:07: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=1732709256; x=1764245256; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gN9s5+2KLW4xXyMAQlysGxn6ZMJyTNgyBHyWLj0xsrU=; b=Li17yQkMtW/plCKSVxrcwdD20HT7iH3FV9LVAcgtpoeiNgqpYoNyUdGg ia9JyY0A1X6v18jVX6C/pExzlazlA3UBRLwvpjvvbOLeqbV3Fox6WwVXD vTbrr4a13z4/yBL/DPLOTj5GDw26PQBWQXKSyHG6MJr7ltXhwHI92AcFW LR+AWG8WlVbnB/Ib3cFW/URLNt0jwCZMaeqYiYm4qObGSV/BaglgMFSg6 FMsOyeGGUknYdcP6Ebbmww6m7o930OAeawTaZ3+zCJgESrNyvhQJDUQvq 0LCbP2zMGyDnA+JCb2WiizbNIqE7azzl0Z84ZpKWeZeWK/CQVLEA/43nB g==; X-CSE-ConnectionGUID: dlJN5Nq3SPWvMlYOKlJgBw== X-CSE-MsgGUID: yrkAd1SrQ16sftxOYV8HOA== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43972798" X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="43972798" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:36 -0800 X-CSE-ConnectionGUID: 9HuhCkayTSyOnzZMrNqPEA== X-CSE-MsgGUID: lVHVX5mGTIWwzRRO36R/eQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="92754926" Received: from fpallare-mobl4.ger.corp.intel.com (HELO vgovind2-mobl3..) ([10.245.244.60]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:34 -0800 From: Vinod Govindapillai To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: vinod.govindapillai@intel.com, kai.vehmanen@linux.intel.co, jani.saarinen@intel.com Subject: [PATCH v2 1/6] drm/i915/display: create a common function to check validity of ELD Date: Wed, 27 Nov 2024 14:07:10 +0200 Message-Id: <20241127120715.185348-2-vinod.govindapillai@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241127120715.185348-1-vinod.govindapillai@intel.com> References: <20241127120715.185348-1-vinod.govindapillai@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" We would need to check the validity of connector ELD from multiple places in the follow up patches. So create a separate function to check the validity for ELD. v2: Keep intel_encoder being passed to audio config calls Use intel_display instead of i915 Signed-off-by: Vinod Govindapillai Reviewed-by: Kai Vehmanen --- drivers/gpu/drm/i915/display/intel_audio.c | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index c6b251f178c2..e8c2cbe34523 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -689,21 +689,32 @@ void intel_audio_sdp_split_update(const struct intel_crtc_state *crtc_state) crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0); } +static bool intel_audio_eld_valid(struct intel_encoder *encoder, + struct drm_connector_state *conn_state) +{ + struct intel_display *display = to_intel_display(encoder); + struct drm_connector *connector = conn_state->connector; + + if (!connector->eld[0]) { + drm_dbg_kms(display->drm, + "Bogus ELD on [CONNECTOR:%d:%s]\n", + connector->base.id, connector->name); + return false; + } + + return true; +} + bool intel_audio_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) { - struct drm_i915_private *i915 = to_i915(encoder->base.dev); struct drm_connector *connector = conn_state->connector; const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; - if (!connector->eld[0]) { - drm_dbg_kms(&i915->drm, - "Bogus ELD on [CONNECTOR:%d:%s]\n", - connector->base.id, connector->name); + if (!intel_audio_eld_valid(encoder, conn_state)) return false; - } BUILD_BUG_ON(sizeof(crtc_state->eld) != sizeof(connector->eld)); memcpy(crtc_state->eld, connector->eld, sizeof(crtc_state->eld)); From patchwork Wed Nov 27 12:07:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Govindapillai X-Patchwork-Id: 13886944 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 4AD83D6ACC3 for ; Wed, 27 Nov 2024 12:07:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EBE7E10EAAC; Wed, 27 Nov 2024 12:07:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="mvbRQ26c"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3D8CB10EAB9; Wed, 27 Nov 2024 12:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732709259; x=1764245259; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sAUCfOiv7RotWjcTQIYd1tlS7zrMVOvYJYbDiBjOKF0=; b=mvbRQ26cskcJdS+DO0QFhC+8P4cpGVJzB5932N5T90V4enGHy3WU/IBU xEQXUv20mdCY4VVTnAC+KkMMP6KoMm05DNZkk/qwci1W3QraBAYUyMChJ qVBRu2K4sdXiLum6Dxzc4VA4wVd9zzzzJx1VCWpbb1uuf0tqYWZz0uDtN fesjtGUih9qDON4YcOrpLFDgbU9yly76lQTKiolLGKVr5ibeSUWdlm4mz FlEtc8fajYTkNy/JHC2FEmTVkKbfDzK9Iyz4polObs2fhnIrb9zXmGEE1 IIR1ELpnmYmuvpxQctM32PA/TB88kkzgQLWOR2bvA7lx195302w+hWJJS A==; X-CSE-ConnectionGUID: o7giVujpTd6HqfY6d+B0OA== X-CSE-MsgGUID: PQ6eH5/4Roe00BlauKLnpw== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43972803" X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="43972803" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:39 -0800 X-CSE-ConnectionGUID: GXatqezvSaGHIWYjQ16qQw== X-CSE-MsgGUID: rjSzro6sQnixnlLvyce3+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="92754931" Received: from fpallare-mobl4.ger.corp.intel.com (HELO vgovind2-mobl3..) ([10.245.244.60]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:37 -0800 From: Vinod Govindapillai To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: vinod.govindapillai@intel.com, kai.vehmanen@linux.intel.co, jani.saarinen@intel.com Subject: [PATCH v2 2/6] drm/i915/display: update call to intel_dp_audio_compute_config Date: Wed, 27 Nov 2024 14:07:11 +0200 Message-Id: <20241127120715.185348-3-vinod.govindapillai@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241127120715.185348-1-vinod.govindapillai@intel.com> References: <20241127120715.185348-1-vinod.govindapillai@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" For the complete audio compute config calculations, we would need to have the transcoder M/N values as well. So move intel_dp_audio_compute_config after the transcoder M/N values are calculated in intel_link_compute_m_n().This becomes more relevant after the follow-up patches where we will need to assess if an audio frequency can be supported with a pipe config. Signed-off-by: Vinod Govindapillai Reviewed-by: Kai Vehmanen --- drivers/gpu/drm/i915/display/intel_dp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 053a9a4182e7..888bcc549ddb 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -3170,8 +3170,6 @@ intel_dp_compute_config(struct intel_encoder *encoder, adjusted_mode->crtc_clock /= n; } - intel_dp_audio_compute_config(encoder, pipe_config, conn_state); - intel_link_compute_m_n(link_bpp_x16, pipe_config->lane_count, adjusted_mode->crtc_clock, @@ -3179,6 +3177,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, intel_dp_bw_fec_overhead(pipe_config->fec_enable), &pipe_config->dp_m_n); + intel_dp_audio_compute_config(encoder, pipe_config, conn_state); + /* FIXME: abstract this better */ if (pipe_config->splitter.enable) pipe_config->dp_m_n.data_m *= pipe_config->splitter.link_count; From patchwork Wed Nov 27 12:07:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Govindapillai X-Patchwork-Id: 13886945 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 D3505D6ACC3 for ; Wed, 27 Nov 2024 12:07:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7811010EAAF; Wed, 27 Nov 2024 12:07:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="UHCK5aXg"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id F303710EABB; Wed, 27 Nov 2024 12:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732709263; x=1764245263; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LE/nuHUEzIi5INIjfPJ2Sgm6fQFrgTkHwq0qQ/Czljc=; b=UHCK5aXgsUwpZxii6mL64nEWcVcoLg4en+TyFuhrcy1W5WGW67BGcK0o IrYDM3YuCbYJl8XrfV31tkBwSS4OaFJFSrGw3G2Ox+X+Nr1hR9MPZEc9U oZuZ10MCTCdN3nf9tHMDU0HAEXUl978yy7UHJcqoQg2dRaBZcaEQRN4/w GRcalNDQqTrGBL3DngXDp454io9AKkOLfNp7Aoym/TdwCgSVVHWkMZ15T hhW6Cj7CIG4NofkhD/MV3YkAJERH+e3NtnOyWBwrMX+2gPissRbZMw+LY R4DVpmRlhjAWrlL/nmz7wahhZgfZZBrDKDN0RIXAQZ+KQqTrluN/FQc9w A==; X-CSE-ConnectionGUID: fZKrr7xZSLefz/RB3zefIQ== X-CSE-MsgGUID: /sPhhh61QbSUIhPZBQZhTg== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43972817" X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="43972817" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:43 -0800 X-CSE-ConnectionGUID: ifLwVi+QSvuhvF74V79/sQ== X-CSE-MsgGUID: unohWtNiRVyg6btYmUYCGg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="92754939" Received: from fpallare-mobl4.ger.corp.intel.com (HELO vgovind2-mobl3..) ([10.245.244.60]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:40 -0800 From: Vinod Govindapillai To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: vinod.govindapillai@intel.com, kai.vehmanen@linux.intel.co, jani.saarinen@intel.com Subject: [PATCH v2 3/6] drm/i915/display: check and prune audio frequencies based on bw limits in DP2.0 Date: Wed, 27 Nov 2024 14:07:12 +0200 Message-Id: <20241127120715.185348-4-vinod.govindapillai@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241127120715.185348-1-vinod.govindapillai@intel.com> References: <20241127120715.185348-1-vinod.govindapillai@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Calculate the audio bw requirements and check the supported sad audio frequencies are feasible with selected pipe configuration. If not feasible, prune the audio frequencies from sad list. v2: clarity in variable names, use #define for constants (Kai) Squash DP2.0 check as part of this path (Kai) Keep passing intel_encoder for compute config calls Better clarity in debug statements Added DP2.0 in patch subject Bspec: 67768 Signed-off-by: Vinod Govindapillai Reviewed-by: Kai Vehmanen --- drivers/gpu/drm/i915/display/intel_audio.c | 111 +++++++++++++++++++++ drivers/gpu/drm/i915/display/intel_audio.h | 4 + drivers/gpu/drm/i915/display/intel_dp.c | 67 ++++++++++++- 3 files changed, 180 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index e8c2cbe34523..b4eef6d60ca1 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -705,6 +705,117 @@ static bool intel_audio_eld_valid(struct intel_encoder *encoder, return true; } +static bool +intel_audio_frequency_feasible(int line_freq_khz, + int hblank_slots_lanes_bytes, + int avail_overhead, int req_overhead, + int channels, int aud_frequency) +{ + int aud_samples_per_line = + DIV_ROUND_UP(aud_frequency, line_freq_khz) + 1; + int lines_per_audio_sample = + max(1, line_freq_khz / aud_frequency); + int hblank_bytes_available = + (hblank_slots_lanes_bytes - avail_overhead) * lines_per_audio_sample; + int hblank_bytes_required; + + if (channels > 2) + hblank_bytes_required = + DIV_ROUND_UP(aud_samples_per_line * 10 + 2, 4) * 16 + req_overhead; + else + hblank_bytes_required = + (DIV_ROUND_UP(DIV_ROUND_UP(aud_samples_per_line, 2) * 5 + 2, 4) + 2) * 16 + req_overhead; + + return hblank_bytes_available > hblank_bytes_required; +} + +static u8 +intel_audio_get_pruned_audfreq(int line_freq_khz, + int hblank_slots_lanes_bytes, + int avail_overhead, int req_overhead, + int channels, u8 in_sad_freq) +{ + const unsigned int freq_list_khz[] = { 32, 44, 48, 88, 96, 176, 192 }; + u8 pruned_sad_freq = in_sad_freq; + + for (int j = ARRAY_SIZE(freq_list_khz) - 1; j >= 0; j--) { + int freq = pruned_sad_freq & BIT(j) ? freq_list_khz[j] : 0; + + if (!freq) + continue; + + /* If "freq" is ok, then values below are also ok */ + if (intel_audio_frequency_feasible(line_freq_khz, + hblank_slots_lanes_bytes, + avail_overhead, + req_overhead, + channels, freq)) + break; + + /* "freq" not feasible! Prune it from the list */ + pruned_sad_freq &= ~BIT(j); + } + + return pruned_sad_freq; +} + +static void intel_audio_compute_sad(struct intel_encoder *encoder, + int line_freq_khz, + int hblank_slots_lanes_bytes, + int avail_overhead, int req_overhead, + struct cea_sad *sad) +{ + u8 sad_channels = sad->channels + 1; + u8 sad_freq; + + sad_freq = intel_audio_get_pruned_audfreq(line_freq_khz, + hblank_slots_lanes_bytes, + avail_overhead, + req_overhead, sad_channels, + sad->freq); + + sad->freq = sad_freq; +} + +bool intel_audio_compute_eld_config(struct intel_encoder *encoder, + struct drm_connector_state *conn_state, + int line_freq_khz, + int hblank_slots_lanes_bytes, + int avail_overhead, int req_overhead) +{ + struct intel_display *display = to_intel_display(encoder); + struct intel_connector *connector = to_intel_connector(conn_state->connector); + u8 *eld; + + if (!intel_audio_eld_valid(encoder, conn_state)) + return false; + + eld = connector->base.eld; + for (int i = 0; i < drm_eld_sad_count(eld); i++) { + struct cea_sad sad; + u8 sad_freq; + + if (drm_eld_sad_get(eld, i, &sad)) + continue; + + sad_freq = sad.freq; + intel_audio_compute_sad(encoder, line_freq_khz, + hblank_slots_lanes_bytes, + avail_overhead, req_overhead, &sad); + + /* Update the eld with new sad data if any changes in the list */ + if (sad_freq != sad.freq) { + drm_eld_sad_set(eld, i, &sad); + drm_dbg_kms(display->drm, + "[CONNECTOR:%d:%s] SAD updated. Freq: 0x%x(0x%x)\n", + connector->base.base.id, connector->base.name, + sad.freq, sad_freq); + } + } + + return true; +} + bool intel_audio_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *crtc_state, struct drm_connector_state *conn_state) diff --git a/drivers/gpu/drm/i915/display/intel_audio.h b/drivers/gpu/drm/i915/display/intel_audio.h index 1bafc155434a..8e851beba46c 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.h +++ b/drivers/gpu/drm/i915/display/intel_audio.h @@ -32,5 +32,9 @@ void intel_audio_init(struct drm_i915_private *dev_priv); void intel_audio_register(struct drm_i915_private *i915); void intel_audio_deinit(struct drm_i915_private *dev_priv); void intel_audio_sdp_split_update(const struct intel_crtc_state *crtc_state); +bool intel_audio_compute_eld_config(struct intel_encoder *encoder, + struct drm_connector_state *conn_state, + int line_freq_khz, int hblank_slots_lanes, + int avail_overhead, int req_overhead); #endif /* __INTEL_AUDIO_H__ */ diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 888bcc549ddb..efcba6e5c452 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -106,6 +106,10 @@ /* DP DSC FEC Overhead factor in ppm = 1/(0.972261) = 1.028530 */ #define DP_DSC_FEC_OVERHEAD_FACTOR 1028530 +/* DP Audio bw params calculations. Bspec: 67768 */ +#define DP_AUDIO_BW_HBLANK_OVERHEAD_AVAIL 64 +#define DP_AUDIO_BW_HBLANK_OVERHEAD_REQ 80 + /* Constants for DP DSC configurations */ static const u8 valid_dsc_bpp[] = {6, 8, 10, 12, 15}; @@ -3033,13 +3037,72 @@ intel_dp_compute_output_format(struct intel_encoder *encoder, return ret; } +static void +intel_dp_compute_audio_bwparams(struct intel_crtc_state *crtc_state, + int *line_freq_khz, + int *hblank_slots_lanes_bytes) +{ + /* Calculation steps based on Bspec: 67768 */ + struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; + int link_rate_mhz = DIV_ROUND_UP(crtc_state->port_clock, 1000); + int pixel_clk_mhz = DIV_ROUND_UP(adjusted_mode->crtc_clock, 1000); + int htotal = adjusted_mode->crtc_htotal; + int hblank_pixels = + adjusted_mode->crtc_hblank_end - adjusted_mode->crtc_hblank_start; + int mtp_clks_per_slot = DIV_ROUND_UP(4, crtc_state->lane_count); + int mtp_size_clks = 64 * mtp_clks_per_slot; + int link_clk_mhz = DIV_ROUND_UP(link_rate_mhz, 32); + int mtp_size_ns = DIV_ROUND_UP(mtp_size_clks * 1000, link_clk_mhz); + int hblank_size_ns = DIV_ROUND_UP(hblank_pixels * 1000, pixel_clk_mhz); + int mtps_in_hblank = DIV_ROUND_UP(hblank_size_ns, mtp_size_ns); + u32 temp = div_u64(mul_u32_u32(mtp_size_clks, crtc_state->dp_m_n.data_m), + crtc_state->dp_m_n.data_n); + int hblank_slots = mtps_in_hblank * temp; + + *line_freq_khz = DIV_ROUND_UP(pixel_clk_mhz, htotal) * 1000; + *hblank_slots_lanes_bytes = hblank_slots * crtc_state->lane_count * 4; +} + +static bool +intel_dp_audio_compute_bw_limits(struct intel_encoder *encoder, + struct intel_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct intel_display *display = to_intel_display(encoder); + struct intel_connector *connector = to_intel_connector(conn_state->connector); + int hblank_bytes_avail_overhead = DP_AUDIO_BW_HBLANK_OVERHEAD_AVAIL; + int hblank_bytes_req_overhead = DP_AUDIO_BW_HBLANK_OVERHEAD_REQ; + int hblank_slots_lanes_bytes; + int line_freq_khz; + + intel_dp_compute_audio_bwparams(crtc_state, &line_freq_khz, + &hblank_slots_lanes_bytes); + drm_dbg_kms(display->drm, + "[CONNECTOR:%d:%s][ENCODER:%d:%s] Bw limits params: line_freq: %d khz hblank_slots: %d bytes\n", + connector->base.base.id, connector->base.name, + encoder->base.base.id, encoder->base.name, + line_freq_khz, hblank_slots_lanes_bytes); + + return intel_audio_compute_eld_config(encoder, conn_state, + line_freq_khz, + hblank_slots_lanes_bytes, + hblank_bytes_avail_overhead, + hblank_bytes_req_overhead); +} + void intel_dp_audio_compute_config(struct intel_encoder *encoder, struct intel_crtc_state *pipe_config, struct drm_connector_state *conn_state) { - pipe_config->has_audio = - intel_dp_has_audio(encoder, conn_state) && + pipe_config->has_audio = intel_dp_has_audio(encoder, conn_state); + + if (intel_dp_is_uhbr(pipe_config)) + pipe_config->has_audio = pipe_config->has_audio && + intel_dp_audio_compute_bw_limits(encoder, pipe_config, + conn_state); + + pipe_config->has_audio = pipe_config->has_audio && intel_audio_compute_config(encoder, pipe_config, conn_state); pipe_config->sdp_split_enable = pipe_config->has_audio && From patchwork Wed Nov 27 12:07:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Govindapillai X-Patchwork-Id: 13886946 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 5A3BBD6ACC5 for ; Wed, 27 Nov 2024 12:07:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0229D10EABF; Wed, 27 Nov 2024 12:07:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="WRh84qIg"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1B49910EABF; Wed, 27 Nov 2024 12:07:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732709266; x=1764245266; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ry18WdMblMIAgPceaNkHXpcJI0Bs97iZ6u0R/Eh54Fo=; b=WRh84qIgployqsTvkyhmUZJDmfKFRQVXn8LhHIn3oVet/NXAe9Het/0V n2dKZjys3FtL+OHCQHpomzLoloJ28Ci+v12cb1WuxAzhq/nrGrTMePKjj xgEzfU9ei9otYxkbCN+YAOc71hz2zE6cGnHDNMaZHotbjtuDhfpcUXzEC tqGa/JnThKGFfqtY7Kg2hDq7amECqoVsS4VdWTPEOAZTk2mRThhT8Jkga UdeN3rb59NRD0zWhbbaKUw9ftCSQXZbCh6RqXscIj21kMeELLrePhfb1s nvyW4IQTPs/NFGFi2vQ8UqxGwl3SLnf8nbYUcceOrhPDQIGlj3esIJI2k w==; X-CSE-ConnectionGUID: AQAa7sVBQa+eW7iZDdkR9Q== X-CSE-MsgGUID: Rdxml5YjR5mmCKaLM45AwQ== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43972825" X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="43972825" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:46 -0800 X-CSE-ConnectionGUID: 9At0aylIQkqaqqnMRC1Ikw== X-CSE-MsgGUID: cFFupRy6RiqQw8t2uqjLIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="92754974" Received: from fpallare-mobl4.ger.corp.intel.com (HELO vgovind2-mobl3..) ([10.245.244.60]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:44 -0800 From: Vinod Govindapillai To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: vinod.govindapillai@intel.com, kai.vehmanen@linux.intel.co, jani.saarinen@intel.com Subject: [PATCH v2 4/6] drm/i915/display: iterate through channels if no feasible frequencies Date: Wed, 27 Nov 2024 14:07:13 +0200 Message-Id: <20241127120715.185348-5-vinod.govindapillai@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241127120715.185348-1-vinod.govindapillai@intel.com> References: <20241127120715.185348-1-vinod.govindapillai@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" For a pipe configuration, if no supported audio frequencies are found, then start reducing the audio channels and try assess the sad audio frequency list again. v2: fix commit description (Kai) uninitialized variable "sad_freq" (kernel test robot) use intel_display instead of i915 Bspec: 67768 Signed-off-by: Vinod Govindapillai Reviewed-by: Kai Vehmanen --- drivers/gpu/drm/i915/display/intel_audio.c | 35 +++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index b4eef6d60ca1..cf88728b8f80 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -765,16 +765,28 @@ static void intel_audio_compute_sad(struct intel_encoder *encoder, int avail_overhead, int req_overhead, struct cea_sad *sad) { - u8 sad_channels = sad->channels + 1; - u8 sad_freq; + u8 sad_freq = 0; + u8 channels; - sad_freq = intel_audio_get_pruned_audfreq(line_freq_khz, - hblank_slots_lanes_bytes, - avail_overhead, - req_overhead, sad_channels, - sad->freq); + /* + * If we don't find any supported audio frequencies for a channel, + * reduce the channel and try + */ + for (channels = sad->channels + 1; channels >= 1; channels--) { + sad_freq = intel_audio_get_pruned_audfreq(line_freq_khz, + hblank_slots_lanes_bytes, + avail_overhead, + req_overhead, + channels, + sad->freq); + + /* Supported frequencies exist! No need to proceed further */ + if (sad_freq) + break; + } sad->freq = sad_freq; + sad->channels = channels ? channels - 1 : 0; } bool intel_audio_compute_eld_config(struct intel_encoder *encoder, @@ -794,22 +806,25 @@ bool intel_audio_compute_eld_config(struct intel_encoder *encoder, for (int i = 0; i < drm_eld_sad_count(eld); i++) { struct cea_sad sad; u8 sad_freq; + u8 sad_channels; if (drm_eld_sad_get(eld, i, &sad)) continue; sad_freq = sad.freq; + sad_channels = sad.channels; intel_audio_compute_sad(encoder, line_freq_khz, hblank_slots_lanes_bytes, avail_overhead, req_overhead, &sad); /* Update the eld with new sad data if any changes in the list */ - if (sad_freq != sad.freq) { + if (sad_freq != sad.freq || sad_channels != sad.channels) { drm_eld_sad_set(eld, i, &sad); drm_dbg_kms(display->drm, - "[CONNECTOR:%d:%s] SAD updated. Freq: 0x%x(0x%x)\n", + "[CONNECTOR:%d:%s] SAD updated. Freq: 0x%x(0x%x) Channels: %d(%d)\n", connector->base.base.id, connector->base.name, - sad.freq, sad_freq); + sad.freq, sad_freq, sad.channels, + sad_channels); } } From patchwork Wed Nov 27 12:07:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Govindapillai X-Patchwork-Id: 13886947 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 A0639D6ACC0 for ; Wed, 27 Nov 2024 12:07:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D67D10EAC2; Wed, 27 Nov 2024 12:07:52 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="KJzqSU8Z"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id DE6C710EABC; Wed, 27 Nov 2024 12:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732709269; x=1764245269; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nzFMqJnJayPxffBvYn7qT14XCfU+ODfvzHercHCjiO0=; b=KJzqSU8ZXdIzpvq6pLdCSlLJeR+A20OspvxddP/did1UXdK2Y+q8bVgc oqusyDE6+gOGVKTJTndsLSwJY6B3Bcx1bsL5WDjHEdzdndKunCrwYuicS yITh3jV9FSwuM1l9x1oZqCTqnUzG2mo8BvZ/8ufyoDJ6VNde7kdwznDUI Ify2GUUvCdFZkqYMHKCo20U7aZrRwX9ByBCNxGzdrleyKAJ/+gU/al7c+ ipmKLr5b+/DXZ7GeYMsvDTUVR7vTYS3JUkdQvn2wWZ8VAAEpiRasArDe4 0LwqVcbN3Gch9NOdGMwg/Y2IM4BrOOgQFPhbQN/bIEWl0p4wDbdqEznfD g==; X-CSE-ConnectionGUID: LB8lFctYQjCIZYtNM2NdJA== X-CSE-MsgGUID: YWgxUe51QsWWXMGfW3/iKA== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43972830" X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="43972830" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:49 -0800 X-CSE-ConnectionGUID: SB+/qYAlQ8uT0aRzCNhhOQ== X-CSE-MsgGUID: EYOvYgNJQHir1rdjw730Dg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="92754985" Received: from fpallare-mobl4.ger.corp.intel.com (HELO vgovind2-mobl3..) ([10.245.244.60]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:47 -0800 From: Vinod Govindapillai To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: vinod.govindapillai@intel.com, kai.vehmanen@linux.intel.co, jani.saarinen@intel.com Subject: [PATCH v2 5/6] drm/i915/display: update audio support based on the available frequencies Date: Wed, 27 Nov 2024 14:07:14 +0200 Message-Id: <20241127120715.185348-6-vinod.govindapillai@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241127120715.185348-1-vinod.govindapillai@intel.com> References: <20241127120715.185348-1-vinod.govindapillai@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" After pruning the sad audio frequency list, if there are no supported audio frequencies left, audio cannot be supported. So mark has_audio accordingly. v2: avoid bitwise operations on bool and use str_yes_no (Jani) use intel_display instead of i915 Signed-off-by: Vinod Govindapillai Reviewed-by: Kai Vehmanen --- drivers/gpu/drm/i915/display/intel_audio.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index cf88728b8f80..f0a50dc3b8a6 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -797,6 +797,7 @@ bool intel_audio_compute_eld_config(struct intel_encoder *encoder, { struct intel_display *display = to_intel_display(encoder); struct intel_connector *connector = to_intel_connector(conn_state->connector); + bool audio_supported = false; u8 *eld; if (!intel_audio_eld_valid(encoder, conn_state)) @@ -826,9 +827,18 @@ bool intel_audio_compute_eld_config(struct intel_encoder *encoder, sad.freq, sad_freq, sad.channels, sad_channels); } + + /* If no supported freq in any sads, report audio not supported */ + if (sad.freq) + audio_supported = true; } - return true; + drm_dbg_kms(display->drm, + "[CONNECTOR:%d:%s][ENCODER:%d:%s] audio supported: %s\n", + connector->base.base.id, connector->base.name, + encoder->base.base.id, encoder->base.name, + str_yes_no(audio_supported)); + return audio_supported; } bool intel_audio_compute_config(struct intel_encoder *encoder, From patchwork Wed Nov 27 12:07:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Govindapillai X-Patchwork-Id: 13886948 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 6A7F0D6ACC0 for ; Wed, 27 Nov 2024 12:07:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 12CE410EAC4; Wed, 27 Nov 2024 12:07:55 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="VMq0QSsk"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8221110EAB9; Wed, 27 Nov 2024 12:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732709272; x=1764245272; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sxC06TLUH15F2qy4Dp3+kPGmi5hB5xm0N3fA+SPQrVI=; b=VMq0QSskxPOvCUkNHXJ4DEDRvqQXF/22IdiGd0q4edWsz0n6XMq2ukho Lf+KWHqTTW9AXlBmrPOQ+Il9E9rfkjw4DDefvZdoM9VsK2kiVdSVne9lV 1vOiQ0oD0I+U+QolNLlRtqzDk57DAXipdxfGiFKBqISoPnAgdD8YBq6E4 V07d65wachy65B9Njlo2Dnb9wDJRHOPb0YGOG01LPIO/S9FJ4eD/uN4KL pGrz4Qg0CaeADnustSy/F4DJwxcuQCCnq3GVQF8Odc9wdx7K3dJ9JerjC 2DQKKfW8EMKOGPzGu6MoW8R59jGEJLyBEQBBI8ExDzPlIQ1GdiSVnlwFR w==; X-CSE-ConnectionGUID: DW6nXvknSKST+MEzGnBblg== X-CSE-MsgGUID: SNE9C/ABRT2MNoCt8BsY/A== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="43972838" X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="43972838" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:52 -0800 X-CSE-ConnectionGUID: X+bCg0RXQ12XpHOBtBEcLg== X-CSE-MsgGUID: zbB3oEnQRZaokYuv6Vs+Lg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,189,1728975600"; d="scan'208";a="92754991" Received: from fpallare-mobl4.ger.corp.intel.com (HELO vgovind2-mobl3..) ([10.245.244.60]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2024 04:07:50 -0800 From: Vinod Govindapillai To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: vinod.govindapillai@intel.com, kai.vehmanen@linux.intel.co, jani.saarinen@intel.com Subject: [PATCH v2 6/6] drm/i915/display: update audio bw calculations for MTL Date: Wed, 27 Nov 2024 14:07:15 +0200 Message-Id: <20241127120715.185348-7-vinod.govindapillai@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241127120715.185348-1-vinod.govindapillai@intel.com> References: <20241127120715.185348-1-vinod.govindapillai@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Update the reference overhead values for audio bw calculations for MTL onwards v2: fix the patch description (Kai) Bspec: 67768 Signed-off-by: Vinod Govindapillai Reviewed-by: Kai Vehmanen --- drivers/gpu/drm/i915/display/intel_dp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index efcba6e5c452..25691f87f779 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -109,6 +109,8 @@ /* DP Audio bw params calculations. Bspec: 67768 */ #define DP_AUDIO_BW_HBLANK_OVERHEAD_AVAIL 64 #define DP_AUDIO_BW_HBLANK_OVERHEAD_REQ 80 +#define MTL_DP_AUDIO_BW_HBLANK_OVERHEAD_REQ 0 + /* Constants for DP DSC configurations */ static const u8 valid_dsc_bpp[] = {6, 8, 10, 12, 15}; @@ -3071,10 +3073,15 @@ intel_dp_audio_compute_bw_limits(struct intel_encoder *encoder, struct intel_display *display = to_intel_display(encoder); struct intel_connector *connector = to_intel_connector(conn_state->connector); int hblank_bytes_avail_overhead = DP_AUDIO_BW_HBLANK_OVERHEAD_AVAIL; - int hblank_bytes_req_overhead = DP_AUDIO_BW_HBLANK_OVERHEAD_REQ; + int hblank_bytes_req_overhead; int hblank_slots_lanes_bytes; int line_freq_khz; + if (DISPLAY_VER(display) >= 14) + hblank_bytes_req_overhead = MTL_DP_AUDIO_BW_HBLANK_OVERHEAD_REQ; + else + hblank_bytes_req_overhead = DP_AUDIO_BW_HBLANK_OVERHEAD_REQ; + intel_dp_compute_audio_bwparams(crtc_state, &line_freq_khz, &hblank_slots_lanes_bytes); drm_dbg_kms(display->drm,