Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpu: host1x: Store device address to all bufs

Currently job pinning is optimized to handle only the first buffer
using a certain host1x_bo object and all subsequent buffers using
the same host1x_bo are considered done.

In most cases this is correct, however, in case the same host1x_bo
is used in multiple gathers inside the same job, we skip also
storing the device address (physical or iova) to this buffer.

This patch reworks the host1x_job_pin() to store the device address
to all gathers.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Arto Merilainen and committed by
Thierry Reding
f08ef2d1 cc09cb6d

+6 -3
+6 -3
drivers/gpu/host1x/job.c
··· 1 1 /* 2 2 * Tegra host1x Job 3 3 * 4 - * Copyright (c) 2010-2013, NVIDIA Corporation. 4 + * Copyright (c) 2010-2015, NVIDIA Corporation. 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify it 7 7 * under the terms and conditions of the GNU General Public License, ··· 539 539 540 540 g->base = job->gather_addr_phys[i]; 541 541 542 - for (j = i + 1; j < job->num_gathers; j++) 543 - if (job->gathers[j].bo == g->bo) 542 + for (j = i + 1; j < job->num_gathers; j++) { 543 + if (job->gathers[j].bo == g->bo) { 544 544 job->gathers[j].handled = true; 545 + job->gathers[j].base = g->base; 546 + } 547 + } 545 548 546 549 err = do_relocs(job, g->bo); 547 550 if (err)