From: Nirmoy <nirmodas@amd.com>
To: Daniel Vetter <daniel@ffwll.ch>, Nirmoy Das <nirmoy.aiemd@gmail.com>
Cc: thellstrom@vmware.com, amd-gfx@lists.freedesktop.org,
airlied@linux.ie, kenny.ho@amd.com, brian.welty@intel.com,
dri-devel@lists.freedesktop.org, nirmoy.das@amd.com,
linux-graphics-maintainer@vmware.com, kraxel@redhat.com,
alexander.deucher@amd.com, sean@poorly.run,
christian.koenig@amd.com, bskeggs@redhat.com
Subject: Re: [PATCH 6/8] drm/vram-helper: don't use ttm bo->offset v2
Date: Thu, 20 Feb 2020 19:29:35 +0100 [thread overview]
Message-ID: <fae55ba8-5bfb-2f27-b708-f946141df039@amd.com> (raw)
In-Reply-To: <20200220180955.GT2363188@phenom.ffwll.local>
On 2/20/20 7:09 PM, Daniel Vetter wrote:
> On Wed, Feb 19, 2020 at 02:53:20PM +0100, Nirmoy Das wrote:
>> Calculate GEM VRAM bo's offset within vram-helper without depending on
>> bo->offset
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>> ---
>> drivers/gpu/drm/drm_gem_vram_helper.c | 17 ++++++++++++++++-
>> 1 file changed, 16 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
>> index 92a11bb42365..3edf5f241c15 100644
>> --- a/drivers/gpu/drm/drm_gem_vram_helper.c
>> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c
>> @@ -198,6 +198,21 @@ u64 drm_gem_vram_mmap_offset(struct drm_gem_vram_object *gbo)
>> }
>> EXPORT_SYMBOL(drm_gem_vram_mmap_offset);
>>
>> +/**
>> + * drm_gem_vram_pg_offset() - Returns a GEM VRAM object's page offset
>> + * @gbo: the GEM VRAM object
>> + *
>> + * Returns:
>> + * The buffer object's page offset, or
>> + * 0 with a warning when memory manager node of the buffer object is NULL
>> + * */
> We generally don't add full formal kerneldoc for internal functions like
> this. It won't get pulled into generated docs and generally just bitrots.
> Just informal comment if it's really tricky, but the function name here is
> clear enough I think.
Thanks for you review Daniel, I will remove that comment.
Nirmoy
> So with the comment removed:
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
>> +static s64 drm_gem_vram_pg_offset(struct drm_gem_vram_object *gbo)
>> +{
>> + 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
>> @@ -214,7 +229,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.25.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-02-20 18:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-19 13:53 [PATCH v3 0/8] do not store GPU address in TTM Nirmoy Das
2020-02-19 13:53 ` [PATCH 1/8] drm/amdgpu: move ttm bo->offset to amdgpu_bo Nirmoy Das
2020-02-21 1:14 ` Luben Tuikov
2020-02-19 13:53 ` [PATCH 2/8] drm/radeon: don't use ttm bo->offset Nirmoy Das
2020-02-21 1:19 ` Luben Tuikov
2020-02-21 13:27 ` Nirmoy
2020-02-19 13:53 ` [PATCH 3/8] drm/vmwgfx: " Nirmoy Das
2020-02-21 8:45 ` Thomas Hellström (VMware)
2020-02-19 13:53 ` [PATCH 4/8] drm/nouveau: don't use ttm bo->offset v3 Nirmoy Das
2020-02-21 1:22 ` Luben Tuikov
2020-02-19 13:53 ` [PATCH 5/8] drm/qxl: don't use ttm bo->offset Nirmoy Das
2020-02-19 13:53 ` [PATCH 6/8] drm/vram-helper: don't use ttm bo->offset v2 Nirmoy Das
2020-02-20 18:09 ` Daniel Vetter
2020-02-20 18:29 ` Nirmoy [this message]
2020-02-21 11:02 ` Thomas Zimmermann
2020-02-19 13:53 ` [PATCH 7/8] drm/bochs: use drm_gem_vram_offset to get bo offset v2 Nirmoy Das
2020-02-20 18:11 ` Daniel Vetter
2020-02-19 13:53 ` [PATCH 8/8] drm/ttm: do not keep GPU dependent addresses Nirmoy Das
2020-02-21 8:48 ` [PATCH v3 0/8] do not store GPU address in TTM Thomas Hellström (VMware)
2020-02-21 11:32 ` Nirmoy
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=fae55ba8-5bfb-2f27-b708-f946141df039@amd.com \
--to=nirmodas@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=brian.welty@intel.com \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=daniel@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.aiemd@gmail.com \
--cc=nirmoy.das@amd.com \
--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 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).