History

ALSA: compress_offload: Add SNDRV_COMPRESS_AVAIL64 ioctl

The previous patch introduced a 64-bit timestamp ioctl (SNDRV_COMPRESS_TSTAMP64). To provide a consistent API, this patch adds a corresponding 64-bit version of the SNDRV_COMPRESS_AVAIL ioctl. A new struct snd_compr_avail64 is added to the UAPI, which includes the 64-bit timestamp. The existing ioctl implementation is refactored to handle both the 32-bit and 64-bit variants.

Joris Verhaegen committed 1 year ago

Commit 86eec881 parent f20a5392 files · +39 −15Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/sound/compress_offload.h+11−0
@@ -84,6 +84,16 @@ struct snd_compr_avail { · 83 unmodified lines
84 struct snd_compr_tstamp tstamp;84 struct snd_compr_tstamp tstamp;
85} __attribute__((packed, aligned(4)));85} __attribute__((packed, aligned(4)));
86 86
87/**
88 * struct snd_compr_avail64 - avail descriptor with tstamp in 64 bit format
89 * @avail: Number of bytes available in ring buffer for writing/reading
90 * @tstamp: timestamp information
91 */
92struct snd_compr_avail64 {
93 __u64 avail;
94 struct snd_compr_tstamp64 tstamp;
95} __attribute__((packed, aligned(4)));
96
87enum snd_compr_direction {97enum snd_compr_direction {
88 SND_COMPRESS_PLAYBACK = 0,98 SND_COMPRESS_PLAYBACK = 0,
89 SND_COMPRESS_CAPTURE,99 SND_COMPRESS_CAPTURE,
@@ -231,6 +241,7 @@ struct snd_compr_task_status { · 141 unmodified lines
231#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)241#define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
232#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)242#define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
233#define SNDRV_COMPRESS_TSTAMP64 _IOR('C', 0x22, struct snd_compr_tstamp64)243#define SNDRV_COMPRESS_TSTAMP64 _IOR('C', 0x22, struct snd_compr_tstamp64)
244#define SNDRV_COMPRESS_AVAIL64 _IOR('C', 0x23, struct snd_compr_avail64)
234#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)245#define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
235#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)246#define SNDRV_COMPRESS_RESUME _IO('C', 0x31)
236#define SNDRV_COMPRESS_START _IO('C', 0x32)247#define SNDRV_COMPRESS_START _IO('C', 0x32)