Debian Codegraph @

media_softlet/linux/common/os/xe/mos_gpucontext_specific_next_xe.h

raw
1 /*
2 * Copyright (c) 2023, Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22 //!
23 //! \file mos_gpucontext_specific_next_xe.h
24 //! \brief Container class for the linux/Android specfic gpu context
25 //!
26
27 #ifndef __GPU_CONTEXT_SPECIFIC_NEXT_XE_H__
28 #define __GPU_CONTEXT_SPECIFIC_NEXT_XE_H__
29
30 #include "mos_bufmgr_xe.h"
31 #include "mos_gpucontext_specific_next.h"
32
33 //!
34 //! \class GpuContextSpecific
35 //! \brief Linux/Android specific gpu context
36 //!
37 class GpuContextSpecificNextXe : public GpuContextSpecificNext
38 {
39 public:
40 //!
41 //! \brief Constructor
42 //!
43 GpuContextSpecificNextXe(
44 const MOS_GPU_NODE gpuNode,
45 CmdBufMgrNext *cmdBufMgr,
46 GpuContextNext *reusedContext) : GpuContextSpecificNext(gpuNode, cmdBufMgr, reusedContext){}
47
48 //!
49 //! \brief Destructor
50 //!
51 ~GpuContextSpecificNextXe();
52
53 virtual MOS_STATUS SubmitCommandBuffer(
54 MOS_STREAM_HANDLE streamState,
55 PMOS_COMMAND_BUFFER cmdBuffer,
56 bool nullRendering) override;
57
58 //!
59 //! \brief Set the Gpu priority for workload scheduling.
60 //! \param [in] priority
61 //! priority to set for current workload.
62 //! \return void
63 //!
64 virtual void UpdatePriority(int32_t priority) override;
65
66 //!
67 //! \brief Allocate gpu status buffer for gpu sync
68 //! \return MOS_STATUS
69 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
70 //!
71 //MOS_STATUS AllocateGPUStatusBuf();
72
73 protected:
74 virtual MOS_STATUS ReportEngineInfo(
75 void *engine_map,
76 int engineNum, bool engineSelectEnable = false) override;
77
78 virtual MOS_STATUS Init3DCtx(PMOS_CONTEXT osParameters,
79 PMOS_GPUCTX_CREATOPTIONS createOption,
80 unsigned int *nengine,
81 void *engine_map) override;
82
83 virtual MOS_STATUS InitComputeCtx(PMOS_CONTEXT osParameters,
84 unsigned int *nengine,
85 void *engine_map,
86 MOS_GPU_NODE gpuNode,
87 bool *isEngineSelectEnable) override;
88
89 virtual MOS_STATUS InitVdVeCtx(PMOS_CONTEXT osParameters,
90 MOS_STREAM_HANDLE streamState,
91 PMOS_GPUCTX_CREATOPTIONS createOption,
92 unsigned int *nengine,
93 void *engine_map,
94 MOS_GPU_NODE gpuNode,
95 bool *isEngineSelectEnable) override;
96
97 virtual MOS_STATUS InitBltCtx(PMOS_CONTEXT osParameters,
98 unsigned int *nengine,
99 void *engine_map) override;
100
101 virtual int32_t ParallelSubmitCommands(std::map<uint32_t, PMOS_COMMAND_BUFFER> secondaryCmdBufs,
102 PMOS_CONTEXT osContext,
103 uint32_t execFlag,
104 int32_t dr4) override;
105
106 virtual MOS_STATUS PatchCommandBuffer(MOS_STREAM_HANDLE streamState,
107 PMOS_COMMAND_BUFFER cmdBuffer);
108
109 virtual MOS_STATUS EndSubmitCommandBuffer(MOS_STREAM_HANDLE streamState,
110 PMOS_COMMAND_BUFFER cmdBuffer,
111 bool cmdBufMapIsReused);
112
113 private:
114 void ClearSecondaryCmdBuffer(bool cmdBufMapIsReused);
115
116 MEDIA_CLASS_DEFINE_END(GpuContextSpecificNextXe)
117 };
118 #endif // __GPU_CONTEXT_SPECIFIC_NEXT_XE_H__