blob: 76234a36496ec74df9cb1965f72cae8bc8f8abdd [file] [log] [blame]
Jesse Hallfc038bd2016-03-26 22:20:22 -07001/*
2 * Copyright 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_GPUSERVICE_H
18#define ANDROID_GPUSERVICE_H
19
20#include <binder/IInterface.h>
21#include <cutils/compiler.h>
Yiwei Zhangcb9d4e42019-02-06 20:22:59 -080022#include <graphicsenv/IGpuService.h>
23
24#include <mutex>
25#include <vector>
Jesse Hallfc038bd2016-03-26 22:20:22 -070026
27namespace android {
28
Peiyong Lin2c37e202018-11-01 10:34:57 -070029class GpuService : public BnGpuService {
Jesse Hallfc038bd2016-03-26 22:20:22 -070030public:
31 static const char* const SERVICE_NAME ANDROID_API;
32
33 GpuService() ANDROID_API;
34
35protected:
Yiwei Zhangcb9d4e42019-02-06 20:22:59 -080036 status_t shellCommand(int in, int out, int err, std::vector<String16>& args) override;
37
38private:
39 // IGpuService interface
Greg Kaiser210bb7e2019-02-12 12:40:05 -080040 void setGpuStats(const std::string& driverPackageName, const std::string& driverVersionName,
Yiwei Zhang512a7232019-02-15 16:04:41 -080041 uint64_t driverVersionCode, const std::string& driverBuildDate,
42 const std::string& appPackageName, GraphicsEnv::Driver driver,
43 bool isDriverLoaded, int64_t driverLoadingTime);
Yiwei Zhangcb9d4e42019-02-06 20:22:59 -080044
45 // GpuStats access must be protected by mStateLock
46 std::mutex mStateLock;
Jesse Hallfc038bd2016-03-26 22:20:22 -070047};
48
49} // namespace android
50
51#endif // ANDROID_GPUSERVICE_H