summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorChris Johnson <cwj@nvidia.com>2011-04-30 14:24:44 -0700
committerNiket Sirsi <nsirsi@nvidia.com>2011-05-16 15:15:20 -0700
commit6d8d2c454e835f7cfe34371e07dac173f3153452 (patch)
treec80564468037653f45c29d607e52e8c472ae8367 /arch/arm/mach-tegra
parent0edac603fc410d7b6686b27e545586b42feb7a80 (diff)
nvrm: move stale wait checking into the kerneltegra-11.2.6
The kernel now receives wait tracking data (similar to gathers and relocs) and compares the current syncpt with the threshold value. If it's old, it gets a kernel mapping and rewrites the method data to use a kernel reserved syncpt that is always 0 (so trivially pops when seen by the HW). Bug 519650 Bug 785525 Bug 803452 Note: reset the author in this commit to fix a email addr problem and since from the latest/last cherry pick there was a reworking of the code to be compatible with different user space versions it also seemed reasonable. (cherry picked from commit 4069d8e67665624ad3dceb628e572980dd57acd0) (cherry picked from commit 6e4336408588e348804a62e53386acc9abc06823) (cherry picked from commit 87a9efe751716ca741caac72b9061fdfdcec540a) Change-Id: I9c6076da2384f373d5f402bee4406b09b4ebc4ff Reviewed-on: http://git-master/r/23159 Reviewed-on: http://git-master/r/30281 Tested-by: Chris Johnson <cwj@nvidia.com> Reviewed-by: Ken Adams <kadams@nvidia.com> Reviewed-by: Prajakta Gudadhe <pgudadhe@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/include/mach/nvhost.h30
-rw-r--r--arch/arm/mach-tegra/include/mach/nvmap.h4
2 files changed, 32 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/include/mach/nvhost.h b/arch/arm/mach-tegra/include/mach/nvhost.h
index fc0336a42b50..fc18f2e6292e 100644
--- a/arch/arm/mach-tegra/include/mach/nvhost.h
+++ b/arch/arm/mach-tegra/include/mach/nvhost.h
@@ -76,6 +76,7 @@ int nvhost_bus_register(struct nvhost_master *host);
#define NVHOST_NO_TIMEOUT (-1)
#define NVHOST_IOCTL_MAGIC 'H'
+/* version 0 header */
struct nvhost_submit_hdr {
__u32 syncpt_id;
__u32 syncpt_incrs;
@@ -83,6 +84,22 @@ struct nvhost_submit_hdr {
__u32 num_relocs;
};
+#define NVHOST_SUBMIT_VERSION_V0 0x0
+#define NVHOST_SUBMIT_VERSION_V1 0x1
+#define NVHOST_SUBMIT_VERSION_MAX_SUPPORTED NVHOST_SUBMIT_VERSION_V1
+
+/* version 1 header (same as version 0, w/ addt'l fields) */
+struct nvhost_submit_hdr_ext {
+ __u32 syncpt_id; /* version 0 fields */
+ __u32 syncpt_incrs;
+ __u32 num_cmdbufs;
+ __u32 num_relocs;
+ __u32 submit_version; /* version 1 fields */
+ __u32 num_waitchks;
+ __u32 waitchk_mask;
+ __u32 pad[5]; /* future expansion */
+};
+
struct nvhost_cmdbuf {
__u32 mem;
__u32 offset;
@@ -96,6 +113,13 @@ struct nvhost_reloc {
__u32 target_offset;
};
+struct nvhost_waitchk {
+ __u32 mem;
+ __u32 offset;
+ __u32 syncpt_id;
+ __u32 thresh;
+};
+
struct nvhost_get_param_args {
__u32 value;
};
@@ -116,9 +140,11 @@ struct nvhost_set_nvmap_fd_args {
_IOW(NVHOST_IOCTL_MAGIC, 5, struct nvhost_set_nvmap_fd_args)
#define NVHOST_IOCTL_CHANNEL_NULL_KICKOFF \
_IOR(NVHOST_IOCTL_MAGIC, 6, struct nvhost_get_param_args)
+#define NVHOST_IOCTL_CHANNEL_SUBMIT_EXT \
+ _IOW(NVHOST_IOCTL_MAGIC, 7, struct nvhost_submit_hdr_ext)
#define NVHOST_IOCTL_CHANNEL_LAST \
- _IOC_NR(NVHOST_IOCTL_CHANNEL_NULL_KICKOFF)
-#define NVHOST_IOCTL_CHANNEL_MAX_ARG_SIZE sizeof(struct nvhost_get_param_args)
+ _IOC_NR(NVHOST_IOCTL_CHANNEL_SUBMIT_EXT)
+#define NVHOST_IOCTL_CHANNEL_MAX_ARG_SIZE sizeof(struct nvhost_submit_hdr_ext)
struct nvhost_ctrl_syncpt_read_args {
__u32 id;
diff --git a/arch/arm/mach-tegra/include/mach/nvmap.h b/arch/arm/mach-tegra/include/mach/nvmap.h
index 7422d1a44d8a..7a79748e5433 100644
--- a/arch/arm/mach-tegra/include/mach/nvmap.h
+++ b/arch/arm/mach-tegra/include/mach/nvmap.h
@@ -97,6 +97,10 @@ int nvmap_pin_array(struct nvmap_client *client, struct nvmap_handle *gather,
void nvmap_unpin_handles(struct nvmap_client *client,
struct nvmap_handle **h, int nr);
+int nvmap_patch_wait(struct nvmap_client *client,
+ struct nvmap_handle *patch,
+ u32 patch_offset, u32 patch_value);
+
struct nvmap_platform_carveout {
const char *name;
unsigned int usage_mask;