Top |
#define | LOCAL_DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT |
enum | pipe |
enum | port |
enum | igt_custom_edid_type |
#define | IGT_CUSTOM_EDID_COUNT |
enum | dsc_output_format |
#define | MAX_HDISPLAY_PER_PIPE |
enum | igt_atomic_crtc_properties |
enum | igt_atomic_connector_properties |
struct | kmstest_connector_config |
struct | kmstest_plane |
struct | kmstest_crtc |
enum | kmstest_force_connector_state |
enum | intel_broadcast_rgb_mode |
enum | joined_pipes |
enum | igt_commit_style |
enum | igt_atomic_plane_properties |
typedef | igt_display_t |
typedef | igt_pipe_t |
typedef | igt_fixed_t |
enum | igt_rotation_t |
#define | IGT_ROTATION_MASK |
igt_plane_t | |
struct | igt_pipe |
igt_output_t | |
struct | igt_display |
igt_tile_info_t | |
igt_backlight_context_t | |
struct | edid |
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 human-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.
void
kmstest_set_vt_text_mode (void
);
Sets the controlling VT (if available) into text mode.
Unlikely kmstest_set_vt_graphics_mode()
it do not install an igt exit
handler to set the VT back to the previous mode.
bool kmstest_force_connector (int fd
,drmModeConnector *connector
,enum kmstest_force_connector_state state
);
Force the specified state on the specified connector.
bool kmstest_force_connector_joiner (int drm_fd
,drmModeConnector *connector
,int joined_pipes
);
Enable force joiner state on the specified connector and install exit handler for resetting
void kmstest_force_edid (int drm_fd
,drmModeConnector *connector
,const struct edid *edid
);
Set the EDID data on connector
to edid
. See also igt_kms_get_base_edid.
If edid
is NULL, the forced EDID will be removed.
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
.
drmModePropertyBlobPtr kmstest_get_path_blob (int drm_fd
,uint32_t connector_id
);
Finds a property with the name "PATH" on the connector object.
bool kmstest_probe_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
, fully probing the connector in the
process.
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 kmstest_get_crtc_idx (drmModeRes *res
,uint32_t crtc_id
);
Get the CRTC index based on its ID. This is useful since a few places of libdrm deal with CRTC masks.
uint32_t kmstest_find_crtc_for_connector (int fd
,drmModeRes *res
,drmModeConnector *connector
,uint32_t crtc_blacklist_idx_mask
);
uint32_t kmstest_dumb_create (int fd
,int width
,int height
,int bpp
,unsigned *stride
,uint64_t *size
);
This wraps the CREATE_DUMB ioctl, which allocates a new dumb buffer object for the specified dimensions.
void * kmstest_dumb_map_buffer (int fd
,uint32_t handle
,uint64_t size
,unsigned prot
);
void
kmstest_wait_for_pageflip (int fd
);
Blocks until pageflip is completed
unsigned int kmstest_get_vblank (int fd
,int pipe
,unsigned int flags
);
Blocks or request a signal when a specified vblank event occurs
Returns 0 on success or non-zero unsigned integer otherwise
bool
kms_has_vblank (int fd
);
Get the VBlank errno after an attempt to call drmWaitVBlank()
. This
function is useful for checking if a driver has support or not for VBlank.
void
igt_display_reset_outputs (igt_display_t *display
);
Initialize display
outputs with their connectors and pipes.
This function clears any previously allocated outputs.
void igt_display_require (igt_display_t *display
,int drm_fd
);
Initialize display
and allocate the various resources required. Use
igt_display_fini to release the resources when they are no longer
required.
This function automatically skips if the kernel driver doesn't support any CRTC or outputs.
void
igt_display_fini (igt_display_t *display
);
Release any resources associated with display
. This does not free display
itself.
void
igt_display_reset (igt_display_t *display
);
Reset basic pipes, connectors and planes on display
back to default values.
In particular, the following properties will be reset:
For outputs:
IGT_CONNECTOR_BROADCAST_RGB
(if applicable)
IGT_CONNECTOR_CONTENT_PROTECTION
(if applicable)
IGT_CONNECTOR_HDR_OUTPUT_METADATA
(if applicable)
IGT_CONNECTOR_DITHERING_MODE
(if applicable)
igt_output_override_mode() to default.
For pipes:
For planes:
IGT_PLANE_SRC_
*
IGT_PLANE_CRTC_
*
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_display_try_commit2
instead.
int
igt_display_commit (igt_display_t *display
);
Commits framebuffer and positioning changes to all planes of each display pipe.
int igt_display_try_commit_atomic (igt_display_t *display
,uint32_t flags
,void *user_data
);
This function is similar to igt_display_try_commit2, but is used when you want to pass different flags to the actual commit.
Useful flags can be DRM_MODE_ATOMIC_ALLOW_MODESET, DRM_MODE_ATOMIC_NONBLOCK, DRM_MODE_PAGE_FLIP_EVENT, or DRM_MODE_ATOMIC_TEST_ONLY.
user_data
is returned in the event if you pass
DRM_MODE_PAGE_FLIP_EVENT to flags
.
This function will return an error if commit fails, instead of aborting the test.
display |
igt_display_t to commit. |
|
flags |
Flags passed to drmModeAtomicCommit. |
|
user_data |
User defined pointer passed to drmModeAtomicCommit. |
void igt_display_commit_atomic (igt_display_t *display
,uint32_t flags
,void *user_data
);
This function is similar to igt_display_commit2, but is used when you want to pass different flags to the actual commit.
Useful flags can be DRM_MODE_ATOMIC_ALLOW_MODESET, DRM_MODE_ATOMIC_NONBLOCK, DRM_MODE_PAGE_FLIP_EVENT, or DRM_MODE_ATOMIC_TEST_ONLY.
user_data
is returned in the event if you pass
DRM_MODE_PAGE_FLIP_EVENT to flags
.
This function will abort the test if commit fails.
display |
igt_display_t to commit. |
|
flags |
Flags passed to drmModeAtomicCommit. |
|
user_data |
User defined pointer passed to drmModeAtomicCommit. |
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.
int
igt_display_drop_events (igt_display_t *display
);
Nonblockingly reads all current events and drops them, for highest
reliability, call igt_display_commit2()
first to flush all outstanding
events.
This will be called on the first commit after igt_display_reset()
too,
to make sure any stale events are flushed.
void
igt_display_require_output (igt_display_t *display
);
Checks whether there's a valid pipe
/output
combination for the given display
Skips test if a valid combination of pipe
and output
is not found
void igt_display_require_output_on_pipe (igt_display_t *display
,enum pipe pipe
);
Checks whether there's a valid pipe
/output
combination for the given display
and pipe
Skips test if a valid pipe
is not found
drmModeModeInfo *
igt_output_get_mode (igt_output_t *output
);
Get the current mode of the given connector
void igt_output_override_mode (igt_output_t *output
,const drmModeModeInfo *mode
);
Overrides the output's mode with mode
, so that it is used instead of the
mode obtained with get connectors. Note that the mode is used without
checking if the output supports it, so this might lead to unexpected results.
void igt_output_set_pipe (igt_output_t *output
,enum pipe pipe
);
This function sets a pipe
to a specific output
connector by
setting the CRTC_ID property of the pipe
. The pipe
is only activated for all pipes except PIPE_NONE.
igt_plane_t * igt_output_get_plane (igt_output_t *output
,int plane_idx
);
Finds a driving pipe for the given output
otherwise and gets the valid
plane associated with that pipe for the given plane_idx
. This function
will terminate the execution if driving pipe is not for a given output
.
igt_plane_t * igt_output_get_plane_type (igt_output_t *output
,int plane_type
);
Finds a valid plane type for the given output
otherwise
the test is skipped if the right combination of output
/plane_type
is not found
int igt_output_count_plane_type (igt_output_t *output
,int plane_type
);
Counts the number of planes of type plane_type
for the provided output
.
igt_plane_t * igt_output_get_plane_type_index (igt_output_t *output
,int plane_type
,int index
);
Get the index
th plane of type plane_type
for the provided output
.
igt_output_t * igt_output_from_connector (igt_display_t *display
,drmModeConnector *connector
);
Finds the output corresponding to the given connector
display |
a pointer to an igt_display_t structure |
|
connector |
a pointer to a drmModeConnector |
void
igt_output_refresh (igt_output_t *output
);
This function sets the given output
to a valid default pipe
drmModeModeInfo *
igt_std_1024_mode_get (int vrefresh
);
This function will create a standard drm mode with a given vrefresh
void igt_output_set_writeback_fb (igt_output_t *output
,struct igt_fb *fb
);
This function sets the given fb
to be used as the target framebuffer for the
writeback engine at the next atomic commit. It will also request a writeback
out fence that will contain the fd number of the out fence created by KMS if
the given fb
is valid.
void
igt_modeset_disable_all_outputs (igt_display_t *display
);
Modeset to disable all output
We need to do a modeset disabling all output to get the next HPD event on TypeC port
igt_plane_t * igt_pipe_get_plane_type (igt_pipe_t *pipe
,int plane_type
);
Finds a valid plane type for the given pipe
otherwise
it skips the test if the right combination of pipe
/plane_type
is not found
int igt_pipe_count_plane_type (igt_pipe_t *pipe
,int plane_type
);
Counts the number of planes of type plane_type
for the provided pipe
.
igt_plane_t * igt_pipe_get_plane_type_index (igt_pipe_t *pipe
,int plane_type
,int index
);
Get the index
th plane of type plane_type
for the provided pipe
.
igt_output_t * igt_get_single_output_for_pipe (igt_display_t *display
,enum pipe pipe
);
Get a compatible output for a pipe.
display |
a pointer to an igt_display_t structure |
|
pipe |
The pipe for which an igt_output_t must be returned. |
void
igt_pipe_request_out_fence (igt_pipe_t *pipe
);
Marks this pipe for requesting an out fence at the next atomic commit will contain the fd number of the out fence created by KMS.
void igt_plane_set_fb (igt_plane_t *plane
,struct igt_fb *fb
);
Pairs a given framebuffer
to a plane
This function also sets a default size and position for the framebuffer to avoid crashes on applications that ignore to set these.
void igt_plane_set_fence_fd (igt_plane_t *plane
,int fence_fd
);
This function sets a fence fd to enable a commit to wait for some event to occur before completing.
void igt_plane_set_position (igt_plane_t *plane
,int x
,int y
);
This function sets a new (x,y) position for the given plane.
New position will be committed at plane commit time via drmModeSetPlane()
.
void igt_plane_set_size (igt_plane_t *plane
,int w
,int h
);
This function sets width and height for requested plane.
New size will be committed at plane commit time via
drmModeSetPlane()
.
void igt_plane_set_rotation (igt_plane_t *plane
,igt_rotation_t rotation
);
This function sets a new rotation for the requested plane
.
New rotation
will be committed at plane commit time via
drmModeSetPlane()
.
void igt_fb_set_position (struct igt_fb *fb
,igt_plane_t *plane
,uint32_t x
,uint32_t y
);
This function sets position for requested framebuffer as src to plane.
New position will be committed at plane commit time via drmModeSetPlane()
.
void igt_fb_set_size (struct igt_fb *fb
,igt_plane_t *plane
,uint32_t w
,uint32_t h
);
This function sets fetch rect size from requested framebuffer as src
to plane. New size will be committed at plane commit time via
drmModeSetPlane()
.
void igt_wait_for_vblank (int drm_fd
,int crtc_offset
);
See igt_wait_for_vblank_count for more details
Waits for 1 vertical blank intervals
void igt_wait_for_vblank_count (int drm_fd
,int crtc_offset
,int count
);
Waits for a given number of vertical blank intervals
In DRM, 'Pipe', as understood by DRM_IOCTL_WAIT_VBLANK, is actually an offset of crtc in drmModeRes.crtcs and it has nothing to do with a hardware concept of a pipe. They can match but don't have to in case of DRM lease or non-contiguous pipes.
To make thing clear we are calling DRM_IOCTL_WAIT_VBLANK's 'pipe' a crtc_offset.
#define igt_pipe_connector_valid(pipe, output)
Checks whether the given pipe and output can be used together.
#define for_each_connected_output(display, output)
This for loop iterates over all connected outputs.
#define for_each_disconnected_output(display, output)
This for loop iterates over all disconnected outputs.
#define for_each_pipe_static(pipe)
This for loop iterates over all pipes supported by IGT libraries.
This should be used to enumerate per-pipe subtests since it has no runtime depencies.
#define for_each_pipe(display, pipe)
This for loop iterates over all pipes.
Note that this cannot be used to enumerate per-pipe subtest names since it depends upon runtime probing of the actual kms driver that is being tested. Use for_each_pipe_static instead.
#define for_each_pipe_with_valid_output(display, pipe, output)
This for loop is called over all connected outputs. This function
will try every combination of pipe
and output
.
If you only need to test a single output for each pipe, use
for_each_pipe_with_single_output()
, if you only need an
output for a single pipe, use igt_get_single_output_for_pipe()
.
display |
a pointer to an igt_display_t structure |
|
pipe |
The pipe for which this |
|
output |
The output for which this |
#define for_each_pipe_with_single_output(display, pipe, output)
This loop is called over all pipes, and will try to find a compatible output
for each pipe. Unlike for_each_pipe_with_valid_output()
, this function will
be called at most once for each pipe.
display |
a pointer to an igt_display_t structure |
|
pipe |
The pipe for which this |
|
output |
The output for which this |
#define for_each_valid_output_on_pipe(display, pipe, output)
This for loop is called over all connected output
that can be used
on this pipe
. If there are no valid outputs for this pipe, nothing
happens.
display |
a pointer to an igt_display_t structure |
|
pipe |
Pipe to enumerate valid outputs over |
|
output |
The enumerated output. |
#define for_each_plane_on_pipe(display, pipe, plane)
This for loop iterates over all planes associated to the given pipe
.
If there are no valid planes for this pipe, nothing happens.
display |
a pointer to an igt_display_t structure |
|
pipe |
Pipe to enumerate valid outputs over |
|
plane |
The enumerated plane. |
#define for_each_connector_mode(output)
This for loop iterates over all modes associated to the given output
.
If there are no mode available for this output, nothing happens.
bool igt_plane_has_prop (igt_plane_t *plane
,enum igt_atomic_plane_properties prop
);
Check whether plane supports a given property.
uint64_t igt_plane_get_prop (igt_plane_t *plane
,enum igt_atomic_plane_properties prop
);
Return current value on a plane for a given property.
#define igt_plane_is_prop_changed(plane, prop)
Check whether a given prop
changed for the plane
.
#define igt_plane_set_prop_changed(plane, prop)
Sets the given prop
for the plane
.
#define igt_plane_clear_prop_changed(plane, prop)
Clears the given prop
for the plane
.
#define igt_plane_set_prop_value(plane, prop, value)
Sets the given prop
with the value
for the plane
.
bool igt_plane_try_prop_enum (igt_plane_t *plane
,enum igt_atomic_plane_properties prop
,const char *val
);
void igt_plane_set_prop_enum (igt_plane_t *plane
,enum igt_atomic_plane_properties prop
,const char *val
);
This function tries to set given enum property prop
value val
to
the given plane
, and terminate the execution if its failed.
void igt_plane_replace_prop_blob (igt_plane_t *plane
,enum igt_atomic_plane_properties prop
,const void *ptr
,size_t length
);
This function will destroy the old property blob for the given property, and will create a new property blob with the values passed to this function.
The new property blob will be committed when you call igt_display_commit()
,
igt_display_commit2()
or igt_display_commit_atomic()
.
bool igt_plane_check_prop_is_mutable (igt_plane_t *plane
,enum igt_atomic_plane_properties igt_prop
);
Check if a plane supports a given property and if this property is mutable.
Returns true if the plane has the mutable property. False if the property is not support or it's immutable.
bool igt_output_has_prop (igt_output_t *output
,enum igt_atomic_connector_properties prop
);
Check whether output supports a given property.
uint64_t igt_output_get_prop (igt_output_t *output
,enum igt_atomic_connector_properties prop
);
Return current value on an output for a given property.
#define igt_output_is_prop_changed(output, prop)
Check whether a given prop
changed for the Output
.
#define igt_output_set_prop_changed(output, prop)
Sets the given prop
for the output
.
#define igt_output_clear_prop_changed(output, prop)
Clears the given prop
for the output
.
#define igt_output_set_prop_value(output, prop, value)
Sets the given prop
with the value
for the output
.
bool igt_output_try_prop_enum (igt_output_t *output
,enum igt_atomic_connector_properties prop
,const char *val
);
void igt_output_set_prop_enum (igt_output_t *output
,enum igt_atomic_connector_properties prop
,const char *val
);
This function tries to set given enum property prop
value val
to
the given output
, and terminate the execution if its failed.
void igt_output_replace_prop_blob (igt_output_t *output
,enum igt_atomic_connector_properties prop
,const void *ptr
,size_t length
);
This function will destroy the old property blob for the given property, and will create a new property blob with the values passed to this function.
The new property blob will be committed when you call igt_display_commit()
,
igt_display_commit2()
or igt_display_commit_atomic()
.
bool igt_pipe_obj_has_prop (igt_pipe_t *pipe
,enum igt_atomic_crtc_properties prop
);
Check whether pipe supports a given property.
uint64_t igt_pipe_obj_get_prop (igt_pipe_t *pipe
,enum igt_atomic_crtc_properties prop
);
Return current value on a pipe for a given property.
uint64_t igt_pipe_get_prop (igt_display_t *display
,enum pipe pipe
,enum igt_atomic_crtc_properties prop
);
Return current value on a pipe for a given property.
bool igt_pipe_has_prop (igt_display_t *display
,enum pipe pipe
,enum igt_atomic_crtc_properties prop
);
Check whether pipe supports a given property.
#define igt_pipe_obj_is_prop_changed(pipe_obj, prop)
Check whether a given prop
changed for the pipe_obj
.
#define igt_pipe_is_prop_changed(display, pipe, prop)
Check whether a given prop
changed for the pipe
.
#define igt_pipe_obj_set_prop_changed(pipe_obj, prop)
Sets the given prop
for the pipe_obj
.
#define igt_pipe_set_prop_changed(display, pipe, prop)
Sets the given prop
for the pipe
.
#define igt_pipe_obj_clear_prop_changed(pipe_obj, prop)
Clears the given prop
for the pipe_obj
.
#define igt_pipe_clear_prop_changed(display, pipe, prop)
Clears the given prop
for the pipe
.
#define igt_pipe_obj_set_prop_value(pipe_obj, prop, value)
Sets the given prop
with the value
for the pipe_obj
.
#define igt_pipe_set_prop_value(display, pipe, prop, value)
Sets the given prop
with the value
for the pipe
.
bool igt_pipe_obj_try_prop_enum (igt_pipe_t *pipe
,enum igt_atomic_crtc_properties prop
,const char *val
);
void igt_pipe_obj_set_prop_enum (igt_pipe_t *pipe
,enum igt_atomic_crtc_properties prop
,const char *val
);
This function tries to set given enum property prop
value val
to
the given pipe_obj
, and terminate the execution if its failed.
#define igt_pipe_set_prop_enum(display, pipe, prop, val)
This function tries to set given enum property prop
value val
to
the given pipe
, and terminate the execution if its failed.
void igt_pipe_obj_replace_prop_blob (igt_pipe_t *pipe
,enum igt_atomic_crtc_properties prop
,const void *ptr
,size_t length
);
This function will destroy the old property blob for the given property, and will create a new property blob with the values passed to this function.
The new property blob will be committed when you call igt_display_commit()
,
igt_display_commit2()
or igt_display_commit_atomic()
.
Please use igt_output_override_mode()
if you want to set IGT_CRTC_MODE_ID,
it works better with legacy commit.
#define igt_pipe_replace_prop_blob(display, pipe, prop, ptr, length)
This function will destroy the old property blob for the given property, and will create a new property blob with the values passed to this function.
The new property blob will be committed when you call igt_display_commit()
,
igt_display_commit2()
or igt_display_commit_atomic()
.
Please use igt_output_override_mode()
if you want to set IGT_CRTC_MODE_ID,
it works better with legacy commit.
void igt_pipe_refresh (igt_display_t *display
,enum pipe pipe
,bool force
);
Requests the pipe to be part of the state on next update. This is useful when state may have been out of sync after a fork, or we just want to be sure the pipe is included in the next commit.
display |
a pointer to an igt_display_t structure |
|
pipe |
Pipe to refresh |
|
force |
Should be set to true if mode_blob is no longer considered to be valid, for example after doing an atomic commit during fork or closing display fd. |
void
igt_enable_connectors (int drm_fd
);
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.
uint32_t
kmstest_get_vbl_flag (int crtc_offset
);
Convert an offset of an crtc in drmModeRes.crtcs into flag representation expected by DRM_IOCTL_WAIT_VBLANK. See igt_wait_for_vblank_count for details
const struct edid *
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
const struct edid *
igt_kms_get_full_edid (void
);
Get the full edid block, which includes the following modes:
2288x1287 144Hz
1920x1080 60Hz
1280x720 60Hz
1024x768 60Hz
800x600 60Hz
640x480 60Hz
const struct edid *
igt_kms_get_base_tile_edid (void
);
Get the base tile edid block, which includes the following modes:
1920x2160 60Hz
1920x1080 60Hz
1280x720 60Hz
1024x768 60Hz
800x600 60Hz
640x480 60Hz
const struct edid *
igt_kms_get_alt_edid (void
);
Get an alternate edid block, which includes the following modes:
1400x1050 60Hz
1920x1080 60Hz
1280x720 60Hz
1024x768 60Hz
800x600 60Hz
640x480 60Hz
const struct edid *
igt_kms_get_hdmi_audio_edid (void
);
Get a basic edid block, which includes the HDMI Audio
const struct edid *
igt_kms_get_dp_audio_edid (void
);
Get a basic edid block, which includes the DP Audio
const struct edid *
igt_kms_get_4k_edid (void
);
Get a basic edid block, which includes 4K resolution
const struct edid *
igt_kms_get_3d_edid (void
);
Get a basic edid block, which includes 3D mode
const struct edid *
igt_kms_get_aspect_ratio_edid (void
);
Gets the base edid block, which includes the following modes and different aspect ratio
1920x1080 60Hz
1280x720 60Hz
1024x768 60Hz
800x600 60Hz
640x480 60Hz
struct edid ** igt_kms_get_tiled_edid (uint8_t htile
,uint8_t vtile
);
Get a basic edid block, which includes tiled display
const struct edid *
igt_kms_get_custom_edid (enum igt_custom_edid_type edid
);
edid
: enum to specify which edid block is required
returns pointer to requested edid block
struct udev_monitor *
igt_watch_uevents (void
);
Begin monitoring udev for sysfs uevents.
bool igt_hotplug_detected (struct udev_monitor *mon
,int timeout_secs
);
Detect if a hotplug event was received since we last checked the monitor.
mon |
A udev monitor initialized with igt_watch_uevents |
|
timeout_secs |
How long to wait for a hotplug event to occur. |
bool igt_lease_change_detected (struct udev_monitor *mon
,int timeout_secs
);
Detect if a lease change event was received since we last checked the monitor.
mon |
A udev monitor initialized with igt_watch_uevents |
|
timeout_secs |
How long to wait for a lease change event to occur. |
bool igt_connector_event_detected (struct udev_monitor *mon
,uint32_t conn_id
,uint32_t prop_id
,int timeout_msecs
);
Detect if a connector event is received for a given connector and property.
mon |
A udev monitor initialized with igt_watch_uevents |
|
conn_id |
Connector id of the Connector for which the property change is expected. |
|
prop_id |
Property id for which the change is expected. |
|
timeout_secs |
How long to wait for a connector event to occur. |
void
igt_flush_uevents (struct udev_monitor *mon
);
Get rid of any pending uevents
void
igt_cleanup_uevents (struct udev_monitor *mon
);
Cleanup the resources allocated by igt_watch_uevents
bool igt_display_has_format_mod (igt_display_t *display
,uint32_t format
,uint64_t modifier
);
display |
a pointer to an igt_display_t structure |
|
format |
Target format |
|
modifier |
Target modifier |
bool igt_plane_has_format_mod (igt_plane_t *plane
,uint32_t format
,uint64_t modifier
);
return igt_vblank_after_eq (b Param1
,a Param2
);
Compare vblank sequence numbers, handling wraparound correctly.
return igt_vblank_after (b Param1
,a Param2
);
Compare vblank sequence numbers, handling wraparound correctly.
void igt_parse_connector_tile_blob (drmModePropertyBlobPtr blob
,igt_tile_info_t *tile
);
Parses the connector tile blob to extract the tile information. The blob information is exposed from drm/drm_connector.c in the kernel. The format of the tile property is defined in the kernel as char tile[256] that consists of 8 integers that are ':' separated.
uint32_t
igt_reduce_format (uint32_t format
);
Reduce format
to a base format. The aim is to allow grouping
sufficiently similar formats into classes. Formats with identical
component sizes, overall pixel size, chroma subsampling, etc. are
considered part of the same class, no matter in which order the
components appear. We arbitrarily choose one of the formats in
the class as the base format. Note that the base format itself
may not be supported by whatever device is being tested even if
some of the other formats in the class are supported.
void igt_require_pipe (igt_display_t *display
,enum pipe pipe
);
Skip a (sub-)test if the pipe not enabled.
Should be used everywhere where a test checks pipe and skip test when pipe is not enabled.
void
igt_dump_connectors_fd (int drmfd
);
Iterates through list of connectors and dumps their list of modes.
void
igt_dump_crtcs_fd (int drmfd
);
Iterates through the list of crtcs and dumps out the mode and basic information for each of them.
bool
igt_override_all_active_output_modes_to_fit_bw
(igt_display_t *display
);
Override the mode on all active outputs (i.e. pending_pipe != PIPE_NONE) on basis of bandwidth.
bool igt_get_i915_edp_lobf_status (int drmfd
,char *connector_name
);
Return: True if its enabled.
unsigned int igt_get_output_max_bpc (int drmfd
,char *connector_name
);
void igt_assert_output_bpc_equal (int drmfd
,enum pipe pipe
,char *output_name
,unsigned int bpc
);
Assert if crtc's current bpc is not matched with the requested one.
bool igt_check_output_bpc_equal (int drmfd
,enum pipe pipe
,char *output_name
,unsigned int bpc
);
This is similar to igt_assert_output_bpc_equal, instead of assert it'll return True if crtc has the correct requested bpc, else False.
int sort_drm_modes_by_clk_dsc (const void *a
,const void *b
);
Comparator function for sorting DRM modes in descending order by clock.
int sort_drm_modes_by_clk_asc (const void *a
,const void *b
);
Comparator function for sorting DRM modes in ascending order by clock.
int sort_drm_modes_by_res_dsc (const void *a
,const void *b
);
Comparator function for sorting DRM modes in descending order by resolution.
int sort_drm_modes_by_res_asc (const void *a
,const void *b
);
Comparator function for sorting DRM modes in ascending order by resolution.
void igt_sort_connector_modes (drmModeConnector *connector
,int (*comparator) (const void *, const void*)
);
Sorts connector modes based on the comparator
.
bool igt_max_bpc_constraint (igt_display_t *display
,enum pipe pipe
,igt_output_t *output
,int bpc
);
The "max bpc" property only ensures that the bpc will not go beyond the value set through this property. It does not guarantee that the same bpc will be used for the given mode.
So, if we really want a particular bpc set, try reducing the resolution till we get the bpc that we set in max bpc property.
display |
a pointer to an igt_display_t structure |
|
pipe |
Display pipe |
|
output |
Target output |
|
bpc |
BPC to compare with max & current bpc |
int
igt_get_max_dotclock (int fd
);
Get the Max pixel clock frequency from intel specific debugfs "i915_frequency_info".
bool igt_bigjoiner_possible (drmModeModeInfo *mode
,int max_dotclock
);
Bigjoiner will come into the picture, when the requested mode resolution > 5K or mode clock > max_dotclock.
bool bigjoiner_mode_found (int drm_fd
,drmModeConnector *connector
,int max_dotclock
,drmModeModeInfo *mode
);
Bigjoiner will come in to the picture when the resolution > 5K or clock > max-dot-clock.
bool igt_ultrajoiner_possible (drmModeModeInfo *mode
,int max_dotclock
);
Ultrajoiner will come into the picture, when the requested mode resolution > 10K or mode clock > 2 * max_dotclock.
bool ultrajoiner_mode_found (int drm_fd
,drmModeConnector *connector
,int max_dotclock
,drmModeModeInfo *mode
);
bool igt_has_force_joiner_debugfs (int drmfd
,char *conn_name
);
Checks if the force big joiner debugfs is available for a specific connector.
bool igt_check_force_joiner_status (int drmfd
,char *connector_name
);
Checks if the force big joiner is enabled.
bool
igt_check_bigjoiner_support (igt_display_t *display
);
Get all active pipes from connected outputs (i.e. pending_pipe != PIPE_NONE) and check those pipes supports the selected mode(s).
Example:
Pipe-D can't support mode > 5K
To use 8K mode on a pipe then consecutive pipe must be free.
bool igt_parse_mode_string (const char *mode_string
,drmModeModeInfo *mode
);
Parse mode string and populate mode
Format: clock(MHz),hdisp,hsync-start,hsync-end,htotal,vdisp,vsync-start, vsync-end,vtotal
bool
intel_pipe_output_combo_valid (igt_display_t *display
);
Every individual test must use igt_output_set_pipe()
before calling this
helper, so that this function will get all active pipes from connected
outputs (i.e. pending_pipe != PIPE_NONE) and check the selected combo is
valid or not.
This helper is supposed to be a superset of all constraints of pipe/output combo.
Example:
Pipe-D can't support mode > 5K
To use 8K mode on a pipe then consecutive pipe must be free.
MSO is supported only on PIPE_A/PIPE_B.
void igt_force_link_retrain (int drm_fd
,igt_output_t *output
,int retrain_count
);
Force link retrain on the output.
void igt_force_lt_failure (int drm_fd
,igt_output_t *output
,int failure_count
);
Force link training failure on the output.
failure_count
: 1 for retraining with same link params
2 for retraining with reduced link params
bool igt_get_dp_link_retrain_disabled (int drm_fd
,igt_output_t *output
);
bool igt_has_force_link_training_failure_debugfs (int drmfd
,igt_output_t *output
);
int igt_get_dp_pending_lt_failures (int drm_fd
,igt_output_t *output
);
void igt_reset_link_params (int drm_fd
,igt_output_t *output
);
Reset link rate and lane count to auto, also installs exit handler to set link rate and lane count to auto on exit
int igt_backlight_read (int *result
,const char *fname
,igt_backlight_context_t *context
);
int igt_backlight_write (int value
,const char *fname
,igt_backlight_context_t *context
);
Invalid pipe, used for disconnecting a output from a pipe. |
||
Deprecated alias for |
||
First crtc. |
||
Second crtc. |
||
Third crtc. |
||
Fourth crtc. |
||
Fifth crtc. |
||
Sixth crtc. |
||
Seventh crtc. |
||
Eighth crtc. |
||
Ninth crtc. |
||
Tenth crtc. |
||
Eleventh crtc. |
||
Twelfth crtc. |
||
Thirteenth crtc. |
||
Fourteenth crtc. |
||
Fifteenth crtc. |
||
Sixteenth crtc. |
||
Max number of pipes allowed. |
Enum used for the helper function igt_custom_edid_type
IGT_CUSTOM_EDID_BASE
: Returns base edid
IGT_CUSTOM_EDID_FULL
: Returns edid with full list of standard timings.
IGT_CUSTOM_EDID_ALT
: Returns alternate edid
IGT_CUSTOM_EDID_HDMI_AUDIO
: Returns edid with HDMI audio block
IGT_CUSTOM_EDID_DP_AUDIO
: Returns edid with DP audio block
IGT_CUSTOM_EDID_ASPECT_RATIO
: Returns base edid with apect ratio data block
struct kmstest_connector_config { drmModeCrtc *crtc; drmModeConnector *connector; drmModeEncoder *encoder; drmModeModeInfo default_mode; int pipe; unsigned valid_crtc_idx_mask; char *connector_path; };
struct kmstest_plane { int id; int index; int type; int pos_x; int pos_y; int width; int height; };
struct kmstest_crtc { int id; int pipe; bool active; int width; int height; int n_planes; struct kmstest_plane *planes; };
struct igt_pipe { igt_display_t *display; /* ID of a hardware pipe */ enum pipe pipe; /* pipe is enabled or not */ bool enabled; int n_planes; int num_primary_planes; int plane_cursor; int plane_primary; igt_plane_t *planes; uint64_t changed; uint32_t props[IGT_NUM_CRTC_PROPS]; uint64_t values[IGT_NUM_CRTC_PROPS]; /* ID of KMS CRTC object */ uint32_t crtc_id; /* offset of a pipe in drmModeRes.crtcs */ uint32_t crtc_offset; int32_t out_fence_fd; };
struct igt_display { int drm_fd; int log_shift; int n_pipes; int n_planes; int n_outputs; igt_output_t *outputs; igt_plane_t *planes; igt_pipe_t *pipes; bool has_cursor_plane; bool is_atomic; bool has_virt_cursor_plane; bool first_commit; uint64_t *modifiers; uint32_t *formats; int format_mod_count; };
typedef struct { int tile_group_id; bool tile_is_single_monitor; uint8_t num_h_tile, num_v_tile; uint8_t tile_h_loc, tile_v_loc; uint16_t tile_h_size, tile_v_size; } igt_tile_info_t;
typedef struct { int max; int old; igt_output_t *output; char path[PATH_MAX]; char backlight_dir_path[PATH_MAX]; } igt_backlight_context_t;