Merge branch 'stable/ttm.pci-api.v5' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into drm-next
* 'stable/ttm.pci-api.v5' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: ttm: Include the 'struct dev' when using the DMA API. nouveau/ttm/PCIe: Use dma_addr if TTM has set it. radeon/ttm/PCIe: Use dma_addr if TTM has set it. ttm: Expand (*populate) to support an array of DMA addresses. ttm: Utilize the DMA API for pages that have TTM_PAGE_FLAG_DMA32 set. ttm: Introduce a placeholder for DMA (bus) addresses.
This commit is contained in:
@@ -50,13 +50,15 @@ struct ttm_backend_func {
|
||||
* @pages: Array of pointers to ttm pages.
|
||||
* @dummy_read_page: Page to be used instead of NULL pages in the
|
||||
* array @pages.
|
||||
* @dma_addrs: Array of DMA (bus) address of the ttm pages.
|
||||
*
|
||||
* Populate the backend with ttm pages. Depending on the backend,
|
||||
* it may or may not copy the @pages array.
|
||||
*/
|
||||
int (*populate) (struct ttm_backend *backend,
|
||||
unsigned long num_pages, struct page **pages,
|
||||
struct page *dummy_read_page);
|
||||
struct page *dummy_read_page,
|
||||
dma_addr_t *dma_addrs);
|
||||
/**
|
||||
* struct ttm_backend_func member clear
|
||||
*
|
||||
@@ -149,6 +151,7 @@ enum ttm_caching_state {
|
||||
* @swap_storage: Pointer to shmem struct file for swap storage.
|
||||
* @caching_state: The current caching state of the pages.
|
||||
* @state: The current binding state of the pages.
|
||||
* @dma_address: The DMA (bus) addresses of the pages (if TTM_PAGE_FLAG_DMA32)
|
||||
*
|
||||
* This is a structure holding the pages, caching- and aperture binding
|
||||
* status for a buffer object that isn't backed by fixed (VRAM / AGP)
|
||||
@@ -173,6 +176,7 @@ struct ttm_tt {
|
||||
tt_unbound,
|
||||
tt_unpopulated,
|
||||
} state;
|
||||
dma_addr_t *dma_address;
|
||||
};
|
||||
|
||||
#define TTM_MEMTYPE_FLAG_FIXED (1 << 0) /* Fixed (on-card) PCI memory */
|
||||
@@ -547,6 +551,7 @@ struct ttm_bo_device {
|
||||
struct list_head device_list;
|
||||
struct ttm_bo_global *glob;
|
||||
struct ttm_bo_driver *driver;
|
||||
struct device *dev;
|
||||
rwlock_t vm_lock;
|
||||
struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
|
||||
spinlock_t fence_lock;
|
||||
|
@@ -36,11 +36,15 @@
|
||||
* @flags: ttm flags for page allocation.
|
||||
* @cstate: ttm caching state for the page.
|
||||
* @count: number of pages to allocate.
|
||||
* @dma_address: The DMA (bus) address of pages (if TTM_PAGE_FLAG_DMA32 set).
|
||||
* @dev: struct device for appropiate DMA accounting.
|
||||
*/
|
||||
int ttm_get_pages(struct list_head *pages,
|
||||
int flags,
|
||||
enum ttm_caching_state cstate,
|
||||
unsigned count);
|
||||
unsigned count,
|
||||
dma_addr_t *dma_address,
|
||||
struct device *dev);
|
||||
/**
|
||||
* Put linked list of pages to pool.
|
||||
*
|
||||
@@ -49,11 +53,15 @@ int ttm_get_pages(struct list_head *pages,
|
||||
* count.
|
||||
* @flags: ttm flags for page allocation.
|
||||
* @cstate: ttm caching state.
|
||||
* @dma_address: The DMA (bus) address of pages (if TTM_PAGE_FLAG_DMA32 set).
|
||||
* @dev: struct device for appropiate DMA accounting.
|
||||
*/
|
||||
void ttm_put_pages(struct list_head *pages,
|
||||
unsigned page_count,
|
||||
int flags,
|
||||
enum ttm_caching_state cstate);
|
||||
enum ttm_caching_state cstate,
|
||||
dma_addr_t *dma_address,
|
||||
struct device *dev);
|
||||
/**
|
||||
* Initialize pool allocator.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user