Thread (23 messages) 23 messages, 3 authors, 2026-03-04

Re: [PATCH v2 14/14] ASoC: qcom: q6apm: Add support for early buffer mapping on DSP

From: Srinivas Kandagatla <hidden>
Date: 2026-03-04 11:10:50
Also in: linux-arm-msm, linux-sound, lkml

On 2/24/26 10:16 AM, Konrad Dybcio wrote:
On 2/23/26 7:07 PM, Srinivas Kandagatla wrote:
quoted
Buffers are allocated on pcm_new and mapped in the dsp on every prepare call,
which is inefficient and unnecessary.

Add new functions q6apm_[un]map_memory_fixed_region to map it on
to dsp only once after allocation.

Signed-off-by: Srinivas Kandagatla <redacted>
---
[...]
quoted
-int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, phys_addr_t phys,
-			     size_t period_sz, unsigned int periods)
+int q6apm_set_memory_map_handle(struct q6apm_graph *graph, unsigned int dir)
+{
+	if (dir == SNDRV_PCM_STREAM_PLAYBACK)
+		graph->rx_data.mem_map_handle = graph->info->mem_map_handle;
+	else
+		graph->tx_data.mem_map_handle = graph->info->mem_map_handle;
+
+	return 0;
+}
This doesn't return a useful value today, will it ever?
return type should be  void.
[...]

quoted
+		case APM_CMD_SHARED_MEM_UNMAP_REGIONS:
+			apm->result.opcode = hdr->opcode;
+			apm->result.status = 0;
+			rsp = data->payload;
+
+			info = idr_find(&apm->graph_info_idr, hdr->token);
+			if (info)
+				info->mem_map_handle = 0;
+			else
+				dev_err(dev, "Error (%d) Processing 0x%08x cmd\n", result->status,
+					result->opcode);
+
+			dev_err(dev, "Memory Map region %x\n", rsp->mem_map_handle);
Looks like a debug leftover (also in the below 'case')
Right, will fix that in next spin.

--srini
Konrad
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help