From f91c9d7610a2fe306273a83e2fd5351bceb85d28 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Tue, 11 Apr 2017 20:33:18 +0900 Subject: ALSA: firewire-lib: cache maximum length of payload to reduce function calls During packet streaming, maximum length of payload for isochronous packet is invariable, therefore no need to recalculate. Current ALSA IEC 61883-1/6 engine calls a function to calculate it 8,000 or more times per second for incoming packet processing. This commit adds a member to have maximum length of payload into 'struct amdtp_stream', to reduces the function calls. At first callback from isochronous context, the length is calculated and stored for later processing. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/amdtp-stream.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sound/firewire/amdtp-stream.h') diff --git a/sound/firewire/amdtp-stream.h b/sound/firewire/amdtp-stream.h index 2bd4de4c7bb7..7e8831722821 100644 --- a/sound/firewire/amdtp-stream.h +++ b/sound/firewire/amdtp-stream.h @@ -110,6 +110,7 @@ struct amdtp_stream { int (*handle_packet)(struct amdtp_stream *s, unsigned int payload_quadlets, unsigned int cycle, unsigned int index); + unsigned int max_payload_length; /* For CIP headers. */ unsigned int source_node_id_field; -- cgit v1.2.3