pvrsrvkm-objs-$(CONFIG_PVR_DEBUG) += pvr_debug.o
pvrsrvkm-objs-$(CONFIG_DEBUG_FS) += pvr_debugfs.o
pvrsrvkm-objs-$(CONFIG_PVR_TIMING) += pvr_debug.o
-pvrsrvkm-objs-$(CONFIG_PVR_DEBUG_PDUMP) += pvr_pdump.o
+pvrsrvkm-objs-$(CONFIG_PVR_DEBUG_PDUMP) += pvr_pdump.o pvr_pdumpfs.o
pvrsrvkm-objs += $(pvrsrvkm-objs-y) $(pvrsrvkm-objs-m)
#include "pvrversion.h"
#include "sgxmmu.h"
#include "mm.h"
+
#include "pvr_pdump.h"
+#include "pvr_pdumpfs.h"
/*
* There is no sense in having SGX_MMU_PAGE_SIZE differ from PAGE_SIZE.
static char *gpszScript;
static char *gpszFile;
-#define DEBUG_MODE_DISABLED 0
-#define DEBUG_MODE_STANDARD 1
-#define DEBUG_MODE_FULL 2
-
-static u32 dbgdrv_mode = DEBUG_MODE_DISABLED;
-static u32 dbgdrv_frame_number;
-
void PDumpSuspendKM(void)
{
atomic_inc(&gsPDumpSuspended);
return atomic_read(&gsPDumpSuspended) != 0;
}
-/*
- * empty pdump backend.
- */
-static void
-dbgdrv_frame_set(u32 frame)
-{
- dbgdrv_frame_number = frame;
-}
-
-static enum PVRSRV_ERROR
-dbgdrv_write_data(void *buffer, int size, bool from_user)
-{
- return PVRSRV_OK;
-}
-
-static void
-dbgdrv_write_string(char *string)
-{
-
-}
-
-static bool
-dbgdrv_capturing(void)
-{
- if (dbgdrv_mode == DEBUG_MODE_FULL)
- return true;
- else
- return false;
-}
-
-static bool dbgdrv_flags_check(u32 flags)
-{
- if (flags & PDUMP_FLAGS_NEVER)
- return false;
- else if (dbgdrv_mode == DEBUG_MODE_FULL)
- return true;
- else if ((dbgdrv_mode == DEBUG_MODE_STANDARD) &&
- (flags & PDUMP_FLAGS_CONTINUOUS))
- return true;
- else
- return false;
-}
-
static void
pdump_print(u32 flags, char *format, ...)
{
if (PDumpSuspended())
return;
- if (!dbgdrv_flags_check(flags))
+ if (!pdumpfs_flags_check(flags))
return;
va_start(ap, format);
vsnprintf(gpszScript, SZ_SCRIPT_SIZE_MAX, format, ap);
va_end(ap);
- dbgdrv_write_string(gpszScript);
+ pdumpfs_write_string(gpszScript);
}
static enum PVRSRV_ERROR
if (PDumpSuspended())
return PVRSRV_OK;
- if (!dbgdrv_flags_check(flags))
+ if (!pdumpfs_flags_check(flags))
return PVRSRV_OK;
- return dbgdrv_write_data(buffer, size, from_user);
+ return pdumpfs_write_data(buffer, size, from_user);
}
void PDumpCommentKM(char *pszComment, u32 ui32Flags)
if (PDumpSuspended())
return;
- dbgdrv_frame_set(ui32Frame);
+ pdumpfs_frame_set(ui32Frame);
}
IMG_BOOL PDumpIsCaptureFrameKM(void)
if (PDumpSuspended())
return IMG_FALSE;
- return dbgdrv_capturing();
+ return pdumpfs_capture_enabled();
}
void PDumpInit(void)
--- /dev/null
+/*
+ * Copyright (c) 2010-2011 by Luc Verhaegen <libv@codethink.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "img_defs.h"
+#include "services_headers.h"
+#include "pvr_pdump.h"
+#include "pvr_pdumpfs.h"
+
+enum pdumpfs_mode {
+ PDUMPFS_MODE_DISABLED,
+ PDUMPFS_MODE_STANDARD,
+ PDUMPFS_MODE_FULL,
+};
+
+static enum pdumpfs_mode pdumpfs_mode = PDUMPFS_MODE_DISABLED;
+static u32 pdumpfs_frame_number;
+
+void
+pdumpfs_frame_set(u32 frame)
+{
+ pdumpfs_frame_number = frame;
+}
+
+bool
+pdumpfs_capture_enabled(void)
+{
+ if (pdumpfs_mode == PDUMPFS_MODE_FULL)
+ return true;
+ else
+ return false;
+}
+
+bool
+pdumpfs_flags_check(u32 flags)
+{
+ if (flags & PDUMP_FLAGS_NEVER)
+ return false;
+ else if (pdumpfs_mode == PDUMPFS_MODE_FULL)
+ return true;
+ else if ((pdumpfs_mode == PDUMPFS_MODE_STANDARD) &&
+ (flags & PDUMP_FLAGS_CONTINUOUS))
+ return true;
+ else
+ return false;
+}
+
+enum PVRSRV_ERROR
+pdumpfs_write_data(void *buffer, size_t size, bool from_user)
+{
+ return PVRSRV_OK;
+}
+
+void
+pdumpfs_write_string(char *string)
+{
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2010 by Luc Verhaegen <libv@codethink.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _PVR_PDUMPFS_H_
+#define _PVR_PDUMPFS_H_
+
+void pdumpfs_frame_set(u32 frame);
+bool pdumpfs_capture_enabled(void);
+bool pdumpfs_flags_check(u32 flags);
+enum PVRSRV_ERROR pdumpfs_write_data(void *buffer, size_t size, bool from_user);
+void pdumpfs_write_string(char *string);
+
+#endif /* _PVR_PDUMPFS_H_ */