Browse Source

gpu: host1x: Fix compiler errors by converting to dma_addr_t

The compiler is complaining with the following errors:

drivers/gpu/host1x/cdma.c:94:48: error:
	passing argument 3 of ‘dma_alloc_wc’ from incompatible pointer type
	[-Werror=incompatible-pointer-types]

drivers/gpu/host1x/cdma.c:113:48: error:
	passing argument 3 of ‘dma_alloc_wc’ from incompatible pointer type
	[-Werror=incompatible-pointer-types]

The expected pointer type of the third argument to dma_alloc_wc() is
dma_addr_t but phys_addr_t is passed.

Change the phys member of struct push_buffer to be dma_addr_t so that we
pass the correct type to dma_alloc_wc().
Also check pb->mapped for non-NULL in the destroy function as that is the
right way of checking if dma_alloc_wc() was successful.

Signed-off-by: Emil Goode <emil.fsw@goode.io>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Emil Goode 7 years ago
parent
commit
2f8a6da866
2 changed files with 2 additions and 2 deletions
  1. 1 1
      drivers/gpu/host1x/cdma.c
  2. 1 1
      drivers/gpu/host1x/cdma.h

+ 1 - 1
drivers/gpu/host1x/cdma.c

@@ -51,7 +51,7 @@ static void host1x_pushbuffer_destroy(struct push_buffer *pb)
 	struct host1x_cdma *cdma = pb_to_cdma(pb);
 	struct host1x_cdma *cdma = pb_to_cdma(pb);
 	struct host1x *host1x = cdma_to_host1x(cdma);
 	struct host1x *host1x = cdma_to_host1x(cdma);
 
 
-	if (!pb->phys)
+	if (!pb->mapped)
 		return;
 		return;
 
 
 	if (host1x->domain) {
 	if (host1x->domain) {

+ 1 - 1
drivers/gpu/host1x/cdma.h

@@ -44,7 +44,7 @@ struct host1x_job;
 struct push_buffer {
 struct push_buffer {
 	void *mapped;			/* mapped pushbuffer memory */
 	void *mapped;			/* mapped pushbuffer memory */
 	dma_addr_t dma;			/* device address of pushbuffer */
 	dma_addr_t dma;			/* device address of pushbuffer */
-	phys_addr_t phys;		/* physical address of pushbuffer */
+	dma_addr_t phys;		/* physical address of pushbuffer */
 	u32 fence;			/* index we've written */
 	u32 fence;			/* index we've written */
 	u32 pos;			/* index to write to */
 	u32 pos;			/* index to write to */
 	u32 size;
 	u32 size;