1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**************************************************************************
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright 2009 Younes Manton.
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * All Rights Reserved.
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining a
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * copy of this software and associated documentation files (the
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * "Software"), to deal in the Software without restriction, including
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * without limitation the rights to use, copy, modify, merge, publish,
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * distribute, sub license, and/or sell copies of the Software, and to
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * permit persons to whom the Software is furnished to do so, subject to
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the following conditions:
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice (including the
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * next paragraph) shall be included in all copies or substantial portions
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * of the Software.
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org **************************************************************************/
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef testlib_h
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define testlib_h
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEST(pred, doc)	test(pred, #pred, doc, __FILE__, __LINE__)
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid test(int pred, const char *pred_string, const char *doc_string, const char *file, unsigned int line);
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org*/
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include <sys/time.h>
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include <X11/Xlib.h>
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include <X11/extensions/XvMClib.h>
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * display: IN			A valid X display
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * width, height: IN		Surface size that the port must display
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * chroma_format: IN		Chroma format that the port must display
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * mc_types, num_mc_types: IN	List of MC types that the port must support, first port that matches the first mc_type will be returned
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * port_id: OUT			Your port's ID
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * surface_type_id: OUT		Your port's surface ID
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * is_overlay: OUT		If 1, port uses overlay surfaces, you need to set a colorkey
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * intra_unsigned: OUT		If 1, port uses unsigned values for intra-coded blocks
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgint GetPort
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org(
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	Display *display,
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	unsigned int width,
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	unsigned int height,
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	unsigned int chroma_format,
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	const unsigned int *mc_types,
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	unsigned int num_mc_types,
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	XvPortID *port_id,
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	int *surface_type_id,
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	unsigned int *is_overlay,
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org	unsigned int *intra_unsigned
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org);
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgunsigned int align(unsigned int value, unsigned int alignment);
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgint timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y);
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif
70