xref: /aosp_15_r20/external/intel-media-driver/media_softlet/agnostic/common/hw/mhw_render_itf.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2021, 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     mhw_render_itf.h
24 //! \brief    MHW RENDER interface common base
25 //! \details
26 //!
27 
28 #ifndef __MHW_RENDER_ITF_H__
29 #define __MHW_RENDER_ITF_H__
30 
31 #include "mhw_itf.h"
32 #include "mhw_render_cmdpar.h"
33 #include "mhw_mi_itf.h"
34 
35 #define _RENDER_CMD_DEF(DEF)                \
36     DEF(PIPELINE_SELECT);                   \
37     DEF(STATE_BASE_ADDRESS);                \
38     DEF(_3DSTATE_CHROMA_KEY);               \
39     DEF(PALETTE_ENTRY);                     \
40     DEF(STATE_SIP);                         \
41     DEF(GPGPU_CSR_BASE_ADDRESS);            \
42     DEF(_3DSTATE_BINDING_TABLE_POOL_ALLOC); \
43     DEF(CFE_STATE);                         \
44     DEF(COMPUTE_WALKER);                    \
45     DEF(STATE_COMPUTE_MODE)
46 
47 namespace mhw
48 {
49 namespace render
50 {
51 class Itf
52 {
53 public:
54     class ParSetting
55     {
56     public:
57         virtual ~ParSetting() = default;
58         _RENDER_CMD_DEF(_MHW_SETPAR_DEF);
59     };
60 
61     virtual ~Itf() = default;
62 
63     virtual MOS_STATUS EnableL3Caching(MHW_RENDER_ENGINE_L3_CACHE_SETTINGS *cacheSettings) = 0;
64     // legacy MHW interface will be removed for another pr
65     virtual MOS_STATUS SetL3Cache(PMOS_COMMAND_BUFFER cmdBuffer, std::shared_ptr<mhw::mi::Itf> miItf) = 0;
66 
67     virtual MOS_STATUS EnablePreemption(PMOS_COMMAND_BUFFER cmdBuffer, std::shared_ptr<mhw::mi::Itf> miItf) = 0;
68 
69     virtual MOS_STATUS InitMmioRegisters() = 0;
70 
71     virtual PMHW_MI_MMIOREGISTERS GetMmioRegisters() = 0;
72 
73     virtual MOS_STATUS AllocateHeaps(MHW_STATE_HEAP_SETTINGS stateHeapSettings) = 0;
74 
75     virtual PMHW_STATE_HEAP_INTERFACE GetStateHeapInterface() = 0;
76 
77     virtual bool IsPreemptionEnabled() =0;
78 
79     virtual void GetSamplerResolutionAlignUnit(bool isAVSSampler, uint32_t &widthAlignUnit, uint32_t &heightAlignUnit) = 0;
80 
81     virtual MHW_RENDER_ENGINE_CAPS* GetHwCaps() = 0;
82 
83     virtual MHW_RENDER_ENGINE_L3_CACHE_CONFIG* GetL3CacheConfig() = 0;
84 
85     virtual MOS_STATUS SetupInlineData() = 0;
86 
87     _RENDER_CMD_DEF(_MHW_CMD_ALL_DEF_FOR_ITF);
88 MEDIA_CLASS_DEFINE_END(mhw__render__Itf)
89 };
90 }  // namespace render
91 }  // namespace mhw
92 #endif  // __MHW_RENDER_ITF_H__
93