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

Commit 8c02341c authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

Revert "Use configStore for maxVirtualDisplay Size"

This reverts commit 56a5dbd3.

Change-Id: I66224bb48d3146846200ff7f2d5a66d1d8ff5cf7
parent 56a5dbd3
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -73,6 +73,12 @@ ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
    LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
    LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
endif
endif


ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
    LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
else
    LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=0
endif

LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
LOCAL_CFLAGS += -fvisibility=hidden -Werror=format


LOCAL_HEADER_LIBRARIES := \
LOCAL_HEADER_LIBRARIES := \
+5 −5
Original line number Original line Diff line number Diff line
@@ -267,12 +267,12 @@ status_t HWComposer::allocateVirtualDisplay(uint32_t width, uint32_t height,
        return NO_MEMORY;
        return NO_MEMORY;
    }
    }


    if (SurfaceFlinger::maxVirtualDisplaySize != 0 &&
    if (MAX_VIRTUAL_DISPLAY_DIMENSION != 0 &&
        (width > SurfaceFlinger::maxVirtualDisplaySize ||
        (width > MAX_VIRTUAL_DISPLAY_DIMENSION ||
         height > SurfaceFlinger::maxVirtualDisplaySize)) {
         height > MAX_VIRTUAL_DISPLAY_DIMENSION)) {
        ALOGE("createVirtualDisplay: Can't create a virtual display with"
        ALOGE("createVirtualDisplay: Can't create a virtual display with"
                      " a dimension > %" PRIu64 " (tried %u x %u)",
                      " a dimension > %u (tried %u x %u)",
              SurfaceFlinger::maxVirtualDisplaySize, width, height);
              MAX_VIRTUAL_DISPLAY_DIMENSION, width, height);
        return INVALID_OPERATION;
        return INVALID_OPERATION;
    }
    }


+0 −6
Original line number Original line Diff line number Diff line
@@ -99,7 +99,6 @@ EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint na


namespace android {
namespace android {



using namespace android::hardware::configstore;
using namespace android::hardware::configstore;
using namespace android::hardware::configstore::V1_0;
using namespace android::hardware::configstore::V1_0;


@@ -116,7 +115,6 @@ int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs;
bool SurfaceFlinger::useContextPriority;
bool SurfaceFlinger::useContextPriority;
int64_t SurfaceFlinger::dispSyncPresentTimeOffset;
int64_t SurfaceFlinger::dispSyncPresentTimeOffset;
bool SurfaceFlinger::useHwcForRgbToYuv;
bool SurfaceFlinger::useHwcForRgbToYuv;
uint64_t SurfaceFlinger::maxVirtualDisplaySize;


SurfaceFlinger::SurfaceFlinger()
SurfaceFlinger::SurfaceFlinger()
    :   BnSurfaceComposer(),
    :   BnSurfaceComposer(),
@@ -178,9 +176,6 @@ SurfaceFlinger::SurfaceFlinger()
    useHwcForRgbToYuv = getBool< ISurfaceFlingerConfigs,
    useHwcForRgbToYuv = getBool< ISurfaceFlingerConfigs,
            &ISurfaceFlingerConfigs::useHwcForRGBtoYUV>(false);
            &ISurfaceFlingerConfigs::useHwcForRGBtoYUV>(false);


    maxVirtualDisplaySize = getUInt64<ISurfaceFlingerConfigs,
            &ISurfaceFlingerConfigs::maxVirtualDisplaySize>(0);

    // debugging stuff...
    // debugging stuff...
    char value[PROPERTY_VALUE_MAX];
    char value[PROPERTY_VALUE_MAX];


@@ -3248,7 +3243,6 @@ void SurfaceFlinger::appendSfConfigString(String8& result) const


    result.appendFormat(" PRESENT_TIME_OFFSET=%" PRId64 , dispSyncPresentTimeOffset);
    result.appendFormat(" PRESENT_TIME_OFFSET=%" PRId64 , dispSyncPresentTimeOffset);
    result.appendFormat(" FORCE_HWC_FOR_RBG_TO_YUV=%d", useHwcForRgbToYuv);
    result.appendFormat(" FORCE_HWC_FOR_RBG_TO_YUV=%d", useHwcForRgbToYuv);
    result.appendFormat(" MAX_VIRT_DISPLAY_DIM=%" PRIu64, maxVirtualDisplaySize);
    result.append("]");
    result.append("]");
}
}


