Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1863089rwb; Fri, 19 Aug 2022 10:38:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR4nzyPdhigipOtZdVfK9QHn6pQ4J5Ii7hGeW6hF89pjTCsjb+WuguBoj/2hgT4r6q28TAwa X-Received: by 2002:a63:5945:0:b0:41d:8ca6:48cd with SMTP id j5-20020a635945000000b0041d8ca648cdmr7133880pgm.311.1660930680301; Fri, 19 Aug 2022 10:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930680; cv=none; d=google.com; s=arc-20160816; b=OUYCBKrZe2T7rpXebUmc9gw84eDK3CSOshEjlYH1ICwXVFyEhSIFaijnbeD9LPmlh4 xaD7nDSYZmM85IyoYpAwV3jH92Cv29j87EOc91I4YNos9DQnsfJfOcmdKcBvYbdcwqwY depqQWo1BFo+7vjARu0F7OigHzwv5qJ9s3NomGSJqMVN8ZxDSu8kfMu3Xj9PwQM5QCdE PKXFATelE/gEzmIZeXIqqAk/FbvFV8xqpRRRQQOvd4uo2Cs2dH4n/hIx4tmefnJLEIU3 qjaWCCQHTbOd3FXqnsejOnTgKneCFQkkAv6Ivo0EXn/iEbuN4bRZ+ZpwclldOk0K0Kf+ lw6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XnwpZFHV3Y3I5Lki0OktcYDzqc4gMiiyEAoY2WNEmyo=; b=TfL4Lg02/PaBo6aMwxLgOBWmUvc4wW9JBocBDq/Hte+/WkD45FrlbKfoJXDXOX5D0R j8pNZcBVjSmrYg9yDqnd8ZCQtlrNuA0rWf2+F0pxtnuNrGoCg0Vm8l4rUpulWJpGMvgz gh4WeYepAiDb8nDn2EPLeiCQ5ibLGQUKBULdxGu1R9Egs5UBRKx/6V5RI3kd+BYSR5xq HaTfgVBDb81PpX9f/Iq7t5FgW5W6eQQYrijyA6oTluHMbCYz6nfkdXjJq2LHEx4qEALF 47D8utVV+OMts5auQkXaCr0ritFoaQnDGVGZ2rQQZNFGwG50eOdrTnlyjIokcoJoTjFj X8YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o36bVtoI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020a63e411000000b00429cf3b6637si4453000pgi.697.2022.08.19.10.37.49; Fri, 19 Aug 2022 10:38:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o36bVtoI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351462AbiHSQJ1 (ORCPT + 99 others); Fri, 19 Aug 2022 12:09:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351724AbiHSQG0 (ORCPT ); Fri, 19 Aug 2022 12:06:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2633810D5BC; Fri, 19 Aug 2022 08:55:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 078E1B82811; Fri, 19 Aug 2022 15:55:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EC40C43470; Fri, 19 Aug 2022 15:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924523; bh=6I0w9ViDntC5SF6upPsG6xsZ4dd8+d6KoR9oeRkH/98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o36bVtoIDOLVyrCj6O+sd3vCxDRTnhAv8neFMjtT+nJ13ttN/QALpLTnTinBSUdXN MXGsH+CKAmoV1+J8TWf2K2z01/o2P7BkjgDspim/NcPIaGB+iHeWi0bsChpqxkY+Mn LpvFwi9hIDwOvYSbaRpVuPmaPd964FxT/jDw1drE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dom Cobley , Maxime Ripard , Sasha Levin Subject: [PATCH 5.10 199/545] drm/vc4: hdmi: Remove firmware logic for MAI threshold setting Date: Fri, 19 Aug 2022 17:39:29 +0200 Message-Id: <20220819153838.285646925@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dom Cobley [ Upstream commit 8434111ccfec8fc0549ec325a632067232d38e14 ] This was a workaround for bugs in hardware on earlier Pi models and wasn't totally successful. It makes audio quality worse on a Pi4 at the higher sample rates Signed-off-by: Dom Cobley Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210525132354.297468-10-maxime@cerno.tech Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_hdmi.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index d5822878b5a7..6acc34f1e095 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1031,22 +1031,12 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, audio_packet_config |= VC4_SET_FIELD(channel_mask, VC4_HDMI_AUDIO_PACKET_CEA_MASK); - /* Set the MAI threshold. This logic mimics the firmware's. */ - if (vc4_hdmi->audio.samplerate > 96000) { - HDMI_WRITE(HDMI_MAI_THR, - VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQHIGH) | - VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); - } else if (vc4_hdmi->audio.samplerate > 48000) { - HDMI_WRITE(HDMI_MAI_THR, - VC4_SET_FIELD(0x14, VC4_HD_MAI_THR_DREQHIGH) | - VC4_SET_FIELD(0x12, VC4_HD_MAI_THR_DREQLOW)); - } else { - HDMI_WRITE(HDMI_MAI_THR, - VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) | - VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | - VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) | - VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW)); - } + /* Set the MAI threshold */ + HDMI_WRITE(HDMI_MAI_THR, + VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICHIGH) | + VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | + VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQHIGH) | + VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_DREQLOW)); HDMI_WRITE(HDMI_MAI_CONFIG, VC4_HDMI_MAI_CONFIG_BIT_REVERSE | -- 2.35.1