diff mbox series

[6/8] drm/vram-helper: don't use ttm bo->offset

Message ID 20200217150427.49994-7-nirmoy.das@amd.com (mailing list archive)
State New, archived
Headers show
Series do not store GPU address in TTM | expand

Commit Message

Nirmoy Das Feb. 17, 2020, 3:04 p.m. UTC
Calculate GPU 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gerd Hoffmann Feb. 24, 2020, 8:01 a.m. UTC | #1
On Mon, Feb 17, 2020 at 04:04:25PM +0100, Nirmoy Das wrote:
> Calculate GPU offset within vram-helper without depending on
> bo->offset
> 
> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Nirmoy Feb. 24, 2020, 9:52 a.m. UTC | #2
Hi Gerd,

This is old one can you please review v3 
https://lists.freedesktop.org/archives/dri-devel/2020-February/255760.html


Regards,

Nirmoy

On 2/24/20 9:01 AM, Gerd Hoffmann wrote:
> On Mon, Feb 17, 2020 at 04:04:25PM +0100, Nirmoy Das wrote:
>> Calculate GPU offset within vram-helper without depending on
>> bo->offset
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c
index 92a11bb42365..e7ef4cd8116d 100644
--- a/drivers/gpu/drm/drm_gem_vram_helper.c
+++ b/drivers/gpu/drm/drm_gem_vram_helper.c
@@ -214,7 +214,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 gbo->bo.mem.start << PAGE_SHIFT;
 }
 EXPORT_SYMBOL(drm_gem_vram_offset);