Skip to contentSkip to conversation

drm/tegra: Use correct property for BO size

PATCH In review Mikko Perttunen 3 participants 3 messages Sep 16, 2021

Subsystems (3)
lore
Share & tools
lore

Mikko Perttunen

author maintainer
#0 lore raw

PATCH 1/1 drm/tegra: Use correct property for BO size

The size property is not always populated, while the gem.size property is.

Fixes d7c591bc1a3f ("drm/tegra: Implement new UAPI")
---
 drivers/gpu/drm/tegra/uapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/uapi.c +1 -1
index dc16a24f4dbe..690a339c52ec 100644
@@ -222,7 +222,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f
 		mapping->iova = sg_dma_address(mapping->sgt->sgl);
 	}
 
-	mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->size;
+	mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->gem.size;
 
 	err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX),
 		       GFP_KERNEL);
Signature · 1 line
2.32.0
#1 lore raw

16.09.2021 17:13, Mikko Perttunen пишет:

Quoted 15 lines

The size property is not always populated, while the gem.size property is.

Fixes d7c591bc1a3f ("drm/tegra: Implement new UAPI")
---
 drivers/gpu/drm/tegra/uapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/uapi.c +0 -0
index dc16a24f4dbe..690a339c52ec 100644

drivers/gpu/drm/tegra/uapi.c int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f · line 228

Quoted 8 lines
drivers/gpu/drm/tegra/uapi.c +1 -1
@@ -222,7 +222,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f
 		mapping->iova = sg_dma_address(mapping->sgt->sgl);
 	}
 
-	mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->size;
+	mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->gem.size;
 
 	err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX),
 		       GFP_KERNEL);

Did something bad happened to [1]? Thierry fetched patches, but didn't make the fixes-PR yet, AFAICS.

[1]
https://patchwork.ozlabs.org/project/linux-tegra/patch/[email protected]/

#2 lore raw
Quoted 21 lines · Dmitry Osipenko

16.09.2021 17:13, Mikko Perttunen пишет:

Quoted 20 lines

The size property is not always populated, while the gem.size property is.

Fixes d7c591bc1a3f ("drm/tegra: Implement new UAPI")
---
  drivers/gpu/drm/tegra/uapi.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tegra/uapi.c +1 -1
index dc16a24f4dbe..690a339c52ec 100644
@@ -222,7 +222,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f
  		mapping->iova = sg_dma_address(mapping->sgt->sgl);
  	}
 
-	mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->size;
+	mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->gem.size;
 
Quoted 6 lines

drivers/gpu/drm/tegra/uapi.c int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f · line 228

Quoted 3 lines
drivers/gpu/drm/tegra/uapi.c +0 -0
  	err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX),
  		       GFP_KERNEL);

Did something bad happened to [1]? Thierry fetched patches, but didn't make the fixes-PR yet, AFAICS.

Oh, didn't remember you had already fixed it. Let's disregard my patch then.

Thanks,
Mikko

Quoted 4 lines

[1]
https://patchwork.ozlabs.org/project/linux-tegra/patch/[email protected]/