From nobody Thu Sep 15 14:07:32 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MSzYJ5sr8z4cMgj; Thu, 15 Sep 2022 14:07:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MSzYJ5Sgsz437q; Thu, 15 Sep 2022 14:07:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663250852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sV+vbSTDuCK68beTrIiw9jItuXyhKV9dece6j+il1+g=; b=QPtbjKTU8D4kBKRrQ2GGmpL0rJLlSs8R7sNb3xxzFNBoo0N0E9Gf8Eb3UFeJrQaTJumQgz 48pZ1gNdKQNvmLCO6Cj8wSctyHHaYEmWCrb6V0xCZpSKVWE3yRuG2mpV8SiHx8WEpg/ODZ Y2iO+hb94ZsjzMH8mWpAdgjAhMS1Vn9vXiwQpXe1xxqchL9JMzp9FxF7JUZRLmwh3m29cp +Pp+qzHZJ+neNokpDW3vuCmbKRx7cXsg0Ups16+/crfnC7GuYufFHPPI1jptS/8CMP6lBh Wy6Y/hqpONIOKRvZO5KbHGaDmVrGNHUNc7rQPZvQjHZe7Dim1Pva5pVcdIbs5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MSzYJ4ZHlz1300; Thu, 15 Sep 2022 14:07:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28FE7WE9062014; Thu, 15 Sep 2022 14:07:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28FE7WrQ062013; Thu, 15 Sep 2022 14:07:32 GMT (envelope-from git) Date: Thu, 15 Sep 2022 14:07:32 GMT Message-Id: <202209151407.28FE7WrQ062013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9054e296819f - main - Retire ISA sound card DMA support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9054e296819f325da3b6a4da301eab853eee6757 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663250852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sV+vbSTDuCK68beTrIiw9jItuXyhKV9dece6j+il1+g=; b=Ee2MkRIMYsiugXTZc98/CBe4bUY/ElKdXqGT4pAtkPAN+UKflL9r0zIhQiSdPjwKihqrtz foWj/ErP9Av7ENsX4omXwuMi4NNHDxgMF/GGtTbHu7axJ15Bk61K06esP9dIsRWxFyFr53 QNuRUlZ5CMkmytDA/ArlmaKpT9f5qIZnOFIhKBBGOdhMLoUCQbFlHihGHdcHhGpyJAC/jv 2txmarr6jasSMNLikBumincmecmMWYnmEGa74CXcTSCh6CKhyEIOYPzy0nTDLWgERJ9F9x nMnMObeenGDY56lHADoUGViTGUo2muTpfytcG7ejlPey7t6+nH8spvO3PifCxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663250852; a=rsa-sha256; cv=none; b=rLb2rK0Op3NaCXcxIE2S4TZe29zz8Tb/UbVSah7AqybCi/b3LXOTMy+IKb6jpTrEk/+MO1 DO/jgp3G8A6yeP+QhjB78rMNzw5xz0dE7wdpBEuOYU+W4rGvDRSASxnbyudC3zoQurCqAK oaNbrDOU99dPkH2orgCqbYPFOicEZbIer0hn9ZWLai5Xu/uMJuwddFgBB9d3XvHW7voZEn T0SFVzHbNAWC7jZ29/lNqc3IehfBrkgR+Yzk8YK6App49C4p54aB5t/+PP7o/gFlaRePp5 5aoNLvcNgzkvFXHWPjetg84lPfIJmSJksHuXvRrF5TF+1WnsosQNKnMmh6PutA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9054e296819f325da3b6a4da301eab853eee6757 commit 9054e296819f325da3b6a4da301eab853eee6757 Author: Ed Maste AuthorDate: 2022-03-18 16:22:21 +0000 Commit: Ed Maste CommitDate: 2022-09-15 14:07:23 +0000 Retire ISA sound card DMA support As all ISA sound card drivers have been removed sndbuf_dma no longer serves any purpose. Reviewed by: mav Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34671 --- sys/conf/files | 1 - sys/dev/sound/isa/sndbuf_dma.c | 109 --------------------------------------- sys/dev/sound/pcm/buffer.h | 10 ---- sys/dev/sound/pcm/channel.c | 9 ---- sys/modules/sound/sound/Makefile | 20 ------- 5 files changed, 149 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index d7949dc5a069..7633d45c5187 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3103,7 +3103,6 @@ dev/smc/if_smc_fdt.c optional smc fdt dev/snp/snp.c optional snp dev/sound/clone.c optional sound dev/sound/unit.c optional sound -dev/sound/isa/sndbuf_dma.c optional sound isa dev/sound/pci/als4000.c optional snd_als4000 pci dev/sound/pci/atiixp.c optional snd_atiixp pci dev/sound/pci/cmi.c optional snd_cmi pci diff --git a/sys/dev/sound/isa/sndbuf_dma.c b/sys/dev/sound/isa/sndbuf_dma.c deleted file mode 100644 index 9d41c5292970..000000000000 --- a/sys/dev/sound/isa/sndbuf_dma.c +++ /dev/null @@ -1,109 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1999 Cameron Grant - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_snd.h" -#endif - -#include - -#include - -SND_DECLARE_FILE("$FreeBSD$"); - -int -sndbuf_dmasetup(struct snd_dbuf *b, struct resource *drq) -{ - /* should do isa_dma_acquire/isa_dma_release here */ - if (drq == NULL) { - b->dmachan = -1; - } else { - sndbuf_setflags(b, SNDBUF_F_DMA, 1); - b->dmachan = rman_get_start(drq); - } - return 0; -} - -int -sndbuf_dmasetdir(struct snd_dbuf *b, int dir) -{ - KASSERT(b, ("sndbuf_dmasetdir called with b == NULL")); - KASSERT(sndbuf_getflags(b) & SNDBUF_F_DMA, ("sndbuf_dmasetdir called on non-ISA buffer")); - - b->dir = (dir == PCMDIR_PLAY)? ISADMA_WRITE : ISADMA_READ; - return 0; -} - -void -sndbuf_dma(struct snd_dbuf *b, int go) -{ - KASSERT(b, ("sndbuf_dma called with b == NULL")); - KASSERT(sndbuf_getflags(b) & SNDBUF_F_DMA, ("sndbuf_dma called on non-ISA buffer")); - - switch (go) { - case PCMTRIG_START: - /* isa_dmainit(b->chan, size); */ - isa_dmastart(b->dir | ISADMA_RAW, b->buf, b->bufsize, b->dmachan); - break; - - case PCMTRIG_STOP: - case PCMTRIG_ABORT: - isa_dmastop(b->dmachan); - isa_dmadone(b->dir | ISADMA_RAW, b->buf, b->bufsize, b->dmachan); - break; - } - - DEB(printf("buf 0x%p ISA DMA %s, channel %d\n", - b, - (go == PCMTRIG_START)? "started" : "stopped", - b->dmachan)); -} - -int -sndbuf_dmaptr(struct snd_dbuf *b) -{ - int i; - - KASSERT(b, ("sndbuf_dmaptr called with b == NULL")); - KASSERT(sndbuf_getflags(b) & SNDBUF_F_DMA, ("sndbuf_dmaptr called on non-ISA buffer")); - - if (!sndbuf_runsz(b)) - return 0; - i = isa_dmastatus(b->dmachan); - KASSERT(i >= 0, ("isa_dmastatus returned %d", i)); - return b->bufsize - i; -} - -void -sndbuf_dmabounce(struct snd_dbuf *b) -{ - KASSERT(b, ("sndbuf_dmabounce called with b == NULL")); - KASSERT(sndbuf_getflags(b) & SNDBUF_F_DMA, ("sndbuf_dmabounce called on non-ISA buffer")); - - /* tell isa_dma to bounce data in/out */ -} diff --git a/sys/dev/sound/pcm/buffer.h b/sys/dev/sound/pcm/buffer.h index 74a684b9a4ac..66b71dcefc2a 100644 --- a/sys/dev/sound/pcm/buffer.h +++ b/sys/dev/sound/pcm/buffer.h @@ -28,12 +28,8 @@ * $FreeBSD$ */ -#define SND_DMA(b) (sndbuf_getflags((b)) & SNDBUF_F_DMA) #define SNDBUF_LOCKASSERT(b) -#define SNDBUF_F_DMA 0x00000001 -#define SNDBUF_F_XRUN 0x00000002 -#define SNDBUF_F_RUNNING 0x00000004 #define SNDBUF_F_MANAGED 0x00000008 #define SNDBUF_NAMELEN 48 @@ -125,12 +121,6 @@ int sndbuf_feed(struct snd_dbuf *from, struct snd_dbuf *to, struct pcm_channel * u_int32_t sndbuf_getflags(struct snd_dbuf *b); void sndbuf_setflags(struct snd_dbuf *b, u_int32_t flags, int on); -int sndbuf_dmasetup(struct snd_dbuf *b, struct resource *drq); -int sndbuf_dmasetdir(struct snd_dbuf *b, int dir); -void sndbuf_dma(struct snd_dbuf *b, int go); -int sndbuf_dmaptr(struct snd_dbuf *b); -void sndbuf_dmabounce(struct snd_dbuf *b); - #ifdef OSSV4_EXPERIMENT void sndbuf_getpeaks(struct snd_dbuf *b, int *lp, int *rp); #endif diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 065bf6ee2c5c..95a29b29d797 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -29,8 +29,6 @@ * SUCH DAMAGE. */ -#include "opt_isa.h" - #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_snd.h" #endif @@ -2191,17 +2189,10 @@ chn_syncstate(struct pcm_channel *c) int chn_trigger(struct pcm_channel *c, int go) { -#ifdef DEV_ISA - struct snd_dbuf *b = c->bufhard; -#endif struct snddev_info *d = c->parentsnddev; int ret; CHN_LOCKASSERT(c); -#ifdef DEV_ISA - if (SND_DMA(b) && (go == PCMTRIG_EMLDMAWR || go == PCMTRIG_EMLDMARD)) - sndbuf_dmabounce(b); -#endif if (!PCMTRIG_COMMON(go)) return (CHANNEL_TRIGGER(c->methods, c->devinfo, go)); diff --git a/sys/modules/sound/sound/Makefile b/sys/modules/sound/sound/Makefile index adbc14a38020..647b9f324f9f 100644 --- a/sys/modules/sound/sound/Makefile +++ b/sys/modules/sound/sound/Makefile @@ -34,24 +34,4 @@ CLEANFILES+= feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h EXPORT_SYMS= YES # XXX evaluate -.if ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "amd64" -# Create an empty opt_isa.h in order to keep kmod.mk from linking in an -# existing one from KERNBUILDDIR which possibly has DEV_ISA defined so -# sound.ko is always built without isadma support. -opt_isa.h: - :> ${.TARGET} -.else -.if !defined(KERNBUILDDIR) -SRCS+= sndbuf_dma.c - -opt_isa.h: - echo "#define DEV_ISA 1" > ${.TARGET} -.else -DEV_ISA!= sed -n '/DEV_ISA/p' ${KERNBUILDDIR}/opt_isa.h -.if !empty(DEV_ISA) -SRCS+= sndbuf_dma.c -.endif -.endif -.endif - .include