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

Commit 617ef7b1 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11623990 from ae9b557b to 24Q3-release

Change-Id: I787146913ed4093084761f2a09865015397e59f1
parents 4499b062 ae9b557b
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -22,21 +22,17 @@
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <string>
#include <vector>

#include <android-base/logging.h>
#include <android-base/strings.h>
#include <android/input.h>
#include <com_android_input_flags.h>

#include <attestation/HmacKeyManager.h>
#include <ftl/enum.h>
#include <input/TfLiteMotionPredictor.h>

namespace input_flags = com::android::input::flags;

namespace android {
namespace {

@@ -201,14 +197,7 @@ std::unique_ptr<MotionEvent> MotionPredictor::predict(nsecs_t timestamp) {
            // device starts to speed up, but avoids producing noisy predictions as it slows down.
            break;
        }
        if (input_flags::enable_jerk_prediction_pruning()) {
            // TODO(b/266747654): Stop predictions if confidence is < some threshold
            // Arbitrarily high pruning index, will correct once jerk thresholding is implemented.
            const size_t upperBoundPredictionIndex = std::numeric_limits<size_t>::max();
            if (i > upperBoundPredictionIndex) {
                break;
            }
        }
        // TODO(b/266747654): Stop predictions if confidence is < some threshold.

        const TfLiteMotionPredictorSample::Point predictedPoint =
                convertPrediction(axisFrom, axisTo, predictedR[i], predictedPhi[i]);
+0 −7
Original line number Diff line number Diff line
@@ -128,10 +128,3 @@ flag {
  description: "Enable fling scrolling to be stopped by putting a finger on the touchpad again"
  bug: "281106755"
}

flag {
  name: "enable_jerk_prediction_pruning"
  namespace: "input"
  description: "Enable prediction pruning based on jerk thresholds."
  bug: "266747654"
}
+16 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@

#include <log/log_main.h>
#include <sync/sync.h>
#include <utils/Trace.h>

namespace android::renderengine::skia {

@@ -33,6 +34,12 @@ static void unref_semaphore(void* semaphore) {
    info->unref();
}

std::unique_ptr<SkiaGpuContext> GaneshVkRenderEngine::createContext(
        VulkanInterface& vulkanInterface) {
    return SkiaGpuContext::MakeVulkan_Ganesh(vulkanInterface.getGaneshBackendContext(),
                                             mSkSLCacheMonitor);
}

void GaneshVkRenderEngine::waitFence(SkiaGpuContext* context, base::borrowed_fd fenceFd) {
    if (fenceFd.get() < 0) return;

@@ -51,11 +58,18 @@ void GaneshVkRenderEngine::waitFence(SkiaGpuContext* context, base::borrowed_fd
    context->grDirectContext()->wait(1, &beSemaphore, kDeleteAfterWait);
}

base::unique_fd GaneshVkRenderEngine::flushAndSubmit(SkiaGpuContext* context) {
base::unique_fd GaneshVkRenderEngine::flushAndSubmit(SkiaGpuContext* context,
                                                     sk_sp<SkSurface> dstSurface) {
    sk_sp<GrDirectContext> grContext = context->grDirectContext();
    {
        ATRACE_NAME("flush surface");
        // TODO: Investigate feasibility of combining this "surface flush" into the "context flush"
        // below.
        context->grDirectContext()->flush(dstSurface.get());
    }

    VulkanInterface& vi = getVulkanInterface(isProtected());
    VkSemaphore semaphore = vi.createExportableSemaphore();

    GrBackendSemaphore backendSemaphore = GrBackendSemaphores::MakeVk(semaphore);

    GrFlushInfo flushInfo;
+2 −1
Original line number Diff line number Diff line
@@ -27,8 +27,9 @@ class GaneshVkRenderEngine : public SkiaVkRenderEngine {
protected:
    GaneshVkRenderEngine(const RenderEngineCreationArgs& args) : SkiaVkRenderEngine(args) {}

    std::unique_ptr<SkiaGpuContext> createContext(VulkanInterface& vulkanInterface) override;
    void waitFence(SkiaGpuContext* context, base::borrowed_fd fenceFd) override;
    base::unique_fd flushAndSubmit(SkiaGpuContext* context) override;
    base::unique_fd flushAndSubmit(SkiaGpuContext* context, sk_sp<SkSurface> dstSurface) override;
};

} // namespace android::renderengine::skia
+10 −5
Original line number Diff line number Diff line
@@ -337,8 +337,14 @@ void SkiaGLRenderEngine::waitFence(SkiaGpuContext*, base::borrowed_fd fenceFd) {
    }
}

base::unique_fd SkiaGLRenderEngine::flushAndSubmit(SkiaGpuContext* context) {
    base::unique_fd drawFence = flush();
base::unique_fd SkiaGLRenderEngine::flushAndSubmit(SkiaGpuContext* context,
                                                   sk_sp<SkSurface> dstSurface) {
    sk_sp<GrDirectContext> grContext = context->grDirectContext();
    {
        ATRACE_NAME("flush surface");
        grContext->flush(dstSurface.get());
    }
    base::unique_fd drawFence = flushGL();

    bool requireSync = drawFence.get() < 0;
    if (requireSync) {
@@ -346,8 +352,7 @@ base::unique_fd SkiaGLRenderEngine::flushAndSubmit(SkiaGpuContext* context) {
    } else {
        ATRACE_BEGIN("Submit(sync=false)");
    }
    bool success =
            context->grDirectContext()->submit(requireSync ? GrSyncCpu::kYes : GrSyncCpu::kNo);
    bool success = grContext->submit(requireSync ? GrSyncCpu::kYes : GrSyncCpu::kNo);
    ATRACE_END();
    if (!success) {
        ALOGE("Failed to flush RenderEngine commands");
@@ -394,7 +399,7 @@ bool SkiaGLRenderEngine::waitGpuFence(base::borrowed_fd fenceFd) {
    return true;
}

base::unique_fd SkiaGLRenderEngine::flush() {
base::unique_fd SkiaGLRenderEngine::flushGL() {
    ATRACE_CALL();
    if (!GLExtensions::getInstance().hasNativeFenceSync()) {
        return base::unique_fd();
Loading