summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Goyal <layog@google.com>2022-03-16 10:53:48 -0700
committerSiddharth Kapoor <ksiddharth@google.com>2022-03-24 07:11:08 +0000
commit757551b6b4d168794e818e89fe44090ea087a260 (patch)
tree52fbcb424c9b23e2a5e881a53a7088c6a041e515
parent027e0dd73abec1a02178aee3e458d6b66e13b211 (diff)
downloadgchips-757551b6b4d168794e818e89fe44090ea087a260.tar.gz
Remove unused debug files
Bug: 207450311 Test: Boots to home Change-Id: I595f060df7576fdf79951b7163b51ff5a95d080a Merged-In: Ia654cc83561784439a207d65dbee1664285e199d
-rw-r--r--gralloc4/src/Android.bp1
-rw-r--r--gralloc4/src/core/Android.bp1
-rw-r--r--gralloc4/src/core/exynos_format_allocation.h2
-rw-r--r--gralloc4/src/core/mali_gralloc_bufferallocation.cpp1
-rw-r--r--gralloc4/src/core/mali_gralloc_debug.cpp136
-rw-r--r--gralloc4/src/core/mali_gralloc_debug.h33
-rw-r--r--gralloc4/src/core/mali_gralloc_reference.cpp2
7 files changed, 2 insertions, 174 deletions
diff --git a/gralloc4/src/Android.bp b/gralloc4/src/Android.bp
index a3a254d..3541b00 100644
--- a/gralloc4/src/Android.bp
+++ b/gralloc4/src/Android.bp
@@ -47,7 +47,6 @@ cc_library_shared {
"core/mali_gralloc_bufferallocation.cpp",
"core/mali_gralloc_bufferdescriptor.cpp",
"core/mali_gralloc_reference.cpp",
- "core/mali_gralloc_debug.cpp",
":libgralloc_hidl_common_shared_metadata",
],
cflags: [
diff --git a/gralloc4/src/core/Android.bp b/gralloc4/src/core/Android.bp
index 023962c..b01b0b7 100644
--- a/gralloc4/src/core/Android.bp
+++ b/gralloc4/src/core/Android.bp
@@ -59,7 +59,6 @@ arm_gralloc_core_cc_defaults {
"mali_gralloc_bufferdescriptor.cpp",
"mali_gralloc_formats.cpp",
"mali_gralloc_reference.cpp",
- "mali_gralloc_debug.cpp",
"format_info.cpp",
],
include_dirs: [
diff --git a/gralloc4/src/core/exynos_format_allocation.h b/gralloc4/src/core/exynos_format_allocation.h
index 30b2c15..bcaadfb 100644
--- a/gralloc4/src/core/exynos_format_allocation.h
+++ b/gralloc4/src/core/exynos_format_allocation.h
@@ -22,6 +22,8 @@
#include "mfc_macros_local.h"
#endif
+#include <gralloc_priv.h>
+
#define PLANE_SIZE(w, h) ((w) * (h))
#define S2B_PLANE_SIZE(w, h) (GRALLOC_ALIGN((w) / 4, 16) * (GRALLOC_ALIGN(h, 16)))
diff --git a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
index d82ff8c..704812e 100644
--- a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
+++ b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp
@@ -29,7 +29,6 @@
#include "allocator/mali_gralloc_shared_memory.h"
#include "mali_gralloc_buffer.h"
#include "mali_gralloc_bufferdescriptor.h"
-#include "mali_gralloc_debug.h"
#include "mali_gralloc_log.h"
#include "format_info.h"
#include <exynos_format.h>
diff --git a/gralloc4/src/core/mali_gralloc_debug.cpp b/gralloc4/src/core/mali_gralloc_debug.cpp
deleted file mode 100644
index cc3bc7f..0000000
--- a/gralloc4/src/core/mali_gralloc_debug.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2016, 2018 ARM Limited. All rights reserved.
- *
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * You may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <inttypes.h>
-#include <stdlib.h>
-#include <vector>
-#include <algorithm>
-
-#include <hardware/hardware.h>
-
-#include "mali_gralloc_debug.h"
-
-static pthread_mutex_t dump_lock = PTHREAD_MUTEX_INITIALIZER;
-static std::vector<private_handle_t *> dump_buffers;
-static android::String8 dumpStrings;
-
-void mali_gralloc_dump_buffer_add(private_handle_t *handle)
-{
- if (NULL == handle)
- {
- MALI_GRALLOC_LOGE("Invalid handle %p and return", handle);
- return;
- }
-
- pthread_mutex_lock(&dump_lock);
- dump_buffers.push_back(handle);
- pthread_mutex_unlock(&dump_lock);
-}
-
-void mali_gralloc_dump_buffer_erase(private_handle_t *handle)
-{
- if (NULL == handle)
- {
- MALI_GRALLOC_LOGE("Invalid handle %p and return", handle);
- return;
- }
-
- pthread_mutex_lock(&dump_lock);
- dump_buffers.erase(std::remove(dump_buffers.begin(), dump_buffers.end(), handle), dump_buffers.end());
- pthread_mutex_unlock(&dump_lock);
-}
-
-void mali_gralloc_dump_string(android::String8 &buf, const char *fmt, ...)
-{
- va_list args;
- va_start(args, fmt);
- buf.appendFormatV(fmt, args);
- va_end(args);
-}
-
-void mali_gralloc_dump_buffers(android::String8 &dumpStrings, uint32_t *outSize)
-{
- if (NULL == outSize)
- {
- MALI_GRALLOC_LOGE("Invalid pointer to dump buffer size and return");
- return;
- }
-
- dumpStrings.clear();
- mali_gralloc_dump_string(dumpStrings,
- "-------------------------Start to dump Gralloc buffers info------------------------\n");
- private_handle_t *hnd;
- size_t num;
-
- mali_gralloc_dump_string(dumpStrings, " handle | width | height | stride | req format |alloc "
- "format|consumer usage|producer usage| shared fd | AFBC "
- "|\n");
- mali_gralloc_dump_string(dumpStrings, "------------+-------+--------+--------+----------------+---------------+----"
- "----------+--------------+-----------+------+\n");
- pthread_mutex_lock(&dump_lock);
-
- for (num = 0; num < dump_buffers.size(); num++)
- {
- hnd = dump_buffers[num];
- mali_gralloc_dump_string(dumpStrings, " %08" PRIxPTR " | %5d | %5d | %5d | %08x | %09" PRIx64
- " | %09" PRIx64 " | %09" PRIx64 " | %08x | %4d |\n",
- hnd, hnd->width, hnd->height, hnd->stride, hnd->req_format, hnd->alloc_format,
- hnd->consumer_usage, hnd->producer_usage, hnd->fds[0],
- (hnd->alloc_format & MALI_GRALLOC_INTFMT_AFBCENABLE_MASK) ? true : false);
- }
-
- pthread_mutex_unlock(&dump_lock);
- mali_gralloc_dump_string(
- dumpStrings, "---------------------End dump Gralloc buffers info with num %zu----------------------\n", num);
-
- *outSize = dumpStrings.size();
-}
-
-void mali_gralloc_dump_internal(uint32_t *outSize, char *outBuffer)
-{
- uint32_t dumpSize;
-
- if (NULL == outSize)
- {
- MALI_GRALLOC_LOGE("Invalid pointer to dump buffer size and return");
- return;
- }
-
- if (NULL == outBuffer)
- {
- if (!dumpStrings.isEmpty())
- {
- dumpStrings.clear();
- }
-
- mali_gralloc_dump_buffers(dumpStrings, outSize);
- }
- else
- {
- if (dumpStrings.isEmpty())
- {
- *outSize = 0;
- }
- else
- {
- dumpSize = dumpStrings.size();
- *outSize = (dumpSize < *outSize) ? dumpSize : *outSize;
- memcpy(outBuffer, dumpStrings.string(), *outSize);
- }
- }
-}
diff --git a/gralloc4/src/core/mali_gralloc_debug.h b/gralloc4/src/core/mali_gralloc_debug.h
deleted file mode 100644
index 9f99f0e..0000000
--- a/gralloc4/src/core/mali_gralloc_debug.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2016, 2018 ARM Limited. All rights reserved.
- *
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef MALI_GRALLOC_DEBUG_H_
-#define MALI_GRALLOC_DEBUG_H_
-
-#include <utils/String8.h>
-#include "gralloc_priv.h"
-
-#include <hardware/gralloc1.h>
-
-void mali_gralloc_dump_buffer_add(private_handle_t *handle);
-void mali_gralloc_dump_buffer_erase(private_handle_t *handle);
-
-void mali_gralloc_dump_string(android::String8 &buf, const char *fmt, ...);
-void mali_gralloc_dump_buffers(android::String8 &dumpBuffer, uint32_t *outSize);
-void mali_gralloc_dump_internal(uint32_t *outSize, char *outBuffer);
-#endif
diff --git a/gralloc4/src/core/mali_gralloc_reference.cpp b/gralloc4/src/core/mali_gralloc_reference.cpp
index 880f838..67dd4f9 100644
--- a/gralloc4/src/core/mali_gralloc_reference.cpp
+++ b/gralloc4/src/core/mali_gralloc_reference.cpp
@@ -22,7 +22,6 @@
#include "allocator/mali_gralloc_ion.h"
#include "allocator/mali_gralloc_shared_memory.h"
#include "mali_gralloc_bufferallocation.h"
-#include "mali_gralloc_debug.h"
#include "mali_gralloc_reference.h"
#include "mali_gralloc_usages.h"
@@ -114,7 +113,6 @@ int mali_gralloc_reference_release(buffer_handle_t handle, bool canFree)
if (hnd->ref_count == 0 && canFree)
{
- mali_gralloc_dump_buffer_erase(hnd);
mali_gralloc_buffer_free(handle);
}
}