All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] demos/intel_sprite_on: Added support to compile intel_sprite_on on Android.
  2014-11-04  8:50 [PATCH] demos/intel_sprite_on: Added support to compile intel_sprite_on on Android Gagandeep S Arora
@ 2014-11-03 14:41 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2014-11-03 14:41 UTC (permalink / raw)
  To: Gagandeep S Arora; +Cc: manikandan.k.pillai, intel-gfx, dhanya.p.r, thomas.wood

On Tue, Nov 04, 2014 at 02:20:38PM +0530, Gagandeep S Arora wrote:
> +/*
> + * The macros and structures inside the conditional statement
> + * #if (ANDROID_HAS_CAIRO == 1) are defined in lib/igt_kms.c
> + * when the flag ANDROID_HAS_CAIRO is 1.
> + */
> +#if (ANDROID_HAS_CAIRO == 0)
> +struct type_name {
> +	int type;
> +	const char *name;
> +};

Imo just really get cairo going on Android. This kind of duplication isn't
good.

Or if you can't, extract the cairo-dependent part of igt_kms.c into
igt_cairo.c source files. But not copypasting.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] demos/intel_sprite_on: Added support to compile intel_sprite_on on Android.
@ 2014-11-04  8:50 Gagandeep S Arora
  2014-11-03 14:41 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Gagandeep S Arora @ 2014-11-04  8:50 UTC (permalink / raw)
  To: intel-gfx; +Cc: dhanya.p.r, manikandan.k.pillai, thomas.wood

From: gsarora <gagandeep.s.arora@intel.com>

Added Android.mk for intel_sprite_on.

Signed-off-by: Gagandeep S Arora <gagandeep.s.arora@intel.com>
---
 Android.mk              |  2 +-
 demos/Android.mk        | 27 ++++++++++++++++++++++
 demos/intel_sprite_on.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 1 deletion(-)
 create mode 100644 demos/Android.mk

diff --git a/Android.mk b/Android.mk
index 681d114..1ab3e64 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,2 +1,2 @@
-include $(call all-named-subdir-makefiles, lib tests tools benchmarks)
+include $(call all-named-subdir-makefiles, lib tests tools benchmarks demos)
 
diff --git a/demos/Android.mk b/demos/Android.mk
new file mode 100644
index 0000000..6227e06
--- /dev/null
+++ b/demos/Android.mk
@@ -0,0 +1,27 @@
+LOCAL_PATH := $(call my-dir)
+
+#================#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := intel_sprite_on.c
+
+LOCAL_CFLAGS += -DHAVE_TERMIOS_H
+LOCAL_CFLAGS += -DANDROID -UNDEBUG
+LOCAL_CFLAGS += -std=c99
+# Excessive complaining for established cases. Rely on the Linux version warnings.
+LOCAL_CFLAGS += -Wno-sign-compare
+
+LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib
+
+LOCAL_MODULE := intel_sprite_on
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
+
+LOCAL_SHARED_LIBRARIES := libdrm
+
+include $(BUILD_EXECUTABLE)
+
+#================#
diff --git a/demos/intel_sprite_on.c b/demos/intel_sprite_on.c
index 23fc56c..c86093b 100644
--- a/demos/intel_sprite_on.c
+++ b/demos/intel_sprite_on.c
@@ -66,6 +66,67 @@ struct connector {
 	int                 pipe;
 };
 
+/*
+ * The macros and structures inside the conditional statement
+ * #if (ANDROID_HAS_CAIRO == 1) are defined in lib/igt_kms.c
+ * when the flag ANDROID_HAS_CAIRO is 1.
+ */
+#if (ANDROID_HAS_CAIRO == 0)
+struct type_name {
+	int type;
+	const char *name;
+};
+
+#define type_name_fn(res) \
+const char * kmstest_##res##_str(int type) {		\
+	unsigned int i;					\
+	for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \
+		if (res##_names[i].type == type)	\
+			return res##_names[i].name;	\
+	}						\
+	return "(invalid)";				\
+}
+
+struct type_name encoder_type_names[] = {
+	{ DRM_MODE_ENCODER_NONE, "none" },
+	{ DRM_MODE_ENCODER_DAC, "DAC" },
+	{ DRM_MODE_ENCODER_TMDS, "TMDS" },
+	{ DRM_MODE_ENCODER_LVDS, "LVDS" },
+	{ DRM_MODE_ENCODER_TVDAC, "TVDAC" },
+};
+
+type_name_fn(encoder_type)
+
+struct type_name connector_status_names[] = {
+	{ DRM_MODE_CONNECTED, "connected" },
+	{ DRM_MODE_DISCONNECTED, "disconnected" },
+	{ DRM_MODE_UNKNOWNCONNECTION, "unknown" },
+};
+
+type_name_fn(connector_status)
+
+struct type_name connector_type_names[] = {
+	{ DRM_MODE_CONNECTOR_Unknown, "unknown" },
+	{ DRM_MODE_CONNECTOR_VGA, "VGA" },
+	{ DRM_MODE_CONNECTOR_DVII, "DVI-I" },
+	{ DRM_MODE_CONNECTOR_DVID, "DVI-D" },
+	{ DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
+	{ DRM_MODE_CONNECTOR_Composite, "composite" },
+	{ DRM_MODE_CONNECTOR_SVIDEO, "s-video" },
+	{ DRM_MODE_CONNECTOR_LVDS, "LVDS" },
+	{ DRM_MODE_CONNECTOR_Component, "component" },
+	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN" },
+	{ DRM_MODE_CONNECTOR_DisplayPort, "DP" },
+	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
+	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
+	{ DRM_MODE_CONNECTOR_TV, "TV" },
+	{ DRM_MODE_CONNECTOR_eDP, "eDP" },
+	{ DRM_MODE_CONNECTOR_MIPI, "MIPI" },
+};
+
+type_name_fn(connector_type)
+#endif
+
 static void dump_mode(drmModeModeInfo *mode)
 {
 	printf("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d\n",
-- 
2.1.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-03 14:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-04  8:50 [PATCH] demos/intel_sprite_on: Added support to compile intel_sprite_on on Android Gagandeep S Arora
2014-11-03 14:41 ` Daniel Vetter

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.