mirror of
https://github.com/torvalds/linux.git
synced 2026-10-16 04:39:02 +02:00
Add support for allocating buffers from reserved carveout memory when IOMMU is not available. This is useful during debugging or bring-up. In this configuration, the device uses physical addresses and does not support scatter-gather lists, requiring physically contiguous buffers. Implement carveout-backed allocation and integrate it into buffer management to support operation in physical address mode. Signed-off-by: Max Zhen <max.zhen@amd.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://patch.msgid.link/20260427170949.2666601-1-lizhi.hou@amd.com
19 lines
606 B
C
19 lines
606 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2026, Advanced Micro Devices, Inc.
|
|
*/
|
|
#ifndef _AMDXDNA_CBUF_H_
|
|
#define _AMDXDNA_CBUF_H_
|
|
|
|
#include "amdxdna_pci_drv.h"
|
|
#include <drm/drm_device.h>
|
|
#include <linux/dma-buf.h>
|
|
|
|
bool amdxdna_use_carveout(struct amdxdna_dev *xdna);
|
|
int amdxdna_carveout_init(struct amdxdna_dev *xdna, u64 carveout_addr, u64 carveout_size);
|
|
void amdxdna_carveout_fini(struct amdxdna_dev *xdna);
|
|
void amdxdna_get_carveout_conf(struct amdxdna_dev *xdna, u64 *addr, u64 *size);
|
|
struct dma_buf *amdxdna_get_cbuf(struct drm_device *dev, size_t size, u64 alignment);
|
|
|
|
#endif
|