fix out-of-tree build and new kernel support
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 19 May 2012 19:55:34 +0000 (22:55 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Mon, 21 May 2012 00:19:32 +0000 (03:19 +0300)
Makefile [new file with mode: 0644]
pvr/Makefile
pvr/omaplfb_displayclass.c
pvr/omaplfb_linux.c
pvr/pvr_debugfs.c
pvr/pvr_events.c

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..92787d4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,6 @@
+ifeq ($(MAKECMDGOALS),)
+MAKECMDGOALS = all
+endif
+
+$(MAKECMDGOALS):
+       make -C pvr $@
index f253168..acdf1db 100644 (file)
@@ -1,3 +1,47 @@
+CONFIG_PVR = m
+
+CONFIG_PVR_RELEASE = y
+CONFIG_PVR_DEBUG = n
+CONFIG_PVR_TIMING = n
+
+CONFIG_PVR_DEBUG_EXTRA = n
+CONFIG_PVR_DEBUG_PDUMP = n
+CONFIG_PVR_PDUMP_MODE_STANDARD = n
+CONFIG_PVR_PDUMP_MODE_FULL = n
+CONFIG_PVR_EDM_DEBUG = n
+CONFIG_NO_HARDWARE = n
+CONFIG_PVR_FORCE_CLOCKS_ON = n
+CONFIG_PVR_EXAMPLES = n
+CONFIG_PVR_TRACE_CMD = n
+
+ccflags-$(CONFIG_PVR_DEBUG) += -DCONFIG_PVR_DEBUG
+ccflags-$(CONFIG_PVR_DEBUG_EXTRA) += -DCONFIG_PVR_DEBUG_EXTRA
+ccflags-$(CONFIG_PVR_DEBUG_PDUMP) += -DCONFIG_PVR_DEBUG_PDUMP \
+       -DCONFIG_PVR_PDUMP_INITIAL_MAX_FRAME_COUNT=4
+ccflags-$(CONFIG_PVR_PDUMP_MODE_STANDARD) += -DCONFIG_PVR_PDUMP_MODE_STANDARD
+ccflags-$(CONFIG_PVR_PDUMP_MODE_FULL) += -DCONFIG_PVR_PDUMP_MODE_FULL
+ccflags-$(CONFIG_PVR_EDM_DEBUG) += -DCONFIG_PVR_EDM_DEBUG
+ccflags-$(CONFIG_PVR_EXAMPLES) += -DCONFIG_PVR_EXAMPLES
+ccflags-$(CONFIG_PVR_FORCE_CLOCKS_ON) += -DCONFIG_PVR_FORCE_CLOCKS_ON
+ccflags-$(CONFIG_PVR_NO_HARDWARE) += -DCONFIG_PVR_NO_HARDWARE
+ccflags-$(CONFIG_PVR_RELEASE) += -DCONFIG_PVR_RELEASE
+ccflags-$(CONFIG_PVR_TIMING) += -DCONFIG_PVR_TIMING
+ccflags-$(CONFIG_PVR_TOOLS) += -DCONFIG_PVR_TOOLS
+ccflags-$(CONFIG_PVR_TRACE_CMD) += -DCONFIG_PVR_TRACE_CMD \
+       -DCONFIG_PVR_TRACE_CMD_BUF_SHIFT=3
+
+ccflags-y += -I$(src)/../include
+
+ifeq ($(KERNELRELEASE),)
+all:
+       $(MAKE) -C $(KERNELDIR) M=`pwd` $*
+
+clean:
+       $(MAKE) -C $(KERNELDIR) M=`pwd` clean
+endif
+
+###
+
 obj-$(CONFIG_PVR)      += omaplfb.o pvrsrvkm.o
 
 omaplfb-objs           := omaplfb_displayclass.o omaplfb_linux.o
@@ -31,7 +75,7 @@ CBUILD                        := -O2                                          \
                           -DPVR_BUILD_DIR="\"$(PVR_BUILD_DIR)\""       \
                           -DPVR_BUILD_DATE="\"$(DATE)\""
 
-ccflags-y              += $(CBUILD) -include $(srctree)/$(src)/pvrconfig.h
+ccflags-y              += $(CBUILD) -include $(src)/pvrconfig.h
 ccflags-y              += $(ccflags-m)
 
 
index ae6cce4..b9d023b 100644 (file)
 #include "kerneldisplay.h"
 #include "omaplfb.h"
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+#define acquire_console_sem console_lock
+#define release_console_sem console_unlock
+#endif
+
 static void *gpvAnchor;
 
 static int fb_idx;
index 9ed02c5..b79a59e 100644 (file)
 #include "omaplfb.h"
 #include "pvrmodule.h"
 
+#if   (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
+#include <video/omapdss.h>
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32))
 #include <plat/display.h>
+#else
+#include <mach/display.h>
+#endif
 
 MODULE_SUPPORTED_DEVICE(DEVNAME);
 
index 32ca6c3..d1493fb 100644 (file)
@@ -23,6 +23,7 @@
  *
  */
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/debugfs.h>
 #include <linux/vmalloc.h>
 #include <linux/mutex.h>
index 6b945df..b2f6046 100644 (file)
 #include <linux/fs.h>
 #include <linux/notifier.h>
 #include <linux/slab.h>
+#include <linux/version.h>
 
+#if   (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
+#include <video/omapdss.h>
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32))
 #include <plat/display.h>
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
+#include <mach/display.h>
+#endif
 
 static spinlock_t event_lock;
 static struct list_head sync_wait_list;