FramebufferSurface build error on HWC1 board config [Oreo r34]

104 views
Skip to first unread message

Jose Emmanuel Mayol

unread,
Nov 27, 2017, 10:26:40 AM11/27/17
to Android Building
Hi All,

I am attempting to build aosp (8.0.0_r34) for a sim config that is still using HWC1. I am getting the following build error for FramebufferSurface because it is using HWCompser::setClientTarget() outside of the #ifdef USE_HWC2 check. setClientTarget() is a function signature defined for HWC2 only (see HWComposer.h and HWComposer_hwc1.h).

<console snipppet>
frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp:180:18: error: no member named 'setClientTarget' in 'android::HWComposer'
            mHwc.setClientTarget(mDisplayType, outSlot, outFence, outBuffer, outDataspace);
            ~~~~ ^
frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp:180:48: error: use of undeclared identifier 'outSlot'
            mHwc.setClientTarget(mDisplayType, outSlot, outFence, outBuffer, outDataspace);
                                               ^
frameworks/native/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp:180:78: error: use of undeclared identifier 'outDataspace'
            mHwc.setClientTarget(mDisplayType, outSlot, outFence, outBuffer, outDataspace);
                                                                             ^
3 errors generated.
[ 80% 38974/48129] //frameworks/base:libplatformprotos clang++ .intermediates/frameworks/base/libplatformprotos/linux_x86_64_static/gen/proto/frameworks/base/core/proto/android/providers/settings.pb.cc [linux]
ninja: build stopped: subcommand failed.
16:17:08 ninja failed with: exit status 1
build/core/main.mk:21: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
<end console snipppet>

Running git annotate on FramebufferSurface.cpp, I can see that the below commit moved the setClientTarget() call from FramebufferSurface::advanceFrame() to FramebufferSurface::nextBuffer(), but it looks like it should have been placed within the USE_HWC2 guard. I was able to go around the error by doing just that.

    commit 281e8113d0ce20c702e847caf971663021eb65e3

    Communicate composition buffer dataspace to HWC
    
    Test: adb shell dumpsys SurfaceFlinger
          look for dataspace info in DisplayDevice section
    Bug: 63146977
    Change-Id: If427171994fbc91faacf5bad9cc736ddfbd35ec3
    (cherry picked from commit 79d272442ce13418c3ea81c95d7fea0159b4b481)


It doesn't look like placing the setClientTarget() call outside of the USE_HWC2 guard was intentional, but as I have little knowledge of surfaceflinger internals, I thought to raise the question. The workaround means on HWC1 builds, FramebufferSurface::nextBuffer() will just return NO_ERROR but I have yet to complete my build to see if this works. I have also not found any bug reports or active reviews related to this.

Any thoughts?

Jose Mayol

unread,
Dec 6, 2017, 12:35:01 PM12/6/17
to Android Building
FYI, I can see that this has now been addressed in android-8.1.0_r1 (thanks!). Nothing else to see here.
Reply all
Reply to author
Forward
0 new messages