1 /* 2 // Copyright(c)2014 IntelCorporation 3 // 4 // LicensedundertheApacheLicense,Version2.0(the"License"); 5 // youmaynotusethisfileexceptincompliancewiththeLicense. 6 // YoumayobtainacopyoftheLicenseat 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unlessrequiredbyapplicablelaworagreedtoinwriting,software 11 // distributedundertheLicenseisdistributedonan"ASIS"BASIS, 12 // WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. 13 // SeetheLicenseforthespecificlanguagegoverningpermissionsand 14 // limitationsundertheLicense. 15 */ 16 #ifndef WSBM_H__ 17 #define WSBM_H__ 18 19 #include <ips/common/WsbmWrapper.h> 20 21 /** 22 * Class: WSBM 23 * A wrapper class to use libwsbm functionalities 24 */ 25 class Wsbm 26 { 27 private: 28 int mDrmFD; 29 public: 30 Wsbm(int drmFD); 31 ~Wsbm(); 32 bool initialize(); 33 void deinitialize(); 34 bool allocateTTMBuffer(uint32_t size, uint32_t align,void ** buf); 35 bool allocateTTMBufferUB(uint32_t size, uint32_t align, void ** buf, void *user_pt); 36 bool destroyTTMBuffer(void * buf); 37 void * getCPUAddress(void * buf); 38 uint32_t getGttOffset(void * buf); 39 bool wrapTTMBuffer(uint32_t handle, void **buf); 40 bool unreferenceTTMBuffer(void *buf); 41 bool waitIdleTTMBuffer(void *buf); 42 uint32_t getKBufHandle(void *buf); 43 private: 44 bool mInitialized; 45 }; 46 47 #endif /*__INTEL_WSBM_H__*/ 48