Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit efe339f

Browse files
yhe39Shao-Feng
authored andcommitted
Set the primary display as internal display for AOSP rebase to Beta 1 on Android S
After AOSP rebase to Beta 1, the gvt-d couldn't boot up as couldn't find the DefaultDisplay. The Android by defualt assume there is one internal display, but in our scenario, we connected to hdmi, hwc set the display as extended display. This WA deem the primary display as internal display. Change-Id: I86cef98231ac25cb52796325534d1eb7e5c9a54d Tracked-On: OAM-97157 Signed-off-by: HeYue <yue.he@intel.com>
1 parent 54fa919 commit efe339f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

os/android/iahwc2.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -879,13 +879,17 @@ HWC2::Error IAHWC2::HwcDisplay::GetDisplayVsyncPeriod(
879879
return HWC2::Error::BadConfig;
880880
}
881881

882-
/**
883-
* A dummy API
884-
* TODO need to get the type from drm.
882+
/*
883+
* After AOSP rebase to Beta 1 on Android S, the gvt-d couldn't
884+
* boot up as couldn't find the DefaultDisplay.
885+
* The Android by defualt assume there is one internal display,
886+
* but in our scenario, we connected to hdmi,
887+
* hwc set the display as extended display.
888+
* This WA deem the primary display as internal display.
885889
*/
886890
HWC2::Error IAHWC2::HwcDisplay::GetDisplayConnectionType(uint32_t *outType) {
887891
supported(__func__);
888-
if (display_->IsInternalConnection())
892+
if (display_->IsInternalConnection() || primary_display_)
889893
*outType = static_cast<uint32_t>(HWC2::DisplayConnectionType::Internal);
890894
else if (display_->IsExternalConnection())
891895
*outType = static_cast<uint32_t>(HWC2::DisplayConnectionType::External);

os/android/iahwc2.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ class IAHWC2 : public hwc2_device_t {
181181
numCap_ = num;
182182
}
183183

184+
bool primary_display_ = false;
184185
uint32_t num_intents_ = 1; // at least support the COLORIMETRIC
185186
uint32_t GetNumRenderIntents() {
186187
return num_intents_;
@@ -342,6 +343,7 @@ class IAHWC2 : public hwc2_device_t {
342343

343344
if (display_handle == HWC_DISPLAY_PRIMARY) {
344345
HwcDisplay &display = hwc->primary_display_;
346+
display.primary_display_ = true;
345347
return static_cast<int32_t>((display.*func)(std::forward<Args>(args)...));
346348
}
347349

@@ -379,6 +381,7 @@ class IAHWC2 : public hwc2_device_t {
379381

380382
if (display_handle == HWC_DISPLAY_PRIMARY) {
381383
HwcDisplay &display = hwc->primary_display_;
384+
display.primary_display_ = true;
382385
Hwc2Layer &layer = display.get_layer(layer_handle);
383386
return static_cast<int32_t>((layer.*func)(std::forward<Args>(args)...));
384387
}

0 commit comments

Comments
 (0)