Merge "video: driver: check for drain last flag for decoder only"
Esse commit está contido em:

commit de
Gerrit - the friendly Code Review server

commit
b0513bcda8
@@ -116,6 +116,7 @@ enum hfi_buffer_firmware_flags {
|
||||
HFI_BUF_FW_FLAG_READONLY = 0x00000010,
|
||||
HFI_BUF_FW_FLAG_CODEC_CONFIG = 0x00000100,
|
||||
HFI_BUF_FW_FLAG_LAST = 0x10000000,
|
||||
HFI_BUF_FW_FLAG_PSC_LAST = 0x20000000,
|
||||
};
|
||||
|
||||
enum hfi_metapayload_header_flags {
|
||||
@@ -165,22 +166,23 @@ enum hfi_reserve_type {
|
||||
#define HFI_CMD_DELIVERY_MODE 0x0100000A
|
||||
#define HFI_CMD_SUBSCRIBE_MODE 0x0100000B
|
||||
#define HFI_CMD_SETTINGS_CHANGE 0x0100000C
|
||||
#define HFI_CMD_RESERVE 0x0100000F
|
||||
|
||||
#define HFI_SSR_TYPE_SW_ERR_FATAL 0x1
|
||||
#define HFI_SSR_TYPE_SW_DIV_BY_ZERO 0x2
|
||||
#define HFI_SSR_TYPE_CPU_WDOG_IRQ 0x3
|
||||
#define HFI_SSR_TYPE_NOC_ERROR 0x4
|
||||
|
||||
#define HFI_BITMASK_HW_CLIENT_ID 0x000000f0
|
||||
#define HFI_BITMASK_SSR_TYPE 0x0000000f
|
||||
#define HFI_CMD_SSR 0x0100000D
|
||||
|
||||
#define HFI_STABILITY_TYPE_VCODEC_HUNG 0x1
|
||||
#define HFI_STABILITY_TYPE_ENC_BUFFER_FULL 0x2
|
||||
#define HFI_BITMASK_STABILITY_TYPE 0x0000000f
|
||||
#define HFI_BITMASK_STABILITY_TYPE 0x0000000f
|
||||
#define HFI_CMD_STABILITY 0x0100000E
|
||||
|
||||
#define HFI_CMD_RESERVE 0x0100000F
|
||||
#define HFI_CMD_FLUSH 0x01000010
|
||||
#define HFI_CMD_PAUSE 0x01000011
|
||||
#define HFI_CMD_END 0x01FFFFFF
|
||||
|
||||
#endif //__H_HFI_COMMAND_H__
|
||||
|
@@ -607,6 +607,10 @@ enum hfi_saliency_type {
|
||||
|
||||
#define HFI_INFO_VCODEC_RESET 0x06000005
|
||||
|
||||
#define HFI_INFO_HFI_FLAG_DRAIN_LAST 0x06000006
|
||||
|
||||
#define HFI_INFO_HFI_FLAG_PSC_LAST 0x06000007
|
||||
|
||||
#define HFI_INFORMATION_END 0x06FFFFFF
|
||||
|
||||
#endif //__H_HFI_PROPERTY_H__
|
||||
|
@@ -520,7 +520,6 @@ static inline unsigned int VIDEO_RAW_BUFFER_SIZE(unsigned int v4l2_fmt,
|
||||
uv_meta_scanlines, 4096);
|
||||
size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane +
|
||||
uv_meta_plane);
|
||||
size = MSM_MEDIA_ALIGN(size, 4096);
|
||||
} else {
|
||||
if (pix_width <= INTERLACE_WIDTH_MAX &&
|
||||
pix_height <= INTERLACE_HEIGHT_MAX &&
|
||||
@@ -597,6 +596,7 @@ static inline unsigned int VIDEO_RAW_BUFFER_SIZE(unsigned int v4l2_fmt,
|
||||
}
|
||||
|
||||
invalid_input:
|
||||
size = MSM_MEDIA_ALIGN(size, 4096);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@@ -352,6 +352,17 @@ static inline bool is_enc_slice_delivery_mode(struct msm_vidc_inst *inst)
|
||||
V4L2_MPEG_VIDC_HEVC_ENCODE_DELIVERY_MODE_SLICE_BASED)));
|
||||
}
|
||||
|
||||
static inline bool is_state(struct msm_vidc_inst *inst, enum msm_vidc_state state)
|
||||
{
|
||||
return inst->state == state;
|
||||
}
|
||||
|
||||
static inline bool is_sub_state(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_sub_state sub_state)
|
||||
{
|
||||
return (inst->sub_state & sub_state);
|
||||
}
|
||||
|
||||
const char *cap_name(enum msm_vidc_inst_capability_type cap_id);
|
||||
const char *v4l2_pixelfmt_name(u32 pixelfmt);
|
||||
const char *v4l2_type_name(u32 port);
|
||||
@@ -382,10 +393,13 @@ u32 v4l2_matrix_coeff_from_driver(struct msm_vidc_inst *inst,
|
||||
int v4l2_type_to_driver_port(struct msm_vidc_inst *inst, u32 type,
|
||||
const char *func);
|
||||
const char *allow_name(enum msm_vidc_allow allow);
|
||||
const char *state_name(enum msm_vidc_inst_state state);
|
||||
const char *state_name(enum msm_vidc_state state);
|
||||
const char *core_state_name(enum msm_vidc_core_state state);
|
||||
int msm_vidc_change_inst_state(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_inst_state request_state, const char *func);
|
||||
int msm_vidc_change_state(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_state request_state, const char *func);
|
||||
int msm_vidc_change_sub_state(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_sub_state clear_sub_states,
|
||||
enum msm_vidc_sub_state set_sub_states, const char *func);
|
||||
int msm_vidc_create_internal_buffer(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_buffer_type buffer_type, u32 index);
|
||||
int msm_vidc_get_internal_buffers(struct msm_vidc_inst *inst,
|
||||
@@ -406,8 +420,6 @@ int msm_vidc_session_open(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_session_set_codec(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_session_set_secure_mode(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_session_set_default_header(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_session_streamon(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_port_type port);
|
||||
int msm_vidc_session_streamoff(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_port_type port);
|
||||
int msm_vidc_session_close(struct msm_vidc_inst *inst);
|
||||
@@ -502,13 +514,21 @@ bool msm_vidc_allow_streamon(struct msm_vidc_inst *inst, u32 type);
|
||||
enum msm_vidc_allow msm_vidc_allow_streamoff(struct msm_vidc_inst *inst, u32 type);
|
||||
enum msm_vidc_allow msm_vidc_allow_qbuf(struct msm_vidc_inst *inst, u32 type);
|
||||
enum msm_vidc_allow msm_vidc_allow_input_psc(struct msm_vidc_inst *inst);
|
||||
bool msm_vidc_allow_last_flag(struct msm_vidc_inst *inst);
|
||||
bool msm_vidc_allow_drain_last_flag(struct msm_vidc_inst *inst);
|
||||
bool msm_vidc_allow_psc_last_flag(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_state_change_streamon(struct msm_vidc_inst *inst, u32 type);
|
||||
int msm_vidc_state_change_streamoff(struct msm_vidc_inst *inst, u32 type);
|
||||
int msm_vidc_state_change_stop(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_state_change_start(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_state_change_input_psc(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_state_change_last_flag(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_state_change_drain_last_flag(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_state_change_psc_last_flag(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_process_drain(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_process_resume(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_process_streamon(struct msm_vidc_inst *inst, u32 type);
|
||||
int msm_vidc_process_stop_done(struct msm_vidc_inst *inst,
|
||||
enum signal_session_response signal_type);
|
||||
int msm_vidc_process_drain_done(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_process_drain_last_flag(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_process_psc_last_flag(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_get_mbs_per_frame(struct msm_vidc_inst *inst);
|
||||
u32 msm_vidc_get_max_bitrate(struct msm_vidc_inst* inst);
|
||||
int msm_vidc_get_fps(struct msm_vidc_inst *inst);
|
||||
@@ -557,6 +577,8 @@ bool res_is_less_than(u32 width, u32 height,
|
||||
u32 ref_width, u32 ref_height);
|
||||
bool res_is_less_than_or_equal_to(u32 width, u32 height,
|
||||
u32 ref_width, u32 ref_height);
|
||||
int signal_session_msg_receipt(struct msm_vidc_inst *inst,
|
||||
enum signal_session_response cmd);
|
||||
int msm_vidc_get_properties(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_create_input_metadata_buffer(struct msm_vidc_inst *inst, int buf_fd);
|
||||
int msm_vidc_update_input_meta_buffer_index(struct msm_vidc_inst *inst, struct vb2_buffer *vb2);
|
||||
|
@@ -75,19 +75,30 @@ struct msm_vidc_buffers_info {
|
||||
struct msm_vidc_buffers partial_data;
|
||||
};
|
||||
|
||||
enum msm_vidc_inst_state {
|
||||
enum msm_vidc_state {
|
||||
MSM_VIDC_OPEN = 1,
|
||||
MSM_VIDC_START_INPUT = 2,
|
||||
MSM_VIDC_START_OUTPUT = 3,
|
||||
MSM_VIDC_START = 4,
|
||||
MSM_VIDC_DRC = 5,
|
||||
MSM_VIDC_DRC_LAST_FLAG = 6,
|
||||
MSM_VIDC_DRAIN = 7,
|
||||
MSM_VIDC_DRAIN_LAST_FLAG = 8,
|
||||
MSM_VIDC_DRC_DRAIN = 9,
|
||||
MSM_VIDC_DRC_DRAIN_LAST_FLAG = 10,
|
||||
MSM_VIDC_DRAIN_START_INPUT = 11,
|
||||
MSM_VIDC_ERROR = 12,
|
||||
MSM_VIDC_INPUT_STREAMING = 2,
|
||||
MSM_VIDC_OUTPUT_STREAMING = 3,
|
||||
MSM_VIDC_STREAMING = 4,
|
||||
MSM_VIDC_CLOSE = 5,
|
||||
MSM_VIDC_ERROR = 6,
|
||||
};
|
||||
|
||||
#define MSM_VIDC_SUB_STATE_NONE 0
|
||||
#define MSM_VIDC_MAX_SUB_STATES 6
|
||||
/*
|
||||
* max value of inst->sub_state if all
|
||||
* the 6 valid bits are set i.e 111111==>63
|
||||
*/
|
||||
#define MSM_VIDC_MAX_SUB_STATE_VALUE ((1 << MSM_VIDC_MAX_SUB_STATES) - 1)
|
||||
|
||||
enum msm_vidc_sub_state {
|
||||
MSM_VIDC_DRAIN = BIT(0),
|
||||
MSM_VIDC_DRC = BIT(1),
|
||||
MSM_VIDC_DRAIN_LAST_BUFFER = BIT(2),
|
||||
MSM_VIDC_DRC_LAST_BUFFER = BIT(3),
|
||||
MSM_VIDC_INPUT_PAUSE = BIT(4),
|
||||
MSM_VIDC_OUTPUT_PAUSE = BIT(5),
|
||||
};
|
||||
|
||||
struct buf_queue {
|
||||
@@ -99,7 +110,9 @@ struct msm_vidc_inst {
|
||||
struct mutex lock;
|
||||
struct mutex request_lock;
|
||||
struct mutex client_lock;
|
||||
enum msm_vidc_inst_state state;
|
||||
enum msm_vidc_state state;
|
||||
enum msm_vidc_sub_state sub_state;
|
||||
char sub_state_name[MAX_NAME_LENGTH];
|
||||
enum msm_vidc_domain_type domain;
|
||||
enum msm_vidc_codec_type codec;
|
||||
void *core;
|
||||
@@ -138,12 +151,10 @@ struct msm_vidc_inst {
|
||||
struct msm_vidc_decode_batch decode_batch;
|
||||
struct msm_vidc_decode_vpp_delay decode_vpp_delay;
|
||||
struct msm_vidc_session_idle session_idle;
|
||||
struct delayed_work response_work;
|
||||
struct delayed_work stats_work;
|
||||
struct work_struct stability_work;
|
||||
struct msm_vidc_stability stability;
|
||||
struct workqueue_struct *response_workq;
|
||||
struct list_head response_works; /* list of struct response_work */
|
||||
struct workqueue_struct *workq;
|
||||
struct list_head enc_input_crs;
|
||||
struct list_head dmabuf_tracker; /* list of struct msm_memory_dmabuf */
|
||||
struct list_head input_timer_list; /* list of struct msm_vidc_input_timer */
|
||||
|
@@ -500,6 +500,7 @@ enum msm_vidc_inst_capability_type {
|
||||
CAVLC_MAX_BITRATE,
|
||||
ALLINTRA_MAX_BITRATE,
|
||||
LOWLATENCY_MAX_BITRATE,
|
||||
LAST_FLAG_EVENT_ENABLE,
|
||||
/* place all root(no parent) enums before this line */
|
||||
|
||||
PROFILE,
|
||||
@@ -940,19 +941,6 @@ enum msm_vidc_allow {
|
||||
MSM_VIDC_IGNORE,
|
||||
};
|
||||
|
||||
enum response_work_type {
|
||||
RESP_WORK_INPUT_PSC = 1,
|
||||
RESP_WORK_OUTPUT_PSC,
|
||||
RESP_WORK_LAST_FLAG,
|
||||
};
|
||||
|
||||
struct response_work {
|
||||
struct list_head list;
|
||||
enum response_work_type type;
|
||||
void *data;
|
||||
u32 data_size;
|
||||
};
|
||||
|
||||
struct msm_vidc_ssr {
|
||||
bool trigger;
|
||||
enum msm_vidc_ssr_trigger_type ssr_type;
|
||||
|
@@ -49,6 +49,10 @@ int venus_hfi_start(struct msm_vidc_inst *inst, enum msm_vidc_port_type port);
|
||||
int venus_hfi_stop(struct msm_vidc_inst *inst, enum msm_vidc_port_type port);
|
||||
int venus_hfi_session_close(struct msm_vidc_inst *inst);
|
||||
int venus_hfi_session_open(struct msm_vidc_inst *inst);
|
||||
int venus_hfi_session_pause(struct msm_vidc_inst *inst, enum msm_vidc_port_type port);
|
||||
int venus_hfi_session_resume(struct msm_vidc_inst *inst,
|
||||
enum msm_vidc_port_type port, u32 payload);
|
||||
int venus_hfi_session_drain(struct msm_vidc_inst *inst, enum msm_vidc_port_type port);
|
||||
int venus_hfi_session_set_codec(struct msm_vidc_inst *inst);
|
||||
int venus_hfi_session_set_secure_mode(struct msm_vidc_inst *inst);
|
||||
int venus_hfi_core_init(struct msm_vidc_core *core);
|
||||
|
@@ -16,11 +16,6 @@ bool is_valid_port(struct msm_vidc_inst *inst, u32 port,
|
||||
const char *func);
|
||||
bool is_valid_hfi_buffer_type(struct msm_vidc_inst *inst,
|
||||
u32 buffer_type, const char *func);
|
||||
void handle_session_response_work_handler(struct work_struct *work);
|
||||
int handle_session_response_work(struct msm_vidc_inst *inst,
|
||||
struct response_work *work);
|
||||
int cancel_response_work(struct msm_vidc_inst *inst);
|
||||
int cancel_response_work_sync(struct msm_vidc_inst *inst);
|
||||
int handle_system_error(struct msm_vidc_core *core,
|
||||
struct hfi_packet *pkt);
|
||||
void fw_coredump(struct msm_vidc_core *core);
|
||||
|
Referência em uma nova issue
Block a user