From 1cd89f46931b8f5c19b3feb14a5c155bd5094e14 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 16 Sep 2024 15:33:20 +0200 Subject: [PATCH] gpu: host1x: Set up device DMA parameters In order to store device DMA parameters, the DMA framework depends on the device's dma_parms field to point at a valid memory location. Add backing storage for this in struct host1x_memory_context and point to it. Reported-by: Jonathan Hunter Reviewed-by: Christoph Hellwig Tested-by: Jon Hunter Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20240916133320.368620-1-thierry.reding@gmail.com (cherry picked from commit b4ad4ef374d66cc8df3188bb1ddb65bce5fc9e50) Bug 4876974 Signed-off-by: Jon Hunter Change-Id: I0a7f9c9f49a5e4580193d5814ff4a6a15f8014c8 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3268196 Reviewed-by: mobile promotions Tested-by: mobile promotions Reviewed-by: Mikko Perttunen GVS: buildbot_gerritrpt --- drivers/gpu/host1x/context.c | 1 + drivers/gpu/host1x/context.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/gpu/host1x/context.c b/drivers/gpu/host1x/context.c index b5afe70e..331bcc0f 100644 --- a/drivers/gpu/host1x/context.c +++ b/drivers/gpu/host1x/context.c @@ -63,6 +63,7 @@ int host1x_memory_context_list_init(struct host1x *host1x) ctx->dev.parent = host1x->dev; ctx->dev.release = host1x_memory_context_release; + ctx->dev.dma_parms = &ctx->dma_parms; dma_set_max_seg_size(&ctx->dev, UINT_MAX); err = device_add(&ctx->dev); diff --git a/drivers/gpu/host1x/context.h b/drivers/gpu/host1x/context.h index e2114cb4..618cb052 100644 --- a/drivers/gpu/host1x/context.h +++ b/drivers/gpu/host1x/context.h @@ -28,6 +28,7 @@ struct host1x_hw_memory_context { refcount_t ref; struct pid *owner; + struct device_dma_parameters dma_parms; struct device dev; u64 dma_mask; u32 stream_id;