Release 4.17 drivers/gpu/drm/nouveau/nouveau_sgdma.c
// SPDX-License-Identifier: GPL-2.0
#include <linux/pagemap.h>
#include <linux/slab.h>
#include "nouveau_drv.h"
#include "nouveau_mem.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 nouveau_mem *mem;
};
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 nouveau_mem *mem = nouveau_mem(reg);
int ret;
ret = nouveau_mem_host(reg, &nvbe->ttm);
if (ret)
return ret;
ret = nouveau_mem_map(mem, &mem->cli->vmm.vmm, &mem->vma[0]);
if (ret) {
nouveau_mem_fini(mem);
return ret;
}
nvbe->mem = mem;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 102 | 95.33% | 7 | 77.78% |
Jérôme Glisse | 5 | 4.67% | 2 | 22.22% |
Total | 107 | 100.00% | 9 | 100.00% |
static int
nv04_sgdma_unbind(struct ttm_tt *ttm)
{
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
nouveau_mem_fini(nvbe->mem);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 30 | 90.91% | 5 | 83.33% |
Jérôme Glisse | 3 | 9.09% | 1 | 16.67% |
Total | 33 | 100.00% | 6 | 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 nouveau_mem *mem = nouveau_mem(reg);
int ret;
ret = nouveau_mem_host(reg, &nvbe->ttm);
if (ret)
return ret;
nvbe->mem = mem;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 64 | 92.75% | 8 | 80.00% |
Jérôme Glisse | 5 | 7.25% | 2 | 20.00% |
Total | 69 | 100.00% | 10 | 100.00% |
static struct ttm_backend_func nv50_sgdma_backend = {
.bind = nv50_sgdma_bind,
.unbind = nv04_sgdma_unbind,
.destroy = nouveau_sgdma_destroy
};
struct ttm_tt *
nouveau_sgdma_create_ttm(struct ttm_buffer_object *bo, uint32_t page_flags)
{
struct nouveau_drm *drm = nouveau_bdev(bo->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, bo, page_flags))
/*
* 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 | 95 | 81.90% | 7 | 58.33% |
Jérôme Glisse | 11 | 9.48% | 1 | 8.33% |
Christian König | 5 | 4.31% | 1 | 8.33% |
Lucas Stach | 3 | 2.59% | 1 | 8.33% |
Jon Mason | 1 | 0.86% | 1 | 8.33% |
Alexandre Courbot | 1 | 0.86% | 1 | 8.33% |
Total | 116 | 100.00% | 12 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ben Skeggs | 392 | 88.69% | 16 | 69.57% |
Jérôme Glisse | 39 | 8.82% | 2 | 8.70% |
Christian König | 5 | 1.13% | 1 | 4.35% |
Lucas Stach | 3 | 0.68% | 1 | 4.35% |
Alexandre Courbot | 1 | 0.23% | 1 | 4.35% |
Greg Kroah-Hartman | 1 | 0.23% | 1 | 4.35% |
Jon Mason | 1 | 0.23% | 1 | 4.35% |
Total | 442 | 100.00% | 23 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.