| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
#ifndef MEDIADRIVER_AGNOSTIC_COMMON_CM_CMSURFACE3DRT_H_ |
| 28 |
#define MEDIADRIVER_AGNOSTIC_COMMON_CM_CMSURFACE3DRT_H_ |
| 29 |
|
| 30 |
#include "cm_surface_3d.h" |
| 31 |
#include "cm_surface.h" |
| 32 |
|
| 33 |
namespace CMRT_UMD |
| 34 |
{ |
| 35 |
class CmSurface3DRT: public CmSurface, public CmSurface3D |
| 36 |
{ |
| 37 |
public: |
| 38 |
static int32_t Create(uint32_t index, |
| 39 |
uint32_t handle, |
| 40 |
uint32_t width, |
| 41 |
uint32_t height, |
| 42 |
uint32_t depth, |
| 43 |
CM_SURFACE_FORMAT format, |
| 44 |
CmSurfaceManager *surfaceManager, |
| 45 |
CmSurface3DRT* &surface); |
| 46 |
|
| 47 |
CM_RT_API int32_t ReadSurface(unsigned char *sysMem, |
| 48 |
CmEvent *event, |
| 49 |
uint64_t sysMemSize = 0xFFFFFFFFFFFFFFFFULL); |
| 50 |
|
| 51 |
CM_RT_API int32_t WriteSurface(const unsigned char *sysMem, |
| 52 |
CmEvent *event, |
| 53 |
uint64_t sysMemSize = 0xFFFFFFFFFFFFFFFFULL); |
| 54 |
|
| 55 |
CM_RT_API int32_t InitSurface(const uint32_t initValue, CmEvent *event); |
| 56 |
|
| 57 |
CM_RT_API int32_t GetIndex(SurfaceIndex* &index); |
| 58 |
|
| 59 |
virtual int32_t GetHandle(uint32_t &handle); |
| 60 |
|
| 61 |
virtual int32_t GetProperties(uint32_t &width, |
| 62 |
uint32_t &height, |
| 63 |
uint32_t &depth, |
| 64 |
CM_SURFACE_FORMAT &format); |
| 65 |
|
| 66 |
int32_t SetProperties(uint32_t width, |
| 67 |
uint32_t height, |
| 68 |
uint32_t depth, |
| 69 |
CM_SURFACE_FORMAT format); |
| 70 |
|
| 71 |
|
| 72 |
CM_ENUM_CLASS_TYPE Type() const { return CM_ENUM_CLASS_TYPE_CMSURFACE3D; }; |
| 73 |
|
| 74 |
int32_t SetMemoryObjectControl(MEMORY_OBJECT_CONTROL memCtrl, |
| 75 |
MEMORY_TYPE memType, |
| 76 |
uint32_t age); |
| 77 |
|
| 78 |
CM_RT_API int32_t |
| 79 |
SelectMemoryObjectControlSetting(MEMORY_OBJECT_CONTROL memCtrl); |
| 80 |
|
| 81 |
CMRT_UMD_API int32_t SetResourceUsage(const MOS_HW_RESOURCE_DEF mosUsage); |
| 82 |
|
| 83 |
void Log(std::ostringstream &oss); |
| 84 |
|
| 85 |
void DumpContent(uint32_t kernelNumber, |
| 86 |
char *kernelName, |
| 87 |
int32_t taskId, |
| 88 |
uint32_t argIndex, |
| 89 |
uint32_t vectorIndex); |
| 90 |
|
| 91 |
protected: |
| 92 |
CmSurface3DRT(uint32_t handle, |
| 93 |
uint32_t width, |
| 94 |
uint32_t height, |
| 95 |
uint32_t depth, |
| 96 |
CM_SURFACE_FORMAT format, |
| 97 |
CmSurfaceManager *surfaceManager); |
| 98 |
|
| 99 |
~CmSurface3DRT(); |
| 100 |
|
| 101 |
int32_t Initialize(uint32_t index); |
| 102 |
|
| 103 |
uint32_t m_handle; |
| 104 |
uint32_t m_width; |
| 105 |
uint32_t m_height; |
| 106 |
uint32_t m_depth; |
| 107 |
CM_SURFACE_FORMAT m_format; |
| 108 |
|
| 109 |
private: |
| 110 |
CmSurface3DRT(const CmSurface3DRT& other); |
| 111 |
CmSurface3DRT& operator=(const CmSurface3DRT& other); |
| 112 |
}; |
| 113 |
}; |
| 114 |
|
| 115 |
#endif |