Exemple #1
0
String GraphicsLayer::layerTreeAsText(LayerTreeAsTextBehavior behavior) const
{
    TextStream ts;

    dumpLayer(ts, 0, behavior);
    return ts.release();
}
void HwcDebug::dumpLayers(hwc_display_contents_1_t* list)
{
    // Check need for dumping layers for debugging.
    if (UNLIKELY(sDumpEnable) && UNLIKELY(needToDumpLayers()) && LIKELY(list)) {
        logHwcProps(list->flags);
        for (size_t i = 0; i < list->numHwLayers; i++) {
            logLayer(i, list->hwLayers);
            dumpLayer(i, list->hwLayers);
        }
    }
}
Exemple #3
0
void LayerAndroid::dumpLayers(FILE* file, int indentLevel) const
{
    writeln(file, indentLevel, "{");

    dumpLayer(file, indentLevel);

    if (countChildren()) {
        writeln(file, indentLevel + 1, "children = [");
        for (int i = 0; i < countChildren(); i++) {
            if (i > 0)
                writeln(file, indentLevel + 1, ", ");
            getChild(i)->dumpLayers(file, indentLevel + 1);
        }
        writeln(file, indentLevel + 1, "];");
    }
    writeln(file, indentLevel, "}");
}
Exemple #4
0
String CCLayerImpl::layerTreeAsText() const
{
    TextStream ts;
    dumpLayer(ts, 0);
    return ts.release();
}
int ExynosVirtualDisplay::prepare(hwc_display_contents_1_t* contents)
{
    ALOGV("preparing %u layers for virtual", contents->numHwLayers);
    hwc_layer_1_t *video_layer = NULL;
    int ret = 0;
    bool isRotationState = false;

    mCompositionType = COMPOSITION_GLES;
    mIsSecureDRM = false;
    mIsNormalDRM = false;
    for (size_t i = 0; i < contents->numHwLayers; i++) {
        hwc_layer_1_t &layer = contents->hwLayers[i];

        if (layer.flags & HWC_ROTATION_ANIMATION) {
            isRotationState = true;
            break;
        }

        if (layer.handle) {
            private_handle_t *h = private_handle_t::dynamicCast(layer.handle);
            if(mMPPs[0]->isProcessingSupported(layer, h->format, false)) {
                if (getDrmMode(h->flags) == SECURE_DRM) {
                    mCompositionType = COMPOSITION_MIXED;
                    layer.compositionType = HWC_OVERLAY;
                    mIsSecureDRM = true;
                    ALOGV("include secure drm layer");
                }
                if (getDrmMode(h->flags) == NORMAL_DRM) {
                    mCompositionType = COMPOSITION_MIXED;
                    layer.compositionType = HWC_OVERLAY;
                    mIsNormalDRM = true;
                    ALOGV("include normal drm layer");
                }
            }
        }
    }

    if (mPrevCompositionType != mCompositionType) {
        ExynosMPPModule &gsc = *mMPPs[0];
        gsc.mDstBuffers[gsc.mCurrentBuf] = NULL;
        gsc.mDstBufFence[gsc.mCurrentBuf] = -1;
        gsc.cleanupM2M();
    }

    mSinkUsage = GRALLOC_USAGE_HW_COMPOSER;

    if (mIsSecureDRM)
        mSinkUsage |= GRALLOC_USAGE_SW_READ_NEVER |
            GRALLOC_USAGE_SW_WRITE_NEVER |
            GRALLOC_USAGE_PROTECTED |
            GRALLOC_USAGE_PHYSICALLY_LINEAR;
    else if (mIsNormalDRM)
        mSinkUsage |= GRALLOC_USAGE_PRIVATE_NONSECURE;
    ALOGV("Sink Buffer's Usage: 0x%x", mSinkUsage);

    for (size_t i = 0; i < contents->numHwLayers; i++) {
        hwc_layer_1_t &layer = contents->hwLayers[i];

        if (isRotationState) {
            layer.compositionType = HWC_OVERLAY;
            layer.flags = HWC_SKIP_RENDERING;
            if (mIsSecureDRM)
                ret = true;
            continue;
        }

        if (layer.compositionType == HWC_FRAMEBUFFER_TARGET) {
            ALOGV("\tlayer %u: framebuffer target", i);

            if (!mIsSecureDRM && !mIsNormalDRM)
                calcDisplayRect(layer);
            layer.transform = mFrameBufferTargetTransform;
            continue;
        }

        if (layer.compositionType == HWC_BACKGROUND) {
            ALOGV("\tlayer %u: background layer", i);
            dumpLayer(&layer);
            continue;
        }

        if (layer.handle) {
            private_handle_t *h = private_handle_t::dynamicCast(layer.handle);

            if (h->flags & GRALLOC_USAGE_INTERNAL_ONLY) {
                layer.compositionType = HWC_OVERLAY;
                layer.flags = HWC_SKIP_RENDERING;
                continue;
            }

            if ((getDrmMode(h->flags) != NO_DRM) && (h->flags & GRALLOC_USAGE_EXTERNAL_DISP)) {
                if (mMPPs[0]->isProcessingSupported(layer, h->format, false)) {
                    if (!video_layer) {
                        if (mIsSecureDRM)
                            ret = mG2D->InitSecureG2D();
                        video_layer = &layer;
                        calcDisplayRect(layer);

                        ALOGV("\tlayer %u: video layer", i);
                        dumpLayer(&layer);
                        continue;
                    }
                } else {
                    layer.compositionType = HWC_OVERLAY;
                    layer.flags = HWC_SKIP_RENDERING;
                    ALOGV("\tlayer %u: skip drm layer", i);
                    continue;
                }
            }
        }
        layer.compositionType = HWC_FRAMEBUFFER;
        dumpLayer(&layer);
    }

    if (!ret && mPhysicallyLinearBufferAddr) {
        mG2D->TerminateSecureG2D();
        unmapAddrFBTarget();
    }

    return 0;
}
Exemple #6
0
std::string CCLayerImpl::layerTreeAsText() const
{
    std::string str;
    dumpLayer(&str, 0);
    return str;
}