1 /*
2 * Copyright 2022 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 #include "StubVirtGpu.h"
18
StubVirtGpuDevice(enum VirtGpuCapset capset)19 StubVirtGpuDevice::StubVirtGpuDevice(enum VirtGpuCapset capset) : VirtGpuDevice(capset) {
20 // Unimplemented stub
21 }
22
getCaps(void)23 struct VirtGpuCaps StubVirtGpuDevice::getCaps(void) { return mCaps; }
24
getDeviceHandle(void)25 int64_t StubVirtGpuDevice::getDeviceHandle(void) {
26 return mDeviceHandle;
27 }
28
createResource(uint32_t width,uint32_t height,uint32_t stride,uint32_t virglFormat,uint32_t target,uint32_t bind)29 VirtGpuResourcePtr StubVirtGpuDevice::createResource(uint32_t width, uint32_t height,
30 uint32_t stride, uint32_t virglFormat,
31 uint32_t target, uint32_t bind) {
32 (void)width;
33 (void)height;
34 (void)stride;
35 (void)virglFormat;
36 (void)target;
37 (void)bind;
38 return nullptr;
39 }
40
createBlob(const struct VirtGpuCreateBlob &)41 VirtGpuResourcePtr StubVirtGpuDevice::createBlob(const struct VirtGpuCreateBlob&) {
42 return nullptr;
43 }
44
importBlob(const struct VirtGpuExternalHandle &)45 VirtGpuResourcePtr StubVirtGpuDevice::importBlob(const struct VirtGpuExternalHandle&) {
46 return nullptr;
47 }
48
execBuffer(struct VirtGpuExecBuffer &,const VirtGpuResource *)49 int StubVirtGpuDevice::execBuffer(struct VirtGpuExecBuffer&, const VirtGpuResource*) { return -1; }
50
createColorBuffer(int,int,uint32_t)51 VirtGpuResourcePtr createColorBuffer(int, int, uint32_t) { return nullptr; }
52
createColorBuffer(int)53 VirtGpuResourcePtr createColorBuffer(int) { return nullptr; }
54
~StubVirtGpuDevice()55 StubVirtGpuDevice::~StubVirtGpuDevice() {
56 // Unimplemented stub
57 }
58
createPlatformVirtGpuDevice(enum VirtGpuCapset capset,int)59 VirtGpuDevice* createPlatformVirtGpuDevice(enum VirtGpuCapset capset, int) {
60 return new StubVirtGpuDevice(capset);
61 }
62