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

Commit 29a6a8b0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove usage of hwcomposer_defs.h." into rvc-dev am: c744328d

Change-Id: Ibddb3898225d4c960b8c744e2a15b57efd7000b5
parents eab00853 c744328d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ cc_defaults {
        "libGLESv1_CM",
        "libGLESv2",
        "libgui",
        "libhardware",
        "libhidlbase",
        "liblayers_proto",
        "liblog",
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public:
                 status_t(DisplayId, uint32_t, const sp<Fence>&, const sp<GraphicBuffer>&,
                          ui::Dataspace));
    MOCK_METHOD1(presentAndGetReleaseFences, status_t(DisplayId));
    MOCK_METHOD2(setPowerMode, status_t(DisplayId, int));
    MOCK_METHOD2(setPowerMode, status_t(DisplayId, hal::PowerMode));
    MOCK_METHOD2(setActiveConfig, status_t(DisplayId, size_t));
    MOCK_METHOD2(setColorTransform, status_t(DisplayId, const mat4&));
    MOCK_METHOD1(disconnectDisplay, void(DisplayId));
+3 −3
Original line number Diff line number Diff line
@@ -716,7 +716,7 @@ struct OutputLayerWriteStateToHWCTest : public OutputLayerTest {
    }

    void expectSetColorCall() {
        hwc_color_t color = {static_cast<uint8_t>(std::round(kColor.r * 255)),
        const hal::Color color = {static_cast<uint8_t>(std::round(kColor.r * 255)),
                                  static_cast<uint8_t>(std::round(kColor.g * 255)),
                                  static_cast<uint8_t>(std::round(kColor.b * 255)), 255};

+8 −5
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@

namespace android {

namespace hal = hardware::graphics::composer::hal;

using android::base::StringAppendF;

ui::Transform::RotationFlags DisplayDevice::sPrimaryDisplayRotationFlags = ui::Transform::ROT_0;
@@ -119,17 +121,17 @@ uint32_t DisplayDevice::getPageFlipCount() const {
}

// ----------------------------------------------------------------------------
void DisplayDevice::setPowerMode(int mode) {
void DisplayDevice::setPowerMode(hal::PowerMode mode) {
    mPowerMode = mode;
    getCompositionDisplay()->setCompositionEnabled(mPowerMode != HWC_POWER_MODE_OFF);
    getCompositionDisplay()->setCompositionEnabled(mPowerMode != hal::PowerMode::OFF);
}

int DisplayDevice::getPowerMode()  const {
hal::PowerMode DisplayDevice::getPowerMode() const {
    return mPowerMode;
}

bool DisplayDevice::isPoweredOn() const {
    return mPowerMode != HWC_POWER_MODE_OFF;
    return mPowerMode != hal::PowerMode::OFF;
}

void DisplayDevice::setActiveConfig(HwcConfigIndexType mode) {
@@ -262,7 +264,8 @@ void DisplayDevice::dump(std::string& result) const {
    StringAppendF(&result, "+ %s\n", getDebugName().c_str());

    result.append("   ");
    StringAppendF(&result, "powerMode=%d, ", mPowerMode);
    StringAppendF(&result, "powerMode=%s (%d), ", to_string(mPowerMode).c_str(),
                  static_cast<int32_t>(mPowerMode));
    StringAppendF(&result, "activeConfig=%d, ", mActiveConfig.value());
    getCompositionDisplay()->dump(result);
}
+7 −6
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@
#include <android/native_window.h>
#include <binder/IBinder.h>
#include <gui/LayerState.h>
#include <hardware/hwcomposer_defs.h>
#include <math/mat4.h>
#include <renderengine/RenderEngine.h>
#include <system/window.h>
@@ -136,8 +135,8 @@ public:
    /* ------------------------------------------------------------------------
     * Display power mode management.
     */
    int getPowerMode() const;
    void setPowerMode(int mode);
    hardware::graphics::composer::hal::PowerMode getPowerMode() const;
    void setPowerMode(hardware::graphics::composer::hal::PowerMode mode);
    bool isPoweredOn() const;

    ui::Dataspace getCompositionDataSpace() const;
@@ -173,7 +172,8 @@ private:

    static ui::Transform::RotationFlags sPrimaryDisplayRotationFlags;

    int mPowerMode = HWC_POWER_MODE_OFF;
    hardware::graphics::composer::hal::PowerMode mPowerMode =
            hardware::graphics::composer::hal::PowerMode::OFF;
    HwcConfigIndexType mActiveConfig;

    // TODO(b/74619554): Remove special cases for primary display.
@@ -184,7 +184,7 @@ struct DisplayDeviceState {
    struct Physical {
        DisplayId id;
        DisplayConnectionType type;
        android::hardware::graphics::composer::hal::HWDisplayId hwcDisplayId;
        hardware::graphics::composer::hal::HWDisplayId hwcDisplayId;

        bool operator==(const Physical& other) const {
            return id == other.id && type == other.type && hwcDisplayId == other.hwcDisplayId;
@@ -228,7 +228,8 @@ struct DisplayDeviceCreationArgs {
    HdrCapabilities hdrCapabilities;
    int32_t supportedPerFrameMetadata{0};
    std::unordered_map<ui::ColorMode, std::vector<ui::RenderIntent>> hwcColorModes;
    int initialPowerMode{HWC_POWER_MODE_NORMAL};
    hardware::graphics::composer::hal::PowerMode initialPowerMode{
            hardware::graphics::composer::hal::PowerMode::ON};
    bool isPrimary{false};
};

Loading