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

Commit 4a4132d2 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 3d6a1924 on remote branch

Change-Id: If51f4a4d3261d4e1879deb7cb6fb02ce8445755e
parents 6c9ed1ae 3d6a1924
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1042,7 +1042,6 @@ public:
        }
    }
    virtual void setDim(uint32_t color) {
        setSkip(false);
        getLayer()->flags |= 0x80000000;
#ifdef QTI_BSP
        // Set RGBA color on HWC Dim layer
@@ -1123,7 +1122,7 @@ public:
    virtual void setBuffer(const sp<GraphicBuffer>& buffer) {
        if (buffer == 0 || buffer->handle == 0) {
            getLayer()->compositionType = HWC_FRAMEBUFFER;
            getLayer()->flags |= HWC_SKIP_LAYER;
            getLayer()->flags |=  (getLayer()->flags & 0x80000000) ? 0 : HWC_SKIP_LAYER;
            getLayer()->handle = 0;
        } else {
            if (getLayer()->compositionType == HWC_SIDEBAND) {
+1 −1
Original line number Diff line number Diff line
@@ -75,13 +75,13 @@ void LayerDim::setPerFrameData(const sp<const DisplayDevice>& hw,
        HWComposer::HWCLayerInterface& layer) {
  HWComposer& hwc = mFlinger->getHwComposer();

  Layer::setPerFrameData(hw, layer);
  if (hwc.hasDimComposition()) {
    // SF Client can set RGBA color on Dim layer. Solid Black is default.
    uint32_t color = getDrawingState().color;
    uint32_t rgba_color = !color ? 0x000000FF : color;
    layer.setDim(rgba_color);
  }
  Layer::setPerFrameData(hw, layer);
}
#endif

+45 −2
Original line number Diff line number Diff line
@@ -778,10 +778,53 @@ status_t SurfaceFlinger::getAnimationFrameStats(FrameStats* outStats) const {
    return NO_ERROR;
}

status_t SurfaceFlinger::getHdrCapabilities(const sp<IBinder>& /*display*/,
status_t SurfaceFlinger::getHdrCapabilities(const sp<IBinder>& display,
        HdrCapabilities* outCapabilities) const {
    // HWC1 does not provide HDR capabilities

    if (!display.get())
        return NAME_NOT_FOUND;

    int32_t type = NAME_NOT_FOUND;
    for (int i=0 ; i < DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES ; i++) {
        if (display == mBuiltinDisplays[i]) {
            type = i;
            break;
        }
    }

    if (type < 0) {
        return type;
    }

#ifdef QTI_BSP
    // Call into display.qservice
    Parcel reply;
    sp<IServiceManager> sm(defaultServiceManager());
    sp<IBinder> binder =
        sm->getService(String16("display.qservice"));
    Parcel input;
    input.writeInterfaceToken(String16("android.display.IQService"));
    input.writeInt32(type);
    // GET_HDR_CAPABILITIES = 35 from IQService.h
    binder->transact(35, input, &reply);
    if (outCapabilities != nullptr) {
        outCapabilities->readFromParcel(&reply);
        if (outCapabilities->getSupportedHdrTypes().size() != 0) {
            ALOGD("HDR support on display: %d", type);
            for (auto hdrtype : outCapabilities->getSupportedHdrTypes()) {
                ALOGD(" HDR type: %d", hdrtype);
            }
            ALOGD(" HDR max luminance: %f", outCapabilities->getDesiredMaxLuminance());
            ALOGD(" HDR max avg luminance: %f",
                  outCapabilities->getDesiredMaxAverageLuminance());
            ALOGD(" HDR min luminance: %f", outCapabilities->getDesiredMinLuminance());
        } else {
            ALOGI("HDR is not supported on display: %d", type);
        }
    }
#else
    *outCapabilities = HdrCapabilities();
#endif
    return NO_ERROR;
}