display: Remove genlock usage
genlock is no-op from Android 4.2 onwards since the sync framework
is used for explicit synchronization.
Change-Id: Idd1df589516534a683e0fa1ef0cfbb7f0e411f67
diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp
index f1af045..292012b 100644
--- a/libgralloc/gpu.cpp
+++ b/libgralloc/gpu.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (c) 2011-2012 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2013 The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,8 +21,6 @@
#include <cutils/properties.h>
#include <sys/mman.h>
-#include <genlock.h>
-
#include "gr.h"
#include "gpu.h"
#include "memalloc.h"
@@ -165,10 +163,6 @@
ALOGE_IF(eDataErr, "gralloc failed for eDataErr=%s",
strerror(-eDataErr));
- if (usage & GRALLOC_USAGE_PRIVATE_UNSYNCHRONIZED) {
- flags |= private_handle_t::PRIV_FLAGS_UNSYNCHRONIZED;
- }
-
if (usage & GRALLOC_USAGE_PRIVATE_EXTERNAL_ONLY) {
flags |= private_handle_t::PRIV_FLAGS_EXTERNAL_ONLY;
//The EXTERNAL_BLOCK flag is always an add-on
@@ -200,6 +194,8 @@
hnd->offset = data.offset;
hnd->base = int(data.base) + data.offset;
+ hnd->gpuaddr = 0;
+
*pHandle = hnd;
}
@@ -265,13 +261,6 @@
return err;
}
- // Create a genlock lock for this buffer handle.
- err = genlock_create_lock((native_handle_t*)(*pHandle));
- if (err) {
- ALOGE("%s: genlock_create_lock failed", __FUNCTION__);
- free_impl(reinterpret_cast<private_handle_t*>(pHandle));
- return err;
- }
*pStride = alignedw;
return 0;
}
@@ -299,12 +288,6 @@
return err;
}
- // Release the genlock
- int err = genlock_release_lock((native_handle_t*)hnd);
- if (err) {
- ALOGE("%s: genlock_release_lock failed", __FUNCTION__);
- }
-
delete hnd;
return 0;
}