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

Commit e07d8df1 authored by Dominik Laskowski's avatar Dominik Laskowski Committed by Android (Google) Code Review
Browse files

Merge "SF: Let DM resize framebuffer on resolution change" into main

parents 06b6e6bb 251e612d
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -502,12 +502,18 @@ struct DisplayState {
    Rect layerStackSpaceRect = Rect::EMPTY_RECT;
    Rect orientedDisplaySpaceRect = Rect::EMPTY_RECT;

    // Exclusive to virtual displays: The sink surface into which the virtual display is rendered,
    // and an optional resolution that overrides its default dimensions.
    sp<IGraphicBufferProducer> surface;
    // For physical displays, this is the resolution, which must match the active display mode. To
    // change the resolution, the client must first call SurfaceControl.setDesiredDisplayModeSpecs
    // with the new DesiredDisplayModeSpecs#defaultMode, then commit the matching width and height.
    //
    // For virtual displays, this is an optional resolution that overrides its default dimensions.
    //
    uint32_t width = 0;
    uint32_t height = 0;

    // For virtual displays, this is the sink surface into which the virtual display is rendered.
    sp<IGraphicBufferProducer> surface;

    status_t write(Parcel& output) const;
    status_t read(const Parcel& input);
};
+2 −1
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ namespace android::display {
struct DisplayModeRequest {
    scheduler::FrameRateMode mode;

    // Whether to emit DisplayEventReceiver::DISPLAY_EVENT_MODE_CHANGE.
    // Whether to emit DisplayEventReceiver::DISPLAY_EVENT_MODE_CHANGE for a change in refresh rate
    // or render rate. Ignored for resolution changes, which always emit the event.
    bool emitEvent = false;

    // Whether to force the request to be applied, even if the mode is unchanged.
+1 −3
Original line number Diff line number Diff line
@@ -223,9 +223,7 @@ void DisplayDevice::setFlags(uint32_t flags) {
    mFlags = flags;
}

void DisplayDevice::setDisplaySize(int width, int height) {
    LOG_FATAL_IF(!isVirtual(), "Changing the display size is supported only for virtual displays.");
    const auto size = ui::Size(width, height);
void DisplayDevice::setDisplaySize(ui::Size size) {
    mCompositionDisplay->setDisplaySize(size);
    if (mRefreshRateOverlay) {
        mRefreshRateOverlay->setViewport(size);
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public:
    ui::Size getSize() const { return {getWidth(), getHeight()}; }

    void setLayerFilter(ui::LayerFilter);
    void setDisplaySize(int width, int height);
    void setDisplaySize(ui::Size);
    void setProjection(ui::Rotation orientation, Rect viewport, Rect frame);
    void stageBrightness(float brightness) REQUIRES(kMainThreadContext);
    void persistBrightness(bool needsComposite) REQUIRES(kMainThreadContext);
+4 −0
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@ struct FrameRateMode {
    }

    bool operator!=(const FrameRateMode& other) const { return !(*this == other); }

    bool matchesResolution(const FrameRateMode& other) const {
        return modePtr->getResolution() == other.modePtr->getResolution();
    }
};

inline std::string to_string(const FrameRateMode& mode) {
Loading