From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 448F0C35254 for ; Mon, 10 Feb 2020 03:40:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C604D214DB for ; Mon, 10 Feb 2020 03:40:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="cZ7bjlds"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="oiHZe3Qf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C604D214DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 255901664; Mon, 10 Feb 2020 04:39:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 255901664 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1581306019; bh=0lWGv0VSdHSbGaFGMnozNgX5gsC7iffd3TjMK2me1VA=; h=To:References:From:Date:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cZ7bjldsnOv90eay/jTpxQASBttMeUk+GSlZCASGUdNyvhWgCHwNnCSo11mFXSfLa OKCghO2J5ylApVoLSptdlMkGobVlSY13SyxHiSAf06r0yKnxgzpqM0nmYlfMgXdyvl 4SV09Pry5KMA6jxgb8HAmEEPqhqaMoe4SqZnaeTI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8D1FCF80118; Mon, 10 Feb 2020 04:39:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DD3D0F80157; Mon, 10 Feb 2020 04:39:26 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E4E1BF80118 for ; Mon, 10 Feb 2020 04:39:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E4E1BF80118 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="oiHZe3Qf" Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sun, 09 Feb 2020 19:38:19 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Sun, 09 Feb 2020 19:39:21 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Sun, 09 Feb 2020 19:39:21 -0800 Received: from [10.24.218.119] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 10 Feb 2020 03:39:19 +0000 To: Takashi Iwai , References: <20200206162804.4734-1-tiwai@suse.de> <20200206162804.4734-2-tiwai@suse.de> From: Nikhil Mahale Message-ID: <99f02eeb-9dfc-8642-96a5-71cca9b8f4f9@nvidia.com> Date: Mon, 10 Feb 2020 09:09:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200206162804.4734-2-tiwai@suse.de> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1581305899; bh=OwLUQU6bQkcUw8Yx8vcktU5FnZeBnnvNz2MqegAvw+g=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=oiHZe3QfODRYZb1UKgLrja4Sb2MUMOkOUAgBIIkqFku0T+fpR8rKIqjyINqS8XVtd fzDyQS4MqaCozsCQ74DWeNEi5zxXTTAVfA3i4Tauut4pPO1POg36jfE5Xftc2xfVnA wVg0FdNjSg7J6iFQ06ikOC5k1CxEBAySRXWdDy/Sz1DATKKBvvibPlssu6EEF+40NQ 8tEssWBtxYn4X+8IdU3hBjL3Mu69IJRHRcs8cDgVcd52QSd4ATFZ9sGQxTF/3qSw8A V0i9+5GDiBaV83ZWZsBiimTQXQ6GE5zVnJddFfl6tYQhLgNrw67dRANNM8Ti87dgRT bcD8aMRso3GCQ== Cc: Kai Vehmanen Subject: Re: [alsa-devel] [PATCH 1/4] ALSA: hda/hdmi: Reduce hda_jack_tbl lookup at unsol event handling X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Looks good to me. Reviewed-by: Nikhil Mahale On 2/6/20 9:58 PM, Takashi Iwai wrote: > External email: Use caution opening links or attachments > > > Pass hda_jack_tbl object to hdmi_intrinsic_event() along with res from > hdmi_unsol_event() so that we can reduce the lookup of the same > hda_jack_tbl object again. > > Minor code refactoring. > > Signed-off-by: Takashi Iwai > --- > sound/pci/hda/patch_hdmi.c | 18 +++--------------- > 1 file changed, 3 insertions(+), 15 deletions(-) > > diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c > index 5119a9ae3d8a..c65d16dea08c 100644 > --- a/sound/pci/hda/patch_hdmi.c > +++ b/sound/pci/hda/patch_hdmi.c > @@ -779,21 +779,9 @@ static void jack_callback(struct hda_codec *codec, > check_presence_and_report(codec, jack->nid, jack->dev_id); > } > > -static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) > +static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res, > + struct hda_jack_tbl *jack) > { > - int tag = res >> AC_UNSOL_RES_TAG_SHIFT; > - struct hda_jack_tbl *jack; > - > - if (codec->dp_mst) { > - int dev_entry = > - (res & AC_UNSOL_RES_DE) >> AC_UNSOL_RES_DE_SHIFT; > - > - jack = snd_hda_jack_tbl_get_from_tag(codec, tag, dev_entry); > - } else { > - jack = snd_hda_jack_tbl_get_from_tag(codec, tag, 0); > - } > - if (!jack) > - return; > jack->jack_dirty = 1; > > codec_dbg(codec, > @@ -853,7 +841,7 @@ static void hdmi_unsol_event(struct hda_codec *codec, unsigned int res) > } > > if (subtag == 0) > - hdmi_intrinsic_event(codec, res); > + hdmi_intrinsic_event(codec, res, jack); > else > hdmi_non_intrinsic_event(codec, res); > } > -- > 2.16.4 > ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel