Skip to content

Commit

Permalink
gpu: host1x: Set up device DMA parameters
Browse files Browse the repository at this point in the history
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 <jonathanh@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916133320.368620-1-thierry.reding@gmail.com
(cherry picked from commit b4ad4ef)
Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
thierryreding committed Oct 15, 2024
1 parent c8347f9 commit eb0c062
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/host1x/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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);
Expand Down
1 change: 1 addition & 0 deletions include/linux/host1x.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ struct host1x_memory_context {
refcount_t ref;
struct pid *owner;

struct device_dma_parameters dma_parms;
struct device dev;
u64 dma_mask;
u32 stream_id;
Expand Down

0 comments on commit eb0c062

Please sign in to comment.