Top |
#define | i915_for_each_gt |
enum | i915_attr_id |
igt_sysfs_rw_attr_t | |
enum | xe_sysfs_driver_action |
This library provides helpers to access sysfs features. Right now it only
provides basic support for like igt_sysfs_open()
.
char * igt_sysfs_path (int device
,char *path
,int pathlen
);
This finds the sysfs directory corresponding to device
.
int
igt_sysfs_open (int device
);
This opens the sysfs directory corresponding to device for use
with igt_sysfs_set()
and igt_sysfs_get()
.
char * igt_sysfs_gt_path (int device
,int gt
,char *path
,int pathlen
);
This finds the sysfs directory corresponding to device
and gt
. If the gt
specific directory is not available and gt is 0, path is filled with sysfs
base directory.
int igt_sysfs_gt_open (int device
,int gt
);
This opens the sysfs gt directory corresponding to device and gt for use
with igt_sysfs_set()
and igt_sysfs_get()
.
int
igt_sysfs_get_num_gt (int device
);
Reads number of GT sysfs entries. Asserts for atleast one GT entry. (see igt_sysfs_gt_path).
bool igt_sysfs_has_attr (int dir
,const char *attr
);
This checks if specified attr exists in device sysfs directory.
const char * igt_sysfs_dir_id_to_name (int dir
,enum i915_attr_id id
);
Returns attribute name corresponding to attribute id in either the per-gt or legacy per-device sysfs
const char * igt_sysfs_path_id_to_name (const char *path
,enum i915_attr_id id
);
Returns attribute name corresponding to attribute id in either the per-gt or legacy per-device sysfs
int igt_sysfs_read (int dir
,const char *attr
,void *data
,int len
);
This reads len
bytes from the sysfs file to data
int igt_sysfs_write (int dir
,const char *attr
,const void *data
,int len
);
This writes len
bytes from data
to the sysfs file. Contrary to
igt_sysfs_set()
, this does not automatically write a null char if len is 0.
It's caller responsibility to pass the right len according to the data being
written.
bool igt_sysfs_set (int dir
,const char *attr
,const char *value
);
This writes the value to the sysfs file.
char * igt_sysfs_get (int dir
,const char *attr
);
This reads the value from the sysfs file.
int igt_sysfs_scanf (int dir
,const char *attr
,const char *fmt
,...
);
scanf() wrapper for sysfs.
dir |
directory for the device from |
|
attr |
name of the sysfs node to open |
|
fmt |
scanf format string |
|
... |
Additional paramaters to store the scaned input values |
int igt_sysfs_vprintf (int dir
,const char *attr
,const char *fmt
,va_list ap
);
int igt_sysfs_printf (int dir
,const char *attr
,const char *fmt
,...
);
printf() wrapper for sysfs.
dir |
directory for the device from |
|
attr |
name of the sysfs node to open |
|
fmt |
printf format string |
|
... |
Additional paramaters to store the scaned input values |
uint32_t igt_sysfs_get_u32 (int dir
,const char *attr
);
Convenience wrapper to read a unsigned 32bit integer from a sysfs file. It asserts on failure.
void igt_sysfs_set_u32 (int dir
,const char *attr
,uint32_t value
);
Convenience wrapper to write a unsigned 32bit integer to a sysfs file. It asserts on failure.
uint64_t igt_sysfs_get_u64 (int dir
,const char *attr
);
Convenience wrapper to read a unsigned 64bit integer from a sysfs file. It asserts on failure.
void igt_sysfs_set_u64 (int dir
,const char *attr
,uint64_t value
);
Convenience wrapper to write a unsigned 64bit integer to a sysfs file. It asserts on failure.
bool igt_sysfs_get_boolean (int dir
,const char *attr
);
Convenience wrapper to read a boolean sysfs file. It asserts on failure.
void igt_sysfs_set_boolean (int dir
,const char *attr
,bool value
);
Convenience wrapper to write a boolean sysfs file. It asserts on failure.
void
bind_fbcon (bool enable
);
This functions enables/disables the text console running on top of the framebuffer device.
void
fbcon_blink_enable (bool enable
);
Enables or disables the cursor blinking in fbcon, it also restores the previous blinking state when exiting test.
void
igt_drm_debug_level_update (unsigned int new_log_level
);
This modifies the current drm debug log level to the new value.
void
igt_drm_debug_level_reset (void
);
This modifies the current debug log level of the machine to the default value post-test.
int
igt_drm_debug_level_get (int dir
);
This reads the current debug log level of the machine on which the test is currently executing.
int
igt_sysfs_drm_module_params_open (void
);
This opens the sysfs directory corresponding to drm module parameters.
void
igt_sysfs_rw_attr_verify (igt_sysfs_rw_attr_t *rw
);
This function attempts to verify writable sysfs attributes, that is the attribute is first written to and then read back and it is verified that the read value matches the written value to a tolerance. However, when we try to do this we run into the issue that a sysfs attribute might have a behavior where the read value is different from the written value for any reason. For example, attributes such as power, voltage, frequency and time typically have a linear region outside which they are clamped (the values saturate). Therefore for such attributes read values match the written value only in the linear region and when writing we don't know if we are writing to the linear or to the clamped region.
Therefore the verification implemented here takes the approach of sweeping across the range of possible values of the attribute (this is done using 'doubling' rather than linearly) and seeing where there are matches. There should be at least one match (to a tolerance) for the verification to have succeeded.
void igt_sysfs_engines (int xe
,int engines
,int gt
,bool all
,const char **property
,void (*test) (int, int, const char **, uint16_t, int)
);
It iterates over sysfs/engines and runs a dynamic engine test.
char * xe_sysfs_gt_path (int xe_device
,int gt
,char *path
,int pathlen
);
int xe_sysfs_gt_open (int xe_device
,int gt
);
This opens the sysfs gt directory corresponding to device and tile for use
bool xe_sysfs_gt_has_node (int xe_device
,int gt
,const char *node
);
This checks if specified node exists in device sysfs gt directory.
char * xe_sysfs_tile_path (int xe_device
,int tile
,char *path
,int pathlen
);
int xe_sysfs_tile_open (int xe_device
,int tile
);
This opens the sysfs tile directory corresponding to device and tile for use
int
xe_sysfs_get_num_tiles (int xe_device
);
Reads number of tile sysfs entries. Asserts for at least one tile entry. (see xe_sysfs_tile_path).
char * xe_sysfs_engine_path (int xe_device
,int gt
,int class
,char *path
,int pathlen
);
int xe_sysfs_engine_open (int xe_device
,int gt
,int class
);
This opens the sysfs gt directory corresponding to device and tile for use
int xe_sysfs_driver_do (int xe_device
,char pci_slot[]
,enum xe_sysfs_driver_action action
);
Use sysfs to perform an action on the driver.
bool xe_sysfs_engine_class_get_property (int xe_device
,int gt
,uint16_t class
,const char *property
,uint32_t *value
);
Convenience wrapper to get value of given property for given engine class on given gt.
bool xe_sysfs_engine_class_set_property (int xe_device
,int gt
,uint16_t class
,const char *property
,uint32_t new_value
,uint32_t *old_value
);
Convenience wrapper to set given property for given engine class on given gt to given value.