hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
 * Copyright 2021 Rockchip Electronics Co. LTD
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
#ifndef __MPP_SERVICE_IMPL_H__
#define __MPP_SERVICE_IMPL_H__
 
#include "mpp_device.h"
#include "mpp_service.h"
 
#define MAX_REG_OFFSET          32
#define MAX_RCB_OFFSET          32
#define MAX_INFO_COUNT          16
 
typedef struct FdTransInfo_t {
    RK_U32          reg_idx;
    RK_U32          offset;
} RegOffsetInfo;
 
typedef struct RcbInfo_t {
    RK_U32          reg_idx;
    RK_U32          size;
} RcbInfo;
 
typedef struct MppDevMppService_t {
    RK_S32          client_type;
    RK_S32          client;
    RK_S32          server;
    void            *serv_ctx;
    RK_S32          batch_io;
    MppCbCtx        *dev_cb;
 
    MppReqV1        *reqs;
    RK_S32          req_max;
    RK_S32          req_cnt;
 
    RegOffsetInfo   *reg_offset_info;
    RK_S32          reg_offset_max;
    RK_S32          reg_offset_count;
    RK_S32          reg_offset_pos;
 
    RcbInfo         *rcb_info;
    RK_S32          rcb_max;
    RK_S32          rcb_count;
    RK_S32          rcb_pos;
 
    MppDevBatCmd    bat_cmd;
 
    RK_S32          info_count;
    MppDevInfoCfg   info[MAX_INFO_COUNT];
 
    /* support max cmd buttom  */
    const MppServiceCmdCap *cap;
    RK_U32          support_set_info;
    RK_U32          support_set_rcb_info;
    RK_U32          support_hw_irq;
} MppDevMppService;
 
#ifdef  __cplusplus
extern "C" {
#endif
 
RK_S32 mpp_service_ioctl(RK_S32 fd, RK_U32 cmd, RK_U32 size, void *param);
RK_S32 mpp_service_ioctl_request(RK_S32 fd, MppReqV1 *req);
MPP_RET mpp_service_check_cmd_valid(RK_U32 cmd, const MppServiceCmdCap *cap);
 
#ifdef  __cplusplus
}
#endif
 
#endif /* __MPP_SERVICE_IMPL_H__ */