@@ -202,17 +202,16 @@ static unsigned int pin_job(struct host1x_job *job)
for (i = 0; i < job->num_gathers; i++) {
struct host1x_job_gather *g = &job->gathers[i];
struct sg_table *sgt;
- dma_addr_t phys_addr;
g->bo = host1x_bo_get(g->bo);
if (!g->bo)
goto unpin;
- phys_addr = host1x_bo_pin(g->bo, &sgt);
- if (!phys_addr)
+ g->base = host1x_bo_pin(g->bo, &sgt);
+ if (!g->base)
goto unpin;
- job->gather_addr_phys[i] = phys_addr;
+ job->gather_addr_phys[i] = g->base;
job->unpins[job->num_unpins].bo = g->bo;
job->unpins[job->num_unpins].sgt = sgt;
job->num_unpins++;
@@ -536,8 +535,6 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev)
if (g->handled)
continue;
- g->base = job->gather_addr_phys[i];
-
for (j = i + 1; j < job->num_gathers; j++)
if (job->gathers[j].bo == g->bo)
job->gathers[j].handled = true;
The gather's base physical address is recorded during patching of gathers, but only the 1st one within the same buffer object has it set, subsequent gathers in the same buffer are being skipped. This patch records the phys addr during pin_job for all gathers. Signed-off-by: David Ung <davidu@nvidia.com> --- drivers/gpu/host1x/job.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)