* [PATCH 1/1 fyi] tools include UAPI: Sync sound/asound.h copy with the kernel sources
@ 2022-02-01 15:12 Arnaldo Carvalho de Melo
2022-02-02 10:35 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-02-01 15:12 UTC (permalink / raw)
To: Takashi Iwai
Cc: Mark Brown, Pierre-Louis Bossart, Takashi Sakamoto,
Linux Kernel Mailing List
Picking the changes from:
55b71f6c29f2a78a ("ALSA: uapi: use C90 comment style instead of C99 style")
fb6723daf89083a0 ("ALSA: pcm: comment about relation between msbits hw parameter and [S|U]32 formats")
b456abe63f60ad93 ("ALSA: pcm: introduce INFO_NO_REWINDS flag")
5aec579e08e4f2be ("ALSA: uapi: Fix a C++ style comment in asound.h")
Which entails no changes in the tooling side as it doesn't introduce new
SNDRV_PCM_IOCTL_ ioctls.
To silence this perf tools build warning:
Warning: Kernel ABI header at 'tools/include/uapi/sound/asound.h' differs from latest version at 'include/uapi/sound/asound.h'
diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h
Cc: Mark Brown <broonie@kernel.org>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/include/uapi/sound/asound.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/include/uapi/sound/asound.h b/tools/include/uapi/sound/asound.h
index 5fbb79e30819af91..ef0cafe295b28253 100644
--- a/tools/include/uapi/sound/asound.h
+++ b/tools/include/uapi/sound/asound.h
@@ -202,6 +202,11 @@ typedef int __bitwise snd_pcm_format_t;
#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
+/*
+ * For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the
+ * available bit count in most significant bit. It's for the case of so-called 'left-justified' or
+ * `right-padding` sample which has less width than 32 bit.
+ */
#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
@@ -300,7 +305,7 @@ typedef int __bitwise snd_pcm_subformat_t;
#define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */
#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */
#define SNDRV_PCM_INFO_EXPLICIT_SYNC 0x10000000 /* needs explicit sync of pointers and data */
-
+#define SNDRV_PCM_INFO_NO_REWINDS 0x20000000 /* hardware can only support monotonic changes of appl_ptr */
#define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */
#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1 fyi] tools include UAPI: Sync sound/asound.h copy with the kernel sources
2022-02-01 15:12 [PATCH 1/1 fyi] tools include UAPI: Sync sound/asound.h copy with the kernel sources Arnaldo Carvalho de Melo
@ 2022-02-02 10:35 ` Takashi Iwai
2022-02-06 11:34 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2022-02-02 10:35 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Takashi Iwai, Mark Brown, Pierre-Louis Bossart, Takashi Sakamoto,
Linux Kernel Mailing List
On Tue, 01 Feb 2022 16:12:18 +0100,
Arnaldo Carvalho de Melo wrote:
>
> Picking the changes from:
>
> 55b71f6c29f2a78a ("ALSA: uapi: use C90 comment style instead of C99 style")
> fb6723daf89083a0 ("ALSA: pcm: comment about relation between msbits hw parameter and [S|U]32 formats")
> b456abe63f60ad93 ("ALSA: pcm: introduce INFO_NO_REWINDS flag")
> 5aec579e08e4f2be ("ALSA: uapi: Fix a C++ style comment in asound.h")
>
> Which entails no changes in the tooling side as it doesn't introduce new
> SNDRV_PCM_IOCTL_ ioctls.
>
> To silence this perf tools build warning:
>
> Warning: Kernel ABI header at 'tools/include/uapi/sound/asound.h' differs from latest version at 'include/uapi/sound/asound.h'
> diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h
>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Thanks for the patch.
Shall I merge this through sound git tree or was already merged in
somewhere else?
Takashi
> ---
> tools/include/uapi/sound/asound.h | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tools/include/uapi/sound/asound.h b/tools/include/uapi/sound/asound.h
> index 5fbb79e30819af91..ef0cafe295b28253 100644
> --- a/tools/include/uapi/sound/asound.h
> +++ b/tools/include/uapi/sound/asound.h
> @@ -202,6 +202,11 @@ typedef int __bitwise snd_pcm_format_t;
> #define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
> #define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
> #define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
> +/*
> + * For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the
> + * available bit count in most significant bit. It's for the case of so-called 'left-justified' or
> + * `right-padding` sample which has less width than 32 bit.
> + */
> #define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
> #define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
> #define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
> @@ -300,7 +305,7 @@ typedef int __bitwise snd_pcm_subformat_t;
> #define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */
> #define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */
> #define SNDRV_PCM_INFO_EXPLICIT_SYNC 0x10000000 /* needs explicit sync of pointers and data */
> -
> +#define SNDRV_PCM_INFO_NO_REWINDS 0x20000000 /* hardware can only support monotonic changes of appl_ptr */
> #define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */
> #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1 fyi] tools include UAPI: Sync sound/asound.h copy with the kernel sources
2022-02-02 10:35 ` Takashi Iwai
@ 2022-02-06 11:34 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-02-06 11:34 UTC (permalink / raw)
To: Takashi Iwai
Cc: Mark Brown, Pierre-Louis Bossart, Takashi Sakamoto,
Linux Kernel Mailing List
Em Wed, Feb 02, 2022 at 11:35:33AM +0100, Takashi Iwai escreveu:
> On Tue, 01 Feb 2022 16:12:18 +0100,
> Arnaldo Carvalho de Melo wrote:
> >
> > Picking the changes from:
> >
> > 55b71f6c29f2a78a ("ALSA: uapi: use C90 comment style instead of C99 style")
> > fb6723daf89083a0 ("ALSA: pcm: comment about relation between msbits hw parameter and [S|U]32 formats")
> > b456abe63f60ad93 ("ALSA: pcm: introduce INFO_NO_REWINDS flag")
> > 5aec579e08e4f2be ("ALSA: uapi: Fix a C++ style comment in asound.h")
> >
> > Which entails no changes in the tooling side as it doesn't introduce new
> > SNDRV_PCM_IOCTL_ ioctls.
> >
> > To silence this perf tools build warning:
> >
> > Warning: Kernel ABI header at 'tools/include/uapi/sound/asound.h' differs from latest version at 'include/uapi/sound/asound.h'
> > diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h
> >
> > Cc: Mark Brown <broonie@kernel.org>
> > Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > Cc: Takashi Iwai <tiwai@suse.de>
> > Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> Thanks for the patch.
> Shall I merge this through sound git tree or was already merged in
> somewhere else?
It'll go thru the perf tools tree, thanks.
- Arnaldo
>
> Takashi
>
> > ---
> > tools/include/uapi/sound/asound.h | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/include/uapi/sound/asound.h b/tools/include/uapi/sound/asound.h
> > index 5fbb79e30819af91..ef0cafe295b28253 100644
> > --- a/tools/include/uapi/sound/asound.h
> > +++ b/tools/include/uapi/sound/asound.h
> > @@ -202,6 +202,11 @@ typedef int __bitwise snd_pcm_format_t;
> > #define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
> > #define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
> > #define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
> > +/*
> > + * For S32/U32 formats, 'msbits' hardware parameter is often used to deliver information about the
> > + * available bit count in most significant bit. It's for the case of so-called 'left-justified' or
> > + * `right-padding` sample which has less width than 32 bit.
> > + */
> > #define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
> > #define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
> > #define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
> > @@ -300,7 +305,7 @@ typedef int __bitwise snd_pcm_subformat_t;
> > #define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */
> > #define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */
> > #define SNDRV_PCM_INFO_EXPLICIT_SYNC 0x10000000 /* needs explicit sync of pointers and data */
> > -
> > +#define SNDRV_PCM_INFO_NO_REWINDS 0x20000000 /* hardware can only support monotonic changes of appl_ptr */
> > #define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */
> > #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
> >
> > --
> > 2.34.1
> >
--
- Arnaldo
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1 fyi] tools include UAPI: Sync sound/asound.h copy with the kernel sources
@ 2024-09-30 15:21 Arnaldo Carvalho de Melo
0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-09-30 15:21 UTC (permalink / raw)
To: linux-kernel
Cc: Adrian Hunter, Ian Rogers, Ivan Orlov, Jiri Olsa, Kan Liang,
Namhyung Kim, Takashi Iwai
tldr; Just FYI, I'm carrying this on the perf tools tree.
Full explanation:
There used to be no copies, with tools/ code using kernel headers
directly. From time to time tools/perf/ broke due to legitimate kernel
hacking. At some point Linus complained about such direct usage. Then we
adopted the current model.
The way these headers are used in perf are not restricted to just
including them to compile something.
There are sometimes used in scripts that convert defines into string
tables, etc, so some change may break one of these scripts, or new MSRs
may use some different #define pattern, etc.
E.g.:
$ ls -1 tools/perf/trace/beauty/*.sh | head -5
tools/perf/trace/beauty/arch_errno_names.sh
tools/perf/trace/beauty/drm_ioctl.sh
tools/perf/trace/beauty/fadvise.sh
tools/perf/trace/beauty/fsconfig.sh
tools/perf/trace/beauty/fsmount.sh
$
$ tools/perf/trace/beauty/fadvise.sh
static const char *fadvise_advices[] = {
[0] = "NORMAL",
[1] = "RANDOM",
[2] = "SEQUENTIAL",
[3] = "WILLNEED",
[4] = "DONTNEED",
[5] = "NOREUSE",
};
$
The tools/perf/check-headers.sh script, part of the tools/ build
process, points out changes in the original files.
So its important not to touch the copies in tools/ when doing changes in
the original kernel headers, that will be done later, when
check-headers.sh inform about the change to the perf tools hackers.
Picking the changes from:
37745918e0e7575b ("ALSA: timer: Introduce virtual userspace-driven timers")
Which entails no changes in the tooling side as it only introduces new
SNDRV_TIMER_IOCTL_ ioctls, and the ones tracked by scripts in
tools/perf/trace/beauty/ are only SNDRV_PCM_IOCTL_ and SNDRV_CTL_IOCTL_,
we still need to support SNDRV_TIMER_IOCTL_ ones, but that probably will
be one of the first for a BTF enumeration based approach :-)
This silences this perf tools build warning:
diff -u tools/perf/trace/beauty/include/uapi/sound/asound.h include/uapi/sound/asound.h
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ivan Orlov <ivan.orlov0322@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
.../trace/beauty/include/uapi/sound/asound.h | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/tools/perf/trace/beauty/include/uapi/sound/asound.h b/tools/perf/trace/beauty/include/uapi/sound/asound.h
index 8bf7e8a0eb6f03a8..4cd513215bcd8f74 100644
--- a/tools/perf/trace/beauty/include/uapi/sound/asound.h
+++ b/tools/perf/trace/beauty/include/uapi/sound/asound.h
@@ -869,7 +869,7 @@ struct snd_ump_block_info {
* Timer section - /dev/snd/timer
*/
-#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
+#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8)
enum {
SNDRV_TIMER_CLASS_NONE = -1,
@@ -894,6 +894,7 @@ enum {
#define SNDRV_TIMER_GLOBAL_RTC 1 /* unused */
#define SNDRV_TIMER_GLOBAL_HPET 2
#define SNDRV_TIMER_GLOBAL_HRTIMER 3
+#define SNDRV_TIMER_GLOBAL_UDRIVEN 4
/* info flags */
#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
@@ -974,6 +975,18 @@ struct snd_timer_status {
};
#endif
+/*
+ * This structure describes the userspace-driven timer. Such timers are purely virtual,
+ * and can only be triggered from software (for instance, by userspace application).
+ */
+struct snd_timer_uinfo {
+ /* To pretend being a normal timer, we need to know the resolution in ns. */
+ __u64 resolution;
+ int fd;
+ unsigned int id;
+ unsigned char reserved[16];
+};
+
#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
#define SNDRV_TIMER_IOCTL_TREAD_OLD _IOW('T', 0x02, int)
@@ -990,6 +1003,8 @@ struct snd_timer_status {
#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
#define SNDRV_TIMER_IOCTL_TREAD64 _IOW('T', 0xa4, int)
+#define SNDRV_TIMER_IOCTL_CREATE _IOWR('T', 0xa5, struct snd_timer_uinfo)
+#define SNDRV_TIMER_IOCTL_TRIGGER _IO('T', 0xa6)
#if __BITS_PER_LONG == 64
#define SNDRV_TIMER_IOCTL_TREAD SNDRV_TIMER_IOCTL_TREAD_OLD
--
2.46.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-30 15:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-01 15:12 [PATCH 1/1 fyi] tools include UAPI: Sync sound/asound.h copy with the kernel sources Arnaldo Carvalho de Melo
2022-02-02 10:35 ` Takashi Iwai
2022-02-06 11:34 ` Arnaldo Carvalho de Melo
-- strict thread matches above, loose matches on Subject: below --
2024-09-30 15:21 Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox