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

Commit bceeddde authored by Jeykumar Sankaran's avatar Jeykumar Sankaran Committed by toastcfh
Browse files

surfaceflinger: Send the alpha value to HWC

C2D composition can handle fade cases. Don't skip layers in fade
case if C2D composition is used. Send the alpha value of the layer
to the HWC

Change-Id: I2751bcb175679b063617102cecda874bc94ad5cf
CRs-fixed: 288257
parent 55a39f8f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
	LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY -DNEVER_DEFAULT_TO_ASYNC_MODE
	LOCAL_CFLAGS += -DREFRESH_RATE=56
endif

ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
	LOCAL_CFLAGS += -DQCOM_HARDWARE
endif

LOCAL_SHARED_LIBRARIES := \
	libcutils \
+10 −0
Original line number Diff line number Diff line
@@ -173,6 +173,16 @@ void DisplayHardware::init(uint32_t dpy)
            LOGW("H/W composition disabled");
            attribs[2] = EGL_CONFIG_CAVEAT;
            attribs[3] = EGL_SLOW_CONFIG;
#ifdef QCOM_HARDWARE
        } else {
            // We have hardware composition enabled. Check the composition type
            if (property_get("debug.composition.type", property, NULL) > 0) {
                if(((strncmp(property, "c2d", 3)) == 0) ||
                   ((strncmp(property, "mdp", 3)) == 0)) {
                        mFlags |= (((strncmp(property, "c2d", 3)) == 0)) ? C2D_COMPOSITION:0;
                }
            }
#endif
        }
    }

+3 −0
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@ public:
        PARTIAL_UPDATES             = 0x00020000,   // video driver feature
        SLOW_CONFIG                 = 0x00040000,   // software
        SWAP_RECTANGLE              = 0x00080000,
#ifdef QCOM_HARDWARE
	C2D_COMPOSITION             = 0x00100000,    // C2D composition
#endif
    };

    DisplayHardware(
+14 −1
Original line number Diff line number Diff line
@@ -182,11 +182,24 @@ void Layer::setGeometry(hwc_layer_t* hwcl)

    hwcl->flags &= ~HWC_SKIP_LAYER;

#ifdef QCOM_HARDWARE
    const DisplayHardware& hw(graphicPlane(0).displayHardware());
    // we can't do alpha-fade with the hwc HAL. C2D composition
    // can handle fade cases
    const State& s(drawingState());
    if ((s.alpha < 0xFF) &&
        !(DisplayHardware::C2D_COMPOSITION & hw.getFlags())) {
        hwcl->flags = HWC_SKIP_LAYER;
    }

    hwcl->alpha = s.alpha;
#else
    // we can't do alpha-fade with the hwc HAL
    const State& s(drawingState());
    if (s.alpha < 0xFF) {
	hwcl->flags = HWC_SKIP_LAYER;
    }
#endif

    /*
     * Transformations are applied in this order: