* [PATCH] Android port of intel-gpu-tools
@ 2012-01-10 4:45 Sateesh Kavuri
2012-01-10 12:47 ` Daniel Vetter
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Sateesh Kavuri @ 2012-01-10 4:45 UTC (permalink / raw)
To: intel-gfx
Added support for Android. Changes include fixes for compilation issues
related to Android using an older version of GCC compiler (ver 4.3.3)
while the latest version of intel-gpu-tools confirms to GCC ver 4.5.2
(C99 standard functions), using functions like getline(). Fixed such
functions, header dependencies for android and added an Android.mk file.
signed-off-by: Sateesh Kavuri <sateesh.kavuri@intel.com>
---
Android.mk | 528 ++++++++++++++++++++++++++++++++++++++++++++
lib/intel_drm.c | 6 +-
lib/intel_mmio.c | 4 +
lib/intel_pci.c | 4 +
tools/intel_decode.c | 10 +
tools/intel_dump_decode.c | 14 +-
tools/intel_error_decode.c | 14 ++
tools/intel_gpu_top.c | 6 +-
tools/intel_reg_write.c | 2 +
9 files changed, 584 insertions(+), 4 deletions(-)
create mode 100644 Android.mk
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..0fc04cd
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,528 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_reg_write.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_reg_map.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+LOCAL_MODULE := intel_reg_write
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_reg_read.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_reg_map.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_reg_read
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_disable_clock_gating.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_disable_clock_gating
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_audio_dump.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_audio_dump
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_backlight.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_backlight
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_bios_dumper.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_bios_dumper
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_bios_reader.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_bios_reader
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_error_decode.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h \
+ lib/instdone.h \
+ lib/instdone.c \
+ tools/intel_decode.h \
+ tools/intel_decode.c \
+ lib/intel_drm.c
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_error_decode
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_gpu_top.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h \
+ lib/instdone.h \
+ lib/instdone.c \
+ lib/intel_reg_map.c
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_gpu_top
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_gpu_time.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_gpu_time
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_gtt.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+
+LOCAL_MODULE := intel_gtt
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_stepping.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_stepping
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_reg_dumper.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_reg_dumper
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/intel_reg_snapshot.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+
+LOCAL_MODULE := intel_reg_snapshot
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ tools/forcewaked.c \
+ lib/intel_pci.c \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg.h \
+ lib/intel_batchbuffer.h \
+ lib/intel_batchbuffer.c \
+ lib/intel_mmio.c \
+ tools/intel_chipset.h \
+ lib/intel_reg_map.c
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := forcewaked
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess \
+ libdrm \
+ libdrm_intel
+
+include $(BUILD_EXECUTABLE)
+
+#================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ lib/intel_gpu_tools.h \
+ tools/intel_reg_checker.c \
+ lib/intel_pci.c \
+ lib/intel_mmio.c
+
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/lib \
+ $(TOPDIR)hardware/intel/libdrm/include/drm \
+ $(TOPDIR)hardware/intel/libdrm/intel \
+ $(LOCAL_PATH)/../libpciaccess/include/
+
+LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+LOCAL_CFLAGS += -DANDROID
+
+
+LOCAL_MODULE := intel_reg_checker
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libpciaccess
+
+include $(BUILD_EXECUTABLE)
+
diff --git a/lib/intel_drm.c b/lib/intel_drm.c
index f8eca7d..1f51856 100644
--- a/lib/intel_drm.c
+++ b/lib/intel_drm.c
@@ -25,7 +25,7 @@
*
*/
-#include "config.h"
+#include "../config.h"
#include <unistd.h>
#include <stdlib.h>
@@ -35,7 +35,11 @@
#include <err.h>
#include <assert.h>
#include <sys/ioctl.h>
+#ifdef ANDROID
+#include <fcntl.h>
+#else
#include <sys/fcntl.h>
+#endif
#include <sys/stat.h>
#include <sys/mman.h>
#ifdef HAVE_STRUCT_SYSINFO_TOTALRAM
diff --git a/lib/intel_mmio.c b/lib/intel_mmio.c
index da68bdf..2020833 100644
--- a/lib/intel_mmio.c
+++ b/lib/intel_mmio.c
@@ -38,7 +38,11 @@
#include <err.h>
#include <assert.h>
#include <sys/ioctl.h>
+#ifdef ANDROID
+#include <fcntl.h>
+#else
#include <sys/fcntl.h>
+#endif
#include <sys/stat.h>
#include <sys/mman.h>
diff --git a/lib/intel_pci.c b/lib/intel_pci.c
index 7bc7466..98889ca 100644
--- a/lib/intel_pci.c
+++ b/lib/intel_pci.c
@@ -33,7 +33,11 @@
#include <err.h>
#include <assert.h>
#include <sys/ioctl.h>
+#ifdef ANDROID
+#include <fcntl.h>
+#else
#include <sys/fcntl.h>
+#endif
#include <sys/stat.h>
#include <sys/mman.h>
diff --git a/tools/intel_decode.c b/tools/intel_decode.c
index 344578b..5ed508f 100644
--- a/tools/intel_decode.c
+++ b/tools/intel_decode.c
@@ -198,7 +198,12 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
if ((data[0] & 0x1f800000) >> 23 == opcodes_mi[opcode].opcode) {
instr_out(data, hw_offset, 0, "%s\n", opcodes_mi[opcode].name);
+ #ifdef ANDROID
+ int i;
+ for (i = 1; i < len; i++) {
+ #else
for (int i = 1; i < len; i++) {
+ #endif
if (i >= count)
BUFFER_FAIL(count, len, opcodes_mi[opcode].name);
instr_out(data, hw_offset, i, "dword %d\n", i);
@@ -1164,7 +1169,12 @@ decode_3d_1d(uint32_t *data, int count,
break;
case 2:
instr_out(data, hw_offset, i, "S2: texcoord formats: ");
+ #ifdef ANDROID
+ int tex_num;
+ for (tex_num = 0; tex_num < 8; tex_num++) {
+ #else
for (int tex_num = 0; tex_num < 8; tex_num++) {
+ #endif
switch((data[i]>>tex_num*4)&0xf) {
case 0: fprintf(out, "%i=2D ", tex_num); break;
case 1: fprintf(out, "%i=3D ", tex_num); break;
diff --git a/tools/intel_dump_decode.c b/tools/intel_dump_decode.c
index 26d57f5..57c1261 100644
--- a/tools/intel_dump_decode.c
+++ b/tools/intel_dump_decode.c
@@ -67,6 +67,10 @@ read_data_file(uint32_t devid, const char * filename)
FILE *file;
uint32_t *data = NULL;
int data_size = 0, count = 0, line_number = 0, matched;
+ #ifdef ANDROID
+ char line[1024];
+ size_t line_size = 1024;
+ #else
char *line = NULL;
size_t line_size;
uint32_t offset, value;
@@ -82,9 +86,15 @@ read_data_file(uint32_t devid, const char * filename)
filename, strerror (errno));
exit (1);
}
-
+#ifdef ANDROID
+ while (fgets (line, line_size, file) != 0) {
+ line[strcspn(line, "\n")] = '\0';
+ if (line[0] == '\0') continue;
+#else
while (getline (&line, &line_size, file) > 0) {
- line_number++;
+#endif
+
+ line_number++;
matched = sscanf (line, "%08x : %08x", &offset, &value);
if (matched != 2) {
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index 6ffaefe..c9c74ba 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -280,15 +280,27 @@ read_data_file (FILE *file)
uint32_t *data = NULL;
long long unsigned fence;
int data_size = 0, count = 0, line_number = 0, matched;
+#ifdef ANDROID
+ char line[1024];
+ size_t line_size = 1024;
+#else
char *line = NULL;
size_t line_size;
+#endif
uint32_t offset, value;
uint32_t gtt_offset = 0, new_gtt_offset;
char *buffer_type[2] = { "ringbuffer", "batchbuffer" };
char *ring_name = NULL;
int is_batch = 1;
+#ifdef ANDROID
+ while (fgets (line, line_size, file) != 0) {
+ line[strcspn(line, "\n")] = '\0';
+ if (line[0] == '\0') continue;
+#else
while (getline (&line, &line_size, file) > 0) {
+#endif
+
char *dashes;
line_number++;
@@ -404,7 +416,9 @@ read_data_file (FILE *file)
}
free (data);
+#ifndef ANDROID
free (line);
+#endif
free (ring_name);
}
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 033ba53..b9d1ce9 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -27,7 +27,7 @@
*
*/
-#include "config.h"
+#include "../config.h"
#include <unistd.h>
#include <stdlib.h>
@@ -602,10 +602,14 @@ int main(int argc, char **argv)
/* Limit the number of lines printed to the terminal height so the
* most important info (at the top) will stay on screen. */
unsigned short int max_lines = -1;
+#ifndef ANDROID
struct winsize ws;
if (ioctl(0, TIOCGWINSZ, &ws) != -1)
max_lines = ws.ws_row - 6; /* exclude header lines */
if (max_lines >= num_instdone_bits)
+ // FIXME: ioctl-types.h still does not exist in Android. Hard code
+ // the max_lines value for now (winsize is part of ioctl-types.h
+#endif
max_lines = num_instdone_bits;
t2 = gettime();
diff --git a/tools/intel_reg_write.c b/tools/intel_reg_write.c
index c8af9bb..81bceef 100644
--- a/tools/intel_reg_write.c
+++ b/tools/intel_reg_write.c
@@ -25,6 +25,8 @@
*
*/
+#include "../config.h"
+
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
--
1.7.4.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] Android port of intel-gpu-tools
2012-01-10 4:45 [PATCH] Android port of intel-gpu-tools Sateesh Kavuri
@ 2012-01-10 12:47 ` Daniel Vetter
2012-01-16 18:25 ` Chad Versace
2012-01-10 15:03 ` Adam Jackson
2012-01-11 7:54 ` Kenneth Graunke
2 siblings, 1 reply; 11+ messages in thread
From: Daniel Vetter @ 2012-01-10 12:47 UTC (permalink / raw)
To: Sateesh Kavuri; +Cc: intel-gfx, xorg-devel
On Tue, Jan 10, 2012 at 10:15:01AM +0530, Sateesh Kavuri wrote:
> Added support for Android. Changes include fixes for compilation issues
> related to Android using an older version of GCC compiler (ver 4.3.3)
> while the latest version of intel-gpu-tools confirms to GCC ver 4.5.2
> (C99 standard functions), using functions like getline(). Fixed such
> functions, header dependencies for android and added an Android.mk file.
>
> signed-off-by: Sateesh Kavuri <sateesh.kavuri@intel.com>
A few comments
- It looks like you need a completely separate makefile for android. Is
there no way to let the automake tools generate that somehow? Because
this simply won't scale.
- There's too much ANDRIOD #ifdef'ery in the code. Either switch to a
construct that works on all platforms or extract things into a little
helper functions (like the get_total_ram helper that has recently been
ported to Solaris).
- You don't seem to touch the testsuite, and I think you want it on
Andriod, too.
Added xorg-devel to cc, maybe someone else has already tried this with a
different package, my buildsystem fu is not up to this.
Yours, Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Android port of intel-gpu-tools
2012-01-10 4:45 [PATCH] Android port of intel-gpu-tools Sateesh Kavuri
2012-01-10 12:47 ` Daniel Vetter
@ 2012-01-10 15:03 ` Adam Jackson
2012-01-10 16:50 ` Kavuri, Sateesh
2012-01-11 7:54 ` Kenneth Graunke
2 siblings, 1 reply; 11+ messages in thread
From: Adam Jackson @ 2012-01-10 15:03 UTC (permalink / raw)
To: Sateesh Kavuri; +Cc: intel-gfx
On 1/9/12 11:45 PM, Sateesh Kavuri wrote:
> Added support for Android. Changes include fixes for compilation issues
> related to Android using an older version of GCC compiler (ver 4.3.3)
> while the latest version of intel-gpu-tools confirms to GCC ver 4.5.2
> (C99 standard functions), using functions like getline(). Fixed such
> functions, header dependencies for android and added an Android.mk file.
I can understand avoiding C99 functions that android doesn't have, but
this kind of thing:
> + #ifdef ANDROID
> + int i;
> + for (i = 1; i< len; i++) {
> + #else
> for (int i = 1; i< len; i++) {
> + #endif
is silly. Does gcc -std=c99 on android seriously not cope with this?
- ajax
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Android port of intel-gpu-tools
2012-01-10 15:03 ` Adam Jackson
@ 2012-01-10 16:50 ` Kavuri, Sateesh
2012-01-16 17:58 ` Chad Versace
0 siblings, 1 reply; 11+ messages in thread
From: Kavuri, Sateesh @ 2012-01-10 16:50 UTC (permalink / raw)
To: Adam Jackson; +Cc: intel-gfx@lists.freedesktop.org
> -----Original Message-----
> From: Adam Jackson [mailto:ajax@redhat.com]
> Sent: Tuesday, January 10, 2012 8:34 PM
> To: Kavuri, Sateesh
> Cc: intel-gfx@lists.freedesktop.org
> Subject: Re: [Intel-gfx] [PATCH] Android port of intel-gpu-tools
>
> On 1/9/12 11:45 PM, Sateesh Kavuri wrote:
> > Added support for Android. Changes include fixes for compilation issues
> > related to Android using an older version of GCC compiler (ver 4.3.3)
> > while the latest version of intel-gpu-tools confirms to GCC ver 4.5.2
> > (C99 standard functions), using functions like getline(). Fixed such
> > functions, header dependencies for android and added an Android.mk file.
>
> I can understand avoiding C99 functions that android doesn't have, but this kind
> of thing:
>
> > + #ifdef ANDROID
> > + int i;
> > + for (i = 1; i< len; i++) {
> > + #else
> > for (int i = 1; i< len; i++) {
> > + #endif
>
> is silly. Does gcc -std=c99 on android seriously not cope with this?
Yes, -std=c99 would help to get rid of such silly checks (would fix it). Continued
this, since there has to be a ANDROID definition for checks like fcntl.h header path
>
> - ajax
--
Sateesh
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Android port of intel-gpu-tools
2012-01-10 4:45 [PATCH] Android port of intel-gpu-tools Sateesh Kavuri
2012-01-10 12:47 ` Daniel Vetter
2012-01-10 15:03 ` Adam Jackson
@ 2012-01-11 7:54 ` Kenneth Graunke
2 siblings, 0 replies; 11+ messages in thread
From: Kenneth Graunke @ 2012-01-11 7:54 UTC (permalink / raw)
To: Sateesh Kavuri; +Cc: intel-gfx
On 01/09/2012 08:45 PM, Sateesh Kavuri wrote:
> Added support for Android. Changes include fixes for compilation issues
> related to Android using an older version of GCC compiler (ver 4.3.3)
> while the latest version of intel-gpu-tools confirms to GCC ver 4.5.2
> (C99 standard functions), using functions like getline(). Fixed such
> functions, header dependencies for android and added an Android.mk file.
>
> signed-off-by: Sateesh Kavuri<sateesh.kavuri@intel.com>
> ---
> Android.mk | 528 ++++++++++++++++++++++++++++++++++++++++++++
> lib/intel_drm.c | 6 +-
> lib/intel_mmio.c | 4 +
> lib/intel_pci.c | 4 +
> tools/intel_decode.c | 10 +
> tools/intel_dump_decode.c | 14 +-
> tools/intel_error_decode.c | 14 ++
> tools/intel_gpu_top.c | 6 +-
> tools/intel_reg_write.c | 2 +
> 9 files changed, 584 insertions(+), 4 deletions(-)
> create mode 100644 Android.mk
>
> diff --git a/Android.mk b/Android.mk
> new file mode 100644
> index 0000000..0fc04cd
> --- /dev/null
> +++ b/Android.mk
> @@ -0,0 +1,528 @@
> +LOCAL_PATH := $(call my-dir)
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_reg_write.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_reg_map.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +LOCAL_MODULE := intel_reg_write
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_reg_read.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_reg_map.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_reg_read
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_disable_clock_gating.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_disable_clock_gating
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_audio_dump.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_audio_dump
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_backlight.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_backlight
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_bios_dumper.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_bios_dumper
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_bios_reader.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_bios_reader
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_error_decode.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h \
> + lib/instdone.h \
> + lib/instdone.c \
> + tools/intel_decode.h \
> + tools/intel_decode.c \
> + lib/intel_drm.c
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_error_decode
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_gpu_top.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h \
> + lib/instdone.h \
> + lib/instdone.c \
> + lib/intel_reg_map.c
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_gpu_top
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_gpu_time.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_gpu_time
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_gtt.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +
> +LOCAL_MODULE := intel_gtt
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_stepping.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_stepping
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_reg_dumper.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_reg_dumper
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/intel_reg_snapshot.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +
> +LOCAL_MODULE := intel_reg_snapshot
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + tools/forcewaked.c \
> + lib/intel_pci.c \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg.h \
> + lib/intel_batchbuffer.h \
> + lib/intel_batchbuffer.c \
> + lib/intel_mmio.c \
> + tools/intel_chipset.h \
> + lib/intel_reg_map.c
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := forcewaked
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess \
> + libdrm \
> + libdrm_intel
> +
> +include $(BUILD_EXECUTABLE)
> +
> +#================
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + lib/intel_gpu_tools.h \
> + tools/intel_reg_checker.c \
> + lib/intel_pci.c \
> + lib/intel_mmio.c
> +
> +
> +LOCAL_C_INCLUDES += \
> + $(LOCAL_PATH)/lib \
> + $(TOPDIR)hardware/intel/libdrm/include/drm \
> + $(TOPDIR)hardware/intel/libdrm/intel \
> + $(LOCAL_PATH)/../libpciaccess/include/
> +
> +LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
> +LOCAL_CFLAGS += -DANDROID
> +
> +
> +LOCAL_MODULE := intel_reg_checker
> +LOCAL_MODULE_TAGS := optional
> +
> +LOCAL_SHARED_LIBRARIES := libpciaccess
> +
> +include $(BUILD_EXECUTABLE)
> +
It's unfortunate that we need another build system, but I understand
that it's necessary---we ended up adding one in Mesa.
> diff --git a/lib/intel_drm.c b/lib/intel_drm.c
> index f8eca7d..1f51856 100644
> --- a/lib/intel_drm.c
> +++ b/lib/intel_drm.c
> @@ -25,7 +25,7 @@
> *
> */
>
> -#include "config.h"
> +#include "../config.h"
>
> #include<unistd.h>
> #include<stdlib.h>
> @@ -35,7 +35,11 @@
> #include<err.h>
> #include<assert.h>
> #include<sys/ioctl.h>
> +#ifdef ANDROID
> +#include<fcntl.h>
> +#else
> #include<sys/fcntl.h>
> +#endif
At least on my system, /usr/include/sys/fcntl.h is simply:
#include <fcntl.h>
So I think you could unconditionally change all of these to #include
<fcntl.h> without #ifdef ANDROID. Perhaps others can confirm that.
That would certainly be a lot nicer.
> #include<sys/stat.h>
> #include<sys/mman.h>
> #ifdef HAVE_STRUCT_SYSINFO_TOTALRAM
> diff --git a/lib/intel_mmio.c b/lib/intel_mmio.c
> index da68bdf..2020833 100644
> --- a/lib/intel_mmio.c
> +++ b/lib/intel_mmio.c
> @@ -38,7 +38,11 @@
> #include<err.h>
> #include<assert.h>
> #include<sys/ioctl.h>
> +#ifdef ANDROID
> +#include<fcntl.h>
> +#else
> #include<sys/fcntl.h>
> +#endif
> #include<sys/stat.h>
> #include<sys/mman.h>
>
> diff --git a/lib/intel_pci.c b/lib/intel_pci.c
> index 7bc7466..98889ca 100644
> --- a/lib/intel_pci.c
> +++ b/lib/intel_pci.c
> @@ -33,7 +33,11 @@
> #include<err.h>
> #include<assert.h>
> #include<sys/ioctl.h>
> +#ifdef ANDROID
> +#include<fcntl.h>
> +#else
> #include<sys/fcntl.h>
> +#endif
> #include<sys/stat.h>
> #include<sys/mman.h>
>
> diff --git a/tools/intel_decode.c b/tools/intel_decode.c
> index 344578b..5ed508f 100644
> --- a/tools/intel_decode.c
> +++ b/tools/intel_decode.c
> @@ -198,7 +198,12 @@ decode_mi(uint32_t *data, int count, uint32_t hw_offset, int *failures)
> if ((data[0]& 0x1f800000)>> 23 == opcodes_mi[opcode].opcode) {
>
> instr_out(data, hw_offset, 0, "%s\n", opcodes_mi[opcode].name);
> + #ifdef ANDROID
> + int i;
> + for (i = 1; i< len; i++) {
> + #else
> for (int i = 1; i< len; i++) {
> + #endif
Like Adam said...just use gcc -std=c99 if possible. We really want C99.
> if (i>= count)
> BUFFER_FAIL(count, len, opcodes_mi[opcode].name);
> instr_out(data, hw_offset, i, "dword %d\n", i);
> @@ -1164,7 +1169,12 @@ decode_3d_1d(uint32_t *data, int count,
> break;
> case 2:
> instr_out(data, hw_offset, i, "S2: texcoord formats: ");
> + #ifdef ANDROID
> + int tex_num;
> + for (tex_num = 0; tex_num< 8; tex_num++) {
> + #else
> for (int tex_num = 0; tex_num< 8; tex_num++) {
> + #endif
> switch((data[i]>>tex_num*4)&0xf) {
> case 0: fprintf(out, "%i=2D ", tex_num); break;
> case 1: fprintf(out, "%i=3D ", tex_num); break;
> diff --git a/tools/intel_dump_decode.c b/tools/intel_dump_decode.c
> index 26d57f5..57c1261 100644
> --- a/tools/intel_dump_decode.c
> +++ b/tools/intel_dump_decode.c
> @@ -67,6 +67,10 @@ read_data_file(uint32_t devid, const char * filename)
> FILE *file;
> uint32_t *data = NULL;
> int data_size = 0, count = 0, line_number = 0, matched;
> + #ifdef ANDROID
> + char line[1024];
> + size_t line_size = 1024;
> + #else
> char *line = NULL;
> size_t line_size;
> uint32_t offset, value;
> @@ -82,9 +86,15 @@ read_data_file(uint32_t devid, const char * filename)
> filename, strerror (errno));
> exit (1);
> }
> -
> +#ifdef ANDROID
> + while (fgets (line, line_size, file) != 0) {
> + line[strcspn(line, "\n")] = '\0';
> + if (line[0] == '\0') continue;
> +#else
> while (getline (&line,&line_size, file)> 0) {
> - line_number++;
> +#endif
Rather than rewriting every use of getline(), could we just include our
own implementation of getline() in an #ifdef ANDROID block? That way,
we work around the Bionic issues in one place.
> +
> + line_number++;
>
> matched = sscanf (line, "%08x : %08x",&offset,&value);
> if (matched != 2) {
> diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
> index 6ffaefe..c9c74ba 100644
> --- a/tools/intel_error_decode.c
> +++ b/tools/intel_error_decode.c
> @@ -280,15 +280,27 @@ read_data_file (FILE *file)
> uint32_t *data = NULL;
> long long unsigned fence;
> int data_size = 0, count = 0, line_number = 0, matched;
> +#ifdef ANDROID
> + char line[1024];
> + size_t line_size = 1024;
> +#else
> char *line = NULL;
> size_t line_size;
> +#endif
> uint32_t offset, value;
> uint32_t gtt_offset = 0, new_gtt_offset;
> char *buffer_type[2] = { "ringbuffer", "batchbuffer" };
> char *ring_name = NULL;
> int is_batch = 1;
>
> +#ifdef ANDROID
> + while (fgets (line, line_size, file) != 0) {
> + line[strcspn(line, "\n")] = '\0';
> + if (line[0] == '\0') continue;
> +#else
> while (getline (&line,&line_size, file)> 0) {
> +#endif
> +
> char *dashes;
> line_number++;
>
> @@ -404,7 +416,9 @@ read_data_file (FILE *file)
> }
>
> free (data);
> +#ifndef ANDROID
> free (line);
> +#endif
> free (ring_name);
> }
>
> diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
> index 033ba53..b9d1ce9 100644
> --- a/tools/intel_gpu_top.c
> +++ b/tools/intel_gpu_top.c
> @@ -27,7 +27,7 @@
> *
> */
>
> -#include "config.h"
> +#include "../config.h"
>
> #include<unistd.h>
> #include<stdlib.h>
> @@ -602,10 +602,14 @@ int main(int argc, char **argv)
> /* Limit the number of lines printed to the terminal height so the
> * most important info (at the top) will stay on screen. */
> unsigned short int max_lines = -1;
> +#ifndef ANDROID
> struct winsize ws;
> if (ioctl(0, TIOCGWINSZ,&ws) != -1)
> max_lines = ws.ws_row - 6; /* exclude header lines */
> if (max_lines>= num_instdone_bits)
> + // FIXME: ioctl-types.h still does not exist in Android. Hard code
> + // the max_lines value for now (winsize is part of ioctl-types.h
> +#endif
> max_lines = num_instdone_bits;
I'm okay with an #ifndef ANDROID workaround here, but would it be better
to use MAX_INSTDONE_BITS? Also, please use
/* FIXME: ..... */
rather than the C++ style comments.
Thanks for your work on this, it'll be nice to see intel-gpu-tools on
Android!
> t2 = gettime();
> diff --git a/tools/intel_reg_write.c b/tools/intel_reg_write.c
> index c8af9bb..81bceef 100644
> --- a/tools/intel_reg_write.c
> +++ b/tools/intel_reg_write.c
> @@ -25,6 +25,8 @@
> *
> */
>
> +#include "../config.h"
> +
> #include<unistd.h>
> #include<stdlib.h>
> #include<stdio.h>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Android port of intel-gpu-tools
2012-01-10 16:50 ` Kavuri, Sateesh
@ 2012-01-16 17:58 ` Chad Versace
0 siblings, 0 replies; 11+ messages in thread
From: Chad Versace @ 2012-01-16 17:58 UTC (permalink / raw)
To: Kavuri, Sateesh; +Cc: intel-gfx@lists.freedesktop.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/10/2012 08:50 AM, Kavuri, Sateesh wrote:
>
>
>> -----Original Message-----
>> From: Adam Jackson [mailto:ajax@redhat.com]
>> Sent: Tuesday, January 10, 2012 8:34 PM
>> To: Kavuri, Sateesh
>> Cc: intel-gfx@lists.freedesktop.org
>> Subject: Re: [Intel-gfx] [PATCH] Android port of intel-gpu-tools
>>
>> On 1/9/12 11:45 PM, Sateesh Kavuri wrote:
>>> Added support for Android. Changes include fixes for compilation issues
>>> related to Android using an older version of GCC compiler (ver 4.3.3)
>>> while the latest version of intel-gpu-tools confirms to GCC ver 4.5.2
>>> (C99 standard functions), using functions like getline(). Fixed such
>>> functions, header dependencies for android and added an Android.mk file.
>>
>> I can understand avoiding C99 functions that android doesn't have, but this kind
>> of thing:
>>
>>> + #ifdef ANDROID
>>> + int i;
>>> + for (i = 1; i< len; i++) {
>>> + #else
>>> for (int i = 1; i< len; i++) {
>>> + #endif
>>
>> is silly. Does gcc -std=c99 on android seriously not cope with this?
>
> Yes, -std=c99 would help to get rid of such silly checks (would fix it). Continued
> this, since there has to be a ANDROID definition for checks like fcntl.h header path
>>
>> - ajax
>
> --
> Sateesh
I want to see the C99 workarounds removed.
In Mesa we enabled -std=c99 in the Android build with this hack:
# Use C99.
ifeq ($(LOCAL_CC),)
ifeq ($(LOCAL_IS_HOST_MODULE),true)
LOCAL_CC := $(HOST_CC) -std=c99
else
LOCAL_CC := $(TARGET_CC) -std=c99
endif
endif
- ----
Chad Versace
chad.versace@linux.intel.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJPFGVPAAoJEAIvNt057x8i+6MP/iX2T5Q9z4zeQB4LlgpNKUVO
5Y6Sl/ZC/AyfWFg1u188pPZvSi6jI86wvZg6MPULzP7NVBx/xG5bsexO0zqDRJ7l
PLridgrxOzUbkreN5jzOI0vV+hVcHfJfuOz9YJ5WTq6LHskPpj/fd3sIbZJRJstg
sGPEFU9Nfp2bVteE35ci4ASYPzdisO/O6sWB5RiDkUJRa+xvBm7NrzBeA4TbxD8f
8lRhKUAcmv1AFtFVJHOUoyL+UkjJXRiI19cSnAB6mr3r6Nf+NCvrN+Kp298ze3xM
/VzLv0GdkmcmtPGzursd8VEEgWwWxWTC39QcURsQjf6+eHs57I77T6XC7YILfGOu
bwMRqCSBygVo6MnCcNlzjCPNHATITgDvRbthSiN8tX2wcrndquNKD1+qBlpoFfVg
d/m8TQD8UAravGkDWwmTxnFFeqXM9pktrTpk55gO+ZNQtkK5SbWtJ9F5O6Yn3trb
8opFiFi6rJdORzSV/4Ma8ySeTaWc7JnANzYaB4PXIJOTTTgUukX9ARWJqYIyRnj9
sBZdG1wrRt89Tlk7KGBQ7f3nXIpMwe9aLYmnajbd6xHMTnzXrEuBZ65r320uUXHo
h+mba6lzJuow3TwcyudvjK5yKPmgQ7ZOV7DmT8wW2pwhVUcIjd4xxgEQsV4xKjLk
SciBCELXKhdkHan8ucml
=fHSl
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Android port of intel-gpu-tools
2012-01-10 12:47 ` Daniel Vetter
@ 2012-01-16 18:25 ` Chad Versace
2012-01-16 18:36 ` Daniel Vetter
0 siblings, 1 reply; 11+ messages in thread
From: Chad Versace @ 2012-01-16 18:25 UTC (permalink / raw)
To: Daniel Vetter; +Cc: xorg-devel, intel-gfx
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/10/2012 04:47 AM, Daniel Vetter wrote:
> On Tue, Jan 10, 2012 at 10:15:01AM +0530, Sateesh Kavuri wrote:
>> Added support for Android. Changes include fixes for compilation issues
>> related to Android using an older version of GCC compiler (ver 4.3.3)
>> while the latest version of intel-gpu-tools confirms to GCC ver 4.5.2
>> (C99 standard functions), using functions like getline(). Fixed such
>> functions, header dependencies for android and added an Android.mk file.
>>
>> signed-off-by: Sateesh Kavuri <sateesh.kavuri@intel.com>
>
> A few comments
> - It looks like you need a completely separate makefile for android. Is
> there no way to let the automake tools generate that somehow? Because
> this simply won't scale.
>
> - There's too much ANDRIOD #ifdef'ery in the code. Either switch to a
> construct that works on all platforms or extract things into a little
> helper functions (like the get_total_ram helper that has recently been
> ported to Solaris).
>
> - You don't seem to touch the testsuite, and I think you want it on
> Andriod, too.
>
> Added xorg-devel to cc, maybe someone else has already tried this with a
> different package, my buildsystem fu is not up to this.
>
> Yours, Daniel
Daniel, the Android.mk's are the curse of every project that is ported to
Android. Android has it's own build system, and those makefiles can't be
generated with autotools. This was a contentious issue when Chia-I Wu and
I ported Mesa to Android and led to a discussion [1] on mesa-dev. Below is
quoted my key email from that discussion (the Dan I'm speaking to is a Debian
maitainer).
[1] http://article.gmane.org/gmane.comp.video.mesa3d.devel/28881/match=add+toplevel+android+mk
> To address Dan's questions, the Android build cannot be fitted into autoconf or
> configs/android. I explored this option, and discovered that it was impossible.
> The Android build system is... well... interesting. Allow me to explain.
>
> The entirety of the Android project --- libc, webkit, the window manager,
> *everything* --- exists in a single source tree [1]. And that source tree is
> built with a single, non-recursive invocation of make. Every time I say that, I
> find it hard to believe myself, so I'll say it again: The entirety of the
> Android OS, all core libraries and apps, are built with a single, non-recursive
> invocation of make. (The kernel is the special exception to this
> all-encompassing build). The final build artifact is a bootable iso image.
>
> [1] http://android.git.kernel.org/
>
> Given this unified design of the Android source tree and build process, it
> requires system components, such as Mesa, to be integrated into its build
> system. If Mesa is going to support Android, the Android.mk's are necessary.
>
> To address another concern of Dan's, this will not add another way to configure
> the Mesa build. Android handles the system's build configuration in a single
> location which is outside of Mesa.
>
> I'm aware that the extra set of makefiles is unwelcome, but their presence will
> be innocuous. The only people that will need to touch them are those maintaining
> the Android build.
- ----
Chad Versace
chad.versace@linux.intel.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJPFGubAAoJEAIvNt057x8iTckQAKf3DPB3zAnVwEPcmad3BacJ
+3SfLISJUJPxoNpROYXiM/50bti/xir6x68Hez3jryzgFpSUTo2jpdXT2CalXSeN
ITdScopl4p0gNu4zxXiWzIv5445RLswkf1IArvL25LABRnQ1xSLdp6qTUZcfZXTa
bpzPM27p7k2FNvWN9z0vwNI8ebtMAwapvsb2lLyFeIfiB2ldQJIsclP1iOMylRlS
wSSEdqmWm7OTzpnocAaptCFDeolNplN7zvBfzMs9/AOCs1miKo+nUlf0GUf1CN0V
xuLrIf4UZn8sNLlsw5Mnc3uBIT5q8NR/rz60IswDKgm/W4pJbjRViaaecNjpbuvL
tzUE99CUtSmK/MY6TiSqlgTzgYRFk1qGu9bGxhbWyJE76gAjOX7A1OL+DsPj+wgR
DfAEKfcfFsUCDCkm3604uhl6hJauu3lDEVxL/6jAm/jMLzvwaxBPoMdS6QFtQ3QR
tTlZ4Y13jDnp+SOar3eLjgDE+pcdsFIHaFZ0ZxYEjgCHGVhP4ye3BaqMtMopwths
HcscB47/xz4y4CmEgBvDmcuPaxw6rgNd9d8543zvWlheb/dGH9yNJcoLBq0dz3tW
P/m0A+Hnv2gfLaopbPZIAPUKdR/iqA4cgoSKQq7OI46He4CHApatPapunL4IKCpU
eSulLcm0Dqpc6fz2zL1B
=Xlzm
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Android port of intel-gpu-tools
2012-01-16 18:25 ` Chad Versace
@ 2012-01-16 18:36 ` Daniel Vetter
2012-01-16 18:53 ` Chad Versace
2012-01-16 19:43 ` Eugeni Dodonov
0 siblings, 2 replies; 11+ messages in thread
From: Daniel Vetter @ 2012-01-16 18:36 UTC (permalink / raw)
To: Chad Versace; +Cc: xorg-devel, intel-gfx
On Mon, Jan 16, 2012 at 10:25:32AM -0800, Chad Versace wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 01/10/2012 04:47 AM, Daniel Vetter wrote:
> > On Tue, Jan 10, 2012 at 10:15:01AM +0530, Sateesh Kavuri wrote:
> >> Added support for Android. Changes include fixes for compilation issues
> >> related to Android using an older version of GCC compiler (ver 4.3.3)
> >> while the latest version of intel-gpu-tools confirms to GCC ver 4.5.2
> >> (C99 standard functions), using functions like getline(). Fixed such
> >> functions, header dependencies for android and added an Android.mk file.
> >>
> >> signed-off-by: Sateesh Kavuri <sateesh.kavuri@intel.com>
> >
> > A few comments
> > - It looks like you need a completely separate makefile for android. Is
> > there no way to let the automake tools generate that somehow? Because
> > this simply won't scale.
> >
> > - There's too much ANDRIOD #ifdef'ery in the code. Either switch to a
> > construct that works on all platforms or extract things into a little
> > helper functions (like the get_total_ram helper that has recently been
> > ported to Solaris).
> >
> > - You don't seem to touch the testsuite, and I think you want it on
> > Andriod, too.
> >
> > Added xorg-devel to cc, maybe someone else has already tried this with a
> > different package, my buildsystem fu is not up to this.
> >
> > Yours, Daniel
>
> Daniel, the Android.mk's are the curse of every project that is ported to
> Android. Android has it's own build system, and those makefiles can't be
> generated with autotools. This was a contentious issue when Chia-I Wu and
> I ported Mesa to Android and led to a discussion [1] on mesa-dev. Below is
> quoted my key email from that discussion (the Dan I'm speaking to is a Debian
> maitainer).
>
> [1] http://article.gmane.org/gmane.comp.video.mesa3d.devel/28881/match=add+toplevel+android+mk
Meh.
I've just read about androgenizer:
http://cgit.collabora.com/git/user/derek/androgenizer.git/
Would that be a useful to at least generate the Android.mk in a sensible
fashion? I don't have clue about this ...
Otherwise we'll just stick Android.mk into the root dir and I'll forget
about this (and probably break it every time I change something).
-Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Android port of intel-gpu-tools
2012-01-16 18:36 ` Daniel Vetter
@ 2012-01-16 18:53 ` Chad Versace
[not found] ` <4F147225.3000604-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2012-01-16 19:43 ` Eugeni Dodonov
1 sibling, 1 reply; 11+ messages in thread
From: Chad Versace @ 2012-01-16 18:53 UTC (permalink / raw)
To: Daniel Vetter; +Cc: xorg-devel, intel-gfx
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/16/2012 10:36 AM, Daniel Vetter wrote:
> On Mon, Jan 16, 2012 at 10:25:32AM -0800, Chad Versace wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 01/10/2012 04:47 AM, Daniel Vetter wrote:
>>> On Tue, Jan 10, 2012 at 10:15:01AM +0530, Sateesh Kavuri wrote:
>>>> Added support for Android. Changes include fixes for compilation issues
>>>> related to Android using an older version of GCC compiler (ver 4.3.3)
>>>> while the latest version of intel-gpu-tools confirms to GCC ver 4.5.2
>>>> (C99 standard functions), using functions like getline(). Fixed such
>>>> functions, header dependencies for android and added an Android.mk file.
>>>>
>>>> signed-off-by: Sateesh Kavuri <sateesh.kavuri@intel.com>
>>>
>>> A few comments
>>> - It looks like you need a completely separate makefile for android. Is
>>> there no way to let the automake tools generate that somehow? Because
>>> this simply won't scale.
>>>
>>> - There's too much ANDRIOD #ifdef'ery in the code. Either switch to a
>>> construct that works on all platforms or extract things into a little
>>> helper functions (like the get_total_ram helper that has recently been
>>> ported to Solaris).
>>>
>>> - You don't seem to touch the testsuite, and I think you want it on
>>> Andriod, too.
>>>
>>> Added xorg-devel to cc, maybe someone else has already tried this with a
>>> different package, my buildsystem fu is not up to this.
>>>
>>> Yours, Daniel
>>
>> Daniel, the Android.mk's are the curse of every project that is ported to
>> Android. Android has it's own build system, and those makefiles can't be
>> generated with autotools. This was a contentious issue when Chia-I Wu and
>> I ported Mesa to Android and led to a discussion [1] on mesa-dev. Below is
>> quoted my key email from that discussion (the Dan I'm speaking to is a Debian
>> maitainer).
>>
>> [1] http://article.gmane.org/gmane.comp.video.mesa3d.devel/28881/match=add+toplevel+android+mk
>
> Meh.
>
> I've just read about androgenizer:
>
> http://cgit.collabora.com/git/user/derek/androgenizer.git/>
> Would that be a useful to at least generate the Android.mk in a sensible
> fashion? I don't have clue about this ...
Never heard of androgenizer, but looks interesting. When the Mesa build gets its overdue conversion
to autotools, I'll have to give it a try.
> Otherwise we'll just stick Android.mk into the root dir and I'll forget
> about this (and probably break it every time I change something).
Hah! That's expected if the Android maintainers aren't vigilant.
We've mostly fixed that problem in Mesa (when people change the "real" makefile,
the Android build breaks) by forcing the two build systems to share common
makefiles when sensible. But I don't suggest that intel-gpu-tools take that approach
unless build-breakage problems become painful.
- ----
Chad Versace
chad.versace@linux.intel.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJPFHIjAAoJEAIvNt057x8ilVAQALd5Z1TSD/SfNBGp1NRTinnz
HFN17Zp56apz2bDQgC1hftkJJXNZW83IPm9lseBvpfeKLVLfxkIsp6uklPbVputK
YJdI4G7TxDWpjDxHdh/tA45q+5H6hrtsPOBcnQwfDGq99DrAI/Pt6fZAO4c/0fbe
ZYnQ42DGeAkHK/XNxvF7zrkc9gJqwYhpUp8EyuguilYmnzyMkwR2SGu8hbDGRTmc
L0dNRuArZaaaTnFWLKAWPjgTZVXg9Ah2ZEawWOlvUNmygtOoqGqtcgIsRWdxr4QR
6hRTcbmiwc6CdmR1QsdL+hHs7MPAq1Kvj5CQjjNmCefkZBleu2W7EOnyLXZmfNDM
MbUOJ79JesS7z8wEkwLgcYgas9Qj+vaHw7tWWaqLxvxXEldFCcfub+Xjf1+Vi2X4
MoZtGAyNQQ6KHPpPS/ObI4D1Ati7eQy4ZiN7ILRgjmPWj4vy+RVwlwNbC7C9yLe2
kugwJGzRePFSl6Sagf1kFymKyK0MzIfquN/7vNh/2+Z/AOR6yISPqNkoxQveXk06
PK/ee4DngWcsUxuDpYcc1/NgNLccRfddyNINxCcbz2OuwQGbhRSa9Y8dpxJeXSIR
yaElS7FFUXCaebeXur3U9KsVq+s9mDpBRRZjaPaSsoss2tWb/F1wz93Yr96QUIIq
FOZrSKKdOxM8Q+Fj0SqP
=REOX
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] Android port of intel-gpu-tools
2012-01-16 18:36 ` Daniel Vetter
2012-01-16 18:53 ` Chad Versace
@ 2012-01-16 19:43 ` Eugeni Dodonov
1 sibling, 0 replies; 11+ messages in thread
From: Eugeni Dodonov @ 2012-01-16 19:43 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx, xorg-devel
[-- Attachment #1.1: Type: text/plain, Size: 404 bytes --]
On Mon, Jan 16, 2012 at 16:36, Daniel Vetter <daniel@ffwll.ch> wrote:
> Otherwise we'll just stick Android.mk into the root dir and I'll forget
> about this (and probably break it every time I change something).
>
I vote for this approach. It would only be used by android build, so when
it breaks, we'll be able to notice it pretty shortly and fix it.
--
Eugeni Dodonov
<http://eugeni.dodonov.net/>
[-- Attachment #1.2: Type: text/html, Size: 712 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Intel-gfx] [PATCH] Android port of intel-gpu-tools
[not found] ` <4F147225.3000604-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2012-01-16 19:52 ` Daniel Stone
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Stone @ 2012-01-16 19:52 UTC (permalink / raw)
To: Chad Versace
Cc: Sateesh Kavuri, xorg-devel-go0+a7rfsptAfugRpC6u6w,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Daniel Vetter
Hi,
On 16 January 2012 18:53, Chad Versace <chad.versace-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> wrote:
> On 01/16/2012 10:36 AM, Daniel Vetter wrote:
>> I've just read about androgenizer:
>>
>> http://cgit.collabora.com/git/user/derek/androgenizer.git/>
>> Would that be a useful to at least generate the Android.mk in a sensible
>> fashion? I don't have clue about this ...
>
> Never heard of androgenizer, but looks interesting. When the Mesa build gets its overdue conversion
> to autotools, I'll have to give it a try.
androgenizer works just fine for us -- we use it on all the Telepathy,
GStreamer and PulseAudio packages and it seems to work great*.
Cheers,
Daniel
*: Things I never thought I'd say: in this case, 'great' means 'builds
and works on Android'.
_______________________________________________
xorg-devel-go0+a7rfsptAfugRpC6u6w@public.gmane.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-01-16 19:52 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-10 4:45 [PATCH] Android port of intel-gpu-tools Sateesh Kavuri
2012-01-10 12:47 ` Daniel Vetter
2012-01-16 18:25 ` Chad Versace
2012-01-16 18:36 ` Daniel Vetter
2012-01-16 18:53 ` Chad Versace
[not found] ` <4F147225.3000604-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2012-01-16 19:52 ` [Intel-gfx] " Daniel Stone
2012-01-16 19:43 ` Eugeni Dodonov
2012-01-10 15:03 ` Adam Jackson
2012-01-10 16:50 ` Kavuri, Sateesh
2012-01-16 17:58 ` Chad Versace
2012-01-11 7:54 ` Kenneth Graunke
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.