From nobody Wed Dec 17 04:09:28 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3270AC32771 for ; Mon, 26 Sep 2022 12:01:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239157AbiIZMBq (ORCPT ); Mon, 26 Sep 2022 08:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239166AbiIZL62 (ORCPT ); Mon, 26 Sep 2022 07:58:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 700A57B1DC; Mon, 26 Sep 2022 03:52:07 -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 9DB35B80943; Mon, 26 Sep 2022 10:42:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8993C43470; Mon, 26 Sep 2022 10:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664188964; bh=Nzr51lwUrmbCck9szfNyKvBeqEsGN2UynDFvYwPfw8A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IE/NHFB6P0FHcpMyO9iuyGrnKRl8Kwn+jyk9KJ89wyK+1Bl4Yk/MwzsdxcBmwgbTf zJw6TGrt7bI0YnVzxjgP1zzy82rNCs3uc6byxIHWGL0e33MsSOXlSQFADT3qELKNuZ WVJ2zSelMHzJ4O41Wt3Ps8K2RekaxfDSp7Gx29zQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mohan Kumar , Takashi Iwai Subject: [PATCH 5.19 029/207] ALSA: hda: Fix Nvidia dp infoframe Date: Mon, 26 Sep 2022 12:10:18 +0200 Message-Id: <20220926100807.779609294@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Mohan Kumar commit f89e409402e2aeb3bc3aa44d2b7a597959e4e6af upstream. 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: Greg Kroah-Hartman --- sound/pci/hda/patch_hdmi.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -170,6 +170,8 @@ struct hdmi_spec { bool dyn_pcm_no_legacy; /* hdmi interrupt trigger control flag for Nvidia codec */ bool hdmi_intr_trig_ctrl; + bool nv_dp_workaround; /* workaround DP audio infoframe for Nvidia */ + bool intel_hsw_fixup; /* apply Intel platform-specific fixups */ /* * Non-generic VIA/NVIDIA specific @@ -679,15 +681,24 @@ static void hdmi_pin_setup_infoframe(str int ca, int active_channels, int conn_type) { + struct hdmi_spec *spec =3D codec->spec; union audio_infoframe ai; =20 memset(&ai, 0, sizeof(ai)); - if (conn_type =3D=3D 0) { /* HDMI */ + if ((conn_type =3D=3D 0) || /* HDMI */ + /* Nvidia DisplayPort: Nvidia HW expects same layout as HDMI */ + (conn_type =3D=3D 1 && spec->nv_dp_workaround)) { struct hdmi_audio_infoframe *hdmi_ai =3D &ai.hdmi; =20 - hdmi_ai->type =3D 0x84; - hdmi_ai->ver =3D 0x01; - hdmi_ai->len =3D 0x0a; + if (conn_type =3D=3D 0) { /* HDMI */ + hdmi_ai->type =3D 0x84; + hdmi_ai->ver =3D 0x01; + hdmi_ai->len =3D 0x0a; + } else {/* Nvidia DP */ + hdmi_ai->type =3D 0x84; + hdmi_ai->ver =3D 0x1b; + hdmi_ai->len =3D 0x11 << 2; + } hdmi_ai->CC02_CT47 =3D active_channels - 1; hdmi_ai->CA =3D ca; hdmi_checksum_audio_infoframe(hdmi_ai); @@ -3617,6 +3628,7 @@ static int patch_nvhdmi_2ch(struct hda_c spec->pcm_playback.rates =3D SUPPORTED_RATES; spec->pcm_playback.maxbps =3D SUPPORTED_MAXBPS; spec->pcm_playback.formats =3D SUPPORTED_FORMATS; + spec->nv_dp_workaround =3D true; return 0; } =20 @@ -3756,6 +3768,7 @@ static int patch_nvhdmi(struct hda_codec spec->chmap.ops.chmap_cea_alloc_validate_get_type =3D nvhdmi_chmap_cea_alloc_validate_get_type; spec->chmap.ops.chmap_validate =3D nvhdmi_chmap_validate; + spec->nv_dp_workaround =3D true; =20 codec->link_down_at_suspend =3D 1; =20 @@ -3779,6 +3792,7 @@ static int patch_nvhdmi_legacy(struct hd spec->chmap.ops.chmap_cea_alloc_validate_get_type =3D nvhdmi_chmap_cea_alloc_validate_get_type; spec->chmap.ops.chmap_validate =3D nvhdmi_chmap_validate; + spec->nv_dp_workaround =3D true; =20 codec->link_down_at_suspend =3D 1; =20 @@ -3993,6 +4007,7 @@ static int tegra_hdmi_init(struct hda_co spec->chmap.ops.chmap_cea_alloc_validate_get_type =3D nvhdmi_chmap_cea_alloc_validate_get_type; spec->chmap.ops.chmap_validate =3D nvhdmi_chmap_validate; + spec->nv_dp_workaround =3D true; =20 return 0; }