drm_hwcomposer: Remove HWC2 hooks for Virtual Displays
Change the Create/Destroy virtual display functions on DrmHwc to remove HWC2 API stuff. Implement the corresponding functions in the HWC3 and HWC2 frontends in terms of these functions. Change-Id: I410da9347ccb2cd008cc94b746c2b5604969b57e Signed-off-by: Drew Davenport <ddavenport@google.com>
This commit is contained in:
parent
c40f27b6ea
commit
1cca58e9e3
4 changed files with 58 additions and 39 deletions
|
|
@ -540,17 +540,14 @@ ndk::ScopedAStatus ComposerClient::createVirtualDisplay(
|
|||
DEBUG_FUNC();
|
||||
const std::unique_lock lock(hwc_->GetResMan().GetMainLock());
|
||||
|
||||
hwc2_display_t hwc2_display_id = 0;
|
||||
// TODO: Format is currently not used in drm_hwcomposer.
|
||||
int32_t hwc2_format = 0;
|
||||
auto err = Hwc2toHwc3Error(hwc_->CreateVirtualDisplay(width, height,
|
||||
&hwc2_format,
|
||||
&hwc2_display_id));
|
||||
if (err != hwc3::Error::kNone) {
|
||||
return ToBinderStatus(err);
|
||||
std::optional<hwc2_display_t>
|
||||
hwc2_display_id = hwc_->CreateVirtualDisplay(width, height);
|
||||
if (!hwc2_display_id) {
|
||||
return ToBinderStatus(hwc3::Error::kUnsupported);
|
||||
}
|
||||
|
||||
out_display->display = Hwc2DisplayToHwc3(hwc2_display_id);
|
||||
out_display->display = Hwc2DisplayToHwc3(hwc2_display_id.value());
|
||||
out_display->format = format_hint;
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
|
@ -574,8 +571,11 @@ ndk::ScopedAStatus ComposerClient::destroyLayer(int64_t display_id,
|
|||
ndk::ScopedAStatus ComposerClient::destroyVirtualDisplay(int64_t display_id) {
|
||||
DEBUG_FUNC();
|
||||
const std::unique_lock lock(hwc_->GetResMan().GetMainLock());
|
||||
auto err = Hwc2toHwc3Error(hwc_->DestroyVirtualDisplay(display_id));
|
||||
return ToBinderStatus(err);
|
||||
if (GetDisplay(display_id) == nullptr) {
|
||||
return ToBinderStatus(hwc3::Error::kBadDisplay);
|
||||
}
|
||||
hwc_->DestroyVirtualDisplay(display_id);
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
::android::HwcDisplay* ComposerClient::GetDisplay(uint64_t display_id) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue