Back to index

libdrm  2.4.37
Functions
radeon_ttm.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "rbo.h"

Go to the source code of this file.

Functions

void ttm_starve_kernel_private_memory (int fd)
int radeon_open_fd (void)
int main (void)

Function Documentation

int main ( void  )

Definition at line 61 of file radeon_ttm.c.

{
    int radeonfd;

    radeonfd = radeon_open_fd();
    if (radeonfd < 0) {
        fprintf(stderr, "failed to open radeon fd\n");
        return -1;
    }

    ttm_starve_kernel_private_memory(radeonfd);

    close(radeonfd);
    return 0;
}

Here is the call graph for this function:

int radeon_open_fd ( void  )

Definition at line 56 of file radeon_ttm.c.

{
    return drmOpen("radeon", NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 33 of file radeon_ttm.c.

{
    struct list_head list;
    struct rbo *bo, *tmp;
    unsigned nbo = 0;

    printf("\n[%s]\n", __func__);
    list_inithead(&list);
    while (1) {
        bo = rbo(fd, 0, 4096, 0, NULL);
        if (bo == NULL) {
            printf("failing after %d bo\n", nbo);
            break;
        }
        nbo++;
        list_add(&bo->list, &list);
    }
    LIST_FOR_EACH_ENTRY_SAFE(bo, tmp, &list, list) {
        list_del(&bo->list);
        rbo_decref(bo);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function: