2014-01-07 20:03:26

by Erik Faye-Lund

[permalink] [raw]
Subject: [PATCH] gpu: host1x: do not check previously handled gathers

When patching gathers, we don't need to check against
gathers with lower indices than the current one, as
they are guaranteed to already have been handled.

Signed-off-by: Erik Faye-Lund <[email protected]>
---

Here's a trivial optimization I have been running with for a while.

drivers/gpu/host1x/job.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
index de5ec33..e965805 100644
--- a/drivers/gpu/host1x/job.c
+++ b/drivers/gpu/host1x/job.c
@@ -534,7 +534,7 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev)

g->base = job->gather_addr_phys[i];

- for (j = 0; j < job->num_gathers; j++)
+ for (j = i + 1; j < job->num_gathers; j++)
if (job->gathers[j].bo == g->bo)
job->gathers[j].handled = true;

--
1.8.1.2


2014-01-23 17:38:09

by Erik Faye-Lund

[permalink] [raw]
Subject: Re: [PATCH] gpu: host1x: do not check previously handled gathers

Ping?

On Tue, Jan 7, 2014 at 9:03 PM, Erik Faye-Lund <[email protected]> wrote:
> When patching gathers, we don't need to check against
> gathers with lower indices than the current one, as
> they are guaranteed to already have been handled.
>
> Signed-off-by: Erik Faye-Lund <[email protected]>
> ---
>
> Here's a trivial optimization I have been running with for a while.
>
> drivers/gpu/host1x/job.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
> index de5ec33..e965805 100644
> --- a/drivers/gpu/host1x/job.c
> +++ b/drivers/gpu/host1x/job.c
> @@ -534,7 +534,7 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev)
>
> g->base = job->gather_addr_phys[i];
>
> - for (j = 0; j < job->num_gathers; j++)
> + for (j = i + 1; j < job->num_gathers; j++)
> if (job->gathers[j].bo == g->bo)
> job->gathers[j].handled = true;
>
> --
> 1.8.1.2
>

2014-01-30 13:51:57

by Terje Bergstrom

[permalink] [raw]
Subject: Re: [PATCH] gpu: host1x: do not check previously handled gathers

On 07.01.2014 22:03, Erik Faye-Lund wrote:
> When patching gathers, we don't need to check against
> gathers with lower indices than the current one, as
> they are guaranteed to already have been handled.
>
> Signed-off-by: Erik Faye-Lund <[email protected]>
> ---
>
> Here's a trivial optimization I have been running with for a while.
>
> drivers/gpu/host1x/job.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
> index de5ec33..e965805 100644
> --- a/drivers/gpu/host1x/job.c
> +++ b/drivers/gpu/host1x/job.c
> @@ -534,7 +534,7 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev)
>
> g->base = job->gather_addr_phys[i];
>
> - for (j = 0; j < job->num_gathers; j++)
> + for (j = i + 1; j < job->num_gathers; j++)
> if (job->gathers[j].bo == g->bo)
> job->gathers[j].handled = true;
>

Hi,

Thanks. This looks good logically, and I ran some tests that agree.

Acked-By: Terje Bergstrom <[email protected]>

Terje

2014-02-10 13:10:57

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH] gpu: host1x: do not check previously handled gathers

On Tue, Jan 07, 2014 at 09:03:06PM +0100, Erik Faye-Lund wrote:
> When patching gathers, we don't need to check against
> gathers with lower indices than the current one, as
> they are guaranteed to already have been handled.
>
> Signed-off-by: Erik Faye-Lund <[email protected]>
> ---
>
> Here's a trivial optimization I have been running with for a while.
>
> drivers/gpu/host1x/job.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks!

Thierry


Attachments:
(No filename) (476.00 B)
(No filename) (836.00 B)
Download all attachments

2014-02-12 10:19:00

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH] gpu: host1x: do not check previously handled gathers

On Tue, Jan 07, 2014 at 09:03:06PM +0100, Erik Faye-Lund wrote:
> When patching gathers, we don't need to check against
> gathers with lower indices than the current one, as
> they are guaranteed to already have been handled.
>
> Signed-off-by: Erik Faye-Lund <[email protected]>
> ---
>
> Here's a trivial optimization I have been running with for a while.
>
> drivers/gpu/host1x/job.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks!

Thierry


Attachments:
(No filename) (476.00 B)
(No filename) (836.00 B)
Download all attachments