gpu: host1x: check relocs after all gathers are consumed
PATCH 1/1 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.
--- drivers/gpu/host1x/job.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/host1x/job.c +4 -4
@@ -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 ; }
Signature · 1 line
1.7.9.5
Quoted 9 lines · Erik Faye-Lund
The
num_relocscount 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 <[email protected]>
- Arto
Quoted 29 lines · Erik Faye-Lund
The
num_relocscount 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 <[email protected]>--- drivers/gpu/host1x/job.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/gpu/host1x/job.c +0
-4@@ -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; }
drivers/gpu/host1x/job.c static inline int copy_gathers(struct host1x_job *job, struct device *dev) · line 497
Quoted 9 lines
drivers/gpu/host1x/job.c +4
-0@@ -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 ; }
Good catch.
Terje
Thierry Reding
AppliedQuoted 5 lines · Erik Faye-Lund
The
num_relocscount 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.
Quoted 7 lines
Fix this by simply moving the check until all gathers have been consumed.
Signed-off-by Erik Faye-Lund <[email protected]>--- drivers/gpu/host1x/job.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied, thanks.
Thierry
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel