NULL) != PVRSRV_OK)
goto init_failed;
+ if (pdumpfs_init()) {
+ pr_err("%s: pdumpfs_init failed.\n", __func__);
+ goto init_failed;
+ }
+
PDumpComment("Driver Product Name: %s", VS_PRODUCT_NAME);
PDumpComment("Driver Product Version: %s (%s)",
PVRVERSION_STRING, PVRVERSION_FILE);
void PDumpDeInit(void)
{
+ pdumpfs_cleanup();
+
if (gpszFile) {
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, SZ_FILENAME_SIZE_MAX,
(void *)gpszFile, NULL);
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <linux/mutex.h>
+
#include "img_defs.h"
#include "services_headers.h"
#include "pvr_pdump.h"
#include "pvr_pdumpfs.h"
+static struct mutex pdumpfs_mutex[1];
+
enum pdumpfs_mode {
PDUMPFS_MODE_DISABLED,
PDUMPFS_MODE_STANDARD,
void
pdumpfs_frame_set(u32 frame)
{
+ mutex_lock(pdumpfs_mutex);
+
pdumpfs_frame_number = frame;
+
+ mutex_unlock(pdumpfs_mutex);
}
bool
pdumpfs_capture_enabled(void)
{
+ bool ret;
+
+ mutex_lock(pdumpfs_mutex);
+
if (pdumpfs_mode == PDUMPFS_MODE_FULL)
- return true;
+ ret = true;
else
- return false;
+ ret = false;
+
+ mutex_unlock(pdumpfs_mutex);
+
+ return ret;
}
bool
pdumpfs_flags_check(u32 flags)
{
+ bool ret;
+
if (flags & PDUMP_FLAGS_NEVER)
return false;
- else if (pdumpfs_mode == PDUMPFS_MODE_FULL)
- return true;
+
+ mutex_lock(pdumpfs_mutex);
+
+ if (pdumpfs_mode == PDUMPFS_MODE_FULL)
+ ret = true;
else if ((pdumpfs_mode == PDUMPFS_MODE_STANDARD) &&
(flags & PDUMP_FLAGS_CONTINUOUS))
- return true;
+ ret = true;
else
- return false;
+ ret = false;
+
+ mutex_unlock(pdumpfs_mutex);
+
+ return ret;
}
enum PVRSRV_ERROR
pdumpfs_write_data(void *buffer, size_t size, bool from_user)
{
+ mutex_lock(pdumpfs_mutex);
+
+ mutex_unlock(pdumpfs_mutex);
+
return PVRSRV_OK;
}
void
pdumpfs_write_string(char *string)
+{
+ mutex_lock(pdumpfs_mutex);
+
+ mutex_unlock(pdumpfs_mutex);
+}
+
+int
+pdumpfs_init(void)
+{
+ mutex_init(pdumpfs_mutex);
+
+ return 0;
+}
+
+void
+pdumpfs_cleanup(void)
{
}
enum PVRSRV_ERROR pdumpfs_write_data(void *buffer, size_t size, bool from_user);
void pdumpfs_write_string(char *string);
+int pdumpfs_init(void);
+void pdumpfs_cleanup(void);
+
#endif /* _PVR_PDUMPFS_H_ */