graphics: get rid of BINDERIZED

It is always on now and all buffers be cloned and registered.
Clients (SF) should make use of the buffer caching mechanism and
pass each unique buffer once, to avoid the overhead.

Test: manual
Change-Id: I74ccbf74e110c8b413a66cfc60044b71ba3f44e3
This commit is contained in:
Chia-I Wu 2017-02-02 09:03:20 -08:00
parent f5589bdf8d
commit 16624b69d6
3 changed files with 11 additions and 43 deletions

View file

@ -2,7 +2,6 @@ cc_library_static {
name: "libhwcomposer-client",
export_include_dirs: ["."],
srcs: ["ComposerClient.cpp"],
cppflags: ["-DBINDERIZED"],
shared_libs: [
"android.hardware.graphics.allocator@2.0",
"android.hardware.graphics.composer@2.1",
@ -22,7 +21,8 @@ cc_library_static {
cc_library_shared {
name: "android.hardware.graphics.composer@2.1-impl",
relative_install_path: "hw",
srcs: ["Hwc.cpp", "ComposerClient.cpp"],
srcs: ["Hwc.cpp"],
static_libs: ["libhwcomposer-client"],
shared_libs: [
"android.hardware.graphics.allocator@2.0",
"android.hardware.graphics.composer@2.1",
@ -42,13 +42,9 @@ cc_library_shared {
cc_binary {
name: "android.hardware.graphics.composer@2.1-service",
relative_install_path: "hw",
srcs: ["service.cpp", "Hwc.cpp"],
cppflags: ["-DBINDERIZED"],
srcs: ["service.cpp"],
init_rc: ["android.hardware.graphics.composer@2.1-service.rc"],
static_libs: [
"libhwcomposer-client",
],
static_libs: ["libhwcomposer-client"],
shared_libs: [
"android.hardware.graphics.allocator@2.0",
"android.hardware.graphics.composer@2.1",

View file

@ -99,7 +99,6 @@ private:
// Some existing gralloc drivers do not support retaining more than once,
// when we are in passthrough mode.
#ifdef BINDERIZED
bool openGralloc()
{
const hw_module_t* module = nullptr;
@ -188,12 +187,6 @@ private:
// gralloc0
const gralloc_module_t* mModule;
#else
bool openGralloc() { return true; }
void closeGralloc() {}
buffer_handle_t cloneBuffer(buffer_handle_t handle) { return handle; }
void releaseBuffer(buffer_handle_t) {}
#endif
};
HandleImporter sHandleImporter;

View file

@ -14,41 +14,20 @@
* limitations under the License.
*/
#define LOG_TAG "HWComposerService"
#define LOG_TAG "android.hardware.graphics.composer@2.1-service"
#include <android/hardware/graphics/composer/2.1/IComposer.h>
#include <binder/ProcessState.h>
#include <hidl/HidlTransportSupport.h>
#include <utils/StrongPointer.h>
#include "Hwc.h"
#include <hidl/LegacySupport.h>
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::sp;
using android::hardware::graphics::composer::V2_1::IComposer;
using android::hardware::graphics::composer::V2_1::implementation::HIDL_FETCH_IComposer;
int main()
{
const char instance[] = "hwcomposer";
ALOGI("Service is starting.");
configureRpcThreadpool(1, true /* callerWillJoin */);
sp<IComposer> service = HIDL_FETCH_IComposer(instance);
if (service == nullptr) {
ALOGI("getService returned NULL");
return -1;
}
LOG_FATAL_IF(service->isRemote(), "Service is REMOTE!");
service->registerAsService(instance);
using android::hardware::defaultPassthroughServiceImplementation;
int main() {
// the conventional HAL might start binder services
android::ProcessState::self()->setThreadPoolMaxThreadCount(4);
android::ProcessState::self()->startThreadPool();
joinRpcThreadpool();
return 0;
return defaultPassthroughServiceImplementation<IComposer>("hwcomposer");
}