summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/sensorservice/CorrectedGyroSensor.cpp2
-rw-r--r--services/sensorservice/GravitySensor.cpp2
-rw-r--r--services/sensorservice/OrientationSensor.cpp2
-rw-r--r--services/sensorservice/RotationVectorSensor.cpp4
-rw-r--r--services/sensorservice/SensorDevice.cpp31
-rw-r--r--services/sensorservice/SensorFusion.cpp2
-rw-r--r--services/sensorservice/SensorInterface.cpp2
-rw-r--r--services/sensorservice/SensorInterface.h6
-rw-r--r--services/sensorservice/SensorService.cpp29
-rw-r--r--services/sensorservice/main_sensorservice.cpp2
-rw-r--r--services/surfaceflinger/Android.mk4
-rw-r--r--services/surfaceflinger/DdmConnection.cpp15
-rw-r--r--services/surfaceflinger/DispSync.cpp2
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp22
-rw-r--r--services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp2
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp11
-rw-r--r--services/surfaceflinger/EventThread.cpp2
-rw-r--r--services/surfaceflinger/FrameTracker.cpp4
-rw-r--r--services/surfaceflinger/MessageQueue.cpp2
-rw-r--r--services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp2
-rw-r--r--services/surfaceflinger/RenderEngine/Program.cpp4
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp17
22 files changed, 92 insertions, 77 deletions
diff --git a/services/sensorservice/CorrectedGyroSensor.cpp b/services/sensorservice/CorrectedGyroSensor.cpp
index 31487a7..b07d544 100644
--- a/services/sensorservice/CorrectedGyroSensor.cpp
+++ b/services/sensorservice/CorrectedGyroSensor.cpp
@@ -61,7 +61,7 @@ status_t CorrectedGyroSensor::activate(void* ident, bool enabled) {
return mSensorFusion.activate(ident, enabled);
}
-status_t CorrectedGyroSensor::setDelay(void* ident, int handle, int64_t ns) {
+status_t CorrectedGyroSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
mSensorDevice.setDelay(ident, mGyro.getHandle(), ns);
return mSensorFusion.setDelay(ident, ns);
}
diff --git a/services/sensorservice/GravitySensor.cpp b/services/sensorservice/GravitySensor.cpp
index dd1f650..3cb3745 100644
--- a/services/sensorservice/GravitySensor.cpp
+++ b/services/sensorservice/GravitySensor.cpp
@@ -70,7 +70,7 @@ status_t GravitySensor::activate(void* ident, bool enabled) {
return mSensorFusion.activate(ident, enabled);
}
-status_t GravitySensor::setDelay(void* ident, int handle, int64_t ns) {
+status_t GravitySensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
return mSensorFusion.setDelay(ident, ns);
}
diff --git a/services/sensorservice/OrientationSensor.cpp b/services/sensorservice/OrientationSensor.cpp
index 10b391c..6d85cca 100644
--- a/services/sensorservice/OrientationSensor.cpp
+++ b/services/sensorservice/OrientationSensor.cpp
@@ -69,7 +69,7 @@ status_t OrientationSensor::activate(void* ident, bool enabled) {
return mSensorFusion.activate(ident, enabled);
}
-status_t OrientationSensor::setDelay(void* ident, int handle, int64_t ns) {
+status_t OrientationSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
return mSensorFusion.setDelay(ident, ns);
}
diff --git a/services/sensorservice/RotationVectorSensor.cpp b/services/sensorservice/RotationVectorSensor.cpp
index a2157b4..cb305eb 100644
--- a/services/sensorservice/RotationVectorSensor.cpp
+++ b/services/sensorservice/RotationVectorSensor.cpp
@@ -56,7 +56,7 @@ status_t RotationVectorSensor::activate(void* ident, bool enabled) {
return mSensorFusion.activate(ident, enabled);
}
-status_t RotationVectorSensor::setDelay(void* ident, int handle, int64_t ns) {
+status_t RotationVectorSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
return mSensorFusion.setDelay(ident, ns);
}
@@ -105,7 +105,7 @@ status_t GyroDriftSensor::activate(void* ident, bool enabled) {
return mSensorFusion.activate(ident, enabled);
}
-status_t GyroDriftSensor::setDelay(void* ident, int handle, int64_t ns) {
+status_t GyroDriftSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {
return mSensorFusion.setDelay(ident, ns);
}
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
index 19caa5c..35b7819 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -14,8 +14,9 @@
* limitations under the License.
*/
-#include <stdint.h>
+#include <inttypes.h>
#include <math.h>
+#include <stdint.h>
#include <sys/types.h>
#include <utils/Atomic.h>
@@ -78,7 +79,7 @@ void SensorDevice::dump(String8& result)
Mutex::Autolock _l(mLock);
for (size_t i=0 ; i<size_t(count) ; i++) {
const Info& info = mActivationCount.valueFor(list[i].handle);
- result.appendFormat("handle=0x%08x, active-count=%d, batch_period(ms)={ ", list[i].handle,
+ result.appendFormat("handle=0x%08x, active-count=%zu, batch_period(ms)={ ", list[i].handle,
info.batchParams.size());
for (size_t j = 0; j < info.batchParams.size(); j++) {
BatchParams params = info.batchParams.valueAt(j);
@@ -87,7 +88,7 @@ void SensorDevice::dump(String8& result)
}
result.appendFormat(" }, selected=%4.1f ms\n", info.bestBatchParams.batchDelay / 1e6f);
- result.appendFormat("handle=0x%08x, active-count=%d, batch_timeout(ms)={ ", list[i].handle,
+ result.appendFormat("handle=0x%08x, active-count=%zu, batch_timeout(ms)={ ", list[i].handle,
info.batchParams.size());
for (size_t j = 0; j < info.batchParams.size(); j++) {
BatchParams params = info.batchParams.valueAt(j);
@@ -134,11 +135,11 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
Info& info( mActivationCount.editValueFor(handle) );
ALOGD_IF(DEBUG_CONNECTIONS,
- "SensorDevice::activate: ident=%p, handle=0x%08x, enabled=%d, count=%d",
+ "SensorDevice::activate: ident=%p, handle=0x%08x, enabled=%d, count=%zu",
ident, handle, enabled, info.batchParams.size());
if (enabled) {
- ALOGD_IF(DEBUG_CONNECTIONS, "enable index=%d", info.batchParams.indexOfKey(ident));
+ ALOGD_IF(DEBUG_CONNECTIONS, "enable index=%zd", info.batchParams.indexOfKey(ident));
if (info.batchParams.indexOfKey(ident) >= 0) {
if (info.batchParams.size() == 1) {
@@ -150,7 +151,7 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
ALOGE("\t >>>ERROR: activate called without batch");
}
} else {
- ALOGD_IF(DEBUG_CONNECTIONS, "disable index=%d", info.batchParams.indexOfKey(ident));
+ ALOGD_IF(DEBUG_CONNECTIONS, "disable index=%zd", info.batchParams.indexOfKey(ident));
if (info.removeBatchParamsForIdent(ident) >= 0) {
if (info.batchParams.size() == 0) {
@@ -163,7 +164,7 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
// batch_rate and timeout. One of the apps has unregistered for sensor
// events, and the best effort batch parameters might have changed.
ALOGD_IF(DEBUG_CONNECTIONS,
- "\t>>> actuating h/w batch %d %d %lld %lld ", handle,
+ "\t>>> actuating h/w batch %d %d %" PRId64 " %" PRId64, handle,
info.bestBatchParams.flags, info.bestBatchParams.batchDelay,
info.bestBatchParams.batchTimeout);
mSensorDevice->batch(mSensorDevice, handle,info.bestBatchParams.flags,
@@ -191,7 +192,7 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
// On older devices which do not support batch, call setDelay().
if (getHalDeviceVersion() < SENSORS_DEVICE_API_VERSION_1_1 && info.batchParams.size() > 0) {
- ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w setDelay %d %lld ", handle,
+ ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w setDelay %d %" PRId64, handle,
info.bestBatchParams.batchDelay);
mSensorDevice->setDelay(
reinterpret_cast<struct sensors_poll_device_t *>(mSensorDevice),
@@ -231,7 +232,7 @@ status_t SensorDevice::batch(void* ident, int handle, int flags, int64_t samplin
}
ALOGD_IF(DEBUG_CONNECTIONS,
- "SensorDevice::batch: ident=%p, handle=0x%08x, flags=%d, period_ns=%lld timeout=%lld",
+ "SensorDevice::batch: ident=%p, handle=0x%08x, flags=%d, period_ns=%" PRId64 " timeout=%" PRId64,
ident, handle, flags, samplingPeriodNs, maxBatchReportLatencyNs);
Mutex::Autolock _l(mLock);
@@ -250,7 +251,8 @@ status_t SensorDevice::batch(void* ident, int handle, int flags, int64_t samplin
info.selectBatchParams();
ALOGD_IF(DEBUG_CONNECTIONS,
- "\t>>> curr_period=%lld min_period=%lld curr_timeout=%lld min_timeout=%lld",
+ "\t>>> curr_period=%" PRId64 " min_period=%" PRId64
+ " curr_timeout=%" PRId64 " min_timeout=%" PRId64,
prevBestBatchParams.batchDelay, info.bestBatchParams.batchDelay,
prevBestBatchParams.batchTimeout, info.bestBatchParams.batchTimeout);
@@ -258,7 +260,7 @@ status_t SensorDevice::batch(void* ident, int handle, int flags, int64_t samplin
// If the min period or min timeout has changed since the last batch call, call batch.
if (prevBestBatchParams != info.bestBatchParams) {
if (halVersion >= SENSORS_DEVICE_API_VERSION_1_1) {
- ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w BATCH %d %d %lld %lld ", handle,
+ ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w BATCH %d %d %" PRId64 " %" PRId64, handle,
info.bestBatchParams.flags, info.bestBatchParams.batchDelay,
info.bestBatchParams.batchTimeout);
err = mSensorDevice->batch(mSensorDevice, handle, info.bestBatchParams.flags,
@@ -270,7 +272,8 @@ status_t SensorDevice::batch(void* ident, int handle, int flags, int64_t samplin
// call setDelay in SensorDevice::activate() method.
}
if (err != NO_ERROR) {
- ALOGE("sensor batch failed %p %d %d %lld %lld err=%s", mSensorDevice, handle,
+ ALOGE("sensor batch failed %p %d %d %" PRId64 " %" PRId64 " err=%s",
+ mSensorDevice, handle,
info.bestBatchParams.flags, info.bestBatchParams.batchDelay,
info.bestBatchParams.batchTimeout, strerror(-err));
info.removeBatchParamsForIdent(ident);
@@ -309,7 +312,7 @@ int SensorDevice::getHalDeviceVersion() const {
return mSensorDevice->common.version;
}
-status_t SensorDevice::flush(void* ident, int handle) {
+status_t SensorDevice::flush(void* /*ident*/, int handle) {
if (getHalDeviceVersion() < SENSORS_DEVICE_API_VERSION_1_1) {
return INVALID_OPERATION;
}
@@ -324,7 +327,7 @@ status_t SensorDevice::Info::setBatchParamsForIdent(void* ident, int flags,
int64_t maxBatchReportLatencyNs) {
ssize_t index = batchParams.indexOfKey(ident);
if (index < 0) {
- ALOGE("Info::setBatchParamsForIdent(ident=%p, period_ns=%lld timeout=%lld) failed (%s)",
+ ALOGE("Info::setBatchParamsForIdent(ident=%p, period_ns=%" PRId64 " timeout=%" PRId64 ") failed (%s)",
ident, samplingPeriodNs, maxBatchReportLatencyNs, strerror(-index));
return BAD_INDEX;
}
diff --git a/services/sensorservice/SensorFusion.cpp b/services/sensorservice/SensorFusion.cpp
index 8512d6b..6d93009 100644
--- a/services/sensorservice/SensorFusion.cpp
+++ b/services/sensorservice/SensorFusion.cpp
@@ -139,7 +139,7 @@ int32_t SensorFusion::getMinDelay() const {
void SensorFusion::dump(String8& result) {
const Fusion& fusion(mFusion);
- result.appendFormat("9-axis fusion %s (%d clients), gyro-rate=%7.2fHz, "
+ result.appendFormat("9-axis fusion %s (%zd clients), gyro-rate=%7.2fHz, "
"q=< %g, %g, %g, %g > (%g), "
"b=< %g, %g, %g >\n",
mEnabled ? "enabled" : "disabled",
diff --git a/services/sensorservice/SensorInterface.cpp b/services/sensorservice/SensorInterface.cpp
index f1d1663..2bf5e72 100644
--- a/services/sensorservice/SensorInterface.cpp
+++ b/services/sensorservice/SensorInterface.cpp
@@ -50,7 +50,7 @@ status_t HardwareSensor::activate(void* ident, bool enabled) {
return mSensorDevice.activate(ident, mSensor.getHandle(), enabled);
}
-status_t HardwareSensor::batch(void* ident, int handle, int flags,
+status_t HardwareSensor::batch(void* ident, int /*handle*/, int flags,
int64_t samplingPeriodNs, int64_t maxBatchReportLatencyNs) {
return mSensorDevice.batch(ident, mSensor.getHandle(), flags, samplingPeriodNs,
maxBatchReportLatencyNs);
diff --git a/services/sensorservice/SensorInterface.h b/services/sensorservice/SensorInterface.h
index c295e22..3e76377 100644
--- a/services/sensorservice/SensorInterface.h
+++ b/services/sensorservice/SensorInterface.h
@@ -40,7 +40,7 @@ public:
virtual status_t setDelay(void* ident, int handle, int64_t ns) = 0;
// Not all sensors need to support batching.
- virtual status_t batch(void* ident, int handle, int flags, int64_t samplingPeriodNs,
+ virtual status_t batch(void* ident, int handle, int /*flags*/, int64_t samplingPeriodNs,
int64_t maxBatchReportLatencyNs) {
if (maxBatchReportLatencyNs == 0) {
return setDelay(ident, handle, samplingPeriodNs);
@@ -48,13 +48,13 @@ public:
return -EINVAL;
}
- virtual status_t flush(void* ident, int handle) {
+ virtual status_t flush(void* /*ident*/, int /*handle*/) {
return -EINVAL;
}
virtual Sensor getSensor() const = 0;
virtual bool isVirtual() const = 0;
- virtual void autoDisable(void *ident, int handle) { }
+ virtual void autoDisable(void* /*ident*/, int /*handle*/) { }
};
// ---------------------------------------------------------------------------
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index ca2fdf6..ba75b6c 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -14,8 +14,9 @@
* limitations under the License.
*/
-#include <stdint.h>
+#include <inttypes.h>
#include <math.h>
+#include <stdint.h>
#include <sys/types.h>
#include <cutils/properties.h>
@@ -153,7 +154,7 @@ void SensorService::onFirstRef()
char line[128];
if (fp != NULL && fgets(line, sizeof(line), fp) != NULL) {
line[sizeof(line) - 1] = '\0';
- sscanf(line, "%u", &mSocketBufferSize);
+ sscanf(line, "%zu", &mSocketBufferSize);
if (mSocketBufferSize > MAX_SOCKET_BUFFER_SIZE_BATCHED) {
mSocketBufferSize = MAX_SOCKET_BUFFER_SIZE_BATCHED;
}
@@ -200,7 +201,7 @@ SensorService::~SensorService()
static const String16 sDump("android.permission.DUMP");
-status_t SensorService::dump(int fd, const Vector<String16>& args)
+status_t SensorService::dump(int fd, const Vector<String16>& /*args*/)
{
String8 result;
if (!PermissionCache::checkCallingPermission(sDump)) {
@@ -260,7 +261,7 @@ status_t SensorService::dump(int fd, const Vector<String16>& args)
result.appendFormat( "last=<%f>\n", e.data[0]);
break;
case SENSOR_TYPE_STEP_COUNTER:
- result.appendFormat( "last=<%llu>\n", e.u64.step_counter);
+ result.appendFormat( "last=<%" PRIu64 ">\n", e.u64.step_counter);
break;
default:
// default to 3 values
@@ -276,19 +277,19 @@ status_t SensorService::dump(int fd, const Vector<String16>& args)
result.append("Active sensors:\n");
for (size_t i=0 ; i<mActiveSensors.size() ; i++) {
int handle = mActiveSensors.keyAt(i);
- result.appendFormat("%s (handle=0x%08x, connections=%d)\n",
+ result.appendFormat("%s (handle=0x%08x, connections=%zu)\n",
getSensorName(handle).string(),
handle,
mActiveSensors.valueAt(i)->getNumConnections());
}
- result.appendFormat("%u Max Socket Buffer size\n", mSocketBufferSize);
- result.appendFormat("%d active connections\n", mActiveConnections.size());
+ result.appendFormat("%zu Max Socket Buffer size\n", mSocketBufferSize);
+ result.appendFormat("%zd active connections\n", mActiveConnections.size());
for (size_t i=0 ; i < mActiveConnections.size() ; i++) {
sp<SensorEventConnection> connection(mActiveConnections[i].promote());
if (connection != 0) {
- result.appendFormat("Connection Number: %d \n", i);
+ result.appendFormat("Connection Number: %zu \n", i);
connection->dump(result);
}
}
@@ -372,7 +373,7 @@ bool SensorService::threadLoop()
for (size_t j=0 ; j<activeVirtualSensorCount ; j++) {
if (count + k >= minBufferSize) {
ALOGE("buffer too small to hold all events: "
- "count=%u, k=%u, size=%u",
+ "count=%zd, k=%zu, size=%zu",
count, k, minBufferSize);
break;
}
@@ -524,11 +525,11 @@ void SensorService::cleanupConnection(SensorEventConnection* c)
Mutex::Autolock _l(mLock);
const wp<SensorEventConnection> connection(c);
size_t size = mActiveSensors.size();
- ALOGD_IF(DEBUG_CONNECTIONS, "%d active sensors", size);
+ ALOGD_IF(DEBUG_CONNECTIONS, "%zu active sensors", size);
for (size_t i=0 ; i<size ; ) {
int handle = mActiveSensors.keyAt(i);
if (c->hasSensor(handle)) {
- ALOGD_IF(DEBUG_CONNECTIONS, "%i: disabling handle=0x%08x", i, handle);
+ ALOGD_IF(DEBUG_CONNECTIONS, "%zu: disabling handle=0x%08x", i, handle);
SensorInterface* sensor = mSensorMap.valueFor( handle );
ALOGE_IF(!sensor, "mSensorMap[handle=0x%08x] is null!", handle);
if (sensor) {
@@ -536,9 +537,9 @@ void SensorService::cleanupConnection(SensorEventConnection* c)
}
}
SensorRecord* rec = mActiveSensors.valueAt(i);
- ALOGE_IF(!rec, "mActiveSensors[%d] is null (handle=0x%08x)!", i, handle);
+ ALOGE_IF(!rec, "mActiveSensors[%zu] is null (handle=0x%08x)!", i, handle);
ALOGD_IF(DEBUG_CONNECTIONS,
- "removing connection %p for sensor[%d].handle=0x%08x",
+ "removing connection %p for sensor[%zu].handle=0x%08x",
c, i, handle);
if (rec && rec->removeConnection(connection)) {
@@ -615,7 +616,7 @@ status_t SensorService::enable(const sp<SensorEventConnection>& connection,
samplingPeriodNs = minDelayNs;
}
- ALOGD_IF(DEBUG_CONNECTIONS, "Calling batch handle==%d flags=%d rate=%lld timeout== %lld",
+ ALOGD_IF(DEBUG_CONNECTIONS, "Calling batch handle==%d flags=%d rate=%" PRId64 " timeout== %" PRId64,
handle, reservedFlags, samplingPeriodNs, maxBatchReportLatencyNs);
status_t err = sensor->batch(connection.get(), handle, reservedFlags, samplingPeriodNs,
diff --git a/services/sensorservice/main_sensorservice.cpp b/services/sensorservice/main_sensorservice.cpp
index 303b65f..0a96f42 100644
--- a/services/sensorservice/main_sensorservice.cpp
+++ b/services/sensorservice/main_sensorservice.cpp
@@ -19,7 +19,7 @@
using namespace android;
-int main(int argc, char** argv) {
+int main(int /*argc*/, char** /*argv*/) {
SensorService::publishAndJoinThreadPool();
return 0;
}
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index afa680f..5a8efeb 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -117,6 +117,10 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_MODULE:= surfaceflinger
+ifdef TARGET_32_BIT_SURFACEFLINGER
+LOCAL_32_BIT_ONLY := true
+endif
+
include $(BUILD_EXECUTABLE)
###############################################################
diff --git a/services/surfaceflinger/DdmConnection.cpp b/services/surfaceflinger/DdmConnection.cpp
index d2c977d..2477921 100644
--- a/services/surfaceflinger/DdmConnection.cpp
+++ b/services/surfaceflinger/DdmConnection.cpp
@@ -45,18 +45,21 @@ void DdmConnection::start(const char* name) {
args.ignoreUnrecognized = JNI_FALSE;
- void* libdvm_dso = dlopen("libdvm.so", RTLD_NOW);
- ALOGE_IF(!libdvm_dso, "DdmConnection: %s", dlerror());
+ // TODO: Should this just link against libnativehelper and use its
+ // JNI_CreateJavaVM wrapper that essential does this dlopen/dlsym
+ // work based on the current system default runtime?
+ void* libart_dso = dlopen("libart.so", RTLD_NOW);
+ ALOGE_IF(!libart_dso, "DdmConnection: %s", dlerror());
void* libandroid_runtime_dso = dlopen("libandroid_runtime.so", RTLD_NOW);
ALOGE_IF(!libandroid_runtime_dso, "DdmConnection: %s", dlerror());
- if (!libdvm_dso || !libandroid_runtime_dso) {
+ if (!libart_dso || !libandroid_runtime_dso) {
goto error;
}
jint (*JNI_CreateJavaVM)(JavaVM** p_vm, JNIEnv** p_env, void* vm_args);
- JNI_CreateJavaVM = (typeof JNI_CreateJavaVM)dlsym(libdvm_dso, "JNI_CreateJavaVM");
+ JNI_CreateJavaVM = (typeof JNI_CreateJavaVM)dlsym(libart_dso, "JNI_CreateJavaVM");
ALOGE_IF(!JNI_CreateJavaVM, "DdmConnection: %s", dlerror());
jint (*registerNatives)(JNIEnv* env, jclass clazz);
@@ -104,8 +107,8 @@ error:
if (libandroid_runtime_dso) {
dlclose(libandroid_runtime_dso);
}
- if (libdvm_dso) {
- dlclose(libdvm_dso);
+ if (libart_dso) {
+ dlclose(libart_dso);
}
}
diff --git a/services/surfaceflinger/DispSync.cpp b/services/surfaceflinger/DispSync.cpp
index c51d207..95839b7 100644
--- a/services/surfaceflinger/DispSync.cpp
+++ b/services/surfaceflinger/DispSync.cpp
@@ -288,7 +288,7 @@ class ZeroPhaseTracer : public DispSync::Callback {
public:
ZeroPhaseTracer() : mParity(false) {}
- virtual void onDispSyncEvent(nsecs_t when) {
+ virtual void onDispSyncEvent(nsecs_t /*when*/) {
mParity = !mParity;
ATRACE_INT("ZERO_PHASE_VSYNC", mParity ? 1 : 0);
}
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index e5ecf07..f9034a6 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -77,16 +77,6 @@ DisplayDevice::DisplayDevice(
mNativeWindow = new Surface(producer, false);
ANativeWindow* const window = mNativeWindow.get();
- // Make sure that composition can never be stalled by a virtual display
- // consumer that isn't processing buffers fast enough. We have to do this
- // in two places:
- // * Here, in case the display is composed entirely by HWC.
- // * In makeCurrent(), using eglSwapInterval. Some EGL drivers set the
- // window's swap interval in eglMakeCurrent, so they'll override the
- // interval we set here.
- if (mType >= DisplayDevice::DISPLAY_VIRTUAL)
- window->setSwapInterval(window, 0);
-
/*
* Create our display's surface
*/
@@ -101,6 +91,16 @@ DisplayDevice::DisplayDevice(
eglQuerySurface(display, surface, EGL_WIDTH, &mDisplayWidth);
eglQuerySurface(display, surface, EGL_HEIGHT, &mDisplayHeight);
+ // Make sure that composition can never be stalled by a virtual display
+ // consumer that isn't processing buffers fast enough. We have to do this
+ // in two places:
+ // * Here, in case the display is composed entirely by HWC.
+ // * In makeCurrent(), using eglSwapInterval. Some EGL drivers set the
+ // window's swap interval in eglMakeCurrent, so they'll override the
+ // interval we set here.
+ if (mType >= DisplayDevice::DISPLAY_VIRTUAL)
+ window->setSwapInterval(window, 0);
+
mDisplay = display;
mSurface = surface;
mFormat = format;
@@ -462,7 +462,7 @@ void DisplayDevice::dump(String8& result) const {
result.appendFormat(
"+ DisplayDevice: %s\n"
" type=%x, hwcId=%d, layerStack=%u, (%4dx%4d), ANativeWindow=%p, orient=%2d (type=%08x), "
- "flips=%u, isSecure=%d, secureVis=%d, acquired=%d, numLayers=%u\n"
+ "flips=%u, isSecure=%d, secureVis=%d, acquired=%d, numLayers=%zu\n"
" v:[%d,%d,%d,%d], f:[%d,%d,%d,%d], s:[%d,%d,%d,%d],"
"transform:[[%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f]]\n",
mDisplayName.string(), mType, mHwcDisplayId,
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
index 0f34764..086ccf8 100644
--- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
+++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
@@ -72,7 +72,7 @@ status_t FramebufferSurface::beginFrame(bool mustRecompose) {
return NO_ERROR;
}
-status_t FramebufferSurface::prepareFrame(CompositionType compositionType) {
+status_t FramebufferSurface::prepareFrame(CompositionType /*compositionType*/) {
return NO_ERROR;
}
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 1b652c3..a48582e 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -16,12 +16,13 @@
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+#include <inttypes.h>
+#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
-#include <math.h>
#include <utils/CallStack.h>
#include <utils/Errors.h>
@@ -1022,12 +1023,12 @@ void HWComposer::dump(String8& result) const {
mFlinger->getLayerSortedByZForHwcDisplay(i);
result.appendFormat(
- " Display[%d] : %ux%u, xdpi=%f, ydpi=%f, refresh=%lld\n",
+ " Display[%zd] : %ux%u, xdpi=%f, ydpi=%f, refresh=%" PRId64 "\n",
i, disp.width, disp.height, disp.xdpi, disp.ydpi, disp.refresh);
if (disp.list) {
result.appendFormat(
- " numHwLayers=%u, flags=%08x\n",
+ " numHwLayers=%zu, flags=%08x\n",
disp.list->numHwLayers, disp.list->flags);
result.append(
@@ -1066,7 +1067,7 @@ void HWComposer::dump(String8& result) const {
if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_3)) {
result.appendFormat(
- " %10s | %08x | %08x | %08x | %02x | %05x | %08x | [%7.1f,%7.1f,%7.1f,%7.1f] | [%5d,%5d,%5d,%5d] %s\n",
+ " %10s | %08" PRIxPTR " | %08x | %08x | %02x | %05x | %08x | [%7.1f,%7.1f,%7.1f,%7.1f] | [%5d,%5d,%5d,%5d] %s\n",
compositionTypeName[type],
intptr_t(l.handle), l.hints, l.flags, l.transform, l.blending, format,
l.sourceCropf.left, l.sourceCropf.top, l.sourceCropf.right, l.sourceCropf.bottom,
@@ -1074,7 +1075,7 @@ void HWComposer::dump(String8& result) const {
name.string());
} else {
result.appendFormat(
- " %10s | %08x | %08x | %08x | %02x | %05x | %08x | [%7d,%7d,%7d,%7d] | [%5d,%5d,%5d,%5d] %s\n",
+ " %10s | %08" PRIxPTR " | %08x | %08x | %02x | %05x | %08x | [%7d,%7d,%7d,%7d] | [%5d,%5d,%5d,%5d] %s\n",
compositionTypeName[type],
intptr_t(l.handle), l.hints, l.flags, l.transform, l.blending, format,
l.sourceCrop.left, l.sourceCrop.top, l.sourceCrop.right, l.sourceCrop.bottom,
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
index 3528b62..d868f32 100644
--- a/services/surfaceflinger/EventThread.cpp
+++ b/services/surfaceflinger/EventThread.cpp
@@ -328,7 +328,7 @@ void EventThread::dump(String8& result) const {
mDebugVsyncEnabled?"enabled":"disabled");
result.appendFormat(" soft-vsync: %s\n",
mUseSoftwareVSync?"enabled":"disabled");
- result.appendFormat(" numListeners=%u,\n events-delivered: %u\n",
+ result.appendFormat(" numListeners=%zu,\n events-delivered: %u\n",
mDisplayEventConnections.size(),
mVSyncEvent[DisplayDevice::DISPLAY_PRIMARY].vsync.count);
for (size_t i=0 ; i<mDisplayEventConnections.size() ; i++) {
diff --git a/services/surfaceflinger/FrameTracker.cpp b/services/surfaceflinger/FrameTracker.cpp
index d406672..2fb665e 100644
--- a/services/surfaceflinger/FrameTracker.cpp
+++ b/services/surfaceflinger/FrameTracker.cpp
@@ -17,6 +17,8 @@
// This is needed for stdint.h to define INT64_MAX in C++
#define __STDC_LIMIT_MACROS
+#include <inttypes.h>
+
#include <cutils/log.h>
#include <ui/Fence.h>
@@ -211,7 +213,7 @@ void FrameTracker::dump(String8& result) const {
const size_t o = mOffset;
for (size_t i = 1; i < NUM_FRAME_RECORDS; i++) {
const size_t index = (o+i) % NUM_FRAME_RECORDS;
- result.appendFormat("%lld\t%lld\t%lld\n",
+ result.appendFormat("%" PRId64 "\t%" PRId64 "\t%" PRId64 "\n",
mFrameRecords[index].desiredPresentTime,
mFrameRecords[index].actualPresentTime,
mFrameRecords[index].frameReadyTime);
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp
index cc672b6..1ad86a6 100644
--- a/services/surfaceflinger/MessageQueue.cpp
+++ b/services/surfaceflinger/MessageQueue.cpp
@@ -179,7 +179,7 @@ int MessageQueue::cb_eventReceiver(int fd, int events, void* data) {
return queue->eventReceiver(fd, events);
}
-int MessageQueue::eventReceiver(int fd, int events) {
+int MessageQueue::eventReceiver(int /*fd*/, int /*events*/) {
ssize_t n;
DisplayEventReceiver::Event buffer[8];
while ((n = DisplayEventReceiver::getEvents(mEventTube, buffer, 8)) > 0) {
diff --git a/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp b/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp
index 521a5d2..cbff320 100644
--- a/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp
+++ b/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp
@@ -237,7 +237,7 @@ void GLES11RenderEngine::drawMesh(const Mesh& mesh) {
}
}
-void GLES11RenderEngine::beginGroup(const mat4& colorTransform) {
+void GLES11RenderEngine::beginGroup(const mat4& /*colorTransform*/) {
// doesn't do anything in GLES 1.1
}
diff --git a/services/surfaceflinger/RenderEngine/Program.cpp b/services/surfaceflinger/RenderEngine/Program.cpp
index 4a7fb58..0424e0c 100644
--- a/services/surfaceflinger/RenderEngine/Program.cpp
+++ b/services/surfaceflinger/RenderEngine/Program.cpp
@@ -25,7 +25,7 @@
namespace android {
-Program::Program(const ProgramCache::Key& needs, const char* vertex, const char* fragment)
+Program::Program(const ProgramCache::Key& /*needs*/, const char* vertex, const char* fragment)
: mInitialized(false) {
GLuint vertexId = buildShader(vertex, GL_VERTEX_SHADER);
GLuint fragmentId = buildShader(fragment, GL_FRAGMENT_SHADER);
@@ -112,7 +112,7 @@ GLuint Program::buildShader(const char* source, GLenum type) {
return shader;
}
-String8& Program::dumpShader(String8& result, GLenum type) {
+String8& Program::dumpShader(String8& result, GLenum /*type*/) {
GLuint shader = GL_FRAGMENT_SHADER ? mFragmentShader : mVertexShader;
GLint l;
glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &l);
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 08cc506..3c447db 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -21,6 +21,7 @@
#include <errno.h>
#include <math.h>
#include <dlfcn.h>
+#include <inttypes.h>
#include <EGL/egl.h>
@@ -429,7 +430,7 @@ void SurfaceFlinger::init() {
// FIXME: currently we don't get blank/unblank requests
// for displays other than the main display, so we always
// assume a connected display is unblanked.
- ALOGD("marking display %d as acquired/unblanked", i);
+ ALOGD("marking display %zu as acquired/unblanked", i);
hw->acquireScreen();
}
mDisplays.add(token, hw);
@@ -1650,7 +1651,7 @@ void SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const
case HWC_FRAMEBUFFER_TARGET: {
// this should not happen as the iterator shouldn't
// let us get there.
- ALOGW("HWC_FRAMEBUFFER_TARGET found in hwc list (index=%d)", i);
+ ALOGW("HWC_FRAMEBUFFER_TARGET found in hwc list (index=%zu)", i);
break;
}
}
@@ -2235,7 +2236,7 @@ void SurfaceFlinger::dumpStatsLocked(const Vector<String16>& args, size_t& index
const nsecs_t period =
getHwComposer().getRefreshPeriod(HWC_DISPLAY_PRIMARY);
- result.appendFormat("%lld\n", period);
+ result.appendFormat("%" PRId64 "\n", period);
if (name.isEmpty()) {
mAnimFrameTracker.dump(result);
@@ -2345,7 +2346,7 @@ void SurfaceFlinger::dumpAllLocked(const Vector<String16>& args, size_t& index,
const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
const size_t count = currentLayers.size();
colorizer.bold(result);
- result.appendFormat("Visible layers (count = %d)\n", count);
+ result.appendFormat("Visible layers (count = %zu)\n", count);
colorizer.reset(result);
for (size_t i=0 ; i<count ; i++) {
const sp<Layer>& layer(currentLayers[i]);
@@ -2357,7 +2358,7 @@ void SurfaceFlinger::dumpAllLocked(const Vector<String16>& args, size_t& index,
*/
colorizer.bold(result);
- result.appendFormat("Displays (%d entries)\n", mDisplays.size());
+ result.appendFormat("Displays (%zu entries)\n", mDisplays.size());
colorizer.reset(result);
for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) {
const sp<const DisplayDevice>& hw(mDisplays[dpy]);
@@ -2646,7 +2647,7 @@ class GraphicProducerWrapper : public BBinder, public MessageHandler {
looper->sendMessage(this, Message(MSG_API_CALL));
barrier.wait();
}
- return NO_ERROR;
+ return result;
}
/*
@@ -2656,7 +2657,7 @@ class GraphicProducerWrapper : public BBinder, public MessageHandler {
virtual void handleMessage(const Message& message) {
android_atomic_release_load(&memoryBarrier);
if (message.what == MSG_API_CALL) {
- impl->asBinder()->transact(code, data[0], reply);
+ result = impl->asBinder()->transact(code, data[0], reply);
barrier.open();
} else if (message.what == MSG_EXIT) {
exitRequested = true;
@@ -2940,7 +2941,7 @@ void SurfaceFlinger::checkScreenshot(size_t w, size_t s, size_t h, void const* v
const bool visible = (state.layerStack == hw->getLayerStack())
&& (state.z >= minLayerZ && state.z <= maxLayerZ)
&& (layer->isVisible());
- ALOGE("%c index=%d, name=%s, layerStack=%d, z=%d, visible=%d, flags=%x, alpha=%x",
+ ALOGE("%c index=%zu, name=%s, layerStack=%d, z=%d, visible=%d, flags=%x, alpha=%x",
visible ? '+' : '-',
i, layer->getName().string(), state.layerStack, state.z,
layer->isVisible(), state.flags, state.alpha);