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

Commit 11313d55 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4677756 from 0bc21a6b to pi-release

Change-Id: Iae8d48bacebadba8ac159def7fdadf629f2c76f8
parents e687f14a 0bc21a6b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ static const TracingCategory k_categories[] = {
    { "network",    "Network",          ATRACE_TAG_NETWORK, { } },
    { "adb",        "ADB",              ATRACE_TAG_ADB, { } },
    { "vibrator",   "Vibrator",         ATRACE_TAG_VIBRATOR, { } },
    { "aidl",       "AIDL calls",       ATRACE_TAG_AIDL, { } },
    { k_coreServiceCategory, "Core services", 0, { } },
    { k_pdxServiceCategory, "PDX services", 0, { } },
    { "sched",      "CPU Scheduling",   0, {
+8 −10
Original line number Diff line number Diff line
@@ -378,8 +378,7 @@ void ListCommand::dumpVintf(const NullableOStream<std::ostream>& out) const {
                }
                if (findAndBumpVersion(hal, version)) {
                    if (&table != &mImplementationsTable) {
                        hal->interfaces[interfaceName].name = interfaceName;
                        hal->interfaces[interfaceName].instances.insert(instanceName);
                        hal->insertLegacyInstance(interfaceName, instanceName);
                    }
                    hal->transportArch.arch |= arch;
                    done = true;
@@ -389,17 +388,16 @@ void ListCommand::dumpVintf(const NullableOStream<std::ostream>& out) const {
            if (done) {
                continue; // to next TableEntry
            }
            decltype(vintf::ManifestHal::interfaces) interfaces;
            if (&table != &mImplementationsTable) {
                interfaces[interfaceName].name = interfaceName;
                interfaces[interfaceName].instances.insert(instanceName);
            }
            if (!manifest.add(vintf::ManifestHal{
            vintf::ManifestHal manifestHal{
                    vintf::HalFormat::HIDL,
                    std::string{fqName.package()},
                    {version},
                    {transport, arch},
                    std::move(interfaces)})) {
                    {}};
            if (&table != &mImplementationsTable) {
                manifestHal.insertLegacyInstance(interfaceName, instanceName);
            }
            if (!manifest.add(std::move(manifestHal))) {
                err() << "Warning: cannot add hal '" << fqInstanceName << "'" << std::endl;
            }
        }
@@ -408,7 +406,7 @@ void ListCommand::dumpVintf(const NullableOStream<std::ostream>& out) const {
         << "    This is a skeleton " << manifest.type() << " manifest. Notes: " << std::endl
         << INIT_VINTF_NOTES
         << "-->" << std::endl;
    out << vintf::gHalManifestConverter(manifest, vintf::SerializeFlag::HALS_ONLY);
    out << vintf::gHalManifestConverter(manifest, vintf::SerializeFlag::HALS_NO_FQNAME);
}

std::string ListCommand::INIT_VINTF_NOTES{
+23 −23
Original line number Diff line number Diff line
@@ -144,15 +144,16 @@ void Device::destroyDisplay(hwc2_display_t displayId)

void Device::onHotplug(hwc2_display_t displayId, Connection connection) {
    if (connection == Connection::Connected) {
        auto display = getDisplayById(displayId);
        if (display) {
            if (display->isConnected()) {
                ALOGW("Attempt to hotplug connect display %" PRIu64
                        " , which is already connected.", displayId);
            } else {
                display->setConnected(true);
        // If we get a hotplug connected event for a display we already have,
        // destroy the display and recreate it. This will force us to requery
        // the display params and recreate all layers on that display.
        auto oldDisplay = getDisplayById(displayId);
        if (oldDisplay != nullptr && oldDisplay->isConnected()) {
            ALOGI("Hotplug connecting an already connected display."
                    " Clearing old display state.");
        }
        } else {
        mDisplays.erase(displayId);

        DisplayType displayType;
        auto intError = mComposer->getDisplayType(displayId,
                reinterpret_cast<Hwc2::IComposerClient::DisplayType *>(
@@ -168,7 +169,6 @@ void Device::onHotplug(hwc2_display_t displayId, Connection connection) {
        auto newDisplay = std::make_unique<Display>(
                *mComposer.get(), mCapabilities, displayId, displayType);
        mDisplays.emplace(displayId, std::move(newDisplay));
        }
    } else if (connection == Connection::Disconnected) {
        // The display will later be destroyed by a call to
        // destroyDisplay(). For now we just mark it disconnected.
+13 −8
Original line number Diff line number Diff line
@@ -305,15 +305,24 @@ String8 ProgramCache::generateFragmentShader(const Key& needs) {

        if (needs.hasToneMapping()) {
            fs << R"__SHADER__(
                float ToneMapChannel(const float color) {
                float CalculateY(const vec3 color) {
                    // BT2020 standard uses the unadjusted KR = 0.2627,
                    // KB = 0.0593 luminance interpretation for RGB conversion.
                    return color.r * 0.262700 + color.g * 0.677998 +
                            color.b * 0.059302;
                }
                vec3 ToneMap(const vec3 color) {
                    const float maxLumi = 10000.0;
                    const float maxMasteringLumi = 1000.0;
                    const float maxContentLumi = 1000.0;
                    const float maxInLumi = min(maxMasteringLumi, maxContentLumi);
                    const float maxOutLumi = 500.0;

                    // Calculate Y value in XYZ color space.
                    float colorY = CalculateY(color);

                    // convert to nits first
                    float nits = color * maxLumi;
                    float nits = colorY * maxLumi;

                    // clamp to max input luminance
                    nits = clamp(nits, 0.0, maxInLumi);
@@ -360,12 +369,8 @@ String8 ProgramCache::generateFragmentShader(const Key& needs) {
                    }

                    // convert back to [0.0, 1.0]
                    return nits / maxOutLumi;
                }

                vec3 ToneMap(const vec3 color) {
                    return vec3(ToneMapChannel(color.r), ToneMapChannel(color.g),
                                ToneMapChannel(color.b));
                    float targetY = nits / maxOutLumi;
                    return color * (targetY / max(1e-6, colorY));
                }
            )__SHADER__";
        } else {
+11 −11
Original line number Diff line number Diff line
@@ -2120,9 +2120,8 @@ void SurfaceFlinger::processDisplayHotplugEventsLocked() {
        getBE().mHwc->onHotplug(event.display, displayType, event.connection);

        if (event.connection == HWC2::Connection::Connected) {
            if (!mBuiltinDisplays[displayType].get()) {
                ALOGV("Creating built in display %d", displayType);
            ALOGW_IF(mBuiltinDisplays[displayType],
                    "Overwriting display token for display type %d", displayType);
                mBuiltinDisplays[displayType] = new BBinder();
                // All non-virtual displays are currently considered secure.
                DisplayDeviceState info(displayType, true);
@@ -2130,6 +2129,7 @@ void SurfaceFlinger::processDisplayHotplugEventsLocked() {
                        "Built-in Screen" : "External Screen";
                mCurrentState.displays.add(mBuiltinDisplays[displayType], info);
                mInterceptor.saveDisplayCreation(info);
            }
        } else {
            ALOGV("Removing built in display %d", displayType);

@@ -3980,7 +3980,7 @@ void SurfaceFlinger::dumpAllLocked(const Vector<String16>& args, size_t& index,

    LayersProto layersProto = dumpProtoInfo(LayerVector::StateSet::Current);
    auto layerTree = LayerProtoParser::generateLayerTree(layersProto);
    result.append(LayerProtoParser::layersToString(layerTree).c_str());
    result.append(LayerProtoParser::layersToString(std::move(layerTree)).c_str());

    /*
     * Dump Display state
Loading