Introduce DynamicDisplayInfo
In this CL we introduce SurfaceContorl.getDynamicDisplayInfo which replaces the current seprate calls for supported and active display mode, supproted and active color modes and HDR capabilities. This way display capabilities can be queried atomically. Additionally this CL pipes an DisplayMode IDs from SurfaceFlinger and updates LocalDislayAdapter to use IDs instead of array indices. Test: presubmit Bug: 159590486 Bug: 175678215 Change-Id: I169e3055d07905e2330e11f158b61ffd366f97e6
This commit is contained in:
@@ -26,14 +26,13 @@
|
||||
#include <gui/SurfaceComposerClient.h>
|
||||
#include <gui/SurfaceControl.h>
|
||||
|
||||
#include <ui/HdrCapabilities.h>
|
||||
#include <ui/DynamicDisplayInfo.h>
|
||||
|
||||
#include <utils/Timers.h>
|
||||
|
||||
using namespace android::hardware::configstore;
|
||||
using namespace android::hardware::configstore::V1_0;
|
||||
using namespace android;
|
||||
using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
|
||||
|
||||
using Transaction = SurfaceComposerClient::Transaction;
|
||||
|
||||
@@ -71,14 +70,13 @@ static bool getHdrSupport(const sp<SurfaceControl>& surfaceControl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
HdrCapabilities hdrCapabilities;
|
||||
status_t err = client->getHdrCapabilities(display, &hdrCapabilities);
|
||||
if (err) {
|
||||
ui::DynamicDisplayInfo info;
|
||||
if (status_t err = client->getDynamicDisplayInfo(display, &info); err != NO_ERROR) {
|
||||
ALOGE("unable to get hdr capabilities");
|
||||
return false;
|
||||
return err;
|
||||
}
|
||||
|
||||
return !hdrCapabilities.getSupportedHdrTypes().empty();
|
||||
return !info.hdrCapabilities.getSupportedHdrTypes().empty();
|
||||
}
|
||||
|
||||
static bool isDataSpaceValid(const sp<SurfaceControl>& surfaceControl, ADataSpace dataSpace) {
|
||||
|
||||
Reference in New Issue
Block a user