universal7885: run clang-format based on system-clang-format

* On every *.cpp *.h files

Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
roynatech2544 2021-12-12 20:37:53 +09:00
commit 098179eabb
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
47 changed files with 1545 additions and 1709 deletions

View file

@ -13,41 +13,41 @@
// limitations under the License.
#include "Gpu.h"
#include <iostream>
#include <fstream>
#include <iostream>
#include <sstream>
namespace vendor::eureka::hardware::gpu::V1_0 {
Return<int32_t> Gpu::setGpuWritable(gpu::V1_0::Enable enable) {
std::ofstream file;
std::string writevalue;
if (enable == Enable::ENABLE){
std::ofstream file;
std::string writevalue;
if (enable == Enable::ENABLE) {
writevalue = "1";
}else{
} else {
writevalue = "0";
}
file.open("/sys/devices/platform/11500000.mali/tmu");
file << writevalue;
file.close();
return 0;
}
file.open("/sys/devices/platform/11500000.mali/tmu");
file << writevalue;
file.close();
return 0;
}
Return<int32_t> Gpu::readGpustats(void) {
std::ifstream file;
std::string value;
int32_t intvalue;
file.open("/sys/devices/platform/11500000.mali/tmu");
if (file.is_open()) {
getline(file, value);
file.close();
std::stringstream val(value);
val >> intvalue;
return intvalue;
}
return -1;
std::ifstream file;
std::string value;
int32_t intvalue;
file.open("/sys/devices/platform/11500000.mali/tmu");
if (file.is_open()) {
getline(file, value);
file.close();
std::stringstream val(value);
val >> intvalue;
return intvalue;
}
return -1;
}
IGpu *Gpu::getInstance(void){
return new Gpu();
IGpu* Gpu::getInstance(void) {
return new Gpu();
}
} // namespace android::hardware::gpu::implementation
} // namespace vendor::eureka::hardware::gpu::V1_0

View file

@ -14,19 +14,19 @@
#pragma once
#include <vendor/eureka/hardware/gpu/1.0/IGpu.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <vendor/eureka/hardware/gpu/1.0/IGpu.h>
namespace vendor::eureka::hardware::gpu::V1_0 {
using ::android::sp;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
struct Gpu : public IGpu {
// Methods from ::vendor::eureka::hardware::gpu::V1_0::IGpu follow.
@ -34,6 +34,5 @@ struct Gpu : public IGpu {
Return<int32_t> readGpustats(void);
// Methods from ::android::hidl::base::V1_0::IBase follow.
static IGpu* getInstance(void);
};
} // namespace android::hardware::gpu::implementation
} // namespace vendor::eureka::hardware::gpu::V1_0

View file

@ -12,38 +12,37 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#define LOG_TAG "vendor.eureka.hardware.gpu@1.0-service"
#include <vendor/eureka/hardware/gpu/1.0/IGpu.h>
#include <hidl/LegacySupport.h>
#include "Gpu.h"
using vendor::eureka::hardware::gpu::V1_0::IGpu;
using vendor::eureka::hardware::gpu::V1_0::Gpu;
using android::sp;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::sp;
using vendor::eureka::hardware::gpu::V1_0::Gpu;
using vendor::eureka::hardware::gpu::V1_0::IGpu;
int main() {
int ret;
android::sp<IGpu> service = Gpu::getInstance();
configureRpcThreadpool(1, true /*callerWillJoin*/);
if (service != nullptr) {
ret = service->registerAsService();
if(ret != 0) {
ALOGE("Can't register instance of Gpu HAL, nullptr");
}else{
ALOGI("registered Gpu HAL");
}
} else {
ALOGE("Can't create instance of Gpu HAL, nullptr");
}
joinRpcThreadpool();
return -1; // should never get here
int ret;
android::sp<IGpu> service = Gpu::getInstance();
configureRpcThreadpool(1, true /*callerWillJoin*/);
if (service != nullptr) {
ret = service->registerAsService();
if (ret != 0) {
ALOGE("Can't register instance of Gpu HAL, nullptr");
} else {
ALOGI("registered Gpu HAL");
}
} else {
ALOGE("Can't create instance of Gpu HAL, nullptr");
}
joinRpcThreadpool();
return -1; // should never get here
}