Top | ![]() |
![]() |
![]() |
![]() |
enum | pipe |
enum | igt_plane |
enum | port |
struct | kmstest_connector_config |
enum | kmstest_force_connector_state |
enum | igt_commit_style |
typedef | igt_display_t |
typedef | igt_pipe_t |
typedef | igt_fixed_t |
enum | igt_rotation_t |
igt_plane_t | |
struct | igt_pipe |
igt_output_t | |
struct | igt_display |
#define | PIPE_ANY |
#define | EDID_LENGTH |
This library provides support to enumerate and set modeset configurations.
There are two parts in this library: First the low level helper function which directly build on top of raw ioctls or the interfaces provided by libdrm. Those functions all have a kmstest_ prefix.
The second part is a high-level library to manage modeset configurations which abstracts away some of the low-level details like the difference between legacy and universal plane support for setting cursors or in the future the difference between legacy and atomic commit. These high-level functions have all igt_ prefixes. This part is still very much work in progress and so also lacks a bit documentation for the individual functions.
Note that this library's header pulls in the i-g-t framebuffer library as a dependency.
void
kmstest_dump_mode (drmModeModeInfo *mode
);
Prints mode
to stdout in a huma-readable form.
void
kmstest_set_vt_graphics_mode (void
);
Sets the controlling VT (if available) into graphics/raw mode and installs an igt exit handler to set the VT back to text mode on exit. Use kmstest_restore_vt_mode to restore the previous VT mode manually.
All kms tests must call this function to make sure that the fbcon doesn't interfere by e.g. blanking the screen.
void
kmstest_restore_vt_mode (void
);
Restore the VT mode in use before kmstest_set_vt_graphics_mode was called.
bool kmstest_force_connector (int fd
,drmModeConnector *connector
,enum kmstest_force_connector_state state
);
Force the specified state on the specified connector.
void kmstest_edid_add_3d (const unsigned char *edid
,size_t length
,unsigned char *new_edid_ptr[]
,size_t *new_length
);
Makes a copy of an existing edid block and adds an extension indicating stereo 3D capabilities.
void kmstest_force_edid (int drm_fd
,drmModeConnector *connector
,const unsigned char *edid
,size_t length
);
Set the EDID data on connector
to edid
. See also igt_kms_get_base_edid.
If length
is zero, the forced EDID will be removed.
drm_fd |
drm file descriptor |
|
connector |
connector to set |
|
edid |
An EDID data block |
|
length |
length of the EDID data. EDID_LENGTH defines the standard EDID length |
bool kmstest_get_connector_default_mode (int drm_fd
,drmModeConnector *connector
,drmModeModeInfo *mode
);
Retrieves the default mode for connector
and stores it in mode
.
bool kmstest_get_connector_config (int drm_fd
,uint32_t connector_id
,unsigned long crtc_idx_mask
,struct kmstest_connector_config *config
);
This tries to find a suitable configuration for the given connector and CRTC
constraint and fills it into config
.
void
kmstest_free_connector_config (struct kmstest_connector_config *config
);
Free any resources in config
allocated in kmstest_get_connector_config()
.
void kmstest_set_connector_dpms (int fd
,drmModeConnector *connector
,int mode
);
This function sets the DPMS setting of connector
to mode
.
bool kmstest_get_property (int drm_fd
,uint32_t object_id
,uint32_t object_type
,const char *name
,uint32_t *prop_id
,uint64_t *value
,drmModePropertyPtr *prop
);
Finds a property with the given name on the given object.
drm_fd |
drm file descriptor |
|
object_id |
object whose properties we're going to get |
|
object_type |
type of obj_id (DRM_MODE_OBJECT_*) |
|
name |
name of the property we're going to get |
|
prop_id |
if not NULL, returns the property id |
|
value |
if not NULL, returns the property value |
|
prop |
if not NULL, returns the property, and the caller will have to free it manually. |
void kmstest_unset_all_crtcs (int drm_fd
,drmModeResPtr resources
);
Disables all the screens.
int igt_display_commit2 (igt_display_t *display
,enum igt_commit_style s
);
Commits framebuffer and positioning changes to all planes of each display pipe, using a specific API to perform the programming. This function should be used to exercise a specific driver programming API; igt_display_commit should be used instead if the API used is unimportant to the test being run.
This function should only be used to commit changes that are expected to
succeed, since any failure during the commit process will cause the IGT
subtest to fail. To commit changes that are expected to fail, use
igt_try_display_commit2
instead.
0 upon success. This function will never return upon failure
since igt_fail()
at lower levels will longjmp out of it.
int
igt_display_commit (igt_display_t *display
);
Commits framebuffer and positioning changes to all planes of each display pipe.
0 upon success. This function will never return upon failure
since igt_fail()
at lower levels will longjmp out of it.
int igt_display_try_commit2 (igt_display_t *display
,enum igt_commit_style s
);
Attempts to commit framebuffer and positioning changes to all planes of each
display pipe. This function should be used to commit changes that are
expected to fail, so that the error code can be checked for correctness.
For changes that are expected to succeed, use igt_display_commit
instead.
Note that in non-atomic commit styles, no display programming will be performed after the first failure is encountered, so only some of the operations requested by a test may have been completed. Tests that catch errors returned by this function should take care to restore the display to a sane state after a failure is detected.
igt_plane_t * igt_output_get_plane (igt_output_t *output
,enum igt_plane plane
);
void igt_plane_set_rotation (igt_plane_t *plane
,igt_rotation_t rotation
);
void
igt_enable_connectors (void
);
Force connectors to be enabled where this is known to work well. Use igt_reset_connectors to revert the changes.
An exit handler is installed to ensure connectors are reset when the test exits.
void
igt_reset_connectors (void
);
Remove any forced state from the connectors.
const unsigned char *
igt_kms_get_base_edid (void
);
Get the base edid block, which includes the following modes:
1920x1080 60Hz
1280x720 60Hz
1024x768 60Hz
800x600 60Hz
640x480 60Hz
This can be extended with further features using functions such as kmstest_edid_add_3d.
struct kmstest_connector_config { drmModeCrtc *crtc; drmModeConnector *connector; drmModeEncoder *encoder; drmModeModeInfo default_mode; int crtc_idx; int pipe; };
struct igt_pipe { igt_display_t *display; enum pipe pipe; bool enabled; #define IGT_MAX_PLANES 4 int n_planes; igt_plane_t planes[IGT_MAX_PLANES]; };
struct igt_display { int drm_fd; int log_shift; int n_pipes; int n_outputs; unsigned long pipes_in_use; igt_output_t *outputs; igt_pipe_t pipes[I915_MAX_PIPES]; bool has_universal_planes; };