xref: /aosp_15_r20/external/intel-media-driver/media_softlet/linux/common/os/mos_oca_defs_specific.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2022, 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_oca_defs_specific.h
24 //! \brief    Linux specfic OCA struct
25 //!
26 
27 #ifndef __MOS_OCA_DEFS_SPECIFIC_H__
28 #define __MOS_OCA_DEFS_SPECIFIC_H__
29 
30 #include "mos_oca_defs.h"
31 #include <cstdint>
32 
33 typedef struct _MOS_OCA_BUFFER_CONFIG
34 {
35     uint32_t            maxResInfoCount = 0;                                                                //!< Max resource info count.
36 }MOS_OCA_BUFFER_CONFIG;
37 
38 /****************************************************************************************************/
39 /*                                      OCA LOG HEADERS                                             */
40 /****************************************************************************************************/
41 typedef struct _MOS_OCA_RESOURCE_INFO
42 {
43     uint64_t                    gfxAddress;
44     uint64_t                    sizeAllocation;
45     uint64_t                    sizeSurface;
46     uint64_t                    sizeSurfacePhy;
47     uint64_t                    sizeMainSurface;
48     uint64_t                    allocationHandle;
49     uint32_t                    hwCmdType;
50     uint32_t                    locationInCmd;
51     uint32_t                    offsetInRes;
52     uint32_t                    pitch;
53     uint32_t                    width;
54     uint32_t                    height;
55     uint32_t                    format;
56     uint32_t                    gmmFormat;
57     uint32_t                    gmmTileMode;
58     uint32_t                    gmmClient;
59     uint32_t                    gmmResUsageType;
60     uint32_t                    mmcMode;
61     uint32_t                    mmcHint;
62     uint64_t                    auxYOffset;
63     uint64_t                    auxUVOffset;
64     uint64_t                    auxCCSOffset;
65     uint64_t                    auxCCOffset;
66     struct {
67         uint32_t                isLocalOnly         : 1;
68         uint32_t                isNonLocalOnly      : 1;
69         uint32_t                isNotLockable       : 1;
70         uint32_t                isShared            : 1;
71         uint32_t                isCameraCapture     : 1;
72         uint32_t                isRenderTarget      : 1;
73     } flags;
74 }MOS_OCA_RESOURCE_INFO, *PMOS_OCA_RESOURCE_INFO;
75 
76 struct MOS_OCA_BUF_CONTEXT
77 {
78     bool                                inUse                 = false;
79     bool                                is1stLevelBBStarted   = false;
80     struct
81     {
82         uint64_t                        *base                 = nullptr;
83         uint32_t                        offset                = 0;
84         struct {
85             uint32_t                    maxResInfoCount       = 0;
86             MOS_OCA_RESOURCE_INFO       *resInfoList          = nullptr;
87             uint32_t                    resCount              = 0;
88             uint32_t                    resCountSkipped       = 0;
89         } resInfo;
90     } logSection;
91 
92 };
93 
94 struct OCA_LOG_SECTION_HEADER
95 {
96     uint64_t magicNum = 0;
97     uint64_t rtlogPatchAddr = 0;
98 };
99 
100 #pragma pack(push)
101 #pragma pack(8)
102 struct MOS_OCA_EXEC_LIST_INFO
103 {
104     int             handle;
105     uint64_t        size;
106     uint64_t        offset64;
107     int             flags;
108     int             mem_region;
109     bool            is_batch;
110 };
111 #pragma pack(pop)
112 
113 typedef struct _MOS_OCA_LOG_HEADER_EXEC_LIST_INFO
114 {
115     MOS_OCA_LOG_HEADER header;
116     uint32_t           count;            // exec bo count dumped.
117     uint32_t           reserved;         // reserved
118 } MOS_OCA_LOG_HEADER_EXEC_LIST_INFO, *PMOS_OCA_LOG_HEADER_EXEC_LIST_INFO;
119 
120 #endif // #ifndef __MOS_OCA_DEFS_SPECIFIC_H__
121