Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdf7e4b4 authored by Marc Kassis's avatar Marc Kassis
Browse files

Each Display Mode now has a list of supported HDR types.

SurfaceFlinger removes Dolby Vision as a supported HDR type when a certain mode does not support it

Bug: 241349060
Test: atest ExcludeDolbyVisionTest
Change-Id: I481cc13417f65cbcb1f4658be410adb6e99c760b
parent 438967a4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2330,6 +2330,9 @@ status_t SurfaceComposerClient::getDynamicDisplayInfo(const sp<IBinder>& display
            outMode.sfVsyncOffset = mode.sfVsyncOffset;
            outMode.presentationDeadline = mode.presentationDeadline;
            outMode.group = mode.group;
            std::transform(mode.supportedHdrTypes.begin(), mode.supportedHdrTypes.end(),
                           std::back_inserter(outMode.supportedHdrTypes),
                           [](const int32_t& value) { return static_cast<ui::Hdr>(value); });
            outInfo->supportedDisplayModes.push_back(outMode);
        }

+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ parcelable DisplayMode {
    Size resolution;
    float xDpi = 0.0f;
    float yDpi = 0.0f;
    int[] supportedHdrTypes;

    float refreshRate = 0.0f;
    long appVsyncOffset = 0;
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <cstdint>
#include <type_traits>

#include <ui/GraphicTypes.h>
#include <ui/Size.h>
#include <utils/Flattenable.h>
#include <utils/Timers.h>
@@ -34,6 +35,7 @@ struct DisplayMode {
    ui::Size resolution;
    float xDpi = 0;
    float yDpi = 0;
    std::vector<ui::Hdr> supportedHdrTypes;

    float refreshRate = 0;
    nsecs_t appVsyncOffset = 0;
+2 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <aidl/android/hardware/graphics/common/ChromaSiting.h>
#include <aidl/android/hardware/graphics/common/Compression.h>
#include <aidl/android/hardware/graphics/common/Cta861_3.h>
#include <aidl/android/hardware/graphics/common/Hdr.h>
#include <aidl/android/hardware/graphics/common/Interlaced.h>
#include <aidl/android/hardware/graphics/common/PlaneLayout.h>
#include <aidl/android/hardware/graphics/common/Smpte2086.h>
@@ -42,7 +43,6 @@ namespace ui {
using android::hardware::graphics::common::V1_1::RenderIntent;
using android::hardware::graphics::common::V1_2::ColorMode;
using android::hardware::graphics::common::V1_2::Dataspace;
using android::hardware::graphics::common::V1_2::Hdr;
using android::hardware::graphics::common::V1_2::PixelFormat;

/**
@@ -50,6 +50,7 @@ using android::hardware::graphics::common::V1_2::PixelFormat;
 */
using aidl::android::hardware::graphics::common::BlendMode;
using aidl::android::hardware::graphics::common::Cta861_3;
using aidl::android::hardware::graphics::common::Hdr;
using aidl::android::hardware::graphics::common::PlaneLayout;
using aidl::android::hardware::graphics::common::Smpte2086;

+1 −1
Original line number Diff line number Diff line
@@ -535,7 +535,7 @@ Error AidlComposer::getHdrCapabilities(Display display, std::vector<Hdr>* outTyp
        return static_cast<Error>(status.getServiceSpecificError());
    }

    *outTypes = translate<Hdr>(capabilities.types);
    *outTypes = capabilities.types;
    *outMaxLuminance = capabilities.maxLuminance;
    *outMaxAverageLuminance = capabilities.maxAverageLuminance;
    *outMinLuminance = capabilities.minLuminance;
Loading