Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp963939rdb; Tue, 19 Sep 2023 16:13:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQlGWnPc3d9AWMGQwSj7cP9LB8244ldN8pAY0spHpAalWQbKiDT4pca3FgGkfOeTwmmSUI X-Received: by 2002:a05:6a00:1350:b0:690:d008:8cfc with SMTP id k16-20020a056a00135000b00690d0088cfcmr1260090pfu.32.1695165182758; Tue, 19 Sep 2023 16:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695165182; cv=none; d=google.com; s=arc-20160816; b=b0+T+T/ZXkhJcpHMxdbDPkbOHnXoTFoy+y//5iUdkJ2Vvv50WtHwEeHLwyrDuP6ruS q77r+jiqvcZHGD0mB4mrVz9NMLx1yvjcDRjeen34JoDsIVXQnX0f299SKJ2em3yZKbfW /y4ZX3vFbesIkjxgS0ywKy0LLIDgQ+wiXp+YdPnOFznhNv1ik1fIjbEoTE9awqbUOTFe xsoRLXQGazlaOfSvd7z0PmqkWbeExug37eep5ucZwrLJBYjNjxPupRI6OljMA+5piG6M /a7/4SzOthDmXlb5wUZZNS5unqsDEtYu57mZzfBu3+ZDOfunTFF2mFLkfSjgIRTsCzPv r39Q== 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 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id t4-20020a63d244000000b00577bf1de778si10542798pgi.585.2023.09.19.16.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 16:13:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; 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 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 03CFA82878F7; Tue, 19 Sep 2023 15:08:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233516AbjISWIR (ORCPT + 99 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 Content-Transfer-Encoding: 8bit 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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 19 Sep 2023 15:08:24 -0700 (PDT) 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; -- 2.41.0