From: Erik Faye-Lund Date: Fri, 4 Oct 2013 20:18:33 +0000 (+0000) Subject: gpu: host1x: check relocs after all gathers are consumed X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a9ff999538ab2bf6d3b1ed8ab5a016bfc6fe2cd1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git gpu: host1x: check relocs after all gathers are consumed The num_relocs count are passed to the kernel per job, not per gather. For multi-gather jobs, we would previously fail if there were relocs in other gathers aside from the first one. Fix this by simply moving the check until all gathers have been consumed. Signed-off-by: Erik Faye-Lund Reviewed-by: Arto Merilainen Acked-By: Terje Bergstrom Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index c4e1050f2252..c9ddff8c76cd 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -436,10 +436,6 @@ static int validate(struct host1x_firewall *fw, struct host1x_job_gather *g) } } - /* No relocs should remain at this point */ - if (fw->num_relocs) - err = -EINVAL; - out: return err; } @@ -493,6 +489,10 @@ static inline int copy_gathers(struct host1x_job *job, struct device *dev) offset += g->words * sizeof(u32); } + /* No relocs should remain at this point */ + if (fw.num_relocs) + return -EINVAL; + return 0; }