Back to index

libdrm  2.4.37
Classes | Defines | Functions
radeon_surface.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  radeon_surface_level
struct  radeon_surface

Defines

#define RADEON_SURF_MAX_LEVEL   32
#define RADEON_SURF_TYPE_MASK   0xFF
#define RADEON_SURF_TYPE_SHIFT   0
#define RADEON_SURF_TYPE_1D   0
#define RADEON_SURF_TYPE_2D   1
#define RADEON_SURF_TYPE_3D   2
#define RADEON_SURF_TYPE_CUBEMAP   3
#define RADEON_SURF_TYPE_1D_ARRAY   4
#define RADEON_SURF_TYPE_2D_ARRAY   5
#define RADEON_SURF_MODE_MASK   0xFF
#define RADEON_SURF_MODE_SHIFT   8
#define RADEON_SURF_MODE_LINEAR   0
#define RADEON_SURF_MODE_LINEAR_ALIGNED   1
#define RADEON_SURF_MODE_1D   2
#define RADEON_SURF_MODE_2D   3
#define RADEON_SURF_SCANOUT   (1 << 16)
#define RADEON_SURF_ZBUFFER   (1 << 17)
#define RADEON_SURF_SBUFFER   (1 << 18)
#define RADEON_SURF_GET(v, field)   (((v) >> RADEON_SURF_ ## field ## _SHIFT) & RADEON_SURF_ ## field ## _MASK)
#define RADEON_SURF_SET(v, field)   (((v) & RADEON_SURF_ ## field ## _MASK) << RADEON_SURF_ ## field ## _SHIFT)
#define RADEON_SURF_CLR(v, field)   ((v) & ~(RADEON_SURF_ ## field ## _MASK << RADEON_SURF_ ## field ## _SHIFT))

Functions

struct radeon_surface_managerradeon_surface_manager_new (int fd)
void radeon_surface_manager_free (struct radeon_surface_manager *surf_man)
int radeon_surface_init (struct radeon_surface_manager *surf_man, struct radeon_surface *surf)
int radeon_surface_best (struct radeon_surface_manager *surf_man, struct radeon_surface *surf)

Class Documentation

struct radeon_surface_level

Definition at line 65 of file radeon_surface.h.

Class Members
uint32_t mode
uint32_t nblk_x
uint32_t nblk_y
uint32_t nblk_z
uint32_t npix_x
uint32_t npix_y
uint32_t npix_z
uint64_t offset
uint32_t pitch_bytes
uint64_t slice_size
struct radeon_surface

Definition at line 78 of file radeon_surface.h.

Class Members
uint32_t array_size
uint32_t bankh
uint32_t bankw
uint32_t blk_d
uint32_t blk_h
uint32_t blk_w
uint64_t bo_alignment
uint64_t bo_size
uint32_t bpe
uint32_t flags
uint32_t last_level
uint32_t mtilea
uint32_t npix_x
uint32_t npix_y
uint32_t npix_z
uint32_t nsamples
uint64_t stencil_offset
uint32_t stencil_tile_split
uint32_t tile_split

Define Documentation

