summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2022-02-11 13:58:12 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2022-02-11 16:35:33 +0900
commit6bceda10ae74e719a91ac78b32148e62807374c2 (patch)
treecd7e7949ff1dae1c417140ca9868651b0cb377dd
parente86b9bb79d0e49fde21ffb3a27882334900aacfa (diff)
downloaddevice-rpi-6bceda10ae74e719a91ac78b32148e62807374c2.tar.gz
device-rpi-6bceda10ae74e719a91ac78b32148e62807374c2.tar.bz2
device-rpi-6bceda10ae74e719a91ac78b32148e62807374c2.zip
From rpi4 new vendor kernel release, dri nodes are changed between v3d and vc4, so gem_info can be in card 1. Consider also the changed sysfs node. Change-Id: I33cf4f3a0fc515a04f7fb180309610b3db49b7b7 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r--hw/memory/memory.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/hw/memory/memory.c b/hw/memory/memory.c
index 90157ab..6d3eb19 100644
--- a/hw/memory/memory.c
+++ b/hw/memory/memory.c
@@ -24,6 +24,7 @@
#include </hal/include/device/hal-backend-common.h>
#define GEM_INFO_PATH "/sys/kernel/debug/dri/0/gem_info"
+#define GEM_INFO_PATH1 "/sys/kernel/debug/dri/1/gem_info"
#define BYTES_PER_KBYTE 1024
static int memory_get_gpu_info(const int pid, struct gpu_info *info)
@@ -44,11 +45,14 @@ static int memory_get_gem_info(const int pid, struct gem_info *info)
fp = fopen(GEM_INFO_PATH, "r");
if (!fp) {
- _E("Failed to open %s, %d", GEM_INFO_PATH, -errno);
- /* Return the designated error(EIO) instead of general error(errno)
- * for api-level error conversion compatibility, as the api(runtime-info)
- * has no error enum for general error(errno) */
- return -EIO;
+ fp = fopen(GEM_INFO_PATH1, "r");
+ if (!fp) {
+ _E("Failed to open %s or %s, %d", GEM_INFO_PATH, GEM_INFO_PATH1, -errno);
+ /* Return the designated error(EIO) instead of general error(errno)
+ * for api-level error conversion compatibility, as the api(runtime-info)
+ * has no error enum for general error(errno) */
+ return -EIO;
+ }
}
total_hcount = 0;