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

Commit 4731cc24 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 am: 8ed79419

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


    void expectSetColorCall() {
    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.g * 255)),
                                  static_cast<uint8_t>(std::round(kColor.b * 255)), 255};
                                  static_cast<uint8_t>(std::round(kColor.b * 255)), 255};


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


namespace android {
namespace android {


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

using android::base::StringAppendF;
using android::base::StringAppendF;


ui::Transform::RotationFlags DisplayDevice::sPrimaryDisplayRotationFlags = ui::Transform::ROT_0;
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;
    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;
    return mPowerMode;
}
}


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


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


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


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


    static ui::Transform::RotationFlags sPrimaryDisplayRotationFlags;
    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;
    HwcConfigIndexType mActiveConfig;


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


        bool operator==(const Physical& other) const {
        bool operator==(const Physical& other) const {
            return id == other.id && type == other.type && hwcDisplayId == other.hwcDisplayId;
            return id == other.id && type == other.type && hwcDisplayId == other.hwcDisplayId;
@@ -228,7 +228,8 @@ struct DisplayDeviceCreationArgs {
    HdrCapabilities hdrCapabilities;
    HdrCapabilities hdrCapabilities;
    int32_t supportedPerFrameMetadata{0};
    int32_t supportedPerFrameMetadata{0};
    std::unordered_map<ui::ColorMode, std::vector<ui::RenderIntent>> hwcColorModes;
    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};
    bool isPrimary{false};
};
};


Loading