1 /*
2  * Copyright © 2014 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
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  * Authors:
25  *     Wei Lin<wei.w.lin@intel.com>
26  *     Yuting Yang<yuting.yang@intel.com>
27  */
28 
29 #ifndef __GENHW_H__
30 #define __GENHW_H__
31 
32 #include "gen_hw_common.h"
33 #include "os_utilities.h"
34 #include "os_util_debug.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #define GENHW_HW_ASSERT(_expr)                                                       \
41     GENOS_ASSERT(GENOS_COMPONENT_HW, GENOS_HW_SUBCOMP_HW, _expr)
42 
43 #define GENHW_HW_ASSERTMESSAGE(_message, ...)                                        \
44     GENOS_ASSERTMESSAGE(GENOS_COMPONENT_HW, GENOS_HW_SUBCOMP_HW, _message, ##__VA_ARGS__)
45 
46 #define GENHW_HW_NORMALMESSAGE(_message, ...)                                        \
47     GENOS_NORMALMESSAGE(GENOS_COMPONENT_HW, GENOS_HW_SUBCOMP_HW, _message, ##__VA_ARGS__)
48 
49 #define GENHW_HW_CHK_NULL(_ptr)                                                      \
50     GENOS_CHK_NULL(GENOS_COMPONENT_HW, GENOS_HW_SUBCOMP_HW, _ptr)
51 
52 #define GENHW_HW_CHK_STATUS(_stmt)                                                   \
53     GENOS_CHK_STATUS(GENOS_COMPONENT_HW, GENOS_HW_SUBCOMP_HW, _stmt)
54 
55 #define GENHW_PUBLIC_ASSERT(_expr)                                                   \
56     GENOS_ASSERT(GENOS_COMPONENT_HW, GENOS_HW_SUBCOMP_PUBLIC, _expr)
57 
58 #define GENHW_PUBLIC_ASSERTMESSAGE(_message, ...)                                    \
59     GENOS_ASSERTMESSAGE(GENOS_COMPONENT_HW, GENOS_HW_SUBCOMP_PUBLIC, _message, ##__VA_ARGS__)
60 
61 	typedef struct _GENHW_HW_INTERFACE *PGENHW_HW_INTERFACE;
62 
63 	typedef struct _GENHW_SETTINGS {
64 		INT iMediaStates;
65 	} GENHW_SETTINGS, *PGENHW_SETTINGS;
66 
67 	typedef CONST GENHW_SETTINGS CGENHW_SETTINGS, *PCGENHW_SETTINGS;
68 
69 	typedef struct _GENHW_SURFACE {
70 		RECT rcSrc;
71 		RECT rcDst;
72 		RECT rcMaxSrc;
73 
74 		DWORD dwWidth;
75 		DWORD dwHeight;
76 		DWORD dwPitch;
77 		GENOS_TILE_TYPE TileType;
78 
79 		GENHW_PLANE_OFFSET YPlaneOffset;
80 		GENHW_PLANE_OFFSET UPlaneOffset;
81 		GENHW_PLANE_OFFSET VPlaneOffset;
82 
83 		GENOS_FORMAT Format;
84 		GENHW_SURFACE_TYPE SurfType;
85 		DWORD dwDepth;
86 		DWORD dwOffset;
87 		GENOS_RESOURCE OsResource;
88 
89 	} GENHW_SURFACE, *PGENHW_SURFACE;
90 
91 	typedef struct {
92 		PCGENHW_SETTINGS pcGenHwSettings;
93 	} GENHW_INITIALIZERS, *PGENHW_INITIALIZERS;
94 
95 	GENOS_STATUS IntelGen_GetSurfaceInfo(PGENOS_INTERFACE pOsInterface,
96 					     PGENHW_SURFACE pSurface);
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 #endif
102