displayconfig: Add dummy display config API

Dummy display config API is added to check the backward
compatibility of IDisplayConfig2.0  with vendor freeze.

CRs-Fixed: 2855291
Change-Id: I4f3ddd5c1a9bb660ab252b9024650a9bd63a4ccf
This commit is contained in:
ksrinath
2021-01-18 16:49:31 +05:30
parent 10c74ab436
commit 4181cc8819
5 changed files with 25 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -32,6 +32,8 @@
#include <vector>
#include <string>
#include <errno.h>
#include <cutils/native_handle.h>
// #defines specifying the API level supported
// Client can use these API level #ifdefs in their implementation to call the
@@ -322,6 +324,7 @@ class ConfigInterface {
bool* /* supported */) DEFAULT_RET
virtual int GetDisplayType(uint64_t /* physical_disp_id */,
DisplayType* /* disp_type */) DEFAULT_RET
virtual int DummyDisplayConfigAPI() DEFAULT_RET
// deprecated APIs
virtual int GetDebugProperty(const std::string /* prop_name */,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -934,6 +934,18 @@ int ClientImpl::IsRCSupported(uint32_t disp_id, bool *supported) {
return error;
}
int ClientImpl::DummyDisplayConfigAPI() {
int error = 0;
auto hidl_cb = [&error] (int32_t err, ByteStream params, HandleStream handles) {
error = err;
};
display_config_->perform(client_handle_, kDummyOpcode, {}, {}, hidl_cb);
if (error) {
return -EINVAL;
}
return error;
}
int ClientImpl::IsSupportedConfigSwitch(uint32_t disp_id, uint32_t config, bool *supported) {
struct SupportedModesParams input = {disp_id, config};
ByteStream input_params;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -126,6 +126,7 @@ class ClientImpl : public ClientInterface {
virtual int ControlIdleStatusCallback(bool enable);
virtual int IsSupportedConfigSwitch(uint32_t disp_id, uint32_t config, bool *supported);
virtual int GetDisplayType(uint64_t physical_disp_id, DisplayType *disp_type);
virtual int DummyDisplayConfigAPI();
private:
android::sp<IDisplayConfig> display_config_ = nullptr;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -1019,6 +1019,9 @@ Return<void> DeviceImpl::perform(uint64_t client_handle, uint32_t op_code,
case kGetDisplayType:
client->ParseGetDisplayType(input_params, _hidl_cb);
break;
case kDummyOpcode:
_hidl_cb(-EINVAL, {}, {});
break;
default:
_hidl_cb(-EINVAL, {}, {});
break;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -82,6 +82,7 @@ enum OpCode {
kControlIdleStatusCallback = 46,
kIsSupportedConfigSwitch = 47,
kGetDisplayType = 48,
kDummyOpcode = 49,
kDestroy = 0xFFFF, // Destroy sequence execution
};