From: Nirmoy Das <nirmoy.aiemd@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: sashal@kernel.org, thellstrom@vmware.com, airlied@linux.ie,
kenny.ho@amd.com, brian.welty@intel.com, nirmoy.das@amd.com,
linux-graphics-maintainer@vmware.com, bskeggs@redhat.com,
Daniel Vetter <daniel.vetter@ffwll.ch>,
alexander.deucher@amd.com, sean@poorly.run,
christian.koenig@amd.com, kraxel@redhat.com
Subject: [PATCH 6/8] drm/vram-helper: don't use ttm bo->offset v4
Date: Wed, 24 Jun 2020 20:26:46 +0200 [thread overview]
Message-ID: <20200624182648.6976-7-nirmoy.das@amd.com> (raw)
In-Reply-To: <20200624182648.6976-1-nirmoy.das@amd.com>
Calculate GEM VRAM bo's offset within vram-helper without depending on
bo->offset.
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/drm_gem_vram_helper.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
index 0023ce1d2cf7..ad096600d89f 100644
--- a/drivers/gpu/drm/drm_gem_vram_helper.c
+++ b/drivers/gpu/drm/drm_gem_vram_helper.c
@@ -281,6 +281,15 @@ u64 drm_gem_vram_mmap_offset(struct drm_gem_vram_object *gbo)
}
EXPORT_SYMBOL(drm_gem_vram_mmap_offset);
+static u64 drm_gem_vram_pg_offset(struct drm_gem_vram_object *gbo)
+{
+ /* Keep TTM behavior for now, remove when drivers are audited */
+ if (WARN_ON_ONCE(!gbo->bo.mem.mm_node))
+ return 0;
+
+ return gbo->bo.mem.start;
+}
+
/**
* drm_gem_vram_offset() - \
Returns a GEM VRAM object's offset in video memory
@@ -297,7 +306,7 @@ s64 drm_gem_vram_offset(struct drm_gem_vram_object *gbo)
{
if (WARN_ON_ONCE(!gbo->pin_count))
return (s64)-ENODEV;
- return gbo->bo.offset;
+ return drm_gem_vram_pg_offset(gbo) << PAGE_SHIFT;
}
EXPORT_SYMBOL(drm_gem_vram_offset);
--
2.27.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-06-25 7:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 18:26 [RESEND] [PATCH v6 0/8] do not store GPU address in TTM Nirmoy Das
2020-06-24 18:26 ` [PATCH 1/8] drm/amdgpu: move ttm bo->offset to amdgpu_bo Nirmoy Das
2020-06-24 18:26 ` [PATCH 2/8] drm/radeon: don't use ttm bo->offset Nirmoy Das
2020-06-24 18:26 ` [PATCH 3/8] drm/vmwgfx: " Nirmoy Das
2020-06-24 18:26 ` [PATCH 4/8] drm/nouveau: don't use ttm bo->offset v3 Nirmoy Das
2020-06-24 18:26 ` [PATCH 5/8] drm/qxl: don't use ttm bo->offset Nirmoy Das
2020-06-24 18:26 ` Nirmoy Das [this message]
2020-09-17 10:51 ` [PATCH 6/8] drm/vram-helper: don't use ttm bo->offset v4 Thomas Zimmermann
2020-09-17 11:12 ` Christian König
2020-09-17 12:29 ` Thomas Zimmermann
2020-09-17 12:32 ` Christian König
2020-09-17 14:57 ` Thomas Zimmermann
2020-09-21 14:26 ` Thomas Zimmermann
2020-09-17 12:58 ` Nirmoy
2020-09-17 13:18 ` Thomas Zimmermann
2020-06-24 18:26 ` [PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset v2 Nirmoy Das
2020-06-24 18:26 ` [PATCH 8/8] drm/ttm: do not keep GPU dependent addresses Nirmoy Das
2020-06-25 9:50 ` [RESEND] [PATCH v6 0/8] do not store GPU address in TTM Christian König
2020-06-25 9:57 ` Daniel Vetter
2020-06-25 15:44 ` Daniel Vetter
2020-06-25 15:52 ` Christian König
2020-06-25 16:02 ` Christian König
2020-06-26 13:04 ` Christian König
2020-06-26 13:12 ` Daniel Vetter
2020-06-26 13:12 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2020-04-01 18:42 [PATCH v5 " Nirmoy Das
2020-04-01 18:42 ` [PATCH 6/8] drm/vram-helper: don't use ttm bo->offset v4 Nirmoy Das
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=20200624182648.6976-7-nirmoy.das@amd.com \
--to=nirmoy.aiemd@gmail.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=brian.welty@intel.com \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kenny.ho@amd.com \
--cc=kraxel@redhat.com \
--cc=linux-graphics-maintainer@vmware.com \
--cc=nirmoy.das@amd.com \
--cc=sashal@kernel.org \
--cc=sean@poorly.run \
--cc=thellstrom@vmware.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.