mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-08 00:16:18 +00:00
tests/kms_force_connector_basic: Add prune-stale-modes subtest
Add a new subtest that makes sure old stale modes get pruned from the connector's mode list when the EDID changes. v2: s/drmModeGetConnector/drmModeGetConnectorCurrent/ since kmstest_force_edid() already takes care of doing the heavier call for us (Daniel) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
b0f4df31ba
commit
870548b653
@ -111,6 +111,46 @@ const unsigned char* igt_kms_get_base_edid(void)
|
|||||||
return base_edid;
|
return base_edid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define VFREQ 60
|
||||||
|
#define CLOCK 101000
|
||||||
|
#define HACTIVE 1400
|
||||||
|
#define HBLANK 160
|
||||||
|
#define VACTIVE 1050
|
||||||
|
#define VBLANK 30
|
||||||
|
#define HOFFSET 48
|
||||||
|
#define HPULSE 32
|
||||||
|
#define VOFFSET 3
|
||||||
|
#define VPULSE 4
|
||||||
|
|
||||||
|
#define HSIZE 52
|
||||||
|
#define VSIZE 30
|
||||||
|
|
||||||
|
#define EDID_NAME alt_edid
|
||||||
|
#include "igt_edid_template.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* igt_kms_get_alt_edid:
|
||||||
|
*
|
||||||
|
* Get an alternate edid block, which includes the following modes:
|
||||||
|
*
|
||||||
|
* - 1400x1050 60Hz
|
||||||
|
* - 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.
|
||||||
|
*
|
||||||
|
* Returns: an alternate edid block
|
||||||
|
*/
|
||||||
|
const unsigned char* igt_kms_get_alt_edid(void)
|
||||||
|
{
|
||||||
|
update_edid_csum(alt_edid);
|
||||||
|
|
||||||
|
return alt_edid;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:igt_kms
|
* SECTION:igt_kms
|
||||||
|
@ -286,6 +286,7 @@ void igt_reset_connectors(void);
|
|||||||
|
|
||||||
#define EDID_LENGTH 128
|
#define EDID_LENGTH 128
|
||||||
const unsigned char* igt_kms_get_base_edid(void);
|
const unsigned char* igt_kms_get_base_edid(void);
|
||||||
|
const unsigned char* igt_kms_get_alt_edid(void);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __IGT_KMS_H__ */
|
#endif /* __IGT_KMS_H__ */
|
||||||
|
@ -178,6 +178,46 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
igt_subtest("prune-stale-modes") {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
kmstest_force_connector(drm_fd, vga_connector,
|
||||||
|
FORCE_CONNECTOR_ON);
|
||||||
|
|
||||||
|
/* test pruning of stale modes */
|
||||||
|
kmstest_force_edid(drm_fd, vga_connector,
|
||||||
|
igt_kms_get_alt_edid(), EDID_LENGTH);
|
||||||
|
temp = drmModeGetConnectorCurrent(drm_fd,
|
||||||
|
vga_connector->connector_id);
|
||||||
|
|
||||||
|
for (i = 0; i < temp->count_modes; i++) {
|
||||||
|
if (temp->modes[i].hdisplay == 1400 &&
|
||||||
|
temp->modes[i].vdisplay == 1050)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
igt_assert_f(i != temp->count_modes, "1400x1050 not on mode list\n");
|
||||||
|
|
||||||
|
drmModeFreeConnector(temp);
|
||||||
|
|
||||||
|
kmstest_force_edid(drm_fd, vga_connector,
|
||||||
|
igt_kms_get_base_edid(), EDID_LENGTH);
|
||||||
|
temp = drmModeGetConnectorCurrent(drm_fd,
|
||||||
|
vga_connector->connector_id);
|
||||||
|
|
||||||
|
for (i = 0; i < temp->count_modes; i++) {
|
||||||
|
if (temp->modes[i].hdisplay == 1400 &&
|
||||||
|
temp->modes[i].vdisplay == 1050)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
igt_assert_f(i == temp->count_modes, "1400x1050 not pruned from mode list\n");
|
||||||
|
|
||||||
|
drmModeFreeConnector(temp);
|
||||||
|
|
||||||
|
kmstest_force_edid(drm_fd, vga_connector, NULL, 0);
|
||||||
|
kmstest_force_connector(drm_fd, vga_connector,
|
||||||
|
FORCE_CONNECTOR_UNSPECIFIED);
|
||||||
|
}
|
||||||
|
|
||||||
igt_fixture {
|
igt_fixture {
|
||||||
drmModeFreeConnector(vga_connector);
|
drmModeFreeConnector(vga_connector);
|
||||||
close(drm_fd);
|
close(drm_fd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user