aboutsummaryrefslogtreecommitdiff
path: root/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.h
diff options
context:
space:
mode:
authorEric Miao <eric.miao@linaro.org>2012-01-11 21:38:33 +0800
committerEric Miao <eric.miao@linaro.org>2012-01-11 21:38:33 +0800
commit3ffa6554d683f636518844887d5dc259b367e731 (patch)
treef174b6b0f9892726c9b5ecdbd66d724a3e2ddc54 /drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.h
parent143920b70301cd37462a2902f2965ef138ae90e6 (diff)
parent20401bffc83f4e9fd18fd6032fea22082099ce88 (diff)
Merge branch 'lt-3.2-imx5' into topic/lt-3.2-imx6-uglytopic/lt-3.2-imx6-ugly
* lt-3.2-imx5: (124 commits) SAUCE: fix the missing header of <linux/module.h> SAUCE: fix the removal of mxc_register_device() SAUCE: mx53_loco: fix gpio_to_irq() being non-constant SAUCE: fix building errors after rebased to v3.2 LINARO: Add lt-mx5_defconfig ARM i.MX5: fix system_rev if not set by atag or DT ENGR00162701 mxc_vout: fix potential deadlock of fb_blank ENGR00162666 mxc_vout: v4l2 playback blocking issue ENGR00162665 ipuv3 fb: fix non-interleave format wrong color issue ENGR00162664 mxc_vout: modify pp bypass condition ENGR00162663 ipuv3 fb: add vertical flip support ENGR00162475 ipuv3 fb: fix camera preview failure ENGR00162360 mxc_vout: fix STREAMOFF and G_CROP issues ENGR00162358 ipuv3 fb: only check pos when fb is unblank ENGR00162354 ipuv3 device: correct kthread operation for split task SAUCE: mx53: add mxc_lcdif support SAUCE: add arm-pmu device SAUCE: remove unnecessary suspend/resume functions from mxc_spdif ENGR00162218 mxc_vout: put set position function before set var ENGR00162208 ipuv3 device: fix jitter issue of split mode ...
Diffstat (limited to 'drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.h')
-rw-r--r--drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.h b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.h
new file mode 100644
index 00000000000..475ee3be2e5
--- /dev/null
+++ b/drivers/mxc/amd-gpu/platform/hal/linux/gsl_kmod_cleanup.h
@@ -0,0 +1,90 @@
+/* Copyright (c) 2008-2010, Advanced Micro Devices. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Advanced Micro Devices nor
+ * the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef __GSL_KMOD_CLEANUP_H
+#define __GSL_KMOD_CLEANUP_H
+#include "gsl_types.h"
+
+#include <linux/gfp.h>
+#include <linux/slab.h>
+#include <linux/fs.h>
+#include <linux/list.h>
+
+#if (GSL_CONTEXT_MAX > 127)
+ #error created_contexts_array supports context numbers only 127 or less.
+#endif
+
+static const s8 EMPTY_ENTRY = -1;
+
+/* A structure to make list of allocated memory blocks. List per fd. */
+/* should probably be allocated from slab cache to minimise fragmentation */
+struct gsl_kmod_alloc_list
+{
+ struct list_head node;
+ gsl_memdesc_t allocated_block;
+ u32 allocation_number;
+};
+
+/* A structure to hold abovementioned list of blocks. Contain per fd data. */
+struct gsl_kmod_per_fd_data
+{
+ struct list_head allocated_blocks_head; // list head
+ u32 maximum_number_of_blocks;
+ u32 number_of_allocated_blocks;
+ s8 created_contexts_array[GSL_DEVICE_MAX][GSL_CONTEXT_MAX];
+};
+
+
+/*
+ * prototypes
+ */
+
+/* allocated memory block tracking */
+int add_memblock_to_allocated_list(struct file *fd,
+ gsl_memdesc_t *allocated_block);
+
+int del_memblock_from_allocated_list(struct file *fd,
+ gsl_memdesc_t *freed_block);
+
+int del_all_memblocks_from_allocated_list(struct file *fd);
+
+/* created contexts tracking */
+void init_created_contexts_array(s8 *array);
+
+void add_device_context_to_array(struct file *fd,
+ gsl_deviceid_t device_id,
+ unsigned int context_id);
+
+void del_device_context_from_array(struct file *fd,
+ gsl_deviceid_t device_id,
+ unsigned int context_id);
+
+void del_all_devices_contexts(struct file *fd);
+
+#endif // __GSL_KMOD_CLEANUP_H
+