+1 −4
Original line number Original line Diff line number Diff line
@@ -105,6 +105,7 @@ class SurfaceFlinger : public BnSurfaceComposer,
{
{
public:
public:



    // This is the phase offset in nanoseconds of the software vsync event
    // This is the phase offset in nanoseconds of the software vsync event
    // relative to the vsync event reported by HWComposer.  The software vsync
    // relative to the vsync event reported by HWComposer.  The software vsync
    // event is when SurfaceFlinger and Choreographer-based applications run each
    // event is when SurfaceFlinger and Choreographer-based applications run each
@@ -141,10 +142,6 @@ public:
    // GL composition.
    // GL composition.
    static bool useHwcForRgbToYuv;
    static bool useHwcForRgbToYuv;


    // Maximum dimension supported by HWC for virtual display.
    // Equal to min(max_height, max_width).
    static uint64_t maxVirtualDisplaySize;

    static char const* getServiceName() ANDROID_API {
    static char const* getServiceName() ANDROID_API {
        return "SurfaceFlinger";
        return "SurfaceFlinger";
    }
    }
+4 −10
Original line number Original line Diff line number Diff line
@@ -114,7 +114,6 @@ int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs;
bool SurfaceFlinger::useContextPriority;
bool SurfaceFlinger::useContextPriority;
int64_t SurfaceFlinger::dispSyncPresentTimeOffset;
int64_t SurfaceFlinger::dispSyncPresentTimeOffset;
bool SurfaceFlinger::useHwcForRgbToYuv;
bool SurfaceFlinger::useHwcForRgbToYuv;
uint64_t SurfaceFlinger::maxVirtualDisplaySize;


SurfaceFlinger::SurfaceFlinger()
SurfaceFlinger::SurfaceFlinger()
    :   BnSurfaceComposer(),
    :   BnSurfaceComposer(),
@@ -151,17 +150,13 @@ SurfaceFlinger::SurfaceFlinger()
        mLastSwapTime(0),
        mLastSwapTime(0),
        mNumLayers(0)
        mNumLayers(0)
{
{

    ALOGI("SurfaceFlinger is starting");

    vsyncPhaseOffsetNs = getInt64< ISurfaceFlingerConfigs,
    vsyncPhaseOffsetNs = getInt64< ISurfaceFlingerConfigs,
            &ISurfaceFlingerConfigs::vsyncEventPhaseOffsetNs>(1000000);
            &ISurfaceFlingerConfigs::vsyncEventPhaseOffsetNs>(1000000);


    sfVsyncPhaseOffsetNs = getInt64< ISurfaceFlingerConfigs,
    sfVsyncPhaseOffsetNs = getInt64< ISurfaceFlingerConfigs,
            &ISurfaceFlingerConfigs::vsyncSfEventPhaseOffsetNs>(1000000);
            &ISurfaceFlingerConfigs::vsyncSfEventPhaseOffsetNs>(1000000);


    maxVirtualDisplaySize = getUInt64<ISurfaceFlingerConfigs,
    ALOGI("SurfaceFlinger is starting");
            &ISurfaceFlingerConfigs::maxVirtualDisplaySize>(0);


    useContextPriority = getBool< ISurfaceFlingerConfigs,
    useContextPriority = getBool< ISurfaceFlingerConfigs,
            &ISurfaceFlingerConfigs::useContextPriority>(false);
            &ISurfaceFlingerConfigs::useContextPriority>(false);
@@ -1706,9 +1701,9 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
                            ALOGE_IF(status != NO_ERROR,
                            ALOGE_IF(status != NO_ERROR,
                                    "Unable to query height (%d)", status);
                                    "Unable to query height (%d)", status);
                            if (mUseHwcVirtualDisplays &&
                            if (mUseHwcVirtualDisplays &&
                                    (SurfaceFlinger::maxVirtualDisplaySize == 0 ||
                                    (MAX_VIRTUAL_DISPLAY_DIMENSION == 0 ||
                                    (width <= SurfaceFlinger::maxVirtualDisplaySize &&
                                    (width <= MAX_VIRTUAL_DISPLAY_DIMENSION &&
                                     height <= SurfaceFlinger::maxVirtualDisplaySize))) {
                                     height <= MAX_VIRTUAL_DISPLAY_DIMENSION))) {
                                hwcDisplayId = allocateHwcDisplayId(state.type);
                                hwcDisplayId = allocateHwcDisplayId(state.type);
                            }
                            }


@@ -3020,7 +3015,6 @@ void SurfaceFlinger::appendSfConfigString(String8& result) const


    result.appendFormat(" PRESENT_TIME_OFFSET=%" PRId64, dispSyncPresentTimeOffset);
    result.appendFormat(" PRESENT_TIME_OFFSET=%" PRId64, dispSyncPresentTimeOffset);
    result.appendFormat(" FORCE_HWC_FOR_RBG_TO_YUV=%d", useHwcForRgbToYuv);
    result.appendFormat(" FORCE_HWC_FOR_RBG_TO_YUV=%d", useHwcForRgbToYuv);
    result.appendFormat(" MAX_VIRT_DISPLAY_DIM=%" PRIu64, maxVirtualDisplaySize);
    result.append("]");
    result.append("]");
}
}