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

Commit 2e1aa184 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Switch from HIDL Composition type to AIDL

In preparation for adding a new Composition type which is only in AIDL.
This change is almost completely mechanical, and should have no impact
on behavior.

Bug: 193170859
Test: existing tests

Change-Id: I1f923fcc8d8e6dff388493a76e31d435638b5255
parent 6ddaa7ae
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -292,14 +292,15 @@ void BufferLayer::preparePerFrameCompositionState() {
    // Sideband layers
    auto* compositionState = editCompositionState();
    if (compositionState->sidebandStream.get() && !compositionState->sidebandStreamHasFrame) {
        compositionState->compositionType = Hwc2::IComposerClient::Composition::SIDEBAND;
        compositionState->compositionType =
                aidl::android::hardware::graphics::composer3::Composition::SIDEBAND;
        return;
    } else {
        // Normal buffer layers
        compositionState->hdrMetadata = mBufferInfo.mHdrMetadata;
        compositionState->compositionType = mPotentialCursor
                ? Hwc2::IComposerClient::Composition::CURSOR
                : Hwc2::IComposerClient::Composition::DEVICE;
                ? aidl::android::hardware::graphics::composer3::Composition::CURSOR
                : aidl::android::hardware::graphics::composer3::Composition::DEVICE;
    }

    compositionState->buffer = mBufferInfo.mBuffer->getBuffer();
+4 −1
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@

#include "DisplayHardware/Hal.h"

#include <aidl/android/hardware/graphics/composer3/Composition.h>

// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic pop // ignored "-Wconversion -Wextra"

@@ -156,7 +158,8 @@ struct LayerFECompositionState {
     */

    // The type of composition for this layer
    hal::Composition compositionType{hal::Composition::INVALID};
    aidl::android::hardware::graphics::composer3::Composition compositionType{
            aidl::android::hardware::graphics::composer3::Composition::INVALID};

    // The buffer and related state
    sp<GraphicBuffer> buffer;
+4 −1
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@

#include "LayerFE.h"

#include <aidl/android/hardware/graphics/composer3/Composition.h>

// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic pop // ignored "-Wconversion -Wextra"

@@ -112,7 +114,8 @@ public:
    virtual bool isHardwareCursor() const = 0;

    // Applies a HWC device requested composition type change
    virtual void applyDeviceCompositionTypeChange(Hwc2::IComposerClient::Composition) = 0;
    virtual void applyDeviceCompositionTypeChange(
            aidl::android::hardware::graphics::composer3::Composition) = 0;

    // Prepares to apply any HWC device layer requests
    virtual void prepareForDeviceLayerRequests() = 0;
+13 −7
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@

#include "DisplayHardware/DisplayIdentification.h"

#include <aidl/android/hardware/graphics/composer3/Composition.h>

namespace android::compositionengine {

struct LayerFECompositionState;
@@ -50,7 +52,8 @@ public:
    HWC2::Layer* getHwcLayer() const override;
    bool requiresClientComposition() const override;
    bool isHardwareCursor() const override;
    void applyDeviceCompositionTypeChange(Hwc2::IComposerClient::Composition) override;
    void applyDeviceCompositionTypeChange(
            aidl::android::hardware::graphics::composer3::Composition) override;
    void prepareForDeviceLayerRequests() override;
    void applyDeviceLayerRequest(Hwc2::IComposerClient::LayerRequest request) override;
    bool needsFiltering() const override;
@@ -68,21 +71,24 @@ protected:

private:
    Rect calculateInitialCrop() const;
    void writeOutputDependentGeometryStateToHWC(HWC2::Layer*, Hwc2::IComposerClient::Composition,
                                                uint32_t z);
    void writeOutputDependentGeometryStateToHWC(
            HWC2::Layer*, aidl::android::hardware::graphics::composer3::Composition, uint32_t z);
    void writeOutputIndependentGeometryStateToHWC(HWC2::Layer*, const LayerFECompositionState&,
                                                  bool skipLayer);
    void writeOutputDependentPerFrameStateToHWC(HWC2::Layer*);
    void writeOutputIndependentPerFrameStateToHWC(
            HWC2::Layer*, const LayerFECompositionState&,
            Hwc2::IComposerClient::Composition compositionType, bool skipLayer);
            aidl::android::hardware::graphics::composer3::Composition compositionType,
            bool skipLayer);
    void writeSolidColorStateToHWC(HWC2::Layer*, const LayerFECompositionState&);
    void writeSidebandStateToHWC(HWC2::Layer*, const LayerFECompositionState&);
    void writeBufferStateToHWC(HWC2::Layer*, const LayerFECompositionState&, bool skipLayer);
    void writeCompositionTypeToHWC(HWC2::Layer*, Hwc2::IComposerClient::Composition,
    void writeCompositionTypeToHWC(HWC2::Layer*,
                                   aidl::android::hardware::graphics::composer3::Composition,
                                   bool isPeekingThrough, bool skipLayer);
    void detectDisallowedCompositionTypeChange(Hwc2::IComposerClient::Composition from,
                                               Hwc2::IComposerClient::Composition to) const;
    void detectDisallowedCompositionTypeChange(
            aidl::android::hardware::graphics::composer3::Composition from,
            aidl::android::hardware::graphics::composer3::Composition to) const;
    bool isClientCompositionForced(bool isPeekingThrough) const;
};

+4 −2
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@

#include "DisplayHardware/ComposerHal.h"

#include <aidl/android/hardware/graphics/composer3/Composition.h>

// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic pop // ignored "-Wconversion -Wextra"

@@ -123,8 +125,8 @@ struct OutputLayerCompositionState {
        std::shared_ptr<HWC2::Layer> hwcLayer;

        // The most recently set HWC composition type for this layer
        Hwc2::IComposerClient::Composition hwcCompositionType{
                Hwc2::IComposerClient::Composition::INVALID};
        aidl::android::hardware::graphics::composer3::Composition hwcCompositionType{
                aidl::android::hardware::graphics::composer3::Composition::INVALID};

        // The buffer cache for this layer. This is used to lower the
        // cost of sending reused buffers to the HWC.
Loading