1 /* 2 * Copyright (c) 2018, 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 #include "gpu_cmd_factory.h" 23 24 #ifndef _FULL_OPEN_SOURCE 25 26 #include "gpu_cmd_hcp_ind_obj_base_addr.h" 27 #include "gpu_cmd_hcp_pipe_buf_addr.h" 28 #include "gpu_cmd_mfx_bsp_buf_base_addr.h" 29 #include "gpu_cmd_mfx_ind_obj_base_addr.h" 30 #include "gpu_cmd_mfx_pipe_buf_addr.h" 31 32 using namespace std; 33 34 #define PUSH(CMD_TYPE) gpuCmds.push_back(make_shared<CMD_TYPE>()) 35 #define GPU_CMD_FACTORY_CREATE(factory) (new factory()) 36 37 class GpuCmdFactoryEncodeHevcDualPipe : public GpuCmdFactory 38 { CreateGpuCmds(vector<pcmditf_t> & gpuCmds,Platform_t platform) const39 void CreateGpuCmds(vector<pcmditf_t> &gpuCmds, Platform_t platform) const override 40 { 41 switch(platform) 42 { 43 case igfxSKLAKE: 44 break; 45 case igfxBROXTON: 46 break; 47 case igfxBROADWELL: 48 break; 49 default: 50 return; 51 } 52 } 53 }; 54 55 class GpuCmdFactoryDecodeHEVCLong : public GpuCmdFactory 56 { CreateGpuCmds(vector<pcmditf_t> & gpuCmds,Platform_t platform) const57 void CreateGpuCmds(vector<pcmditf_t> &gpuCmds, Platform_t platform) const override 58 { 59 switch(platform) 60 { 61 case igfxSKLAKE: 62 break; 63 case igfxBROXTON: 64 break; 65 case igfxBROADWELL: 66 break; 67 default: 68 return; 69 } 70 } 71 }; 72 73 class GpuCmdFactoryEncodeAvcDualPipe : public GpuCmdFactory 74 { CreateGpuCmds(vector<pcmditf_t> & gpuCmds,Platform_t platform) const75 void CreateGpuCmds(vector<pcmditf_t> &gpuCmds, Platform_t platform) const override 76 { 77 switch(platform) 78 { 79 case igfxSKLAKE: 80 //PUSH(GpuCmdMfxPipeBufAddrG9Skl); 81 //PUSH(GpuCmdMfxIndObjBaseAddrG9Skl); 82 //PUSH(GpuCmdMfxBspBufBaseAddrG9Skl); 83 break; 84 case igfxBROXTON: 85 //PUSH(GpuCmdMfxPipeBufAddrG9Bxt); 86 //PUSH(GpuCmdMfxIndObjBaseAddrG9Bxt); 87 //PUSH(GpuCmdMfxBspBufBaseAddrG9Bxt); 88 break; 89 case igfxBROADWELL: 90 break; 91 default: 92 return; 93 } 94 } 95 }; 96 97 class GpuCmdFactoryDecodeAVCLong : public GpuCmdFactory 98 { CreateGpuCmds(vector<pcmditf_t> & gpuCmds,Platform_t platform) const99 void CreateGpuCmds(vector<pcmditf_t> &gpuCmds, Platform_t platform) const override 100 { 101 switch(platform) 102 { 103 case igfxSKLAKE: 104 //PUSH(GpuCmdMfxPipeBufAddrG9Skl); 105 //PUSH(GpuCmdMfxIndObjBaseAddrG9Skl); 106 //PUSH(GpuCmdMfxBspBufBaseAddrG9Skl); 107 break; 108 case igfxBROXTON: 109 //PUSH(GpuCmdMfxPipeBufAddrG9Bxt); 110 //PUSH(GpuCmdMfxIndObjBaseAddrG9Bxt); 111 //PUSH(GpuCmdMfxBspBufBaseAddrG9Bxt); 112 break; 113 case igfxBROADWELL: 114 break; 115 default: 116 return; 117 } 118 } 119 }; 120 121 #else // not _FULL_OPEN_SOURCE 122 123 #define GPU_CMD_FACTORY_CREATE(factory) nullptr 124 125 #endif // _FULL_OPEN_SOURCE 126 127 GpuCmdFactory *g_gpuCmdFactoryEncodeHevcDualPipe = GPU_CMD_FACTORY_CREATE(GpuCmdFactoryEncodeHevcDualPipe); 128 GpuCmdFactory *g_gpuCmdFactoryDecodeHEVCLong = GPU_CMD_FACTORY_CREATE(GpuCmdFactoryDecodeHEVCLong); 129 GpuCmdFactory *g_gpuCmdFactoryEncodeAvcDualPipe = GPU_CMD_FACTORY_CREATE(GpuCmdFactoryEncodeAvcDualPipe); 130 GpuCmdFactory *g_gpuCmdFactoryDecodeAVCLong = GPU_CMD_FACTORY_CREATE(GpuCmdFactoryDecodeAVCLong); 131