[VP] Full support of Gen9 CML kernel integration

Full support of Gen9 CML kernel integration
Stay the same compile option as Gen9
v20190405
http://ubit-gfx.intel.com/build/6522821

Change-Id: I967d7ef820abcdeac91a11d369ade1982c089984
diff --git a/media_driver/agnostic/gen9/vp/kernel/media_srcs.cmake b/media_driver/agnostic/gen9/vp/kernel/media_srcs.cmake
index a82e8ad..60978a6 100755
--- a/media_driver/agnostic/gen9/vp/kernel/media_srcs.cmake
+++ b/media_driver/agnostic/gen9/vp/kernel/media_srcs.cmake
@@ -21,13 +21,11 @@
 set(TMP_SOURCES_
     ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_g9.c
     ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_isa_g9.c
-    ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_g9_cml.c
 )
 
 set(TMP_HEADERS_
     ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_g9.h
     ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_isa_g9.h
-    ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_g9_cml.h
 )
 
 set(SOURCES_
diff --git a/media_driver/agnostic/gen9_cml/media_srcs.cmake b/media_driver/agnostic/gen9_cml/media_srcs.cmake
new file mode 100644
index 0000000..243d57b
--- /dev/null
+++ b/media_driver/agnostic/gen9_cml/media_srcs.cmake
@@ -0,0 +1,21 @@
+# Copyright (c) 2019, Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+media_include_subdirectory(vp)
diff --git a/media_driver/agnostic/gen9/vp/kernel/igvpkrn_g9_cml.c b/media_driver/agnostic/gen9_cml/vp/kernel/igvpkrn_g9_cml.c
similarity index 99%
rename from media_driver/agnostic/gen9/vp/kernel/igvpkrn_g9_cml.c
rename to media_driver/agnostic/gen9_cml/vp/kernel/igvpkrn_g9_cml.c
index 7a393e3..14a7206 100644
--- a/media_driver/agnostic/gen9/vp/kernel/igvpkrn_g9_cml.c
+++ b/media_driver/agnostic/gen9_cml/vp/kernel/igvpkrn_g9_cml.c
@@ -1,32 +1,32 @@
-/*
- * Copyright (c) 2019, Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * 'Software'), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
+/*                                                                                     
+ * Copyright (c) 2019, Intel Corporation                                               
+ *                                                                                     
+ * Permission is hereby granted, free of charge, to any person obtaining a             
+ * copy of this software and associated documentation files (the                       
+ * 'Software'), to deal in the Software without restriction, including                 
+ * without limitation the rights to use, copy, modify, merge, publish,                 
+ * distribute, sublicense, and/or sell copies of the Software, and to                  
+ * permit persons to whom the Software is furnished to do so, subject to               
+ * the following conditions:                                                           
+ *                                                                                     
+ * The above copyright notice and this permission notice shall be included             
+ * in all copies or substantial portions of the Software.                              
+ *                                                                                     
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS             
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF                          
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.              
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY                
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,                
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE                   
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                              
+*/                                                                                     
+                                                                                       
+////////////////////////////////////////////////////////////////////////////////       
+// !!! WARNING - AUTO GENERATED FILE. DO NOT EDIT DIRECTLY. !!!                        
+// Generated by KernelBinToSource.exe tool                                             
+////////////////////////////////////////////////////////////////////////////////       
 
-////////////////////////////////////////////////////////////////////////////////
-// !!! WARNING - AUTO GENERATED FILE. DO NOT EDIT DIRECTLY. !!!
-// Generated by KernelBinToSource.exe tool
-////////////////////////////////////////////////////////////////////////////////
-
-#ifdef IGFX_GEN9_SUPPORTED
+#ifdef IGFX_GEN9_CML_SUPPORTED
 extern const unsigned int IGVPKRN_G9_CML_SIZE = 1633728;
 extern const unsigned int IGVPKRN_G9_CML[] =
 {
diff --git a/media_driver/agnostic/gen9/vp/kernel/igvpkrn_g9_cml.h b/media_driver/agnostic/gen9_cml/vp/kernel/igvpkrn_g9_cml.h
similarity index 96%
rename from media_driver/agnostic/gen9/vp/kernel/igvpkrn_g9_cml.h
rename to media_driver/agnostic/gen9_cml/vp/kernel/igvpkrn_g9_cml.h
index 722039d..52e1746 100644
--- a/media_driver/agnostic/gen9/vp/kernel/igvpkrn_g9_cml.h
+++ b/media_driver/agnostic/gen9_cml/vp/kernel/igvpkrn_g9_cml.h
@@ -1,5 +1,5 @@
 /*                                                                                     
- * Copyright (c) 2019 Intel Corporation                                               
+ * Copyright (c) 2019, Intel Corporation                                               
  *                                                                                     
  * Permission is hereby granted, free of charge, to any person obtaining a             
  * copy of this software and associated documentation files (the                       
diff --git a/media_driver/agnostic/gen9_cml/vp/kernel/media_srcs.cmake b/media_driver/agnostic/gen9_cml/vp/kernel/media_srcs.cmake
new file mode 100644
index 0000000..d79f794
--- /dev/null
+++ b/media_driver/agnostic/gen9_cml/vp/kernel/media_srcs.cmake
@@ -0,0 +1,42 @@
+# Copyright (c) 2019, Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+set(TMP_SOURCES_
+    ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_g9_cml.c
+)
+
+set(TMP_HEADERS_
+    ${CMAKE_CURRENT_LIST_DIR}/igvpkrn_g9_cml.h
+)
+
+set(SOURCES_
+    ${SOURCES_}
+    ${TMP_SOURCES_}
+)
+
+set(HEADERS_
+    ${HEADERS_}
+    ${TMP_HEADERS_}
+)
+
+source_group( "Kernel\\VpKernel" FILES ${TMP_SOURCES_} ${TMP_HEADERS_} )
+
+
+media_add_curr_to_include_path()
diff --git a/media_driver/agnostic/gen9_cml/vp/media_srcs.cmake b/media_driver/agnostic/gen9_cml/vp/media_srcs.cmake
new file mode 100644
index 0000000..6a54a58
--- /dev/null
+++ b/media_driver/agnostic/gen9_cml/vp/media_srcs.cmake
@@ -0,0 +1,23 @@
+# Copyright (c) 2019, Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+if(ENABLE_KERNELS AND ENABLE_NONFREE_KERNELS)
+    media_include_subdirectory(kernel)
+endif()
diff --git a/media_driver/agnostic/media_srcs.cmake b/media_driver/agnostic/media_srcs.cmake
index c75cc3f..d0fe36a 100755
--- a/media_driver/agnostic/media_srcs.cmake
+++ b/media_driver/agnostic/media_srcs.cmake
@@ -205,6 +205,10 @@
     media_include_subdirectory(gen9)
 endif()
 
+if(GEN9_CML)
+    media_include_subdirectory(gen9_cml)
+endif()
+
 if(GEN9_BXT)
     media_include_subdirectory(gen9_bxt)
 endif()
diff --git a/media_driver/cmake/linux/media_gen_flags_linux.cmake b/media_driver/cmake/linux/media_gen_flags_linux.cmake
index 1ef6ad7..c57d4b7 100644
--- a/media_driver/cmake/linux/media_gen_flags_linux.cmake
+++ b/media_driver/cmake/linux/media_gen_flags_linux.cmake
@@ -39,6 +39,9 @@
 cmake_dependent_option(GEN9_SKL
     "Enabled SKL support (Gen9)" ON
     "GEN9" OFF)
+cmake_dependent_option(GEN9_CML
+    "Enabled CML support (Gen9)" ON
+    "GEN9" OFF)
 
 option(GEN10 "Enable Gen10 support" ON)
 cmake_dependent_option(GEN10_CNL
@@ -82,6 +85,10 @@
     add_definitions(-DIGFX_GEN9_KBL_SUPPORTED)
 endif()
 
+if(GEN9_CML)
+    add_definitions(-DIGFX_GEN9_CML_SUPPORTED)
+endif()
+
 if(GEN10)
     add_definitions(-DIGFX_GEN10_SUPPORTED)
 endif()
diff --git a/media_driver/linux/media_srcs.cmake b/media_driver/linux/media_srcs.cmake
index 7c1e362..14cbd97 100644
--- a/media_driver/linux/media_srcs.cmake
+++ b/media_driver/linux/media_srcs.cmake
@@ -28,6 +28,10 @@
     media_include_subdirectory(gen9)
 endif()
 
+if(GEN9_CML)
+    media_include_subdirectory(gen9_cml)
+endif()
+
 if(GEN9_BXT)
     media_include_subdirectory(gen9_bxt)
 endif()