Пример #1
0
static uint32_t plane_get_igt_format(struct kms_atomic_plane_state *plane)
{
	drmModePlanePtr plane_kms;
	const uint32_t *igt_formats;
	uint32_t ret = 0;
	int num_igt_formats;
	int i;

	plane_kms = drmModeGetPlane(plane->state->desc->fd, plane->obj);
	igt_assert(plane_kms);

	igt_get_all_formats(&igt_formats, &num_igt_formats);
	for (i = 0; i < num_igt_formats; i++) {
		int j;

		for (j = 0; j < plane_kms->count_formats; j++) {
			if (plane_kms->formats[j] == igt_formats[i]) {
				ret = plane_kms->formats[j];
				break;
			}
		}
	}

	drmModeFreePlane(plane_kms);
	return ret;
}
Пример #2
0
static void test_connector(const char *test_name,
			   struct kmstest_connector_config *cconf,
			   enum test_flags flags)
{
	const uint32_t *formats;
	int format_count;
	int i;

	igt_get_all_formats(&formats, &format_count);
	for (i = 0; i < format_count; i++) {
		if (intel_gen(intel_get_drm_devid(drm_fd)) < 4
		    && formats[i] == DRM_FORMAT_XRGB2101010) {
			igt_info("gen2/3 don't support 10bpc, skipping\n");
			continue;
		}

		test_format(test_name,
			    cconf, &cconf->connector->modes[0],
			    formats[i], flags);
	}
}