Skip to content

Commit e95a313

Browse files
softwareckikv2019i
authored andcommitted
ipc4: notification: Add functions to prepare ipc xrun notifications
Add functions to prepare ipc4 notifications about underrun/overrun detected by a dma. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent 82f85e4 commit e95a313

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

src/include/ipc4/notification.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,9 @@ struct ipc4_resource_event_data_notification {
274274
void process_data_error_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id,
275275
uint32_t error_code);
276276

277+
void copier_gateway_underrun_notif_msg_init(struct ipc_msg *msg, uint32_t pipeline_id);
278+
void copier_gateway_overrun_notif_msg_init(struct ipc_msg *msg, uint32_t pipeline_id);
279+
void gateway_underrun_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id);
280+
void gateway_overrun_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id);
281+
277282
#endif /* __IPC4_NOTIFICATION_H__ */

src/ipc/ipc4/notification.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,46 @@ void xrun_notif_msg_init(struct ipc_msg *msg_xrun, uint32_t resource_id, uint32_
3636
}
3737
#endif
3838

39+
void copier_gateway_underrun_notif_msg_init(struct ipc_msg *msg, uint32_t pipeline_id)
40+
{
41+
struct ipc4_resource_event_data_notification *notif_data = msg->tx_data;
42+
43+
resource_notif_header_init(msg);
44+
notif_data->resource_id = pipeline_id;
45+
notif_data->event_type = SOF_IPC4_GATEWAY_UNDERRUN_DETECTED;
46+
notif_data->resource_type = SOF_IPC4_PIPELINE;
47+
}
48+
49+
void gateway_underrun_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id)
50+
{
51+
struct ipc4_resource_event_data_notification *notif_data = msg->tx_data;
52+
53+
resource_notif_header_init(msg);
54+
notif_data->resource_id = resource_id;
55+
notif_data->event_type = SOF_IPC4_GATEWAY_UNDERRUN_DETECTED;
56+
notif_data->resource_type = SOF_IPC4_GATEWAY;
57+
}
58+
59+
void copier_gateway_overrun_notif_msg_init(struct ipc_msg *msg, uint32_t pipeline_id)
60+
{
61+
struct ipc4_resource_event_data_notification *notif_data = msg->tx_data;
62+
63+
resource_notif_header_init(msg);
64+
notif_data->resource_id = pipeline_id;
65+
notif_data->event_type = SOF_IPC4_GATEWAY_OVERRUN_DETECTED;
66+
notif_data->resource_type = SOF_IPC4_PIPELINE;
67+
}
68+
69+
void gateway_overrun_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id)
70+
{
71+
struct ipc4_resource_event_data_notification *notif_data = msg->tx_data;
72+
73+
resource_notif_header_init(msg);
74+
notif_data->resource_id = resource_id;
75+
notif_data->event_type = SOF_IPC4_GATEWAY_OVERRUN_DETECTED;
76+
notif_data->resource_type = SOF_IPC4_GATEWAY;
77+
}
78+
3979
void process_data_error_notif_msg_init(struct ipc_msg *msg, uint32_t resource_id,
4080
uint32_t error_code)
4181
{

0 commit comments

Comments
 (0)