Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2523854rwb; Mon, 3 Oct 2022 01:55:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5B7R2dpRCTYS7AIcxJnGBhVBZHvtgjcjceAG9I3WTAFDylf+bN2e4qEheTovbpYzRDxARL X-Received: by 2002:a63:4243:0:b0:439:2031:be87 with SMTP id p64-20020a634243000000b004392031be87mr18179580pga.592.1664787341002; Mon, 03 Oct 2022 01:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664787340; cv=none; d=google.com; s=arc-20160816; b=rOAuyeN/JiCDLF2pSSj8+DrKMWkMI9StGkbBycpkPsbIdphhQbNVJPSW3sW6X5Ihwx IopwUp0usk/EwQC2RuKo+3ECQGJQKAgELcKr3jl2EsTA2w7KKWynjFKwv4HWEl9U5X22 UCjbq57HmMCC1Dap7bKGGe062gmDO3RBKXJZKjTxkb02azabCCgxuEaGBZdvLwbyg5SG OO02xrkNonxLQCIdxCihO9qf+afWQ+kcGCeTgidmzS3Jtlj2+h4uwch9IA+Y/BtfOUBv 7Yyf+POwuwApBr51rInMJPJrORPa9yeQ8VmKgpw9UedGDEFuLbEWcf9dS0tCDqvlaJaP aU+w== 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=1U3vkI0c9v27qn1FrDG2tBfXk+ESOnm8GD1ma5FnQBc=; b=t31EMmn+389xlCYgxkQuPrSKPsQ7pLJajDbHk4abSg+QTUw3sW/m+STpGu3pQ1FhNn YlnANq9xMmOnfjbczf+N11nKoep6quIbyEMILBkNaG3QD4wLXRJavEo61iKqY2VsM2ZS GNmMMeaSByf1sEl+WP+MFIHE+qcgK5ko8gpoVMvCwjRekxuf8QWEFiaKC2UA3UOBadsr QzwyFffRuMAhFV1y26RgQwaeCTk3x8dcQbxSkNo6wOvZM1jHKDzKCicFeo5Otkzz5eHU 3p4TyMjo6kafray3c1IBeM8ufgCTeXkrjQOivoZCHzgIHCcpZ994xVOHqMgDu76VCfjp D5Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X0VuHeES; 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 j8-20020a655588000000b00434b739a66bsi10837597pgs.276.2022.10.03.01.55.29; Mon, 03 Oct 2022 01:55:40 -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=X0VuHeES; 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 S229644AbiJCIYj (ORCPT + 99 others); Mon, 3 Oct 2022 04:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230454AbiJCIX7 (ORCPT ); Mon, 3 Oct 2022 04:23:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9C7119C29; Mon, 3 Oct 2022 00:58:35 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5737D60FA9; Mon, 3 Oct 2022 07:21:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DEF8C433D6; Mon, 3 Oct 2022 07:21:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664781696; bh=ja9jN6fWUSoocVyq+OaQvuGynReSYFuZ/zmV/0jH1UI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X0VuHeESpTnhcwvJHLlI+I+MpTTwR1hgEYEV4dUdfuB3Zyi8wkIh0IXGTGmfXVuDK 71JNELxTBdSePGJTVp4t/KO48NcZQKWzIj5w/x+H+UDORGsaHxJjiLIgc1hh6+XRIm wyk2/cJhijfMUJYQ86Po6KbkG0CyfRdycsg7wcDc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mohan Kumar , Takashi Iwai , Sasha Levin Subject: [PATCH 5.10 06/52] ALSA: hda: Fix Nvidia dp infoframe Date: Mon, 3 Oct 2022 09:11:13 +0200 Message-Id: <20221003070718.899509428@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221003070718.687440096@linuxfoundation.org> References: <20221003070718.687440096@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 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: Mohan Kumar [ Upstream commit f89e409402e2aeb3bc3aa44d2b7a597959e4e6af ] Nvidia HDA HW expects infoframe data bytes order same for both HDMI and DP i.e infoframe data starts from 5th bytes offset. As dp infoframe structure has 4th byte as valid infoframe data, use hdmi infoframe structure for nvidia dp infoframe to match HW behvaior. Signed-off-by: Mohan Kumar Cc: Link: https://lore.kernel.org/r/20220913065818.13015-1-mkumard@nvidia.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/hda/patch_hdmi.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 6110370f874d..99dd31335f6a 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -158,6 +158,8 @@ struct hdmi_spec { bool dyn_pin_out; bool dyn_pcm_assign; bool dyn_pcm_no_legacy; + bool nv_dp_workaround; /* workaround DP audio infoframe for Nvidia */ + bool intel_hsw_fixup; /* apply Intel platform-specific fixups */ /* * Non-generic VIA/NVIDIA specific @@ -667,15 +669,24 @@ static void hdmi_pin_setup_infoframe(struct hda_codec *codec, int ca, int active_channels, int conn_type) { + struct hdmi_spec *spec = codec->spec; union audio_infoframe ai; memset(&ai, 0, sizeof(ai)); - if (conn_type == 0) { /* HDMI */ + if ((conn_type == 0) || /* HDMI */ + /* Nvidia DisplayPort: Nvidia HW expects same layout as HDMI */ + (conn_type == 1 && spec->nv_dp_workaround)) { struct hdmi_audio_infoframe *hdmi_ai = &ai.hdmi; - hdmi_ai->type = 0x84; - hdmi_ai->ver = 0x01; - hdmi_ai->len = 0x0a; + if (conn_type == 0) { /* HDMI */ + hdmi_ai->type = 0x84; + hdmi_ai->ver = 0x01; + hdmi_ai->len = 0x0a; + } else {/* Nvidia DP */ + hdmi_ai->type = 0x84; + hdmi_ai->ver = 0x1b; + hdmi_ai->len = 0x11 << 2; + } hdmi_ai->CC02_CT47 = active_channels - 1; hdmi_ai->CA = ca; hdmi_checksum_audio_infoframe(hdmi_ai); @@ -3526,6 +3537,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec) spec->pcm_playback.rates = SUPPORTED_RATES; spec->pcm_playback.maxbps = SUPPORTED_MAXBPS; spec->pcm_playback.formats = SUPPORTED_FORMATS; + spec->nv_dp_workaround = true; return 0; } @@ -3665,6 +3677,7 @@ static int patch_nvhdmi(struct hda_codec *codec) spec->chmap.ops.chmap_cea_alloc_validate_get_type = nvhdmi_chmap_cea_alloc_validate_get_type; spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; + spec->nv_dp_workaround = true; codec->link_down_at_suspend = 1; @@ -3688,6 +3701,7 @@ static int patch_nvhdmi_legacy(struct hda_codec *codec) spec->chmap.ops.chmap_cea_alloc_validate_get_type = nvhdmi_chmap_cea_alloc_validate_get_type; spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; + spec->nv_dp_workaround = true; codec->link_down_at_suspend = 1; @@ -3861,6 +3875,7 @@ static int patch_tegra_hdmi(struct hda_codec *codec) spec->chmap.ops.chmap_cea_alloc_validate_get_type = nvhdmi_chmap_cea_alloc_validate_get_type; spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; + spec->nv_dp_workaround = true; return 0; } -- 2.35.1