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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
/*
* Samsung Exynos SoC series VPU driver
*
* Copyright (c) 2016 Samsung Electronics Co., Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef VPUL_HWMAPPER_H_
#define VPUL_HWMAPPER_H_
#include "vpu-hardware.h"
#include "vpul-ds.h"
/** \addtogroup VPUL-HwMapper
* @{
*/
/**
* \name Resource Get Bit Flags definitions
* \brief Bit flags for "flags" argument to vpu_resource_get.
* \li various combinations of those flag values are possible
* \li each flag is represented here by its bit-number the corresponding
* mask value would be 1 << bit-number
* @{
*/
/**
* \brief Specifies that PU will not be allocated, and PU sepcified in
* task will remain.
*/
#define VPUL_GRAPH_FLAG_FIXED 0
/**
* \brief
* Specifies that a resource (PU instance / MPRB) can be re-used in
* different sub-chains of same task.
* \details
* Specifies that a resource (PU instance / MPRB) can be re-used in
* different sub-chains of same task.
* If this option is NOT selected, when trying to allocate resources for a
* specific subchain, resources already
* allocated to other subchains in task are not available for allocation.
*/
#define VPUL_GRAPH_FLAG_SHARED_AMONG_SUBCHAINS 1
/**
* \brief
* Should HW mapper prefer allocate while sharing between subchains.
* \note
* This flag applies only if VPUL_GRAPH_FLAG_SHARED_AMONG_SUBCHAINS is set
* \details
* Should HW mapper prefer allocate while sharing between subchains.
* \li flag set : will first try to allocate resources already allocated to
* other subchains in task, and only if this fails - try to
* allocate resources not allocated to other subchains
* \li flag cleared : will first try to allocate resources not allocated to
* other subchains in task, and only if this fails - try to
* allocate resources already allocated to other subchains
*/
#define VPUL_GRAPH_FLAG_SHARING_AMONG_SUBCHAINS_PREFERRED 2
/**
* \brief
* Specifies that a resource (PU instance / MPRB) can be concurrently
* allocated to different tasks.
* \details
* Specifies that a resource (PU instance / MPRB) can be concurrently
* allocated to different tasks.
* If this option is NOT selected, resources
* already allocated to other tasks are not available for allocation in this
* task.
*/
#define VPUL_GRAPH_FLAG_SHARED_AMONG_TASKS 3
/**
* \brief Specifies sharing of resources with other tasks
* \note
* this flag applies only if VPUL_GRAPH_FLAG_SHARED_AMONG_TASKS is set
* \details
* Specifies sharing of resources with other tasks
* \li flag set : will first try to allocate resources already allocated to
* other tasks, and only if this fails - try to allocate
* resources not allocated to other tasks
* \li flag cleared : will first try to allocate resources not allocated to
* other tasks, and only if this fails - try to allocate
* resources already allocated to other tasks
*/
#define VPUL_GRAPH_FLAG_SHARING_AMONG_TASKS_PREFERRED 4
/**
* \brief Specifies that HW mapper should not try to balance
* sub-chains latency.
* \details Specifies that HW mapper should not try to balance
* sub-chains latency
*/
#define VPUL_GRAPH_FLAG_DSBL_LATENCY_BALANCING 5
/**
* \brief Flag to change small MPRB to large
*/
#define VPUL_STATIC_ALLOC_LARGE_MPRB_INSTEAD_SMALL_FLAG (6)
#define VPUL_STATIC_ALLOC_LARGE_INSTEAD_SMALL_MPRB_MASK (0x40)
/**
* \brief Flag to set which pu need change
* MPRB from small to large
*/
#define VPUL_STATIC_ALLOC_PU_INSTANCE_LSB (7)
#define VPUL_STATIC_ALLOC_PU_INSTANCE_MASK (0xFF)
/** @}*/
extern const enum VPU_PU_TYPES pu_inst2type[];
/**
* \brief Allocates resource to a task according to availability in system.
* \param vpu_hw VPU HW resource availability representation
* \param task VPU task for which resources are required
* \param flags indicates mode of operation
* as defined in Resource Get Bit Flags definitions
*
*/
__s32 __vpu_resource_get(struct vpu_hardware *vpu_hw,
struct vpul_task *task, __u32 flags);
/**
* \brief De-Allocates resource from task back to VPU system representation.
* \param vpu_hw VPU HW resource availability representation
* \param task VPU task for which resources are required
*/
__s32 __vpu_resource_put(struct vpu_hardware *vpu_hw,
struct vpul_task *task);
/** @}*/
#endif
|