From: Jordan Crouse <jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org
Subject: [PATCH 9/9] drm/msm/gpu: Map the ringbuffer in the iova at create time
Date: Wed, 7 Nov 2018 15:35:54 -0700 [thread overview]
Message-ID: <20181107223554.27308-10-jcrouse@codeaurora.org> (raw)
In-Reply-To: <20181107223554.27308-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
For reasons that I'm sure made perfect sense at the time we were
opting to defer the iova alloc / pin on the ringbuffer until HW
init time so when we moved to iova reference counting we ended
up adding a reference count every time the hardware started.
Not that it mattered (because the ring is always around) but
it did make the debug output look odd. Allocate and pin the iova
at create time instead.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---
drivers/gpu/drm/msm/adreno/adreno_gpu.c | 9 ---------
drivers/gpu/drm/msm/msm_ringbuffer.c | 4 ++--
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 3c2988514fc5..05092ca12193 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -209,15 +209,6 @@ int adreno_hw_init(struct msm_gpu *gpu)
if (!ring)
continue;
- ret = msm_gem_get_and_pin_iova(ring->bo, gpu->aspace,
- &ring->iova);
- if (ret) {
- ring->iova = 0;
- DRM_DEV_ERROR(gpu->dev->dev,
- "could not map ringbuffer %d: %d\n", i, ret);
- return ret;
- }
-
ring->cur = ring->start;
ring->next = ring->start;
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c
index 6169bd6ca153..20a96fe69dcd 100644
--- a/drivers/gpu/drm/msm/msm_ringbuffer.c
+++ b/drivers/gpu/drm/msm/msm_ringbuffer.c
@@ -36,9 +36,9 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id,
ring->gpu = gpu;
ring->id = id;
- /* Pass NULL for the iova pointer - we will map it later */
+
ring->start = msm_gem_kernel_new(gpu->dev, MSM_GPU_RINGBUFFER_SZ,
- MSM_BO_WC, gpu->aspace, &ring->bo, NULL);
+ MSM_BO_WC, gpu->aspace, &ring->bo, &ring->iova);
if (IS_ERR(ring->start)) {
ret = PTR_ERR(ring->start);
--
2.18.0
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-11-07 22:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 22:35 [PATCH v2 0/9] drm/msm: separate iova allocation and mapping Jordan Crouse
[not found] ` <20181107223554.27308-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-11-07 22:35 ` [PATCH 1/9] drm/msm: Add a common function to free kernel buffer objects Jordan Crouse
2018-11-07 22:35 ` [PATCH 2/9] drm/msm: Remove sgt from the mmu unmap function Jordan Crouse
2018-11-07 22:35 ` [PATCH 3/9] drm/msm: Split msm_gem_get_iova into two steps Jordan Crouse
2018-11-07 22:35 ` [PATCH 4/9] drm/msm: Clean up and enhance the output of the 'gem' debugfs node Jordan Crouse
2018-11-07 22:35 ` [PATCH 5/9] drm/msm: Add msm_gem_get_and_pin_iova() Jordan Crouse
2018-11-07 22:35 ` [PATCH 7/9] drm/msm: Add a name field for gem objects Jordan Crouse
2018-11-07 22:35 ` [PATCH 8/9] drm/msm: Add a name field to struct drm_msm_gem_new Jordan Crouse
2018-11-07 22:35 ` Jordan Crouse [this message]
2018-11-07 22:35 ` [PATCH 6/9] drm/msm: Count how many times iova memory is pinned Jordan Crouse
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=20181107223554.27308-10-jcrouse@codeaurora.org \
--to=jcrouse-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=bzwang-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@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