From nobody Mon Dec 02 16:27:21 2024 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 4Y28MF309Gz5g4vP; Mon, 02 Dec 2024 16:27:21 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y28MF2Rcnz4THk; Mon, 2 Dec 2024 16:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733156841; 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=IZkciBZ9ydHkWv5ESbBoJoN2n10HlKQUZp3RShYAV+8=; b=tKm1IBeCBDYUIHd1ViC3+eeSZ8o13J/eUbB91qvYX9x7EPUvnObFJ8yQyONWpgTPbgegch TIhOHpEdp/igmkOO/KNxbTzTyP4Gth4Y/IYlQDmdc5Qgoveee7pk8cpqFyIfxn4pQvo8gq 6GbG8FPBYVMmgIKJ1gVweOzZ5CGlB5oLEpqhCfA1mVlRVITg+FZc1mGdRv7MmgxeORtxFX /wCX5hMs0PrfuYoOVG/fs/MiFLEgL6dv3EK2xFQWdyLkhRJVGDlI26KkIKyJ1GvTW1c289 I3zMRIdsF3vDHz6s4a8u70Z6ETp+/Bqu1UhjALEvq3o1eXVEz8ecJhxsQ7GyLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733156841; 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=IZkciBZ9ydHkWv5ESbBoJoN2n10HlKQUZp3RShYAV+8=; b=NogTbgZdwOua4NazNZo6UPWaj6n2jky7xfdGtmgl4DWlteBH8seUy2Czmk6V4TInmoPET0 fk5c0wWJ3ulps0JJg6QlMCUqAX0RyUizqVZnGdrm5xoyxaKjlhPAxpRLYaBQvxy67Qu90e 1mR5PRaDU6ONa+GFhG4xllaYtLjVgvMAFJK4DlGOc9rNeT/db3irbbwmOZXzXkHQYJkhhU 0sAAzqpNfsIyE8qGTzDxVBFOXkRRYtJOo61rzpndzvYroQMwEr0l94RdIv2ILqQeGqNPXw wth1mhGJIZZSZbU2jpllkOWyoX+3e0eA2dytThyHZD1SQw1Tlml2m0MPGOzotA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733156841; a=rsa-sha256; cv=none; b=R482fVfqShvi0wVt/EsMY4E5RHKQwnIkl74W6W/xW+nvnnpQdd9FAgWavgY6ud+yG9Fi3R WgmK7NfkqlWbIkz3lDVtEJh3z8dHXZytvvU6+ieD0EpCgtfCu/yA2B3cTUkctOPUI2MO+D P/ibt7e1iPyOz3kYj/uMGe85I6SNrlYcixxZUzOcvWD+0L0op/hEdmmfIJ0ddcReoPMOhD yVSQFmUh52RNkymANQh47BJYb0uNCikh4IeryhV/VdlOP5e7i3N3l8VMN9AjCpk4YmTcxk mTjDFra0PAtEboHnBDMA963kDpP3PrPwgpdWJYoKD6X9L8Vwv28rodhAfPKTdg== 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 4Y28MF22WLzlLc; Mon, 2 Dec 2024 16:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B2GRLnZ070732; Mon, 2 Dec 2024 16:27:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B2GRLsu070729; Mon, 2 Dec 2024 16:27:21 GMT (envelope-from git) Date: Mon, 2 Dec 2024 16:27:21 GMT Message-Id: <202412021627.4B2GRLsu070729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 00731aaaed76 - main - sound: Remove dead code from pcm/ 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00731aaaed76785af8befe13e9a4e85b3554b3f5 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=00731aaaed76785af8befe13e9a4e85b3554b3f5 commit 00731aaaed76785af8befe13e9a4e85b3554b3f5 Author: Christos Margiolis AuthorDate: 2024-12-02 16:26:27 +0000 Commit: Christos Margiolis CommitDate: 2024-12-02 16:26:27 +0000 sound: Remove dead code from pcm/ No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D47733 --- sys/dev/sound/pcm/ac97.c | 23 ------------------ sys/dev/sound/pcm/buffer.c | 9 ------- sys/dev/sound/pcm/channel.c | 53 ----------------------------------------- sys/dev/sound/pcm/dsp.c | 22 ----------------- sys/dev/sound/pcm/feeder.h | 26 -------------------- sys/dev/sound/pcm/feeder_rate.c | 21 ---------------- 6 files changed, 154 deletions(-) diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c index 71eb387afa1b..f5ca06cd3942 100644 --- a/sys/dev/sound/pcm/ac97.c +++ b/sys/dev/sound/pcm/ac97.c @@ -322,12 +322,6 @@ ac97_rdcd(struct ac97_info *codec, int reg) i[1] = AC97_READ(codec->methods, codec->devinfo, reg); while (i[0] != i[1] && j) i[j-- & 1] = AC97_READ(codec->methods, codec->devinfo, reg); -#if 0 - if (j < 100) { - device_printf(codec->dev, "%s(): Inconsistent register value at" - " 0x%08x (retry: %d)\n", __func__, reg, 100 - j); - } -#endif return i[!(j & 1)]; } return AC97_READ(codec->methods, codec->devinfo, reg); @@ -512,9 +506,6 @@ ac97_setmixer(struct ac97_info *codec, unsigned channel, unsigned left, unsigned snd_mtxunlock(codec->lock); return left | (right << 8); } else { -#if 0 - printf("ac97_setmixer: reg=%d, bits=%d, enable=%d\n", e->reg, e->bits, e->enable); -#endif return -1; } } @@ -737,10 +728,6 @@ ac97_initmixer(struct ac97_info *codec) for (j = 0; k >> j; j++) ; if (j != 0) { -#if 0 - device_printf(codec->dev, "%2d: [ac97_rdcd() = %d] [Testbit = %d] %d -> %d\n", - i, k, bit, codec->mix[i].bits, j); -#endif codec->mix[i].enable = 1; codec->mix[i].bits = j; } else if (reg == AC97_MIX_BEEP) { @@ -756,9 +743,6 @@ ac97_initmixer(struct ac97_info *codec) codec->mix[i].enable = 0; ac97_wrcd(codec, reg, old); } -#if 0 - printf("mixch %d, en=%d, b=%d\n", i, codec->mix[i].enable, codec->mix[i].bits); -#endif } device_printf(codec->dev, "<%s>\n", @@ -1097,13 +1081,6 @@ ac97mix_init(struct snd_mixer *m) if (pcm_getflags(codec->dev) & SD_F_SOFTPCMVOL) ac97_wrcd(codec, AC97_MIX_PCM, 0); -#if 0 - /* XXX For the sake of debugging purposes */ - mix_setparentchild(m, SOUND_MIXER_VOLUME, - SOUND_MASK_PCM | SOUND_MASK_CD); - mix_setrealdev(m, SOUND_MIXER_VOLUME, SOUND_MIXER_NONE); - ac97_wrcd(codec, AC97_MIX_MASTER, 0); -#endif mask = 0; for (i = 0; i < AC97_MIXER_SIZE; i++) diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index afb4b95e357a..8bf3631afb7a 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -356,15 +356,6 @@ sndbuf_setfmt(struct snd_dbuf *b, u_int32_t fmt) b->fmt = fmt; b->bps = AFMT_BPS(b->fmt); b->align = AFMT_ALIGN(b->fmt); -#if 0 - b->bps = AFMT_CHANNEL(b->fmt); - if (b->fmt & AFMT_16BIT) - b->bps <<= 1; - else if (b->fmt & AFMT_24BIT) - b->bps *= 3; - else if (b->fmt & AFMT_32BIT) - b->bps <<= 2; -#endif return 0; } diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index f619ddd4bc35..728284b055e5 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -405,23 +405,6 @@ chn_wrfeed(struct pcm_channel *c) chn_wakeup(c); } -#if 0 -static void -chn_wrupdate(struct pcm_channel *c) -{ - - CHN_LOCKASSERT(c); - KASSERT(c->direction == PCMDIR_PLAY, ("%s(): bad channel", __func__)); - - if ((c->flags & (CHN_F_MMAP | CHN_F_VIRTUAL)) || CHN_STOPPED(c)) - return; - chn_dmaupdate(c); - chn_wrfeed(c); - /* tell the driver we've updated the primary buffer */ - chn_trigger(c, PCMTRIG_EMLDMAWR); -} -#endif - static void chn_wrintr(struct pcm_channel *c) { @@ -535,22 +518,6 @@ chn_rdfeed(struct pcm_channel *c) chn_wakeup(c); } -#if 0 -static void -chn_rdupdate(struct pcm_channel *c) -{ - - CHN_LOCKASSERT(c); - KASSERT(c->direction == PCMDIR_REC, ("chn_rdupdate on bad channel")); - - if ((c->flags & (CHN_F_MMAP | CHN_F_VIRTUAL)) || CHN_STOPPED(c)) - return; - chn_trigger(c, PCMTRIG_EMLDMARD); - chn_dmaupdate(c); - chn_rdfeed(c); -} -#endif - /* read interrupt routine. Must be called with interrupts blocked. */ static void chn_rdintr(struct pcm_channel *c) @@ -1980,12 +1947,6 @@ chn_resizebuf(struct pcm_channel *c, int latency, hblksz -= hblksz % sndbuf_getalign(b); -#if 0 - hblksz = sndbuf_getmaxsize(b) >> 1; - hblksz -= hblksz % sndbuf_getalign(b); - hblkcnt = 2; -#endif - CHN_UNLOCK(c); if (chn_usefrags == 0 || CHANNEL_SETFRAGMENTS(c->methods, c->devinfo, @@ -2016,14 +1977,6 @@ chn_resizebuf(struct pcm_channel *c, int latency, if (limit > CHN_2NDBUFMAXSIZE) limit = CHN_2NDBUFMAXSIZE; -#if 0 - while (limit > 0 && (sblksz * sblkcnt) > limit) { - if (sblkcnt < 4) - break; - sblkcnt >>= 1; - } -#endif - while ((sblksz * sblkcnt) < limit) sblkcnt <<= 1; @@ -2140,12 +2093,6 @@ chn_setspeed(struct pcm_channel *c, uint32_t speed) uint32_t oldformat, oldspeed, format; int ret; -#if 0 - /* XXX force 48k */ - if (c->format & AFMT_PASSTHROUGH) - speed = AFMT_PASSTHROUGH_RATE; -#endif - oldformat = c->format; oldspeed = c->speed; format = oldformat; diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index ccf240681a25..dcbdd581c82a 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -1257,7 +1257,6 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct snd_dbuf *bs = wrch->bufsoft; CHN_LOCK(wrch); - /* XXX abusive DMA update: chn_wrupdate(wrch); */ a->bytes = sndbuf_getfree(bs); a->fragments = a->bytes / sndbuf_getblksz(bs); a->fragstotal = sndbuf_getblkcnt(bs); @@ -1275,7 +1274,6 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct snd_dbuf *bs = rdch->bufsoft; CHN_LOCK(rdch); - /* XXX abusive DMA update: chn_rdupdate(rdch); */ a->bytes = sndbuf_gettotal(bs); a->blocks = sndbuf_getblocks(bs) - rdch->blocks; a->ptr = sndbuf_getfreeptr(bs); @@ -1293,7 +1291,6 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct snd_dbuf *bs = wrch->bufsoft; CHN_LOCK(wrch); - /* XXX abusive DMA update: chn_wrupdate(wrch); */ a->bytes = sndbuf_gettotal(bs); a->blocks = sndbuf_getblocks(bs) - wrch->blocks; a->ptr = sndbuf_getreadyptr(bs); @@ -1385,7 +1382,6 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct snd_dbuf *bs = wrch->bufsoft; CHN_LOCK(wrch); - /* XXX abusive DMA update: chn_wrupdate(wrch); */ *arg_i = sndbuf_getready(bs); CHN_UNLOCK(wrch); } else @@ -1582,14 +1578,8 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, CHN_LOCK(chn); bs = chn->bufsoft; -#if 0 - tmp = (sndbuf_getsize(b) + chn_getptr(chn) - sndbuf_gethwptr(b)) % sndbuf_getsize(b); - oc->samples = (sndbuf_gettotal(b) + tmp) / sndbuf_getalign(b); - oc->fifo_samples = (sndbuf_getready(b) - tmp) / sndbuf_getalign(b); -#else oc->samples = sndbuf_gettotal(bs) / sndbuf_getalign(bs); oc->fifo_samples = sndbuf_getready(bs) / sndbuf_getalign(bs); -#endif CHN_UNLOCK(chn); } break; @@ -1738,18 +1728,6 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, case SNDCTL_SETNAME: ret = dsp_oss_setname(wrch, rdch, (oss_longname_t *)arg); break; -#if 0 - /** - * @note The S/PDIF interface ioctls, @c SNDCTL_DSP_READCTL and - * @c SNDCTL_DSP_WRITECTL have been omitted at the suggestion of - * 4Front Technologies. - */ - case SNDCTL_DSP_READCTL: - case SNDCTL_DSP_WRITECTL: - ret = EINVAL; - break; -#endif /* !0 (explicitly omitted ioctls) */ - #endif /* !OSSV4_EXPERIMENT */ case SNDCTL_DSP_MAPINBUF: case SNDCTL_DSP_MAPOUTBUF: diff --git a/sys/dev/sound/pcm/feeder.h b/sys/dev/sound/pcm/feeder.h index 1e240d934e94..60b8280e59ef 100644 --- a/sys/dev/sound/pcm/feeder.h +++ b/sys/dev/sound/pcm/feeder.h @@ -167,32 +167,6 @@ int feeder_matrix_oss_get_channel_order(struct pcmchan_matrix *, int feeder_matrix_oss_set_channel_order(struct pcmchan_matrix *, unsigned long long *); -#if 0 -/* feeder_matrix */ -enum { - FEEDMATRIX_TYPE, - FEEDMATRIX_RESET, - FEEDMATRIX_CHANNELS_IN, - FEEDMATRIX_CHANNELS_OUT, - FEEDMATRIX_SET_MAP -}; - -enum { - FEEDMATRIX_TYPE_NONE, - FEEDMATRIX_TYPE_AUTO, - FEEDMATRIX_TYPE_2X1, - FEEDMATRIX_TYPE_1X2, - FEEDMATRIX_TYPE_2X2 -}; - -#define FEEDMATRIX_TYPE_STEREO_TO_MONO FEEDMATRIX_TYPE_2X1 -#define FEEDMATRIX_TYPE_MONO_TO_STEREO FEEDMATRIX_TYPE_1X2 -#define FEEDMATRIX_TYPE_SWAP_STEREO FEEDMATRIX_TYPE_2X2 -#define FEEDMATRIX_MAP(x, y) ((((x) & 0x3f) << 6) | ((y) & 0x3f)) -#define FEEDMATRIX_MAP_SRC(x) ((x) & 0x3f) -#define FEEDMATRIX_MAP_DST(x) (((x) >> 6) & 0x3f) -#endif - /* * By default, various feeders only deal with sign 16/32 bit native-endian * since it should provide the fastest processing path. Processing 8bit samples diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c index 77de21e7a31a..40e5d3018ab4 100644 --- a/sys/dev/sound/pcm/feeder_rate.c +++ b/sys/dev/sound/pcm/feeder_rate.c @@ -431,11 +431,6 @@ z_roundpow2(int32_t v) static void z_feed_zoh(struct z_info *info, uint8_t *dst) { -#if 0 - z_copy(info->z_delay + - (info->z_start * info->channels * info->bps), dst, - info->channels * info->bps); -#else uint32_t cnt; uint8_t *src; @@ -449,7 +444,6 @@ z_feed_zoh(struct z_info *info, uint8_t *dst) do { *dst++ = *src++; } while (--cnt != 0); -#endif } /* @@ -1171,14 +1165,6 @@ z_setup_adaptive_sinc: info->z_scale = Z_ONE; } -#if 0 -#define Z_SCALE_DIV 10000 -#define Z_SCALE_LIMIT(s, v) \ - ((((uint64_t)(s) * (v)) + (Z_SCALE_DIV >> 1)) / Z_SCALE_DIV) - - info->z_scale = Z_SCALE_LIMIT(info->z_scale, 9780); -#endif - /* Smallest drift increment. */ info->z_dx = info->z_dy / info->z_gy; @@ -1672,12 +1658,6 @@ z_resampler_feed_internal(struct pcm_feeder *f, struct pcm_channel *c, */ do { info->z_resample(info, dst); -#if 0 - startdrift = z_gy2gx(info, 1); - alphadrift = z_drift(info, startdrift, 1); - info->z_start += startdrift; - info->z_alpha += alphadrift; -#else info->z_alpha += alphadrift; if (info->z_alpha < info->z_gy) info->z_start += startdrift; @@ -1685,7 +1665,6 @@ z_resampler_feed_internal(struct pcm_feeder *f, struct pcm_channel *c, info->z_start += startdrift - 1; info->z_alpha -= info->z_gy; } -#endif dst += align; #ifdef Z_DIAGNOSTIC info->z_cycle++;