Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

It is advised here and there to add debug.sf.hw=1 to build.prop.

They say that this "makes Android render GUI with GPU". This looks very suspicious because what does it debug then (and since when debug speeded up anything)?

So I'm just curious about what does this setting (property) actually means?

share|improve this question
    
You should accept answers. –  Shimmy Sep 13 '12 at 0:03

1 Answer 1

up vote 6 down vote accepted

I believe what it stands for is "Debug SurfaceFlinger Hardware", and there's only one (that I know of) reference to it in the Android source code (in DisplayHardware.cpp):

// debug: disable h/w rendering
char property[PROPERTY_VALUE_MAX];
if (property_get("debug.sf.hw", property, NULL) > 0) {
    if (atoi(property) == 0) {
        ALOGW("H/W composition disabled");
        attribs[2] = EGL_CONFIG_CAVEAT;
        attribs[3] = EGL_SLOW_CONFIG;
    }
}

Or, in English terms, the system reads the value of the debug.sf.hw flag. If it has a value and that value is equal to zero it disables hardware compositing, otherwise it skips over that block of code.

I think there's something of a misconception in that the default should be to have hardware compositing enabled, but you can set debug.sf.hw=0 in order to disable it. So really it is a debug flag, but setting it to 1 (strictly speaking, any non-zero value) would explicitly cause compositing to remain enabled. As far as I know, though, the only time it should really have an impact is if the device's default value is 0 for whatever reason.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.