Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 May 2020 18:15:36 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r360790 - head/sys/dev/sound/pcm
Message-ID:  <202005071815.047IFaN2082953@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu May  7 18:15:35 2020
New Revision: 360790
URL: https://svnweb.freebsd.org/changeset/base/360790

Log:
  Set PCM_CAP_VIRTUAL for virtual DSP devices.
  
  Submitted by:	Kevin Zheng <kevinz5000@gmail.com>
  PR:		246206
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/sound/pcm/dsp.c

Modified: head/sys/dev/sound/pcm/dsp.c
==============================================================================
--- head/sys/dev/sound/pcm/dsp.c	Thu May  7 17:59:17 2020	(r360789)
+++ head/sys/dev/sound/pcm/dsp.c	Thu May  7 18:15:35 2020	(r360790)
@@ -1703,6 +1703,10 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg,
 		*arg_i = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER;
 		if (rdch && wrch && !(dsp_get_flags(i_dev) & SD_F_SIMPLEX))
 			*arg_i |= PCM_CAP_DUPLEX;
+		if (rdch && (rdch->flags & CHN_F_VIRTUAL) != 0)
+			*arg_i |= PCM_CAP_VIRTUAL;
+		if (wrch && (wrch->flags & CHN_F_VIRTUAL) != 0)
+			*arg_i |= PCM_CAP_VIRTUAL;
 		PCM_UNLOCK(d);
 		break;
 
@@ -2653,6 +2657,7 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *a
 			 *       these in pcmchan::caps?
 			 */
 			ai->caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER |
+			    ((ch->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) |
 			    ((ch->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT);
 
 			/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005071815.047IFaN2082953>