Rev 5362 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5362 | Rev 5366 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | * "Software"), to deal in the Software without restriction, including |
6 | * "Software"), to deal in the Software without restriction, including |
7 | * without limitation the rights to use, copy, modify, merge, publish, |
7 | * without limitation the rights to use, copy, modify, merge, publish, |
8 | * distribute, sub license, and/or sell copies of the Software, and to |
8 | * distribute, sub license, and/or sell copies of the Software, and to |
9 | * permit persons to whom the Software is furnished to do so, subject to |
9 | * permit persons to whom the Software is furnished to do so, subject to |
10 | * the following conditions: |
10 | * the following conditions: |
11 | * |
11 | * |
12 | * The above copyright notice and this permission notice (including the |
12 | * The above copyright notice and this permission notice (including the |
13 | * next paragraph) shall be included in all copies or substantial portions |
13 | * next paragraph) shall be included in all copies or substantial portions |
14 | * of the Software. |
14 | * of the Software. |
15 | * |
15 | * |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
17 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
17 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
19 | * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR |
19 | * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR |
20 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
20 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
Line 34... | Line 34... | ||
34 | #define DEAD_SURFACE_ID (VASurfaceID) 0xbeefdead |
34 | #define DEAD_SURFACE_ID (VASurfaceID) 0xbeefdead |
Line 35... | Line 35... | ||
35 | 35 | ||
36 | void test_unique_surfaces(VASurfaceID *surface_list1, int surface_count1, VASurfaceID *surface_list2, int surface_count2) |
36 | void test_unique_surfaces(VASurfaceID *surface_list1, int surface_count1, VASurfaceID *surface_list2, int surface_count2) |
37 | { |
37 | { |
38 | int i,j; |
38 | int i,j; |
39 | 39 | ||
40 | for(i = 0; i < surface_count1; i++) |
40 | for(i = 0; i < surface_count1; i++) |
41 | { |
41 | { |
42 | for(j = 0; j < surface_count2; j++) |
42 | for(j = 0; j < surface_count2; j++) |
43 | { |
43 | { |
Line 54... | Line 54... | ||
54 | { |
54 | { |
55 | VASurfaceID surfaces_1[1+1]; |
55 | VASurfaceID surfaces_1[1+1]; |
56 | VASurfaceID surfaces_4[4+1]; |
56 | VASurfaceID surfaces_4[4+1]; |
57 | VASurfaceID surfaces_16[16+1]; |
57 | VASurfaceID surfaces_16[16+1]; |
58 | VASurfaceID surfaces_6[6+1]; |
58 | VASurfaceID surfaces_6[6+1]; |
59 | 59 | ||
60 | memset(surfaces_1, 0xff, sizeof(surfaces_1)); |
60 | memset(surfaces_1, 0xff, sizeof(surfaces_1)); |
61 | memset(surfaces_4, 0xff, sizeof(surfaces_4)); |
61 | memset(surfaces_4, 0xff, sizeof(surfaces_4)); |
62 | memset(surfaces_16, 0xff, sizeof(surfaces_16)); |
62 | memset(surfaces_16, 0xff, sizeof(surfaces_16)); |
63 | memset(surfaces_6, 0xff, sizeof(surfaces_6)); |
63 | memset(surfaces_6, 0xff, sizeof(surfaces_6)); |
Line 77... | Line 77... | ||
77 | status("vaCreateSurfaces 16 surfaces\n"); |
77 | status("vaCreateSurfaces 16 surfaces\n"); |
78 | surfaces_16[16] = DEAD_SURFACE_ID; |
78 | surfaces_16[16] = DEAD_SURFACE_ID; |
79 | va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 352, 288, surfaces_16, 16, NULL, 0); |
79 | va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 352, 288, surfaces_16, 16, NULL, 0); |
80 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
80 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
81 | ASSERT( DEAD_SURFACE_ID == surfaces_16[16] ); /* bounds check */ |
81 | ASSERT( DEAD_SURFACE_ID == surfaces_16[16] ); /* bounds check */ |
82 | 82 | ||
83 | test_unique_surfaces(surfaces_1, 1, surfaces_4, 4); |
83 | test_unique_surfaces(surfaces_1, 1, surfaces_4, 4); |
84 | test_unique_surfaces(surfaces_4, 4, surfaces_16, 4); |
- | |
85 | test_unique_surfaces(surfaces_4, 4, surfaces_16, 16); |
84 | test_unique_surfaces(surfaces_4, 4, surfaces_16, 16); |
86 | test_unique_surfaces(surfaces_4, 1, surfaces_16, 16); |
85 | test_unique_surfaces(surfaces_4, 1, surfaces_16, 16); |
87 | test_unique_surfaces(surfaces_1, 16, surfaces_16, 16); |
- | |
Line 88... | Line 86... | ||
88 | 86 | ||
89 | status("vaDestroySurface 4 surfaces\n"); |
87 | status("vaDestroySurface 4 surfaces\n"); |
90 | va_status = vaDestroySurfaces(va_dpy, surfaces_4, 4); |
88 | va_status = vaDestroySurfaces(va_dpy, surfaces_4, 4); |
91 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
89 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
92 | 90 | ||
93 | status("vaCreateSurfaces 6 surfaces\n"); |
91 | status("vaCreateSurfaces 6 surfaces\n"); |
94 | surfaces_6[6] = DEAD_SURFACE_ID; |
92 | surfaces_6[6] = DEAD_SURFACE_ID; |
95 | va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 352, 288, surfaces_6, 6, NULL, 0); |
93 | va_status = vaCreateSurfaces(va_dpy, VA_RT_FORMAT_YUV420, 352, 288, surfaces_6, 6, NULL, 0); |
96 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
94 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
Line 97... | Line 95... | ||
97 | ASSERT( DEAD_SURFACE_ID == surfaces_6[6] ); /* bounds check */ |
95 | ASSERT( DEAD_SURFACE_ID == surfaces_6[6] ); /* bounds check */ |
98 | 96 | ||
99 | test_unique_surfaces(surfaces_1, 1, surfaces_6, 6); |
97 | test_unique_surfaces(surfaces_1, 1, surfaces_6, 6); |
Line 100... | Line 98... | ||
100 | test_unique_surfaces(surfaces_6, 6, surfaces_16, 16); |
98 | test_unique_surfaces(surfaces_6, 6, surfaces_16, 16); |
101 | test_unique_surfaces(surfaces_1, 6, surfaces_16, 6); |
99 | test_unique_surfaces(surfaces_1, 1, surfaces_16, 16); |
102 | 100 | ||
103 | status("vaDestroySurface 16 surfaces\n"); |
101 | status("vaDestroySurface 16 surfaces\n"); |
104 | va_status = vaDestroySurfaces(va_dpy, surfaces_16, 16); |
102 | va_status = vaDestroySurfaces(va_dpy, surfaces_16, 16); |
105 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
103 | ASSERT( VA_STATUS_SUCCESS == va_status ); |
106 | 104 | ||
Line 107... | Line 105... | ||
107 | status("vaDestroySurface 1 surface\n"); |
105 | status("vaDestroySurface 1 surface\n"); |