mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-11 09:56:22 +00:00
tests/kms_cursor_crc: rework to auto-skip connectors
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
8bb5730d28
commit
43def94f32
@ -116,25 +116,14 @@ static igt_pipe_crc_t *create_crc(data_t *data, int crtc_idx)
|
|||||||
|
|
||||||
static void display_init(data_t *data)
|
static void display_init(data_t *data)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
data->resources = drmModeGetResources(data->drm_fd);
|
data->resources = drmModeGetResources(data->drm_fd);
|
||||||
igt_assert(data->resources);
|
igt_assert(data->resources);
|
||||||
|
|
||||||
data->pipe_crc = calloc(data->resources->count_crtcs, sizeof(data->pipe_crc[0]));
|
data->pipe_crc = calloc(data->resources->count_crtcs, sizeof(data->pipe_crc[0]));
|
||||||
for (i = 0; i < data->resources->count_crtcs; i++) {
|
|
||||||
data->pipe_crc[i] = create_crc(data, i);
|
|
||||||
igt_require_f(data->pipe_crc[i],
|
|
||||||
"pipe/pf crc not supported\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void display_fini(data_t *data)
|
static void display_fini(data_t *data)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < data->resources->count_crtcs; i++)
|
|
||||||
igt_pipe_crc_free(data->pipe_crc[i]);
|
|
||||||
free(data->pipe_crc);
|
free(data->pipe_crc);
|
||||||
|
|
||||||
drmModeFreeResources(data->resources);
|
drmModeFreeResources(data->resources);
|
||||||
@ -236,7 +225,7 @@ static bool prepare_crtc(test_data_t *test_data, uint32_t connector_id)
|
|||||||
connector_t connector;
|
connector_t connector;
|
||||||
igt_crc_t *crcs = NULL;
|
igt_crc_t *crcs = NULL;
|
||||||
data_t *data = test_data->data;
|
data_t *data = test_data->data;
|
||||||
igt_pipe_crc_t *pipe_crc = data->pipe_crc[test_data->crtc_idx];
|
igt_pipe_crc_t *pipe_crc;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = kmstest_get_connector_config(data->drm_fd,
|
ret = kmstest_get_connector_config(data->drm_fd,
|
||||||
@ -248,6 +237,15 @@ static bool prepare_crtc(test_data_t *test_data, uint32_t connector_id)
|
|||||||
|
|
||||||
connector_set_mode(data, &connector, &connector.config.default_mode);
|
connector_set_mode(data, &connector, &connector.config.default_mode);
|
||||||
|
|
||||||
|
pipe_crc = create_crc(data, test_data->crtc_idx);
|
||||||
|
if (!pipe_crc) {
|
||||||
|
printf("auto crc not supported on this connector with crtc %i\n",
|
||||||
|
test_data->crtc_idx);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
data->pipe_crc[test_data->crtc_idx] = pipe_crc;
|
||||||
|
|
||||||
/* x/y position where the cursor is still fully visible */
|
/* x/y position where the cursor is still fully visible */
|
||||||
test_data->left = 0;
|
test_data->left = 0;
|
||||||
test_data->right = connector.config.default_mode.hdisplay - 64;
|
test_data->right = connector.config.default_mode.hdisplay - 64;
|
||||||
@ -276,6 +274,7 @@ static void run_test(data_t *data, enum cursor_type cursor_type, bool onscreen)
|
|||||||
.data = data,
|
.data = data,
|
||||||
};
|
};
|
||||||
int i, n;
|
int i, n;
|
||||||
|
int valid_tests = 0;
|
||||||
|
|
||||||
for (i = 0; i < data->resources->count_connectors; i++) {
|
for (i = 0; i < data->resources->count_connectors; i++) {
|
||||||
uint32_t connector_id = data->resources->connectors[i];
|
uint32_t connector_id = data->resources->connectors[i];
|
||||||
@ -287,6 +286,8 @@ static void run_test(data_t *data, enum cursor_type cursor_type, bool onscreen)
|
|||||||
if (!prepare_crtc(&test_data, connector_id))
|
if (!prepare_crtc(&test_data, connector_id))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
valid_tests++;
|
||||||
|
|
||||||
fprintf(stdout, "Beginning %s on crtc %d, connector %d\n",
|
fprintf(stdout, "Beginning %s on crtc %d, connector %d\n",
|
||||||
igt_subtest_name(), test_data.crtc_id, connector_id);
|
igt_subtest_name(), test_data.crtc_id, connector_id);
|
||||||
|
|
||||||
@ -295,8 +296,12 @@ static void run_test(data_t *data, enum cursor_type cursor_type, bool onscreen)
|
|||||||
|
|
||||||
fprintf(stdout, "\n%s on crtc %d, connector %d: PASSED\n\n",
|
fprintf(stdout, "\n%s on crtc %d, connector %d: PASSED\n\n",
|
||||||
igt_subtest_name(), test_data.crtc_id, connector_id);
|
igt_subtest_name(), test_data.crtc_id, connector_id);
|
||||||
|
|
||||||
|
igt_pipe_crc_free(data->pipe_crc[test_data.crtc_idx]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void exit_handler(int sig)
|
static void exit_handler(int sig)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user