All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: tomi.valkeinen@ti.com, airlied@linux.ie, daniel@ffwll.ch
Cc: jsarha@ti.com, dri-devel@lists.freedesktop.org
Subject: [PATCH v3 3/8] drm/omap: accept NULL for dma_addr in omap_gem_pin
Date: Mon, 7 Oct 2019 13:25:50 +0200	[thread overview]
Message-ID: <20191007112555.25278-4-jjhiblot@ti.com> (raw)
In-Reply-To: <20191007112555.25278-1-jjhiblot@ti.com>

From: Tomi Valkeinen <tomi.valkeinen@ti.com>

Allow NULL to be passed in 'dma_addr' for omap_gem_pin(), in case the
caller does not need the dma_addr.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_gem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 9201c21e206f..a6562d23d314 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -819,9 +819,11 @@ int omap_gem_pin(struct drm_gem_object *obj, dma_addr_t *dma_addr)
 			refcount_inc(&omap_obj->dma_addr_cnt);
 		}
 
-		*dma_addr = omap_obj->dma_addr;
+		if (dma_addr)
+			*dma_addr = omap_obj->dma_addr;
 	} else if (omap_gem_is_contiguous(omap_obj)) {
-		*dma_addr = omap_obj->dma_addr;
+		if (dma_addr)
+			*dma_addr = omap_obj->dma_addr;
 	} else {
 		ret = -EINVAL;
 		goto fail;
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-10-07 11:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 11:25 [PATCH v3 0/8] drm/omap: OMAP_BO flags Jean-Jacques Hiblot
2019-10-07 11:25 ` [PATCH v3 1/8] drm/omap: use refcount API to track the number of users of dma_addr Jean-Jacques Hiblot
2019-10-09 10:38   ` Tomi Valkeinen
2019-10-07 11:25 ` [PATCH v3 2/8] drm/omap: add omap_gem_unpin_locked() Jean-Jacques Hiblot
2019-10-08 15:54   ` [v3,2/8] " Jean-Jacques Hiblot
2019-10-07 11:25 ` Jean-Jacques Hiblot [this message]
2019-10-08 15:55   ` [v3,3/8] drm/omap: accept NULL for dma_addr in omap_gem_pin Jean-Jacques Hiblot
2019-10-07 11:25 ` [PATCH v3 4/8] drm/omap: cleanup OMAP_BO flags Jean-Jacques Hiblot
2019-10-08 15:56   ` [v3,4/8] " Jean-Jacques Hiblot
2019-10-07 11:25 ` [PATCH v3 5/8] drm/omap: remove OMAP_BO_TILED define Jean-Jacques Hiblot
2019-10-08 15:56   ` [v3,5/8] " Jean-Jacques Hiblot
2019-10-07 11:25 ` [PATCH v3 6/8] drm/omap: cleanup OMAP_BO_SCANOUT use Jean-Jacques Hiblot
2019-10-08 15:57   ` [v3,6/8] " Jean-Jacques Hiblot
2019-10-07 11:25 ` [PATCH v3 7/8] drm/omap: add omap_gem_validate_flags() Jean-Jacques Hiblot
2019-10-08 15:58   ` [v3,7/8] " Jean-Jacques Hiblot
2019-10-07 11:25 ` [PATCH v3 8/8] drm/omap: add OMAP_BO flags to affect buffer allocation Jean-Jacques Hiblot
2019-10-08 16:01   ` [v3,8/8] " Jean-Jacques Hiblot
2019-10-07 12:16 ` [PATCH v3 0/8] drm/omap: OMAP_BO flags Tomi Valkeinen
2019-10-08 16:08   ` Jean-Jacques Hiblot
2019-10-09  7:05     ` Tomi Valkeinen

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=20191007112555.25278-4-jjhiblot@ti.com \
    --to=jjhiblot@ti.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.