drm_hwcomposer: Remove HWC2 LegacyGetDisplayConfigs
This was only used by the HWC2 frontend. Move the function to hwc2_device. Change-Id: I4b539e9a37ea09bd577eadd44c205e17230a5a6b Signed-off-by: Drew Davenport <ddavenport@google.com>
This commit is contained in:
parent
2600a3d487
commit
0113d20d46
3 changed files with 28 additions and 27 deletions
|
|
@ -667,27 +667,6 @@ HWC2::Error HwcDisplay::GetColorModes(uint32_t *num_modes, int32_t *modes) {
|
|||
return HWC2::Error::None;
|
||||
}
|
||||
|
||||
HWC2::Error HwcDisplay::LegacyGetDisplayConfigs(uint32_t *num_configs,
|
||||
hwc2_config_t *configs) {
|
||||
uint32_t idx = 0;
|
||||
for (auto &hwc_config : configs_.hwc_configs) {
|
||||
if (hwc_config.second.disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (configs != nullptr) {
|
||||
if (idx >= *num_configs) {
|
||||
break;
|
||||
}
|
||||
configs[idx] = hwc_config.second.id;
|
||||
}
|
||||
|
||||
idx++;
|
||||
}
|
||||
*num_configs = idx;
|
||||
return HWC2::Error::None;
|
||||
}
|
||||
|
||||
HWC2::Error HwcDisplay::GetDisplayName(uint32_t *size, char *name) {
|
||||
std::ostringstream stream;
|
||||
if (IsInHeadlessMode()) {
|
||||
|
|
|
|||
|
|
@ -152,8 +152,6 @@ class HwcDisplay {
|
|||
|
||||
// HWC2 Hooks - these should not be used outside of the hwc2 device.
|
||||
HWC2::Error GetColorModes(uint32_t *num_modes, int32_t *modes);
|
||||
HWC2::Error LegacyGetDisplayConfigs(uint32_t *num_configs,
|
||||
hwc2_config_t *configs);
|
||||
HWC2::Error GetDisplayName(uint32_t *size, char *name);
|
||||
#if __ANDROID_API__ > 27
|
||||
HWC2::Error GetRenderIntents(int32_t mode, uint32_t *outNumIntents,
|
||||
|
|
|
|||
|
|
@ -481,6 +481,33 @@ static int32_t GetDisplayAttribute(hwc2_device_t *device,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int32_t GetDisplayConfigs(hwc2_device_t *device, hwc2_display_t display,
|
||||
uint32_t *num_configs,
|
||||
hwc2_config_t *configs) {
|
||||
ALOGV("GetDisplayConfigs");
|
||||
LOCK_COMPOSER(device);
|
||||
GET_DISPLAY(display);
|
||||
|
||||
uint32_t idx = 0;
|
||||
for (const auto &hwc_config : idisplay->GetDisplayConfigs().hwc_configs) {
|
||||
if (hwc_config.second.disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (configs != nullptr) {
|
||||
if (idx >= *num_configs) {
|
||||
break;
|
||||
}
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic):
|
||||
configs[idx] = hwc_config.second.id;
|
||||
}
|
||||
|
||||
idx++;
|
||||
}
|
||||
*num_configs = idx;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int32_t SetOutputBuffer(hwc2_device_t *device, hwc2_display_t display,
|
||||
buffer_handle_t buffer, int32_t release_fence) {
|
||||
ALOGV("SetOutputBuffer");
|
||||
|
|
@ -1118,10 +1145,7 @@ static hwc2_function_pointer_t HookDevGetFunction(struct hwc2_device * /*dev*/,
|
|||
case HWC2::FunctionDescriptor::GetDisplayAttribute:
|
||||
return (hwc2_function_pointer_t)GetDisplayAttribute;
|
||||
case HWC2::FunctionDescriptor::GetDisplayConfigs:
|
||||
return ToHook<HWC2_PFN_GET_DISPLAY_CONFIGS>(
|
||||
DisplayHook<decltype(&HwcDisplay::LegacyGetDisplayConfigs),
|
||||
&HwcDisplay::LegacyGetDisplayConfigs, uint32_t *,
|
||||
hwc2_config_t *>);
|
||||
return (hwc2_function_pointer_t)GetDisplayConfigs;
|
||||
case HWC2::FunctionDescriptor::GetDisplayName:
|
||||
return ToHook<HWC2_PFN_GET_DISPLAY_NAME>(
|
||||
DisplayHook<decltype(&HwcDisplay::GetDisplayName),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue