Release 4.11 drivers/gpu/drm/nouveau/nouveau_sgdma.c
#include <linux/pagemap.h>
#include <linux/slab.h>
#include "nouveau_drv.h"
#include "nouveau_ttm.h"
struct nouveau_sgdma_be {
/* this has to be the first field so populate/unpopulated in
* nouve_bo.c works properly, otherwise have to move them here
*/
struct ttm_dma_tt ttm;
struct nvkm_mem *node;
};
static void
nouveau_sgdma_destroy(struct ttm_tt *ttm)
{
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
if (ttm) {
ttm_dma_tt_fini(&nvbe->ttm);
kfree(nvbe);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 30 | 71.43% | 2 | 50.00% |
Jérôme Glisse | 12 | 28.57% | 2 | 50.00% |
Total | 42 | 100.00% | 4 | 100.00% |
static int
nv04_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *reg)
{
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
struct nvkm_mem *node = reg->mm_node;
if (ttm->sg) {
node->sg = ttm->sg;
node->pages = NULL;
} else {
node->sg = NULL;
node->pages = nvbe->ttm.dma_address;
}
node->size = (reg->num_pages << PAGE_SHIFT) >> 12;
nvkm_vm_map(&node->vma[0], node);
nvbe->node = node;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 107 | 93.86% | 7 | 77.78% |
Jérôme Glisse | 7 | 6.14% | 2 | 22.22% |
Total | 114 | 100.00% | 9 | 100.00% |
static int
nv04_sgdma_unbind(struct ttm_tt *ttm)
{
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
nvkm_vm_unmap(&nvbe->node->vma[0]);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 36 | 92.31% | 6 | 85.71% |
Jérôme Glisse | 3 | 7.69% | 1 | 14.29% |
Total | 39 | 100.00% | 7 | 100.00% |
static struct ttm_backend_func nv04_sgdma_backend = {
.bind = nv04_sgdma_bind,
.unbind = nv04_sgdma_unbind,
.destroy = nouveau_sgdma_destroy
};
static int
nv50_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *reg)
{
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
struct nvkm_mem *node = reg->mm_node;
/* noop: bound in move_notify() */
if (ttm->sg) {
node->sg = ttm->sg;
node->pages = NULL;
} else {
node->sg = NULL;
node->pages = nvbe->ttm.dma_address;
}
node->size = (reg->num_pages << PAGE_SHIFT) >> 12;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 71 | 73.96% | 8 | 72.73% |
Dave Airlie | 17 | 17.71% | 1 | 9.09% |
Jérôme Glisse | 8 | 8.33% | 2 | 18.18% |
Total | 96 | 100.00% | 11 | 100.00% |
static int
nv50_sgdma_unbind(struct ttm_tt *ttm)
{
/* noop: unbound in move_notify() */
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 13 | 86.67% | 3 | 75.00% |
Jérôme Glisse | 2 | 13.33% | 1 | 25.00% |
Total | 15 | 100.00% | 4 | 100.00% |
static struct ttm_backend_func nv50_sgdma_backend = {
.bind = nv50_sgdma_bind,
.unbind = nv50_sgdma_unbind,
.destroy = nouveau_sgdma_destroy
};
struct ttm_tt *
nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
unsigned long size, uint32_t page_flags,
struct page *dummy_read_page)
{
struct nouveau_drm *drm = nouveau_bdev(bdev);
struct nouveau_sgdma_be *nvbe;
nvbe = kzalloc(sizeof(*nvbe), GFP_KERNEL);
if (!nvbe)
return NULL;
if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA)
nvbe->ttm.ttm.func = &nv04_sgdma_backend;
else
nvbe->ttm.ttm.func = &nv50_sgdma_backend;
if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page))
/*
* A failing ttm_dma_tt_init() will call ttm_tt_destroy()
* and thus our nouveau_sgdma_destroy() hook, so we don't need
* to free nvbe here.
*/
return NULL;
return &nvbe->ttm.ttm;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 100 | 78.74% | 7 | 63.64% |
Jérôme Glisse | 22 | 17.32% | 1 | 9.09% |
Lucas Stach | 3 | 2.36% | 1 | 9.09% |
Alexandre Courbot | 1 | 0.79% | 1 | 9.09% |
Jon Mason | 1 | 0.79% | 1 | 9.09% |
Total | 127 | 100.00% | 11 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 425 | 84.33% | 15 | 71.43% |
Jérôme Glisse | 57 | 11.31% | 2 | 9.52% |
Dave Airlie | 17 | 3.37% | 1 | 4.76% |
Lucas Stach | 3 | 0.60% | 1 | 4.76% |
Alexandre Courbot | 1 | 0.20% | 1 | 4.76% |
Jon Mason | 1 | 0.20% | 1 | 4.76% |
Total | 504 | 100.00% | 21 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.