summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/host1x/job.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
index 1146e3bba6e1..85be2f7b95f0 100644
--- a/drivers/gpu/host1x/job.c
+++ b/drivers/gpu/host1x/job.c
@@ -507,12 +507,16 @@ static inline int copy_gathers(struct host1x_job *job, struct device *dev)
int host1x_job_pin(struct host1x_job *job, struct device *dev)
{
- int err;
- unsigned int i, j;
struct host1x *host = dev_get_drvdata(dev->parent);
- DECLARE_BITMAP(waitchk_mask, host1x_syncpt_nb_pts(host));
+ unsigned int num = host1x_syncpt_nb_pts(host);
+ unsigned long *waitchk_mask;
+ unsigned int i, j;
+ int err;
+
+ waitchk_mask = kcalloc(sizeof(*waitchk_mask), num, GFP_KERNEL);
+ if (!waitchk_mask)
+ return -ENOMEM;
- bitmap_zero(waitchk_mask, host1x_syncpt_nb_pts(host));
for (i = 0; i < job->num_waitchk; i++) {
u32 syncpt_id = job->waitchk[i].syncpt_id;
if (syncpt_id < host1x_syncpt_nb_pts(host))
@@ -523,6 +527,8 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev)
for_each_set_bit(i, waitchk_mask, host1x_syncpt_nb_pts(host))
host1x_syncpt_load(host->syncpt + i);
+ kfree(waitchk_mask);
+
/* pin memory */
err = pin_job(job);
if (!err)