summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hung Hsieh2017-10-26 13:19:43 -0500
committerChih-Hung Hsieh2017-11-02 17:16:18 -0500
commitc7f344e9a9070c748bc885a5e60edbd256ffffd5 (patch)
tree4c0152173e1e566c732b9b6cb3dedd8b5c4c10d7 /libpixelflinger
parent0d323c12df99201a341f0fb34ed543a46ec6eb86 (diff)
downloadplatform-system-core-c7f344e9a9070c748bc885a5e60edbd256ffffd5.tar.gz
platform-system-core-c7f344e9a9070c748bc885a5e60edbd256ffffd5.tar.xz
platform-system-core-c7f344e9a9070c748bc885a5e60edbd256ffffd5.zip
Use -Werror in system/core/libpixelflinger
* Remove unused local variables. * Suppress/fix warning of unused functions, conditionally used variables. Bug: 66996870 Test: build with WITH_TIDY=1 Change-Id: If92bc79f15a0486364da0389defbb2d43b3bd6ea
Diffstat (limited to 'libpixelflinger')
-rw-r--r--libpixelflinger/Android.mk2
-rw-r--r--libpixelflinger/codeflinger/Arm64Assembler.cpp6
-rw-r--r--libpixelflinger/codeflinger/GGLAssembler.cpp3
-rw-r--r--libpixelflinger/codeflinger/load_store.cpp1
-rw-r--r--libpixelflinger/codeflinger/texturing.cpp11
-rw-r--r--libpixelflinger/include/private/pixelflinger/ggl_fixed.h1
-rw-r--r--libpixelflinger/raster.cpp1
-rw-r--r--libpixelflinger/scanline.cpp1
-rw-r--r--libpixelflinger/tests/arch-arm64/assembler/Android.mk2
-rw-r--r--libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk2
-rw-r--r--libpixelflinger/tests/arch-arm64/disassembler/Android.mk2
-rw-r--r--libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk2
-rw-r--r--libpixelflinger/tests/codegen/Android.mk2
-rw-r--r--libpixelflinger/tests/codegen/codegen.cpp6
-rw-r--r--libpixelflinger/tests/gglmul/Android.mk2
-rw-r--r--libpixelflinger/trap.cpp2
16 files changed, 22 insertions, 24 deletions
diff --git a/libpixelflinger/Android.mk b/libpixelflinger/Android.mk
index 55891db99..c7306cd5e 100644
--- a/libpixelflinger/Android.mk
+++ b/libpixelflinger/Android.mk
@@ -25,6 +25,8 @@ PIXELFLINGER_SRC_FILES:= \
25 buffer.cpp 25 buffer.cpp
26 26
27PIXELFLINGER_CFLAGS := -fstrict-aliasing -fomit-frame-pointer 27PIXELFLINGER_CFLAGS := -fstrict-aliasing -fomit-frame-pointer
28PIXELFLINGER_CFLAGS += -Wall -Werror
29PIXELFLINGER_CFLAGS += -Wno-unused-function
28 30
29PIXELFLINGER_SRC_FILES_arm := \ 31PIXELFLINGER_SRC_FILES_arm := \
30 codeflinger/ARMAssembler.cpp \ 32 codeflinger/ARMAssembler.cpp \
diff --git a/libpixelflinger/codeflinger/Arm64Assembler.cpp b/libpixelflinger/codeflinger/Arm64Assembler.cpp
index bff87bbac..aebc129bf 100644
--- a/libpixelflinger/codeflinger/Arm64Assembler.cpp
+++ b/libpixelflinger/codeflinger/Arm64Assembler.cpp
@@ -151,11 +151,11 @@
151 151
152namespace android { 152namespace android {
153 153
154static const char* shift_codes[] = 154static __unused const char* shift_codes[] =
155{ 155{
156 "LSL", "LSR", "ASR", "ROR" 156 "LSL", "LSR", "ASR", "ROR"
157}; 157};
158static const char *cc_codes[] = 158static __unused const char *cc_codes[] =
159{ 159{
160 "EQ", "NE", "CS", "CC", "MI", 160 "EQ", "NE", "CS", "CC", "MI",
161 "PL", "VS", "VC", "HI", "LS", 161 "PL", "VS", "VC", "HI", "LS",
@@ -984,7 +984,7 @@ uint32_t ArmToArm64Assembler::reg_post(int /*Rm*/)
984// A64 instructions 984// A64 instructions
985// ---------------------------------------------------------------------------- 985// ----------------------------------------------------------------------------
986 986
987static const char * dataTransferOpName[] = 987static __unused const char * dataTransferOpName[] =
988{ 988{
989 "LDR","LDRB","LDRH","STR","STRB","STRH" 989 "LDR","LDRB","LDRH","STR","STRB","STRH"
990}; 990};
diff --git a/libpixelflinger/codeflinger/GGLAssembler.cpp b/libpixelflinger/codeflinger/GGLAssembler.cpp
index 91fbd53cf..04e285d1b 100644
--- a/libpixelflinger/codeflinger/GGLAssembler.cpp
+++ b/libpixelflinger/codeflinger/GGLAssembler.cpp
@@ -94,8 +94,6 @@ int GGLAssembler::scanline(const needs_t& needs, context_t const* c)
94 94
95int GGLAssembler::scanline_core(const needs_t& needs, context_t const* c) 95int GGLAssembler::scanline_core(const needs_t& needs, context_t const* c)
96{ 96{
97 int64_t duration = ggl_system_time();
98
99 mBlendFactorCached = 0; 97 mBlendFactorCached = 0;
100 mBlending = 0; 98 mBlending = 0;
101 mMasking = 0; 99 mMasking = 0;
@@ -353,7 +351,6 @@ void GGLAssembler::build_scanline_prolog(
353 fragment_parts_t& parts, const needs_t& needs) 351 fragment_parts_t& parts, const needs_t& needs)
354{ 352{
355 Scratch scratches(registerFile()); 353 Scratch scratches(registerFile());
356 int Rctx = mBuilderContext.Rctx;
357 354
358 // compute count 355 // compute count
359 comment("compute ct (# of pixels to process)"); 356 comment("compute ct (# of pixels to process)");
diff --git a/libpixelflinger/codeflinger/load_store.cpp b/libpixelflinger/codeflinger/load_store.cpp
index da21e1d97..4db0a4948 100644
--- a/libpixelflinger/codeflinger/load_store.cpp
+++ b/libpixelflinger/codeflinger/load_store.cpp
@@ -232,7 +232,6 @@ void GGLAssembler::expand(integer_t& dst, const integer_t& src, int dbits)
232void GGLAssembler::downshift( 232void GGLAssembler::downshift(
233 pixel_t& d, int component, component_t s, const reg_t& dither) 233 pixel_t& d, int component, component_t s, const reg_t& dither)
234{ 234{
235 const needs_t& needs = mBuilderContext.needs;
236 Scratch scratches(registerFile()); 235 Scratch scratches(registerFile());
237 236
238 int sh = s.h; 237 int sh = s.h;
diff --git a/libpixelflinger/codeflinger/texturing.cpp b/libpixelflinger/codeflinger/texturing.cpp
index 4c357af83..e6997bd4b 100644
--- a/libpixelflinger/codeflinger/texturing.cpp
+++ b/libpixelflinger/codeflinger/texturing.cpp
@@ -41,7 +41,6 @@ namespace android {
41void GGLAssembler::init_iterated_color(fragment_parts_t& parts, const reg_t& x) 41void GGLAssembler::init_iterated_color(fragment_parts_t& parts, const reg_t& x)
42{ 42{
43 context_t const* c = mBuilderContext.c; 43 context_t const* c = mBuilderContext.c;
44 const needs_t& needs = mBuilderContext.needs;
45 44
46 if (mSmooth) { 45 if (mSmooth) {
47 // NOTE: we could take this case in the mDithering + !mSmooth case, 46 // NOTE: we could take this case in the mDithering + !mSmooth case,
@@ -324,9 +323,7 @@ void GGLAssembler::init_textures(
324 tex_coord_t* coords, 323 tex_coord_t* coords,
325 const reg_t& x, const reg_t& y) 324 const reg_t& x, const reg_t& y)
326{ 325{
327 context_t const* c = mBuilderContext.c;
328 const needs_t& needs = mBuilderContext.needs; 326 const needs_t& needs = mBuilderContext.needs;
329 int Rctx = mBuilderContext.Rctx;
330 int Rx = x.reg; 327 int Rx = x.reg;
331 int Ry = y.reg; 328 int Ry = y.reg;
332 329
@@ -402,10 +399,6 @@ void GGLAssembler::init_textures(
402void GGLAssembler::build_textures( fragment_parts_t& parts, 399void GGLAssembler::build_textures( fragment_parts_t& parts,
403 Scratch& regs) 400 Scratch& regs)
404{ 401{
405 context_t const* c = mBuilderContext.c;
406 const needs_t& needs = mBuilderContext.needs;
407 int Rctx = mBuilderContext.Rctx;
408
409 // We don't have a way to spill registers automatically 402 // We don't have a way to spill registers automatically
410 // spill depth and AA regs, when we know we may have to. 403 // spill depth and AA regs, when we know we may have to.
411 // build the spill list... 404 // build the spill list...
@@ -434,7 +427,6 @@ void GGLAssembler::build_textures( fragment_parts_t& parts,
434 427
435 Spill spill(registerFile(), *this, spill_list); 428 Spill spill(registerFile(), *this, spill_list);
436 429
437 const bool multiTexture = mTextureMachine.activeUnits > 1;
438 for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT; i++) { 430 for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT; i++) {
439 const texture_unit_t& tmu = mTextureMachine.tmu[i]; 431 const texture_unit_t& tmu = mTextureMachine.tmu[i];
440 if (tmu.format_idx == 0) 432 if (tmu.format_idx == 0)
@@ -442,7 +434,7 @@ void GGLAssembler::build_textures( fragment_parts_t& parts,
442 434
443 pointer_t& txPtr = parts.coords[i].ptr; 435 pointer_t& txPtr = parts.coords[i].ptr;
444 pixel_t& texel = parts.texel[i]; 436 pixel_t& texel = parts.texel[i];
445 437
446 // repeat... 438 // repeat...
447 if ((tmu.swrap == GGL_NEEDS_WRAP_11) && 439 if ((tmu.swrap == GGL_NEEDS_WRAP_11) &&
448 (tmu.twrap == GGL_NEEDS_WRAP_11)) 440 (tmu.twrap == GGL_NEEDS_WRAP_11))
@@ -656,7 +648,6 @@ void GGLAssembler::build_textures( fragment_parts_t& parts,
656void GGLAssembler::build_iterate_texture_coordinates( 648void GGLAssembler::build_iterate_texture_coordinates(
657 const fragment_parts_t& parts) 649 const fragment_parts_t& parts)
658{ 650{
659 const bool multiTexture = mTextureMachine.activeUnits > 1;
660 for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT; i++) { 651 for (int i=0 ; i<GGL_TEXTURE_UNIT_COUNT; i++) {
661 const texture_unit_t& tmu = mTextureMachine.tmu[i]; 652 const texture_unit_t& tmu = mTextureMachine.tmu[i];
662 if (tmu.format_idx == 0) 653 if (tmu.format_idx == 0)
diff --git a/libpixelflinger/include/private/pixelflinger/ggl_fixed.h b/libpixelflinger/include/private/pixelflinger/ggl_fixed.h
index 17b85dd58..51e9e2695 100644
--- a/libpixelflinger/include/private/pixelflinger/ggl_fixed.h
+++ b/libpixelflinger/include/private/pixelflinger/ggl_fixed.h
@@ -497,7 +497,6 @@ inline GGLfixed gglMulSubx(GGLfixed x, GGLfixed y, GGLfixed a, int shift)
497{ 497{
498 498
499 GGLfixed result; 499 GGLfixed result;
500 int rshift;
501 500
502 asm("smull %x[result], %w[x], %w[y] \n" 501 asm("smull %x[result], %w[x], %w[y] \n"
503 "lsr %x[result], %x[result], %x[shift] \n" 502 "lsr %x[result], %x[result], %x[shift] \n"
diff --git a/libpixelflinger/raster.cpp b/libpixelflinger/raster.cpp
index 26d8e4571..e95c2c8ab 100644
--- a/libpixelflinger/raster.cpp
+++ b/libpixelflinger/raster.cpp
@@ -153,7 +153,6 @@ GGLint gglBitBlit(GGLContext* con, int tmu, GGLint crop[4], GGLint where[4])
153 GGLint h = where[3]; 153 GGLint h = where[3];
154 154
155 // exclsively enable this tmu 155 // exclsively enable this tmu
156 const GGLSurface& cbSurface = c->state.buffers.color.s;
157 c->procs.activeTexture(c, tmu); 156 c->procs.activeTexture(c, tmu);
158 c->procs.disable(c, GGL_W_LERP); 157 c->procs.disable(c, GGL_W_LERP);
159 158
diff --git a/libpixelflinger/scanline.cpp b/libpixelflinger/scanline.cpp
index c6cf5bffe..4cc23c773 100644
--- a/libpixelflinger/scanline.cpp
+++ b/libpixelflinger/scanline.cpp
@@ -2144,7 +2144,6 @@ void scanline_t32cb16(context_t* c)
2144 const int32_t u = (c->state.texture[0].shade.is0>>16) + x; 2144 const int32_t u = (c->state.texture[0].shade.is0>>16) + x;
2145 const int32_t v = (c->state.texture[0].shade.it0>>16) + y; 2145 const int32_t v = (c->state.texture[0].shade.it0>>16) + y;
2146 uint32_t *src = reinterpret_cast<uint32_t*>(tex->data)+(u+(tex->stride*v)); 2146 uint32_t *src = reinterpret_cast<uint32_t*>(tex->data)+(u+(tex->stride*v));
2147 int sR, sG, sB;
2148 uint32_t s, d; 2147 uint32_t s, d;
2149 2148
2150 if (ct==1 || uintptr_t(dst)&2) { 2149 if (ct==1 || uintptr_t(dst)&2) {
diff --git a/libpixelflinger/tests/arch-arm64/assembler/Android.mk b/libpixelflinger/tests/arch-arm64/assembler/Android.mk
index bd0f24b3e..db5dc4df9 100644
--- a/libpixelflinger/tests/arch-arm64/assembler/Android.mk
+++ b/libpixelflinger/tests/arch-arm64/assembler/Android.mk
@@ -14,6 +14,8 @@ LOCAL_C_INCLUDES := \
14 14
15LOCAL_MODULE:= test-pixelflinger-arm64-assembler-test 15LOCAL_MODULE:= test-pixelflinger-arm64-assembler-test
16 16
17LOCAL_CFLAGS := -Wall -Werror
18
17LOCAL_MODULE_TAGS := tests 19LOCAL_MODULE_TAGS := tests
18 20
19LOCAL_MULTILIB := 64 21LOCAL_MULTILIB := 64
diff --git a/libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk b/libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk
index 3368eb017..3096232b8 100644
--- a/libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk
+++ b/libpixelflinger/tests/arch-arm64/col32cb16blend/Android.mk
@@ -11,6 +11,8 @@ LOCAL_C_INCLUDES :=
11 11
12LOCAL_MODULE:= test-pixelflinger-arm64-col32cb16blend 12LOCAL_MODULE:= test-pixelflinger-arm64-col32cb16blend
13 13
14LOCAL_CFLAGS := -Wall -Werror
15
14LOCAL_MODULE_TAGS := tests 16LOCAL_MODULE_TAGS := tests
15 17
16LOCAL_MULTILIB := 64 18LOCAL_MULTILIB := 64
diff --git a/libpixelflinger/tests/arch-arm64/disassembler/Android.mk b/libpixelflinger/tests/arch-arm64/disassembler/Android.mk
index d8f7e699f..78f12af9d 100644
--- a/libpixelflinger/tests/arch-arm64/disassembler/Android.mk
+++ b/libpixelflinger/tests/arch-arm64/disassembler/Android.mk
@@ -9,6 +9,8 @@ LOCAL_SHARED_LIBRARIES :=
9 9
10LOCAL_MODULE:= test-pixelflinger-arm64-disassembler-test 10LOCAL_MODULE:= test-pixelflinger-arm64-disassembler-test
11 11
12LOCAL_CFLAGS := -Wall -Werror
13
12LOCAL_MODULE_TAGS := tests 14LOCAL_MODULE_TAGS := tests
13 15
14LOCAL_MULTILIB := 64 16LOCAL_MULTILIB := 64
diff --git a/libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk b/libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk
index 8e5ec5e01..664347f50 100644
--- a/libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk
+++ b/libpixelflinger/tests/arch-arm64/t32cb16blend/Android.mk
@@ -11,6 +11,8 @@ LOCAL_C_INCLUDES :=
11 11
12LOCAL_MODULE:= test-pixelflinger-arm64-t32cb16blend 12LOCAL_MODULE:= test-pixelflinger-arm64-t32cb16blend
13 13
14LOCAL_CFLAGS := -Wall -Werror
15
14LOCAL_MODULE_TAGS := tests 16LOCAL_MODULE_TAGS := tests
15 17
16LOCAL_MULTILIB := 64 18LOCAL_MULTILIB := 64
diff --git a/libpixelflinger/tests/codegen/Android.mk b/libpixelflinger/tests/codegen/Android.mk
index 2f9ca2f9a..72d71efd3 100644
--- a/libpixelflinger/tests/codegen/Android.mk
+++ b/libpixelflinger/tests/codegen/Android.mk
@@ -13,6 +13,8 @@ LOCAL_C_INCLUDES := \
13 13
14LOCAL_MODULE:= test-opengl-codegen 14LOCAL_MODULE:= test-opengl-codegen
15 15
16LOCAL_CFLAGS:= -Wall -Werror
17
16LOCAL_MODULE_TAGS := tests 18LOCAL_MODULE_TAGS := tests
17 19
18include $(BUILD_NATIVE_TEST) 20include $(BUILD_NATIVE_TEST)
diff --git a/libpixelflinger/tests/codegen/codegen.cpp b/libpixelflinger/tests/codegen/codegen.cpp
index efa6d87bf..dce4ed72c 100644
--- a/libpixelflinger/tests/codegen/codegen.cpp
+++ b/libpixelflinger/tests/codegen/codegen.cpp
@@ -40,9 +40,9 @@ public:
40 const AssemblyKey<needs_t>& key() const { return mKey; } 40 const AssemblyKey<needs_t>& key() const { return mKey; }
41}; 41};
42 42
43#if ANDROID_ARM_CODEGEN
43static void ggl_test_codegen(uint32_t n, uint32_t p, uint32_t t0, uint32_t t1) 44static void ggl_test_codegen(uint32_t n, uint32_t p, uint32_t t0, uint32_t t1)
44{ 45{
45#if ANDROID_ARM_CODEGEN
46 GGLContext* c; 46 GGLContext* c;
47 gglInit(&c); 47 gglInit(&c);
48 needs_t needs; 48 needs_t needs;
@@ -73,10 +73,12 @@ static void ggl_test_codegen(uint32_t n, uint32_t p, uint32_t t0, uint32_t t1)
73 printf("error %08x (%s)\n", err, strerror(-err)); 73 printf("error %08x (%s)\n", err, strerror(-err));
74 } 74 }
75 gglUninit(c); 75 gglUninit(c);
76}
76#else 77#else
78static void ggl_test_codegen(uint32_t, uint32_t, uint32_t, uint32_t) {
77 printf("This test runs only on ARM, Arm64 or MIPS\n"); 79 printf("This test runs only on ARM, Arm64 or MIPS\n");
78#endif
79} 80}
81#endif
80 82
81int main(int argc, char** argv) 83int main(int argc, char** argv)
82{ 84{
diff --git a/libpixelflinger/tests/gglmul/Android.mk b/libpixelflinger/tests/gglmul/Android.mk
index 75bd39ef5..67f358fc5 100644
--- a/libpixelflinger/tests/gglmul/Android.mk
+++ b/libpixelflinger/tests/gglmul/Android.mk
@@ -11,6 +11,8 @@ LOCAL_C_INCLUDES := \
11 11
12LOCAL_MODULE:= test-pixelflinger-gglmul 12LOCAL_MODULE:= test-pixelflinger-gglmul
13 13
14LOCAL_CFLAGS:= -Wall -Werror
15
14LOCAL_MODULE_TAGS := tests 16LOCAL_MODULE_TAGS := tests
15 17
16include $(BUILD_NATIVE_TEST) 18include $(BUILD_NATIVE_TEST)
diff --git a/libpixelflinger/trap.cpp b/libpixelflinger/trap.cpp
index 234bfdde1..06ad2373c 100644
--- a/libpixelflinger/trap.cpp
+++ b/libpixelflinger/trap.cpp
@@ -349,7 +349,6 @@ void linex_validate(void *con, const GGLcoord* v0, const GGLcoord* v1, GGLcoord
349 349
350static void linex(void *con, const GGLcoord* v0, const GGLcoord* v1, GGLcoord width) 350static void linex(void *con, const GGLcoord* v0, const GGLcoord* v1, GGLcoord width)
351{ 351{
352 GGL_CONTEXT(c, con);
353 GGLcoord v[4][2]; 352 GGLcoord v[4][2];
354 v[0][0] = v0[0]; v[0][1] = v0[1]; 353 v[0][0] = v0[0]; v[0][1] = v0[1];
355 v[1][0] = v1[0]; v[1][1] = v1[1]; 354 v[1][0] = v1[0]; v[1][1] = v1[1];
@@ -377,7 +376,6 @@ static void linex(void *con, const GGLcoord* v0, const GGLcoord* v1, GGLcoord wi
377 376
378static void aa_linex(void *con, const GGLcoord* v0, const GGLcoord* v1, GGLcoord width) 377static void aa_linex(void *con, const GGLcoord* v0, const GGLcoord* v1, GGLcoord width)
379{ 378{
380 GGL_CONTEXT(c, con);
381 GGLcoord v[4][2]; 379 GGLcoord v[4][2];
382 v[0][0] = v0[0]; v[0][1] = v0[1]; 380 v[0][0] = v0[0]; v[0][1] = v0[1];
383 v[1][0] = v1[0]; v[1][1] = v1[1]; 381 v[1][0] = v1[0]; v[1][1] = v1[1];