tspp: add kernel api for video demux component

The demux is an in-kernel software component whose purpose is to take
an incoming TSIF stream and split it into multiple output channels
based on the PID field in each TS packet. Each output channel can be
used for a different purpose, such as audio, video or channel
information. In order to get good performance when moving such large
data streams around, the demux was placed in kernel-space as to
prevent copying memory buffers between kernel-space and user-space, at
least at this early stage in processing the traffic. Originally the
design of the TSPP driver was based on the earlier TSIF driver, so it
contained only a user-space API.

Signed-off-by: Joel Nider <jnider@codeaurora.org>
(cherry picked from commit 435ad8e2157eec5783a435f1e7ec47f67d759882)

Change-Id: I0dadf04ec2694c82fc8378fbed5fbf81fc889337
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
This commit is contained in:
Joel Nider
2011-12-14 16:53:30 +02:00
committed by Stephen Boyd
parent 04f0695801
commit adec35c3d6
3 changed files with 944 additions and 483 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and
@@ -13,6 +13,8 @@
#ifndef _MSM_TSPP_H_ #ifndef _MSM_TSPP_H_
#define _MSM_TSPP_H_ #define _MSM_TSPP_H_
#include <linux/tspp.h> /* tspp_source */
struct msm_tspp_platform_data { struct msm_tspp_platform_data {
int num_gpios; int num_gpios;
const struct msm_gpio *gpios; const struct msm_gpio *gpios;
@@ -20,5 +22,34 @@ struct msm_tspp_platform_data {
const char *tsif_ref_clk; const char *tsif_ref_clk;
}; };
struct tspp_data_descriptor {
void *virt_base; /* logical address of the actual data */
u32 phys_base; /* physical address of the actual data */
int size; /* size of buffer in bytes */
int id; /* unique identifier */
void *user; /* user-defined data */
};
typedef void (tspp_notifier)(int channel, void *user);
typedef void* (tspp_allocator)(int channel, int size,
u32 *phys_base, void *user);
/* Kernel API functions */
int tspp_open_stream(u32 dev, u32 channel_id, enum tspp_source src,
enum tspp_tsif_mode mode);
int tspp_close_stream(u32 dev, u32 channel_id);
int tspp_open_channel(u32 dev, u32 channel_id);
int tspp_close_channel(u32 dev, u32 channel_id);
int tspp_add_filter(u32 dev, u32 channel_id, struct tspp_filter *filter);
int tspp_remove_filter(u32 dev, u32 channel_id, struct tspp_filter *filter);
int tspp_set_key(u32 dev, u32 channel_id, struct tspp_key *key);
int tspp_register_notification(u32 dev, u32 channel, tspp_notifier *notify,
void *data, u32 timer_ms);
int tspp_unregister_notification(u32 dev, u32 channel);
const struct tspp_data_descriptor *tspp_get_buffer(u32 dev, u32 channel);
int tspp_release_buffer(u32 dev, u32 channel, u32 descriptor_id);
int tspp_allocate_buffers(u32 dev, u32 channel_id, u32 count,
u32 size, u32 int_freq, tspp_allocator *alloc, void *user);
#endif /* _MSM_TSPP_H_ */ #endif /* _MSM_TSPP_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -24,6 +24,12 @@ enum tspp_mode {
TSPP_MODE_RAW_NO_SUFFIX TSPP_MODE_RAW_NO_SUFFIX
}; };
enum tspp_tsif_mode {
TSPP_TSIF_MODE_LOOPBACK, /* loopback mode */
TSPP_TSIF_MODE_1, /* without sync */
TSPP_TSIF_MODE_2 /* with sync signal */
};
struct tspp_filter { struct tspp_filter {
int pid; int pid;
int mask; int mask;
@@ -35,6 +41,7 @@ struct tspp_filter {
struct tspp_select_source { struct tspp_select_source {
enum tspp_source source; enum tspp_source source;
enum tspp_tsif_mode mode;
}; };
struct tspp_pid { struct tspp_pid {
@@ -77,8 +84,5 @@ struct tspp_buffer {
_IOW(TSPP_IOCTL_BASE, 5, struct tspp_system_keys) _IOW(TSPP_IOCTL_BASE, 5, struct tspp_system_keys)
#define TSPP_IOCTL_BUFFER_SIZE \ #define TSPP_IOCTL_BUFFER_SIZE \
_IOW(TSPP_IOCTL_BASE, 6, struct tspp_buffer) _IOW(TSPP_IOCTL_BASE, 6, struct tspp_buffer)
#define TSPP_IOCTL_LOOPBACK \
_IOW(TSPP_IOCTL_BASE, 0xFF, int)
#endif /* _TSPP_H_ */ #endif /* _TSPP_H_ */