video: driver: state handling code movement

state handling changes were spread across multiple files.
So re-arrange all state related handling changes into
msm_vidc_state.h/.c file.

Change-Id: I3826daa678d1e2b5ce7e74380d465e70b1b824c6
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
This commit is contained in:
Govindaraj Rajagopal
2023-01-30 10:53:20 +05:30
parent 0884f5a04a
commit c175e36454
5 changed files with 321 additions and 325 deletions

View File

@@ -14,15 +14,6 @@
struct msm_vidc_inst;
#define FOREACH_STATE(STATE) { \
STATE(OPEN) \
STATE(INPUT_STREAMING) \
STATE(OUTPUT_STREAMING) \
STATE(STREAMING) \
STATE(CLOSE) \
STATE(ERROR) \
}
#define call_session_op(c, op, ...) \
(((c) && (c)->session_ops && (c)->session_ops->op) ? \
((c)->session_ops->op(__VA_ARGS__)) : 0)
@@ -68,25 +59,6 @@ struct msm_vidc_buffers_info {
struct msm_vidc_buffers partial_data;
};
enum msm_vidc_state FOREACH_STATE(GENERATE_MSM_VIDC_ENUM);
#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 {
struct vb2_queue *vb2q;
};