1/*
2 * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef __RK_VDEC_CMD_H__
17#define __RK_VDEC_CMD_H__
18
19/*
20 * decoder query interface is only for debug usage
21 */
22#define MPP_DEC_QUERY_STATUS (0x00000001)
23#define MPP_DEC_QUERY_WAIT (0x00000002)
24#define MPP_DEC_QUERY_FPS (0x00000004)
25#define MPP_DEC_QUERY_BPS (0x00000008)
26#define MPP_DEC_QUERY_DEC_IN_PKT (0x00000010)
27#define MPP_DEC_QUERY_DEC_WORK (0x00000020)
28#define MPP_DEC_QUERY_DEC_OUT_FRM (0x00000040)
29
30#define MPP_DEC_QUERY_ALL                                                                                              \
31    (MPP_DEC_QUERY_STATUS | MPP_DEC_QUERY_WAIT | MPP_DEC_QUERY_FPS | MPP_DEC_QUERY_BPS | MPP_DEC_QUERY_DEC_IN_PKT |    \
32     MPP_DEC_QUERY_DEC_WORK | MPP_DEC_QUERY_DEC_OUT_FRM)
33
34typedef struct MppDecQueryCfg_t {
35    /*
36     * 32 bit query flag for query data check
37     * Each bit represent a query data switch.
38     * bit 0 - for querying decoder runtime status
39     * bit 1 - for querying decoder runtime waiting status
40     * bit 2 - for querying decoder realtime decode fps
41     * bit 3 - for querying decoder realtime input bps
42     * bit 4 - for querying decoder input packet count
43     * bit 5 - for querying decoder start hardware times
44     * bit 6 - for querying decoder output frame count
45     */
46    unsigned int query_flag;
47
48    /* 64 bit query data output */
49    unsigned int rt_status;
50    unsigned int rt_wait;
51    unsigned int rt_fps;
52    unsigned int rt_bps;
53    unsigned int dec_in_pkt_cnt;
54    unsigned int dec_hw_run_cnt;
55    unsigned int dec_out_frm_cnt;
56} MppDecQueryCfg;
57
58#endif /* __RK_VDEC_CMD_H__ */