Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
Peiyong Lin | 2c37e20 | 2018-11-01 10:34:57 -0700 | [diff] [blame] | 20 | #include <vector> |
| 21 | |
Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 22 | #include <binder/IInterface.h> |
| 23 | #include <cutils/compiler.h> |
| 24 | |
| 25 | namespace android { |
| 26 | |
| 27 | /* |
| 28 | * This class defines the Binder IPC interface for GPU-related queries and |
| 29 | * control. |
| 30 | */ |
| 31 | class IGpuService : public IInterface { |
| 32 | public: |
| 33 | DECLARE_META_INTERFACE(GpuService); |
| 34 | }; |
| 35 | |
| 36 | class BnGpuService: public BnInterface<IGpuService> { |
| 37 | protected: |
| 38 | virtual status_t shellCommand(int in, int out, int err, |
Peiyong Lin | 2c37e20 | 2018-11-01 10:34:57 -0700 | [diff] [blame] | 39 | std::vector<String16>& args) = 0; |
Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 40 | |
Peiyong Lin | 2c37e20 | 2018-11-01 10:34:57 -0700 | [diff] [blame] | 41 | status_t onTransact(uint32_t code, const Parcel& data, |
Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 42 | Parcel* reply, uint32_t flags = 0) override; |
| 43 | }; |
| 44 | |
Peiyong Lin | 2c37e20 | 2018-11-01 10:34:57 -0700 | [diff] [blame] | 45 | class GpuService : public BnGpuService { |
Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 46 | public: |
| 47 | static const char* const SERVICE_NAME ANDROID_API; |
| 48 | |
| 49 | GpuService() ANDROID_API; |
| 50 | |
| 51 | protected: |
Peiyong Lin | 2c37e20 | 2018-11-01 10:34:57 -0700 | [diff] [blame] | 52 | status_t shellCommand(int in, int out, int err, |
| 53 | std::vector<String16>& args) override; |
Jesse Hall | fc038bd | 2016-03-26 22:20:22 -0700 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | } // namespace android |
| 57 | |
| 58 | #endif // ANDROID_GPUSERVICE_H |