summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_softjobs.c
diff options
context:
space:
mode:
authorSiddharth Kapoor <ksiddharth@google.com>2022-01-07 19:09:01 +0800
committerSiddharth Kapoor <ksiddharth@google.com>2022-01-07 19:09:01 +0800
commit0207d6c3b7a2002f15c60d08617e956faf5ba90c (patch)
treeeae0afe608a70b25f64e959db2b782fb33f89160 /mali_kbase/mali_kbase_softjobs.c
parent0c596dc70431fa2c70021fa1685e3efc969a852d (diff)
downloadgpu-0207d6c3b7a2002f15c60d08617e956faf5ba90c.tar.gz
Mali Valhall Android DDK r35p0 KMD
Provenance: 3e260085ac (collaborate/EAC/v_r35p0) VX504X08X-BU-00000-r35p0-01eac0 - Valhall Android DDK VX504X08X-BU-60000-r35p0-01eac0 - Valhall Android Document Bundle VX504X08X-DC-11001-r35p0-01eac0 - Valhall Android DDK Software Errata VX504X08X-SW-99006-r35p0-01eac0 - Valhall Android Renderscript AOSP parts Signed-off-by: Siddharth Kapoor <ksiddharth@google.com> Change-Id: Id9ef73da49680e2935a827c40d54169545f7162e
Diffstat (limited to 'mali_kbase/mali_kbase_softjobs.c')
-rw-r--r--mali_kbase/mali_kbase_softjobs.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/mali_kbase/mali_kbase_softjobs.c b/mali_kbase/mali_kbase_softjobs.c
index bee3513..df34854 100644
--- a/mali_kbase/mali_kbase_softjobs.c
+++ b/mali_kbase/mali_kbase_softjobs.c
@@ -95,7 +95,8 @@ static int kbasep_read_soft_event_status(
unsigned char *mapped_evt;
struct kbase_vmap_struct map;
- mapped_evt = kbase_vmap(kctx, evt, sizeof(*mapped_evt), &map);
+ mapped_evt = kbase_vmap_prot(kctx, evt, sizeof(*mapped_evt),
+ KBASE_REG_CPU_RD, &map);
if (!mapped_evt)
return -EFAULT;
@@ -116,7 +117,8 @@ static int kbasep_write_soft_event_status(
(new_status != BASE_JD_SOFT_EVENT_RESET))
return -EINVAL;
- mapped_evt = kbase_vmap(kctx, evt, sizeof(*mapped_evt), &map);
+ mapped_evt = kbase_vmap_prot(kctx, evt, sizeof(*mapped_evt),
+ KBASE_REG_CPU_WR, &map);
if (!mapped_evt)
return -EFAULT;
@@ -1203,8 +1205,8 @@ static int kbase_jit_allocate_process(struct kbase_jd_atom *katom)
* Write the address of the JIT allocation to the user provided
* GPU allocation.
*/
- ptr = kbase_vmap(kctx, info->gpu_alloc_addr, sizeof(*ptr),
- &mapping);
+ ptr = kbase_vmap_prot(kctx, info->gpu_alloc_addr, sizeof(*ptr),
+ KBASE_REG_CPU_WR, &mapping);
if (!ptr) {
/*
* Leave the allocations "live" as the JIT free atom
@@ -1649,7 +1651,12 @@ int kbase_prepare_soft_job(struct kbase_jd_atom *katom)
if (copy_to_user((__user void *)(uintptr_t)katom->jc,
&fence, sizeof(fence)) != 0) {
kbase_sync_fence_out_remove(katom);
- kbase_sync_fence_close_fd(fd);
+ /* fd should have been closed here, but there's
+ * no good way of doing that. Since
+ * copy_to_user() very rarely fails, and the fd
+ * will get closed on process termination this
+ * won't be a problem.
+ */
fence.basep.fd = -EINVAL;
return -EINVAL;
}