1 /*==============================================================================
2 Copyright(c) 2017 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 #pragma once
24 
25 
26 #define __STR2__(x) #x
27 #define __STR1__(x) __STR2__(x)
28 #define __LOC__ __FILE__ "(" __STR1__(__LINE__) ") : Warning Msg: "
29 #define __LOC2__ __FILE__ "(" __STR1__(__LINE__) ") : "
30 //#pragma message(__LOC2__ "Header Message")
31 
32 #ifndef _WIN32
33 #include <portable_compiler.h>
34 #endif
35 
36 #if !defined(GMM_DIAG_APP_DIRECTIVE)
37 
38     #include "../../../../inc/umKmInc/sharedata.h"
39 
40     #include "../../../../inc/common/igfxfmid.h"       // Contains platform families
41     #include "../../../../inc/common/gfxplatform.h"    // __GFX_MACRO_C__  must be defined before
42     #include "../../../../inc/common/gfxmacro.h"       // including gfxplatform.h. See Preprocessor settings
43                                                        // has MACRO ops like POW2, MASK, etc.
44     #include "External/Common/GmmDebug.h"              // GMM definitions for assert and printf
45 
46 #else
47 
48     #define DRIVER_VERSION_INFO uint32_t
49 #endif
50 
51 //For compile time GFXGEN detection. GMM_GFX_GEN is optional cmd line definition
52 #if (!defined(GMM_GFX_GEN) || (GMM_GFX_GEN == 80))
53     #define GMM_ENABLE_GEN8 1
54 #else
55     #define GMM_ENABLE_GEN8 0
56 #endif
57 
58 #if (!defined(GMM_GFX_GEN) || (GMM_GFX_GEN == 90))
59     #define GMM_ENABLE_GEN9 1
60 #else
61     #define GMM_ENABLE_GEN9 0
62 #endif
63 
64 #if (!defined(GMM_GFX_GEN) || (GMM_GFX_GEN == 100))
65     #define GMM_ENABLE_GEN10 1
66 #else
67     #define GMM_ENABLE_GEN10 0
68 #endif
69 
70 #if (!defined(GMM_GFX_GEN) || (GMM_GFX_GEN == 110))
71     #define GMM_ENABLE_GEN11 1
72 #else
73     #define GMM_ENABLE_GEN11 0
74 #endif
75 
76 #if (!defined(GMM_GFX_GEN) || (GMM_GFX_GEN == 120))
77 #define GMM_ENABLE_GEN12 1
78 #else
79 #define GMM_ENABLE_GEN12 0
80 #endif
81 
82 
83 #if (IGFX_GEN >= IGFX_GEN11)
84     #if !(GMM_ENABLE_GEN8 || GMM_ENABLE_GEN9 || GMM_ENABLE_GEN10 || \
85         GMM_ENABLE_GEN11 || GMM_ENABLE_GEN12)
86     #error "Unrecognized GMM_GFX_GEN !"
87     #endif
88 #elif (IGFX_GEN >= IGFX_GEN10)
89     #if !(GMM_ENABLE_GEN8 || GMM_ENABLE_GEN9 || GMM_ENABLE_GEN10)
90     #error "Unrecognized GMM_GFX_GEN !"
91     #endif
92 #else
93     #if !(GMM_ENABLE_GEN8 || GMM_ENABLE_GEN9)
94     #error "Unrecognized GMM_GFX_GEN !"
95     #endif
96 #endif
97 
98