linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ung <davidu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: airlied-cv59FeDIM0c@public.gmane.org
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org,
	amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	David Ung <davidu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH V2 2/3] gpu: host1x: Remove addr_phys member from host1x_job
Date: Thu, 5 Mar 2015 17:51:51 -0800	[thread overview]
Message-ID: <1425606712-15986-2-git-send-email-davidu@nvidia.com> (raw)
In-Reply-To: <1425606712-15986-1-git-send-email-davidu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

We are using addr_phys and gather_addr_phys/reloc_addr_phys interchangeably
which points to the same set of memory. Using only gather/reloc_addr_phys
make the code clearer and less error prone.

Signed-off-by: David Ung <davidu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/gpu/host1x/job.c | 11 +++++------
 include/linux/host1x.h   |  1 -
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
index 9c11265..7ecbefd 100644
--- a/drivers/gpu/host1x/job.c
+++ b/drivers/gpu/host1x/job.c
@@ -69,10 +69,9 @@ struct host1x_job *host1x_job_alloc(struct host1x_channel *ch,
 	mem += num_waitchks * sizeof(struct host1x_waitchk);
 	job->gathers = num_cmdbufs ? mem : NULL;
 	mem += num_cmdbufs * sizeof(struct host1x_job_gather);
-	job->addr_phys = num_unpins ? mem : NULL;
-
-	job->reloc_addr_phys = job->addr_phys;
-	job->gather_addr_phys = &job->addr_phys[num_relocs];
+	job->reloc_addr_phys = num_unpins ? mem : NULL;
+	mem += num_relocs * sizeof(dma_addr_t);
+	job->gather_addr_phys = num_unpins ? mem : NULL;
 
 	return job;
 }
@@ -194,7 +193,7 @@ static unsigned int pin_job(struct host1x_job *job)
 		if (!phys_addr)
 			goto unpin;
 
-		job->addr_phys[job->num_unpins] = phys_addr;
+		job->reloc_addr_phys[i] = phys_addr;
 		job->unpins[job->num_unpins].bo = reloc->target.bo;
 		job->unpins[job->num_unpins].sgt = sgt;
 		job->num_unpins++;
@@ -213,7 +212,7 @@ static unsigned int pin_job(struct host1x_job *job)
 		if (!phys_addr)
 			goto unpin;
 
-		job->addr_phys[job->num_unpins] = phys_addr;
+		job->gather_addr_phys[i] = phys_addr;
 		job->unpins[job->num_unpins].bo = g->bo;
 		job->unpins[job->num_unpins].sgt = sgt;
 		job->num_unpins++;
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index bb9840f..a722c4b 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -202,7 +202,6 @@ struct host1x_job {
 	struct host1x_job_unpin_data *unpins;
 	unsigned int num_unpins;
 
-	dma_addr_t *addr_phys;
 	dma_addr_t *gather_addr_phys;
 	dma_addr_t *reloc_addr_phys;
 
-- 
1.8.1.5

  parent reply	other threads:[~2015-03-06  1:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06  1:51 [PATCH V2 1/3] gpu: host1x: Reduce host1x job allocation size David Ung
     [not found] ` <1425606712-15986-1-git-send-email-davidu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-03-06  1:51   ` David Ung [this message]
2015-03-06  1:51   ` [PATCH V2 3/3] gpu: host1x: Record the physical address for gathers David Ung
2015-03-18  0:53   ` [PATCH V2 1/3] gpu: host1x: Reduce host1x job allocation size David Ung
     [not found]     ` <0e36c4295adc4f2daae9715cd0dde87d-wO81nVYWzR5xWE4FnwvcdlaTQe2KTcn/@public.gmane.org>
2015-03-23  7:09       ` Alexandre Courbot
     [not found]         ` <CAAVeFuK4NOrfCcX846rgPdViR6Ur4pSrrVihiV7KP1kRf15kdw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-23 19:39           ` David Ung
     [not found]             ` <2253e92cd45c4b33913a45011c4ce823-wO81nVYWzR5xWE4FnwvcdlaTQe2KTcn/@public.gmane.org>
2015-03-31  6:29               ` Alexandre Courbot
     [not found]                 ` <CAAVeFuLZOJdOtpuSqdRzGa0rK3WZWURz-pn2tXhqTv58J0R_NA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-02 23:13                   ` David Ung
     [not found]                     ` <4ca2d661eab54c3eb861680ebc24a430-wO81nVYWzR5xWE4FnwvcdlaTQe2KTcn/@public.gmane.org>
2015-04-06  4:14                       ` Alexandre Courbot
2015-04-09  8:53                       ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425606712-15986-2-git-send-email-davidu@nvidia.com \
    --to=davidu-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).