return 0;
}
+static void __mfc_create_bitrate_table(struct mfc_dev *dev)
+{
+ struct mfc_platdata *pdata = dev->pdata;
+ int i, interval;
+
+ interval = pdata->max_Kbps[0] / pdata->num_mfc_freq;
+ dev->bps_ratio = pdata->max_Kbps[0] / dev->pdata->max_Kbps[1];
+ for (i = 0; i < pdata->num_mfc_freq; i++) {
+ dev->bitrate_table[i].bps_interval = interval * (i + 1);
+ dev->bitrate_table[i].mfc_freq = pdata->mfc_freqs[i];
+ mfc_info_dev("[QoS] bitrate table[%d] %dKHz: ~ %dKbps\n",
+ i, dev->bitrate_table[i].mfc_freq,
+ dev->bitrate_table[i].bps_interval);
+ }
+}
+
static void __mfc_parse_dt(struct device_node *np, struct mfc_dev *mfc)
{
struct mfc_platdata *pdata = mfc->pdata;
of_property_read_u32(np, "qos_weight_super64_bframe", &pdata->qos_weight.weight_super64_bframe);
#endif
/* Bitrate control for QoS */
+ of_property_read_u32(np, "num_mfc_freq", &pdata->num_mfc_freq);
+ if (pdata->num_mfc_freq)
+ of_property_read_u32_array(np, "mfc_freqs", pdata->mfc_freqs, pdata->num_mfc_freq);
of_property_read_u32_array(np, "max_Kbps", pdata->max_Kbps, MAX_NUM_MFC_BPS);
- dev->bps_ratio = pdata->max_Kbps[0] / dev->pdata->max_Kbps[1];
+ __mfc_create_bitrate_table(mfc);
}
static void *__mfc_get_drv_data(struct platform_device *pdev);
#define MFC_MAX_DPBS 32
#define MFC_MAX_BUFFERS 32
#define MFC_MAX_EXTRA_BUF 10
-#define MFC_TIME_INDEX 15
#define MFC_SFR_LOGGING_COUNT_SET0 10
#define MFC_SFR_LOGGING_COUNT_SET1 28
#define MFC_SFR_LOGGING_COUNT_SET2 32
#define MFC_LOGGING_DATA_SIZE 950
#define MFC_MAX_DEFAULT_PARAM 100
+/* OTF */
#define HWFC_MAX_BUF 10
#define OTF_MAX_BUF 30
+/* HDR */
#define HDR_MAX_WINDOWS 3
#define HDR_MAX_SCL 3
#define HDR_MAX_DISTRIBUTION 15
/* Maximum number of temporal layers */
#define VIDEO_MAX_TEMPORAL_LAYERS 7
+/* Batch mode */
#define MAX_NUM_IMAGES_IN_VB 8
#define MAX_NUM_BUFCON_BUFS 32
+/* QoS */
+#define MAX_TIME_INDEX 15
#define MAX_NUM_CLUSTER 3
#define MAX_NUM_MFC_BPS 2
+#define MAX_NUM_MFC_FREQ 10
/*
* MFC region id for smc
struct mfc_qos *qos_table;
struct mfc_qos_boost *qos_boost_table;
#endif
+ int num_mfc_freq;
+ unsigned int mfc_freqs[MAX_NUM_MFC_FREQ];
unsigned int max_Kbps[MAX_NUM_MFC_BPS];
/* NAL-Q size */
unsigned int nal_q_entry_size;
int is_on_status;
};
+struct mfc_bitrate_table {
+ int mfc_freq;
+ int bps_interval;
+};
+
/**
* struct mfc_dev - The struct containing driver internal parameters.
*/
int qos_has_enc_ctx;
struct mutex qos_mutex;
#endif
+ struct mfc_bitrate_table bitrate_table[MAX_NUM_MFC_FREQ];
int bps_ratio;
int id;
struct list_head qos_list;
#endif
- struct mfc_timestamp ts_array[MFC_TIME_INDEX];
+ struct mfc_timestamp ts_array[MAX_TIME_INDEX];
struct list_head ts_list;
int ts_count;
int ts_is_full;
- struct mfc_bitrate bitrate_array[MFC_TIME_INDEX];
+ /* bitrate control for QoS*/
+ struct mfc_bitrate bitrate_array[MAX_TIME_INDEX];
struct list_head bitrate_list;
int bitrate_index;
int bitrate_is_full;
curr_ts->index = ctx->ts_count;
ctx->ts_count++;
- if (ctx->ts_count == MFC_TIME_INDEX) {
+ if (ctx->ts_count == MAX_TIME_INDEX) {
ctx->ts_is_full = 1;
- ctx->ts_count %= MFC_TIME_INDEX;
+ ctx->ts_count %= MAX_TIME_INDEX;
}
return 0;
mfc_debug(3, "[QoS] %d Kbps, average %lld Kbits per frame\n", ctx->Kbps, avg_Kbits);
ctx->bitrate_index++;
- if (ctx->bitrate_index == MFC_TIME_INDEX) {
+ if (ctx->bitrate_index == MAX_TIME_INDEX) {
ctx->bitrate_is_full = 1;
- ctx->bitrate_index %= MFC_TIME_INDEX;
+ ctx->bitrate_index %= MAX_TIME_INDEX;
}
}