mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: Make buf alignment generic
Drastically simplify and move the aligment computation for buffers getting mapped into the SGT code. An SGT is all that is needed for computing the alignment. However, this did require that a new SGT op was added: nvgpu_sgt_iommuable() This function returns true if the passed SGT is IOMMU'able and must be implemented by an SGT implementation that has IOMMU'able buffers. If this function is left as NULL then it is assumed that the buffer is not IOMMU'able. Also cleanup the parameter ordering convention among all nvgpu_sgt functions. Previously there was a mishmash of different parameter orderings. This patch now standardizes on the gk20a first approach seen everywhere else in the driver. JIRA NVGPU-30 JIRA NVGPU-246 JIRA NVGPU-71 Change-Id: Ic4ab7b752847cf795c7cfafed5a07818217bba86 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1583985 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
6911b4d48c
commit
ee4970a33f
@@ -529,6 +529,12 @@ static u64 nvgpu_mem_linux_sgl_gpu_addr(struct gk20a *g, void *sgl,
|
||||
sg_dma_address((struct scatterlist *)sgl));
|
||||
}
|
||||
|
||||
static bool nvgpu_mem_linux_sgt_iommuable(struct gk20a *g,
|
||||
struct nvgpu_sgt *sgt)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static void nvgpu_mem_linux_sgl_free(struct gk20a *g, struct nvgpu_sgt *sgt)
|
||||
{
|
||||
/*
|
||||
@@ -539,12 +545,13 @@ static void nvgpu_mem_linux_sgl_free(struct gk20a *g, struct nvgpu_sgt *sgt)
|
||||
}
|
||||
|
||||
static const struct nvgpu_sgt_ops nvgpu_linux_sgt_ops = {
|
||||
.sgl_next = nvgpu_mem_linux_sgl_next,
|
||||
.sgl_phys = nvgpu_mem_linux_sgl_phys,
|
||||
.sgl_dma = nvgpu_mem_linux_sgl_dma,
|
||||
.sgl_length = nvgpu_mem_linux_sgl_length,
|
||||
.sgl_gpu_addr = nvgpu_mem_linux_sgl_gpu_addr,
|
||||
.sgt_free = nvgpu_mem_linux_sgl_free,
|
||||
.sgl_next = nvgpu_mem_linux_sgl_next,
|
||||
.sgl_phys = nvgpu_mem_linux_sgl_phys,
|
||||
.sgl_dma = nvgpu_mem_linux_sgl_dma,
|
||||
.sgl_length = nvgpu_mem_linux_sgl_length,
|
||||
.sgl_gpu_addr = nvgpu_mem_linux_sgl_gpu_addr,
|
||||
.sgt_iommuable = nvgpu_mem_linux_sgt_iommuable,
|
||||
.sgt_free = nvgpu_mem_linux_sgl_free,
|
||||
};
|
||||
|
||||
static struct nvgpu_sgt *__nvgpu_mem_get_sgl_from_vidmem(
|
||||
|
||||
Reference in New Issue
Block a user