From patchwork Tue Sep 19 21:56:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lyude Paul X-Patchwork-Id: 142144 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3780953vqi; Tue, 19 Sep 2023 17:41:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmYTnTcZyB0CyK5SuFdFnVbWT+y6xZQnTY/R3hZXV7hSQtJvF8kddg3By4LUMQO2l4m1HW X-Received: by 2002:a05:6a20:9757:b0:14d:fefd:a2e5 with SMTP id hs23-20020a056a20975700b0014dfefda2e5mr963249pzc.62.1695170519454; Tue, 19 Sep 2023 17:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695170519; cv=none; d=google.com; s=arc-20160816; b=ZS3xr9B3hxx0tkX7B2fvlKhVHPth8CCY0f6mq2dRPSezCrM6Ab5n7HpTkCj4u+CgAp liAMvcuz+fj6dFVW6GjHzswITiAemq5G6XU+U3N3ftXxVF/oXlxbKqcpAt/cne8m+aaY qFtkrfBZJPFje2wzH5wHRchw7KpL40hggVeHif0rTMytJN5UIYGe8B0nNPy+abW31rUt e8ibcXpFCxC976aid6phWd+2unQE8+cOgj1BbNeannsnfK4BR9YWEDSRWxBeohSplSsC 9ALFy04Y7/424aTvr0f8PsKu9yfAo7yHFCr1tXv5L3c2B2inURqTfbmqVoZY/K3cvgwP Cv3Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OU5XGffeFstkERqBf5Qi7YcQ1tt2JoUnNS+NoZuaHhI=; fh=Jvk2GAthtEduWUuzeJ+pdnWULX/23bLTsBp9Bf4Yysw=; b=hYYLKSYOH4QLaYE9uoXKE9W2bZPndOtUHP5dyKoUJJeP03dPDjG074xc+uv3FowuuW s8vLtG7Ucfv4Ov520sw0/xGEd4wOiYfbypop4TI5FxvLAub1Oswi/oEpXDEKD4WjqPy1 qA94mHDYYrEZcHd+j2M2BaHCsgKTLsNYPANkMfLKjFQyrr5133s/Vj/KXiseqsMyJQPC UvFpfombFfgLOPDRhn4CzhTL0Qa48E43Uf/9U/MkaRES+HJcBVmpQTVauxD7NhxaBeHO C+DFys1EE6IkvIBbwSUbHIT8g1Pa71I1HkNTnRvm0udm5BjAMyWBhcokeVJjfnm0YD/H wL5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QKBxUSlK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u18-20020a170902e5d200b001c465e1e219si2414019plf.30.2023.09.19.17.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 17:41:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QKBxUSlK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 69EF0829AA35; Tue, 19 Sep 2023 15:08:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233518AbjISWIR (ORCPT + 26 others); Tue, 19 Sep 2023 18:08:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233484AbjISWIO (ORCPT ); Tue, 19 Sep 2023 18:08:14 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B63CD6 for ; Tue, 19 Sep 2023 15:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695161207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OU5XGffeFstkERqBf5Qi7YcQ1tt2JoUnNS+NoZuaHhI=; b=QKBxUSlKFdzlTgezbMZIpt1yV7kyoeEEKiM3wIS2fZNJnSoniUsLazk9B4b+TPaRzdeoBz kZp2l1g/E9gS1rZePLChHC+BxGs/1NvtTGDWWsJFEKyKUy+YoOGPzGLfgBKdVzW65KHE1h paY5xUnrYS0ccY1DzI+xIHBImP8pjmY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-681-PT4rTQ6-MVCHn11FAVKtKw-1; Tue, 19 Sep 2023 18:06:44 -0400 X-MC-Unique: PT4rTQ6-MVCHn11FAVKtKw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7F3893C02539; Tue, 19 Sep 2023 22:06:43 +0000 (UTC) Received: from emerald.lyude.net (unknown [10.22.18.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08C5740C2064; Tue, 19 Sep 2023 22:06:43 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org Cc: Ben Skeggs , Danilo Krummrich , Karol Herbst , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 25/44] drm/nouveau/disp: add hdmi audio hal function Date: Tue, 19 Sep 2023 17:56:20 -0400 Message-ID: <20230919220442.202488-26-lyude@redhat.com> In-Reply-To: <20230919220442.202488-1-lyude@redhat.com> References: <20230919220442.202488-1-lyude@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 19 Sep 2023 15:08:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777515122490159634 X-GMAIL-MSGID: 1777515122490159634 From: Ben Skeggs This just adds a hook for RM to use, HW paths remain untouched, but should probably be cleaned up to use this too at some point. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h | 1 + drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h index 6e750890bcc93..8686e5c044a5d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h @@ -74,6 +74,7 @@ struct nvkm_ior_func { bool scrambling_low_rates); void (*infoframe_avi)(struct nvkm_ior *, int head, void *data, u32 size); void (*infoframe_vsi)(struct nvkm_ior *, int head, void *data, u32 size); + void (*audio)(struct nvkm_ior *, int head, bool enable); } *hdmi; const struct nvkm_ior_func_dp { diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c index ad75dc5c50cf7..7574f22006441 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uoutp.c @@ -99,12 +99,20 @@ nvkm_uoutp_mthd_hda_eld(struct nvkm_outp *outp, void *argv, u32 argc) if (argc && args->v0.data[0]) { if (outp->info.type == DCB_OUTPUT_DP) ior->func->dp->audio(ior, args->v0.head, true); + else + if (ior->func->hdmi->audio) + ior->func->hdmi->audio(ior, args->v0.head, true); + ior->func->hda->hpd(ior, args->v0.head, true); ior->func->hda->eld(ior, args->v0.head, args->v0.data, argc); } else { + ior->func->hda->hpd(ior, args->v0.head, false); + if (outp->info.type == DCB_OUTPUT_DP) ior->func->dp->audio(ior, args->v0.head, false); - ior->func->hda->hpd(ior, args->v0.head, false); + else + if (ior->func->hdmi->audio) + ior->func->hdmi->audio(ior, args->v0.head, false); } return 0;