#define RADEON_SURF_CLR (   v,
  field 
)    ((v) & ~(RADEON_SURF_ ## field ## _MASK << RADEON_SURF_ ## field ## _SHIFT))

Definition at line 60 of file radeon_surface.h.

#define RADEON_SURF_GET (   v,
  field 
)    (((v) >> RADEON_SURF_ ## field ## _SHIFT) & RADEON_SURF_ ## field ## _MASK)

Definition at line 58 of file radeon_surface.h.

#define RADEON_SURF_MAX_LEVEL   32

Definition at line 38 of file radeon_surface.h.

#define RADEON_SURF_MODE_1D   2

Definition at line 52 of file radeon_surface.h.

#define RADEON_SURF_MODE_2D   3

Definition at line 53 of file radeon_surface.h.

#define RADEON_SURF_MODE_LINEAR   0

Definition at line 50 of file radeon_surface.h.

Definition at line 51 of file radeon_surface.h.

#define RADEON_SURF_MODE_MASK   0xFF

Definition at line 48 of file radeon_surface.h.

#define RADEON_SURF_MODE_SHIFT   8

Definition at line 49 of file radeon_surface.h.

#define RADEON_SURF_SBUFFER   (1 << 18)

Definition at line 56 of file radeon_surface.h.

#define RADEON_SURF_SCANOUT   (1 << 16)

Definition at line 54 of file radeon_surface.h.

#define RADEON_SURF_SET (   v,
  field 
)    (((v) & RADEON_SURF_ ## field ## _MASK) << RADEON_SURF_ ## field ## _SHIFT)

Definition at line 59 of file radeon_surface.h.

#define RADEON_SURF_TYPE_1D   0

Definition at line 42 of file radeon_surface.h.

#define RADEON_SURF_TYPE_1D_ARRAY   4

Definition at line 46 of file radeon_surface.h.

#define RADEON_SURF_TYPE_2D   1

Definition at line 43 of file radeon_surface.h.

#define RADEON_SURF_TYPE_2D_ARRAY   5

Definition at line 47 of file radeon_surface.h.

#define RADEON_SURF_TYPE_3D   2

Definition at line 44 of file radeon_surface.h.

#define RADEON_SURF_TYPE_CUBEMAP   3

Definition at line 45 of file radeon_surface.h.

#define RADEON_SURF_TYPE_MASK   0xFF

Definition at line 40 of file radeon_surface.h.

#define RADEON_SURF_TYPE_SHIFT   0

Definition at line 41 of file radeon_surface.h.

#define RADEON_SURF_ZBUFFER   (1 << 17)

Definition at line 55 of file radeon_surface.h.


Function Documentation

int radeon_surface_best ( struct radeon_surface_manager surf_man,
struct radeon_surface surf 
)

Definition at line 1050 of file radeon_surface.c.

{
    unsigned mode, type;
    int r;

    type = RADEON_SURF_GET(surf->flags, TYPE);
    mode = RADEON_SURF_GET(surf->flags, MODE);

    r = radeon_surface_sanity(surf_man, surf, type, mode);
    if (r) {
        return r;
    }
    return surf_man->surface_best(surf_man, surf);
}

Here is the call graph for this function:

int radeon_surface_init ( struct radeon_surface_manager surf_man,
struct radeon_surface surf 
)

Definition at line 1034 of file radeon_surface.c.

{
    unsigned mode, type;
    int r;

    type = RADEON_SURF_GET(surf->flags, TYPE);
    mode = RADEON_SURF_GET(surf->flags, MODE);

    r = radeon_surface_sanity(surf_man, surf, type, mode);
    if (r) {
        return r;
    }
    return surf_man->surface_init(surf_man, surf);
}

Here is the call graph for this function:

Definition at line 962 of file radeon_surface.c.

{
    free(surf_man);
}

Definition at line 926 of file radeon_surface.c.

{
    struct radeon_surface_manager *surf_man;

    surf_man = calloc(1, sizeof(struct radeon_surface_manager));
    if (surf_man == NULL) {
        return NULL;
    }
    surf_man->fd = fd;
    if (radeon_get_value(fd, RADEON_INFO_DEVICE_ID, &surf_man->device_id)) {
        goto out_err;
    }
    if (radeon_get_family(surf_man)) {
        goto out_err;
    }

    if (surf_man->family <= CHIP_RV740) {
        if (r6_init_hw_info(surf_man)) {
            goto out_err;
        }
        surf_man->surface_init = &r6_surface_init;
        surf_man->surface_best = &r6_surface_best;
    } else {
        if (eg_init_hw_info(surf_man)) {
            goto out_err;
        }
        surf_man->surface_init = &eg_surface_init;
        surf_man->surface_best = &eg_surface_best;
    }

    return surf_man;
out_err:
    free(surf_man);
    return NULL;
}

Here is the call graph for this function: