]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - drivers/media/pci/intel/ipu6/ipu-platform-resources.h
UBUNTU: SAUCE: IPU driver release WW14
[mirror_ubuntu-jammy-kernel.git] / drivers / media / pci / intel / ipu6 / ipu-platform-resources.h
CommitLineData
f2efa4ee
WY
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (C) 2018 - 2020 Intel Corporation */
3
4#ifndef IPU_PLATFORM_RESOURCES_COMMON_H
5#define IPU_PLATFORM_RESOURCES_COMMON_H
6
7#define IPU_FW_PSYS_N_PADDING_UINT8_IN_PROGRAM_MANIFEST 0
8
9#define IPU_FW_PSYS_N_PADDING_UINT8_IN_PROCESS_STRUCT 0
10#define IPU_FW_PSYS_N_PADDING_UINT8_IN_PROCESS_GROUP_STRUCT 2
11#define IPU_FW_PSYS_N_PADDING_UINT8_IN_PROGRAM_MANIFEST_EXT 2
12
13#define IPU_FW_PSYS_N_PADDING_UINT8_IN_TERMINAL_STRUCT 5
14
15#define IPU_FW_PSYS_N_PADDING_UINT8_IN_PARAM_TERMINAL_STRUCT 6
16
17#define IPU_FW_PSYS_N_PADDING_UINT8_IN_DATA_TERMINAL_STRUCT 3
18
19#define IPU_FW_PSYS_N_PADDING_UINT8_IN_FRAME_DESC_STRUCT 3
20#define IPU_FW_PSYS_N_FRAME_PLANES 6
21#define IPU_FW_PSYS_N_PADDING_UINT8_IN_FRAME_STRUCT 4
22
23#define IPU_FW_PSYS_N_PADDING_UINT8_IN_BUFFER_SET_STRUCT 1
24
25#define IPU_FW_PSYS_MAX_INPUT_DEC_RESOURCES 4
26#define IPU_FW_PSYS_MAX_OUTPUT_DEC_RESOURCES 4
27
28#define IPU_FW_PSYS_PROCESS_MAX_CELLS 1
29#define IPU_FW_PSYS_KERNEL_BITMAP_NOF_ELEMS 4
30#define IPU_FW_PSYS_RBM_NOF_ELEMS 5
31#define IPU_FW_PSYS_KBM_NOF_ELEMS 4
32
33struct ipu_fw_psys_process {
34 s16 parent_offset;
35 u8 size;
36 u8 cell_dependencies_offset;
37 u8 terminal_dependencies_offset;
38 u8 process_extension_offset;
39 u8 ID;
40 u8 program_idx;
41 u8 state;
42 u8 cells[IPU_FW_PSYS_PROCESS_MAX_CELLS];
43 u8 cell_dependency_count;
44 u8 terminal_dependency_count;
45};
46
47struct ipu_fw_psys_program_manifest {
48 u32 kernel_bitmap[IPU_FW_PSYS_KERNEL_BITMAP_NOF_ELEMS];
49 s16 parent_offset;
50 u8 program_dependency_offset;
51 u8 terminal_dependency_offset;
52 u8 size;
53 u8 program_extension_offset;
54 u8 program_type;
55 u8 ID;
56 u8 cells[IPU_FW_PSYS_PROCESS_MAX_CELLS];
57 u8 cell_type_id;
58 u8 program_dependency_count;
59 u8 terminal_dependency_count;
60};
61
62/* platform specific resource interface */
63struct ipu_psys_resource_pool;
64struct ipu_psys_resource_alloc;
65struct ipu_fw_psys_process_group;
66int ipu_psys_allocate_resources(const struct device *dev,
67 struct ipu_fw_psys_process_group *pg,
68 void *pg_manifest,
69 struct ipu_psys_resource_alloc *alloc,
70 struct ipu_psys_resource_pool *pool);
71int ipu_psys_move_resources(const struct device *dev,
72 struct ipu_psys_resource_alloc *alloc,
73 struct ipu_psys_resource_pool *source_pool,
74 struct ipu_psys_resource_pool *target_pool);
75
76void ipu_psys_resource_copy(struct ipu_psys_resource_pool *src,
77 struct ipu_psys_resource_pool *dest);
78
79int ipu_psys_try_allocate_resources(struct device *dev,
80 struct ipu_fw_psys_process_group *pg,
81 void *pg_manifest,
82 struct ipu_psys_resource_pool *pool);
83
af60d6fc
WY
84void ipu_psys_reset_process_cell(const struct device *dev,
85 struct ipu_fw_psys_process_group *pg,
86 void *pg_manifest,
87 int process_count);
f2efa4ee
WY
88void ipu_psys_free_resources(struct ipu_psys_resource_alloc *alloc,
89 struct ipu_psys_resource_pool *pool);
90
91int ipu_fw_psys_set_proc_dfm_bitmap(struct ipu_fw_psys_process *ptr,
92 u16 id, u32 bitmap,
93 u32 active_bitmap);
94
95int ipu_psys_allocate_cmd_queue_resource(struct ipu_psys_resource_pool *pool);
96void ipu_psys_free_cmd_queue_resource(struct ipu_psys_resource_pool *pool,
97 u8 queue_id);
98
99extern const struct ipu_fw_resource_definitions *ipu6_res_defs;
100extern const struct ipu_fw_resource_definitions *ipu6se_res_defs;
eaffc3a7 101extern const struct ipu_fw_resource_definitions *ipu6ep_res_defs;
f2efa4ee
WY
102extern struct ipu6_psys_hw_res_variant hw_var;
103#endif /* IPU_PLATFORM_RESOURCES_COMMON_H */