msm

msm — msm support library

Functions

struct msm_device * igt_msm_dev_open ()
void igt_msm_dev_close ()
struct msm_bo * igt_msm_bo_new ()
void igt_msm_bo_free ()
void * igt_msm_bo_map ()
struct msm_pipe * igt_msm_pipe_open ()
void igt_msm_pipe_close ()
unsigned pm4_odd_parity_bit ()
uint32_t pm4_pkt0_hdr ()
uint32_t pm4_pkt3_hdr ()
uint32_t pm4_pkt4_hdr ()
uint32_t pm4_pkt7_hdr ()
#define U642VOID()
#define VOID2U64()

Types and Values

Includes

#include <igt_msm.h>

Description

This library provides various auxiliary helper functions for writing msm tests.

Functions

igt_msm_dev_open ()

struct msm_device *
igt_msm_dev_open (void);

Open the msm drm device.


igt_msm_dev_close ()

void
igt_msm_dev_close (struct msm_device *dev);

Close the msm drm device.

Parameters

dev

the device to close

 

igt_msm_bo_new ()

struct msm_bo *
igt_msm_bo_new (struct msm_device *dev,
                size_t size,
                uint32_t flags);

Allocate a buffer object of the requested size.

Parameters

dev

the device to allocate the BO from

 

size

the requested BO size in bytes

 

flags

bitmask of MSM_BO_x

 

igt_msm_bo_free ()

void
igt_msm_bo_free (struct msm_bo *bo);

Free a buffer object

Parameters

bo

the BO to free

 

igt_msm_bo_map ()

void *
igt_msm_bo_map (struct msm_bo *bo);

Returns a pointer to mmap'd buffer.

Parameters

bo

the BO to map

 

igt_msm_pipe_open ()

struct msm_pipe *
igt_msm_pipe_open (struct msm_device *dev,
                   uint32_t prio);

Allocate a pipe/submitqueue against which cmdstream may be submitted.

Parameters

dev

the device to create a submitqueue/pipe against

 

prio

the requested priority, from 0 (highest) to MSM_PARAM_PRIORITIES-1 (lowest)

 

igt_msm_pipe_close ()

void
igt_msm_pipe_close (struct msm_pipe *pipe);

Close a pipe

Parameters

pipe

the pipe to close

 

pm4_odd_parity_bit ()

unsigned
pm4_odd_parity_bit (unsigned  val);

pm4_pkt0_hdr ()

uint32_t
pm4_pkt0_hdr (uint16_t regindx,
              uint16_t cnt);

pm4_pkt3_hdr ()

uint32_t
pm4_pkt3_hdr (uint8_t opcode,
              uint16_t cnt);

pm4_pkt4_hdr ()

uint32_t
pm4_pkt4_hdr (uint16_t regindx,
              uint16_t cnt);

pm4_pkt7_hdr ()

uint32_t
pm4_pkt7_hdr (uint8_t opcode,
              uint16_t cnt);

U642VOID()

#define U642VOID(x) ((void *)(uintptr_t)(x))

VOID2U64()

#define VOID2U64(x) ((uint64_t)(uintptr_t)(x))

Types and Values

struct msm_device

struct msm_device {
	int fd;
	unsigned gen;
};

Helper container for device and device related parameters used by tests.

Members

int fd;

the drm device file descriptor

 

struct msm_bo

struct msm_bo {
	struct msm_device *dev;
	int handle;
	uint32_t size;
	void *map;
};

Helper wrapper for a GEM buffer object.

Members

struct msm_device *dev;

the device the BO is allocated from

 

int handle;

the BO's GEM handle

 

uint32_t size;

the BO's size

 

void *map;

the BO's memory mapping (if mapped)

 

struct msm_pipe

struct msm_pipe {
	struct msm_device *dev;
	uint32_t pipe;
	uint32_t submitqueue_id;
};

Helper wrapper for a submitqueue for cmdstream submission.

Members

struct msm_device *dev;

the device the pipe is allocated from

 

uint32_t pipe;

the pipe id

 

uint32_t submitqueue_id;

the submitqueue id

 

enum adreno_pm4_packet_type

Members

CP_TYPE0_PKT

   

CP_TYPE1_PKT

   

CP_TYPE2_PKT

   

CP_TYPE3_PKT

   

CP_TYPE4_PKT

   

CP_TYPE7_PKT

   

enum adreno_pm4_type3_packets

Members

CP_NOP