File: mos_os_cp_interface_specific.h

package info (click to toggle)
intel-media-driver 21.1.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 108,772 kB
  • sloc: cpp: 1,078,942; ansic: 164,231; asm: 45,336; python: 554; sh: 177; makefile: 13
file content (242 lines) | stat: -rw-r--r-- 5,704 bytes parent folder | download | duplicates (2)
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/*
* Copyright (c) 2009-2017, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
//!
//! \file     mos_os_cp_interface_specific.h
//! \brief    OS specific implement for CP related functions
//!

#ifndef __MOS_OS_CP_INTERFACE_SPECIFIC_H__
#define __MOS_OS_CP_INTERFACE_SPECIFIC_H__

#include "mos_defs.h"
#include "mos_os_hw.h"
#include "mos_util_debug.h"

static void OsStubMessage()
{
    MOS_NORMALMESSAGE(
        MOS_COMPONENT_CP,
        MOS_CP_SUBCOMP_OS,
        "This function is stubbed as CP is not enabled.");
}

class MosCpInterface
{
public:
    MosCpInterface() {}

    virtual ~MosCpInterface() {}

    virtual MOS_STATUS RegisterPatchForHM(
        uint32_t *     pPatchAddress,
        uint32_t       bWrite,
        MOS_HW_COMMAND HwCommandType,
        uint32_t       forceDwordOffset,
        void *         plResource,
        void *         pPatchLocationList)

    {
        MOS_UNUSED(pPatchAddress);
        MOS_UNUSED(bWrite);
        MOS_UNUSED(HwCommandType);
        MOS_UNUSED(forceDwordOffset);
        MOS_UNUSED(plResource);
        MOS_UNUSED(pPatchLocationList);

        OsStubMessage();
        return MOS_STATUS_SUCCESS;
    }

    virtual MOS_STATUS PermeatePatchForHM(
        void *virt,
        void *pvCurrentPatch,
        void *resource)
    {
        MOS_UNUSED(virt);
        MOS_UNUSED(pvCurrentPatch);
        MOS_UNUSED(resource);

        OsStubMessage();
        return MOS_STATUS_SUCCESS;
    }

    virtual MOS_STATUS PermeateBBPatchForHM()
    {
        OsStubMessage();
        return MOS_STATUS_SUCCESS;
    }

    virtual bool IsCpEnabled()
    {
        OsStubMessage();
        return false;
    }

    virtual void SetCpEnabled(bool bIsCpEnabled)
    {
        OsStubMessage();
    }

    virtual bool IsHMEnabled()
    {
        OsStubMessage();
        return false;
    }

    virtual bool IsTSEnabled()
    {
        OsStubMessage();
        return false;
    }

    virtual bool IsIDMEnabled()
    {
        OsStubMessage();
        return false;
    }

    virtual bool IsSMEnabled()
    {
        OsStubMessage();
        return false;
    }

    virtual bool IsTearDownHappen()
    {
        OsStubMessage();
        return false;
    }

    virtual MOS_STATUS SetResourceEncryption(
        void *pResource,
        bool  bEncryption)

    {
        MOS_UNUSED(pResource);
        MOS_UNUSED(bEncryption);

        OsStubMessage();
        return MOS_STATUS_UNIMPLEMENTED;
    }

    virtual MOS_STATUS PrepareResources(
        void *   source[],
        uint32_t sourceCount,
        void *   target[],
        uint32_t targetCount)
    {
        MOS_UNUSED(source);
        MOS_UNUSED(sourceCount);
        MOS_UNUSED(target);
        MOS_UNUSED(targetCount);

        OsStubMessage();
        return MOS_STATUS_SUCCESS;
    }

    virtual bool RenderBlockedFromCp()
    {
        OsStubMessage();
        return false;
    }

    virtual MOS_STATUS AllocateTEEPhysicalBuffer(
        void        **ppTEEBuffer,
        uint32_t    *pBufferSize)
    {
        MOS_UNUSED(ppTEEBuffer);
        MOS_UNUSED(pBufferSize);

        OsStubMessage();
        return MOS_STATUS_SUCCESS;
    }

    virtual MOS_STATUS DeAllocateTEEPhysicalBuffer(
        void      *pTEEBuffer)
    {
        MOS_UNUSED(pTEEBuffer);

        OsStubMessage();
        return MOS_STATUS_SUCCESS;
    }

    virtual MOS_STATUS GetTK(
        uint32_t **ppTKs,
        uint32_t * pTKsSize,
        uint32_t * pTKsUpdateCnt)
    {
        MOS_UNUSED(ppTKs);
        MOS_UNUSED(pTKsSize);
        MOS_UNUSED(pTKsUpdateCnt);

        OsStubMessage();
        return MOS_STATUS_SUCCESS;
    }

    MOS_STATUS ReadCtrNounceRegister(bool readCtr0, uint32_t *pCounter)
    {
        MOS_UNUSED(readCtr0);
        MOS_UNUSED(pCounter);

        OsStubMessage();
        return MOS_STATUS_UNIMPLEMENTED;
    }

    void *GetOcaDumper()
    {
        OsStubMessage();
        return nullptr;
    }

    MOS_STATUS CreateOcaDumper()
    {
        OsStubMessage();
        return MOS_STATUS_SUCCESS;
    }

    virtual bool CpRegisterAccessible()
    {
        OsStubMessage();
        return false;
    }
};

//!
//! \brief    Create MosCpInterface Object
//!           Must use Delete_MosCpInterface to delete created Object to avoid ULT Memory Leak errors
//!
//! \param    [in] pvOsInterface
//!           void*
//!
//! \return   Return CP Wrapper Object
//!
MosCpInterface* Create_MosCpInterface(void* pvOsInterface);

//!
//! \brief    Delete the MosCpInterface Object
//!
//! \param    [in] pMosCpInterface
//!           MosCpInterface
//!
void Delete_MosCpInterface(MosCpInterface* pMosCpInterface);

#endif  // __MOS_OS_CP_SPECIFIC_H__