Loading services/surfaceflinger/CompositionEngine/src/Display.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -384,8 +384,13 @@ void Display::applyLayerLutsToLayers(const LayerLuts& layerLuts) { if (auto lutsIt = layerLuts.find(hwcLayer); lutsIt != layerLuts.end()) { if (auto mapperIt = mapper.find(hwcLayer); mapperIt != mapper.end()) { layer->applyDeviceLayerLut(::android::base::unique_fd(mapperIt->second.release()), if (mapperIt->second.ok()) { layer->applyDeviceLayerLut(::android::base::unique_fd( mapperIt->second.release()), lutsIt->second); } else { layer->applyDeviceLayerLut(::android::base::unique_fd(), lutsIt->second); } } } } Loading services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +19 −15 Original line number Diff line number Diff line Loading @@ -1012,6 +1012,7 @@ void OutputLayer::applyDeviceLayerLut( auto& state = editState(); LOG_FATAL_IF(!state.hwc); auto& hwcState = *state.hwc; if (lutFd.ok()) { std::vector<int32_t> offsets; std::vector<int32_t> dimensions; std::vector<int32_t> sizes; Loading @@ -1029,6 +1030,9 @@ void OutputLayer::applyDeviceLayerLut( hwcState.luts = std::make_shared<gui::DisplayLuts>(std::move(lutFd), std::move(offsets), std::move(dimensions), std::move(sizes), std::move(samplingKeys)); } else { hwcState.luts = nullptr; } } bool OutputLayer::needsFiltering() const { Loading services/surfaceflinger/DisplayHardware/HWC2.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -626,9 +626,9 @@ Error Display::getRequestedLuts(LayerLuts* outLuts, auto layer = getLayerById(layerIds[i]); if (layer) { auto& layerLut = tmpLuts[i]; std::vector<std::pair<int32_t, LutProperties>> lutOffsetsAndProperties; if (layerLut.luts.pfd.get() >= 0 && layerLut.luts.offsets.has_value()) { const auto& offsets = layerLut.luts.offsets.value(); std::vector<std::pair<int32_t, LutProperties>> lutOffsetsAndProperties; lutOffsetsAndProperties.reserve(offsets.size()); std::transform(offsets.begin(), offsets.end(), layerLut.luts.lutProperties.begin(), std::back_inserter(lutOffsetsAndProperties), Loading @@ -637,8 +637,12 @@ Error Display::getRequestedLuts(LayerLuts* outLuts, lutFileDescriptorMapper.emplace_or_replace(layer.get(), ::android::base::unique_fd( layerLut.luts.pfd.release())); } else if (layerLut.luts.pfd.get() < 0) { outLuts->emplace_or_replace(layer.get(), lutOffsetsAndProperties); lutFileDescriptorMapper.emplace_or_replace(layer.get(), ::android::base::unique_fd()); } else { ALOGE("getRequestedLuts: invalid luts on layer %" PRIu64 " found" ALOGE("getRequestedLuts: invalid luts offsets on layer %" PRIu64 " found" " on display %" PRIu64 ". pfd.get()=%d, offsets.has_value()=%d", layerIds[i], mId, layerLut.luts.pfd.get(), layerLut.luts.offsets.has_value()); } Loading Loading
services/surfaceflinger/CompositionEngine/src/Display.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -384,8 +384,13 @@ void Display::applyLayerLutsToLayers(const LayerLuts& layerLuts) { if (auto lutsIt = layerLuts.find(hwcLayer); lutsIt != layerLuts.end()) { if (auto mapperIt = mapper.find(hwcLayer); mapperIt != mapper.end()) { layer->applyDeviceLayerLut(::android::base::unique_fd(mapperIt->second.release()), if (mapperIt->second.ok()) { layer->applyDeviceLayerLut(::android::base::unique_fd( mapperIt->second.release()), lutsIt->second); } else { layer->applyDeviceLayerLut(::android::base::unique_fd(), lutsIt->second); } } } } Loading
services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +19 −15 Original line number Diff line number Diff line Loading @@ -1012,6 +1012,7 @@ void OutputLayer::applyDeviceLayerLut( auto& state = editState(); LOG_FATAL_IF(!state.hwc); auto& hwcState = *state.hwc; if (lutFd.ok()) { std::vector<int32_t> offsets; std::vector<int32_t> dimensions; std::vector<int32_t> sizes; Loading @@ -1029,6 +1030,9 @@ void OutputLayer::applyDeviceLayerLut( hwcState.luts = std::make_shared<gui::DisplayLuts>(std::move(lutFd), std::move(offsets), std::move(dimensions), std::move(sizes), std::move(samplingKeys)); } else { hwcState.luts = nullptr; } } bool OutputLayer::needsFiltering() const { Loading
services/surfaceflinger/DisplayHardware/HWC2.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -626,9 +626,9 @@ Error Display::getRequestedLuts(LayerLuts* outLuts, auto layer = getLayerById(layerIds[i]); if (layer) { auto& layerLut = tmpLuts[i]; std::vector<std::pair<int32_t, LutProperties>> lutOffsetsAndProperties; if (layerLut.luts.pfd.get() >= 0 && layerLut.luts.offsets.has_value()) { const auto& offsets = layerLut.luts.offsets.value(); std::vector<std::pair<int32_t, LutProperties>> lutOffsetsAndProperties; lutOffsetsAndProperties.reserve(offsets.size()); std::transform(offsets.begin(), offsets.end(), layerLut.luts.lutProperties.begin(), std::back_inserter(lutOffsetsAndProperties), Loading @@ -637,8 +637,12 @@ Error Display::getRequestedLuts(LayerLuts* outLuts, lutFileDescriptorMapper.emplace_or_replace(layer.get(), ::android::base::unique_fd( layerLut.luts.pfd.release())); } else if (layerLut.luts.pfd.get() < 0) { outLuts->emplace_or_replace(layer.get(), lutOffsetsAndProperties); lutFileDescriptorMapper.emplace_or_replace(layer.get(), ::android::base::unique_fd()); } else { ALOGE("getRequestedLuts: invalid luts on layer %" PRIu64 " found" ALOGE("getRequestedLuts: invalid luts offsets on layer %" PRIu64 " found" " on display %" PRIu64 ". pfd.get()=%d, offsets.has_value()=%d", layerIds[i], mId, layerLut.luts.pfd.get(), layerLut.luts.offsets.has_value()); } Loading