blob: daab5084b4dfbf319a3b372db32d5c2ddb2521c0 [file] [log] [blame]
Jason Macnak1de7f662020-01-24 15:05:57 -08001/*
2 * Copyright 2020 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#define LOG_TAG "AllocatorService"
8
9#include <hidl/LegacySupport.h>
10
11#include "cros_gralloc/gralloc3/CrosGralloc3Allocator.h"
12
13using android::sp;
14using android::hardware::configureRpcThreadpool;
15using android::hardware::joinRpcThreadpool;
16using android::hardware::graphics::allocator::V3_0::IAllocator;
17
18int main(int, char**) {
19 sp<IAllocator> allocator = new CrosGralloc3Allocator();
20 configureRpcThreadpool(4, true /* callerWillJoin */);
21 if (allocator->registerAsService() != android::NO_ERROR) {
22 ALOGE("failed to register graphics IAllocator 3.0 service");
23 return -EINVAL;
24 }
25
26 ALOGI("graphics IAllocator 3.0 service is initialized");
27 android::hardware::joinRpcThreadpool();
28 ALOGI("graphics IAllocator 3.0 service is terminating");
29 return 0;
30}