os/graphics/egl/egltest/endpointtestsuite/automated/tinc/egltest_endpoint_engine_types.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/egl/egltest/endpointtestsuite/automated/tinc/egltest_endpoint_engine_types.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,430 @@
1.4 +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @test
1.22 + @internalComponent - Internal Symbian test code
1.23 +*/
1.24 +
1.25 +
1.26 +#ifndef __EGLTEST_ENDPOINT_ENGINE_TYPES_H__
1.27 +#define __EGLTEST_ENDPOINT_ENGINE_TYPES_H__
1.28 +
1.29 +#include "egltest_surface.h"
1.30 +
1.31 +
1.32 +enum TEngineCases
1.33 + {
1.34 + // ECreateEndpointCase
1.35 + // iEndPointIndex is used to store the endpoint at that index.
1.36 + ECreateEndpointCase = 0,
1.37 +
1.38 + // EBeginStreamingCase
1.39 + // Call EglEndpointBeginStreaming.
1.40 + // iEndpointIndex indicates the endpoint to call BeginStreaming on.
1.41 + EBeginStreamingCase = 1,
1.42 +
1.43 + // EAcquireImageCase
1.44 + // iEndpointIndex indicates the endpoint used to acquire the image.
1.45 + // iImageIndex is ignored.
1.46 + EAcquireImageCase = 2,
1.47 +
1.48 + // EReleaseImageCase
1.49 + // iEndpointIndex indicates the endpoint used to acquire the image.
1.50 + // iImageIndex indicates the slot of the eglImage to be used.
1.51 + EReleaseImageCase = 3,
1.52 +
1.53 + // EEndStreamingCase
1.54 + // Call EglEndPointEndStreaming.
1.55 + // iEndpointIndex indicates which endpoint to use.
1.56 + EEndStreamingCase = 4,
1.57 +
1.58 + // EContentUpdateCase
1.59 + // iEndpointIndex indicates which surface to use.
1.60 + // iImageIndex index to the rectangle set to pass in as "dirty rectangles".
1.61 + // if index = 0, then a NULL is passed - indicating full surface
1.62 + // (no other value currently supported).
1.63 + // iFlags: ENoWait: complete immediately, rather than wait for displayed
1.64 + // notification (only valid for non-EGL surfaces).
1.65 + // ENoSync: Do not wait for contentupdate to complete, instead,
1.66 + // use a short delay (300ms) to ensure the submitupdate
1.67 + // has reached SUS.
1.68 + // This is necessary to avoid a deadlock where the local
1.69 + // side is doing EglSwapBuffer [or similar], and the
1.70 + // remote side has not yet done EglReleaseImageNOK.
1.71 + // If the local side was to wait for the EglSwapBuffer
1.72 + // to complete, the EglReleaseImageNOK would not happen.
1.73 + // There is no need to have ENoSync if the EglReleaseBuffer
1.74 + // for that endpoint is called before the EContentUpdateCase.
1.75 + EContentUpdateCase = 5,
1.76 +
1.77 + // EDestroyEndpointCase
1.78 + // iEndpointIndex indciates the endpoint to be destroyed.
1.79 + EDestroyEndpointCase = 6,
1.80 +
1.81 + // ETerminateCase
1.82 + // Call eglTerminate and does various other cleanup.
1.83 + // No egl calls except eglInitialize is expected to "work" after this point.
1.84 + // This is also sent to the local exec thread to terminate it when test step
1.85 + // is finished.
1.86 + ETerminateCase = 7,
1.87 +
1.88 + // EInitializeCase
1.89 + // Initialize. Call eglInitialize and other setup.
1.90 + EInitializeCase = 8,
1.91 +
1.92 + // EGetAttributeCase
1.93 + // iEndpointIndex indicates the endpoint to use.
1.94 + // iArg1 is the attribute key to request.
1.95 + // iArg2 is the value expected.
1.96 + EGetAttribCase = 9,
1.97 +
1.98 + // ESetAttributeCase
1.99 + // iEndpointIndex indicates the endpoint to use.
1.100 + // iImageIndex is ignored.
1.101 + // iArg1 is the attribute key to request.
1.102 + // iArg2 is the value to set.
1.103 + ESetAttribCase = 10,
1.104 +
1.105 + // ECreateSurfaceCase
1.106 + // iEndpointIndex indicates which the surface object is stored at
1.107 + // iImageIndex indicates the surfaceParams to use.
1.108 + ECreateSurfaceCase = 11,
1.109 +
1.110 + // EDrawContentCase
1.111 + // Draws an image.
1.112 + // iEndpointIndex indicates the surface to draw to.
1.113 + // iImageIndex is the index of the image to be drawn.
1.114 + EDrawContentCase = 12,
1.115 +
1.116 + // ECompareImageCase
1.117 + // iEndpointIndex = the index of the eglimage stored, the iImageIndex when it was acquired
1.118 + // iImageIndex is the index of the image to compare
1.119 + ECompareImageCase = 13,
1.120 +
1.121 + // EBufferCountCase
1.122 + // Query the surface to find out number of buffers, and only run the remainder
1.123 + // of case if the number of buffers match. If test fails, log a warning that
1.124 + // the test is not executed, then terminate the case.
1.125 + // iEndpointIndex = number of the surface to check.
1.126 + // iImageIndex = n/a - ignored.
1.127 + // arg1 = Min buffer count (inclusive). 0 -> any number.
1.128 + // arg2 = Max buffer count (inclusive). 0 -> any number
1.129 + EBufferCountCase = 14,
1.130 +
1.131 + // ENotifyWhenCase
1.132 + // iEndpointIndex = surface for which the notification applies.
1.133 + // iImageIndex = which notification (See TNotification in egltest_surface.h)
1.134 + // iArg1 = XTimes when ENotifyWhenDispXTimes
1.135 + ENotifyWhenCase = 15,
1.136 +
1.137 + // EWaitForCase
1.138 + // iExpectedError = KErrTimedOut if the notification is expected to "not be signaled", KErrNone for other cases.
1.139 + // iEndpointIndex = surface for which to wait on notification (also used for timestamp).
1.140 + // iImageIndex = which notification (See TNotification in egltest_surface.h)
1.141 + // iArg1 = Timeout length in microseconds.
1.142 + // iArg2 = expected timestamp. (NOtifywhendisplayed), relative to timestamp of ETimeStampCase.
1.143 + EWaitForCase = 16,
1.144 +
1.145 + // ECreateVgImageCase
1.146 + // iEndpointIndex = the index of the eglimage to create the vgimage from.
1.147 + // iImageIndex is the index in the vgimages array that the created vgimage will be saved to.
1.148 + ECreateVgImageCase = 17,
1.149 +
1.150 + // EDestroyVgImageCase
1.151 + // iImageIndex is the index in the vgimages array that will be destroyed.
1.152 + EDestroyVgImageCase = 18,
1.153 +
1.154 + // EDestroyEglImageCase
1.155 + // Note: This is not intended for normal endpoint tests - use EReleaseImageCase for that.
1.156 + // iEndpointIndex = ignored.
1.157 + // iImageIndex = image index to destroy.
1.158 + EDestroyEglImageCase = 19,
1.159 +
1.160 + // ETimeStampCase
1.161 + // Store current User::FastCounter().
1.162 + // iEndpointIndex = index to store timestamp at (should match the surface index).
1.163 + ETimeStampCase = 20,
1.164 +
1.165 + // ETestVgImageValidCase
1.166 + // Test that the VgImage is valid and "works" by reading some of the pixels in it.
1.167 + // No checking that the content is as expected, since where we use this
1.168 + // is to test that the VgImage is valid after destroying the endpoint - at which point
1.169 + // the content is undefined, but the VgImage must be usable by the effects engine code.
1.170 + // See also ECreateVgImageCase.
1.171 + // iEndpointIndex ignored.
1.172 + // iImageIndex is the index of the vgimage to be drawn.
1.173 + ETestVgImageValidCase = 21,
1.174 +
1.175 + // ERequestNotificationCase
1.176 + // Request a notification of update.
1.177 + // iEndpointIndexis the index of the endpoint to use.
1.178 + ERequestNotificationCase = 22,
1.179 +
1.180 + // ECancelNotificationCase
1.181 + // Cancel a notification of update.
1.182 + // iEndpointIndexis the index of the endpoint to use.
1.183 + ECancelNotificationCase = 23,
1.184 +
1.185 + // EWaitForNotificationCase
1.186 + // Wait for the notification of the
1.187 + // iEndpointIndex is the index of the endpoint to use.
1.188 + // iImageIndex - not used
1.189 + // iArg1 - timeout value in microseconds.
1.190 + EWaitForNotificationCase = 24,
1.191 +
1.192 + // EGetEndpointDirtyAreaCase
1.193 + // Get dirty area
1.194 + // iEndpointIndex is the index of the endpoint to use.
1.195 + // iImageIndex index to the rectangle set to pass in as "dirty rectangles".
1.196 + // if index = 0, then full surface is expected.
1.197 + // iarg1 start_rect
1.198 + // iArg2 max_rects
1.199 + // iFlags - EUseNullRects - pass NULL as the rects value.
1.200 + // EUseCollapseArea - pass TRUE for collapse
1.201 + EGetEndpointDirtyAreaCase = 25,
1.202 +
1.203 + // EGetSurfaceParamsCase
1.204 + // Get parameters of the surface.
1.205 + // iEndpointIndex is the index of the surface being used.
1.206 + // This is used for internal communication between the controller thread
1.207 + // and the EGL execution thread, so the parameters can be passed over to
1.208 + // the remote side. This is due to the fact that we can only use the
1.209 + // RWindow component that is part of an EGL surface in the thread that
1.210 + // created the RWindow.
1.211 + EGetSurfaceParamsCase = 26,
1.212 +
1.213 + // EDestroySurfaceCase
1.214 + // Opposite of ECreatSurfaceCase.
1.215 + // iEndpointIndex indicates which surface object
1.216 + EDestroySurfaceCase = 27,
1.217 +
1.218 + // EStartLoadThreadCase
1.219 + // For tests that have some sort of second thread that does "loading"
1.220 + // (e.g. heavy drawing or using up memory), this will start that thread.
1.221 + // iEndpointIndex is the thread number.
1.222 + // Note, relies on the thread implementing a StartLoadThread() function -
1.223 + // default implementation will panic.
1.224 + EStartLoadThreadCase = 28,
1.225 +
1.226 + // EEndLoadThreadCase
1.227 + // For tests that have some sort of second thread that does "loading"
1.228 + // (e.g. heavy drawing or using up memory), this will end the thread.
1.229 + // iEndpointIndex is the thread number.
1.230 + // Note, relies on the thread implementing a EndLoadThread() function -
1.231 + // default implementation will panic.
1.232 + EEndLoadThreadCase = 29,
1.233 +
1.234 + // ECheckForMemoryLeaks
1.235 + // Used by tests that perform for example out-of-memory testing.
1.236 + // Executed on the in the remote engine code.
1.237 + // The amount of memory available is stored in an array, and when
1.238 + // the ECheckForMemoryLeaksFinish is called, the statistics is
1.239 + // calculated abd deternubed if there is a leak or not.
1.240 + ECheckForMemoryLeaks = 30,
1.241 +
1.242 + // ECheckForMemoryLeaksFinish
1.243 + // Check the collected data from ECheckForMemoryLeaks, and determine the
1.244 + // trend of memory usage.
1.245 + // See ECheckForMemoryLeaks
1.246 + ECheckForMemoryLeaksFinish = 31,
1.247 +
1.248 + // ESpecialEglHeapCase
1.249 + // Configure a heap for the EGL calls.
1.250 + // This is used to allow egl calls to be done with a heap that is full.
1.251 + // iEndpointIndex = min size
1.252 + // iImageIndex = max size
1.253 + // IMPORTANT NOTE: This HAS TO BE the first case sent to the remote engine.
1.254 + ESpecialEglHeapCase = 32,
1.255 +
1.256 +
1.257 + ///
1.258 + /// Debug cases
1.259 + ///
1.260 + // EBreakPointCase
1.261 + // Used for debugging.
1.262 + // iFlags = EDebugExecThread, EDebugController, EDebugRemote - break
1.263 + // exec_thread, controller and/or remote part of engine.
1.264 + EBreakPointCase = 64,
1.265 +
1.266 + // ELogEnableCase
1.267 + // Logging enable - all items executed after this point are written out, including data parameters.
1.268 + // iFlags = EDebugLocal, EDebugRemote - log on local/remote side.
1.269 + ELogEnableCase = 65,
1.270 +
1.271 + ///////////////////////////////////////////////////////
1.272 + // Control messages - "done", "sync", etc.
1.273 + ///////////////////////////////////////////////////////
1.274 +
1.275 + // ESetVerdictCase
1.276 + // Used to set the relevant threads "teststepresult".
1.277 + // Flags indicate which thread is updated.
1.278 + // iEndpointIndex = verdict to set.
1.279 + // Note: Remote value is not using the ERtvXXX values, the standard
1.280 + // values in Test Framework are translated in the remote step.
1.281 + ESetVerdictCase = 996,
1.282 +
1.283 + // ESyncLocalCase
1.284 + // Used for synchronizing the local execution thread.
1.285 + // Should normally not be needed for the common cases of coding, but used internally to
1.286 + // perform the synchronization.
1.287 + ESyncLocalCase = 997,
1.288 +
1.289 + // EPanicCase
1.290 + // Cause panic on local or remote side. Used for testing purposes only.
1.291 + // iFlags = EDebugExecThread, EDebugController, EDebugRemote - break
1.292 + // exec_thread, controller and/or remote part of engine.
1.293 + EPanicCase = 998,
1.294 +
1.295 + // EIllegalCase
1.296 + // A case that is by definition not legal/valid. There should be no case-
1.297 + // statement for this in the engine, it should be treated as a "unknown" case,
1.298 + // and cause any test to fail in the same way as if an unused value was put
1.299 + // in the table. Used for testing purposes, and can also be used to make a
1.300 + // particular test fail on purpose (e.g. due to production code bugs).
1.301 + // All arguments ignored.
1.302 + EIllegalCase = 999,
1.303 +
1.304 + // Indicate end of sequence.
1.305 + EFinishedCase = 1000
1.306 + };
1.307 +
1.308 +enum TEngineFlags
1.309 + {
1.310 + EUseBadDisplay = 1 << 0,
1.311 + EUseBadEndpoint = 1 << 1,
1.312 + EUseBadEglImage = 1 << 2,
1.313 + EUseBadEndpointType = 1 << 3,
1.314 + EUseBadSourceType = 1 << 4,
1.315 + EExpectError = 1 << 5, // Used when other flags are not indicating a failure expected.
1.316 + EUseBadSurfaceId = 1 << 6,
1.317 + EUseBadApi = 1 << 7,
1.318 + // Flag to modify EContentUpdateCase to not wait for displayed.
1.319 + EUseBadSync = 1 << 8,
1.320 + EUseBadRects = 1 << 9,
1.321 + // Extra flags for EGetEndpointDirtyAreaCase
1.322 + EUseNullRects = 1 << 10,
1.323 + EUseCollapseArea = 1 << 11,
1.324 +
1.325 + // flags used by EContentUpdateCase
1.326 + ENoWait = 1 << 14,
1.327 + ENoSync = 1 << 15,
1.328 +
1.329 + // Debug flags - perform operation on "Local"
1.330 + EDebugExecThread = 1 << 16,
1.331 + EDebugRemote = 1 << 17,
1.332 + EDebugController = 1 << 18,
1.333 +
1.334 + // ThreadingFlags - just rename the debug flags, because it's actually the
1.335 + // same thing. We _RELY_ on this being the same to simplify the code in
1.336 + // the controller thread.
1.337 + // Note: the lack of "execthread" is intentional. Since controller and exec
1.338 + // are in the same process, there is no reason to use the ExecThread to
1.339 + // start a new thread. ??This may need to be changed int he future.??
1.340 + EThreadRemote = EDebugRemote,
1.341 + EThreadController = EDebugController,
1.342 + };
1.343 +
1.344 +enum TEngineFlagsMask
1.345 + {
1.346 + // Mask to match all "bad".
1.347 + EExpectFailureMask = EUseBadDisplay |
1.348 + EUseBadEndpoint |
1.349 + EUseBadEglImage |
1.350 + EUseBadEndpointType |
1.351 + EUseBadSourceType |
1.352 + EExpectError |
1.353 + EUseBadSurfaceId |
1.354 + EUseBadApi |
1.355 + EUseBadSync |
1.356 + EUseBadRects |
1.357 + 0 // So that it's easier to merge.
1.358 + };
1.359 +
1.360 +
1.361 +enum TRemoteThreadEngineThread
1.362 + {
1.363 + EUnknownThread = 0,
1.364 + EThreadLoadHeapMemory = 1,
1.365 + EThreadLoadGpuMemory = 2,
1.366 + EThreadLoadGpuProcessor = 3,
1.367 + };
1.368 +
1.369 +struct TEngineTestCase
1.370 + {
1.371 + TEngineCases iCase; // Command to execute. See TEngineCases for details.
1.372 + TInt iFlags; // Flags to indicate for example bad parameters (TEngineFlags).
1.373 + TInt iErrorExpected; // The value that eglGetError() is expected to return.
1.374 + TInt iEndpointIndex; // Index to the endpoint to use.
1.375 + TInt iImageIndex; // Index to image to draw/compare(egltest_endpoint_images)
1.376 + TInt iArg1; // E.g. GetAttrib or SetAttrib attrib.
1.377 + TInt iArg2; // E.g GetAttrib expected value or SetAttrib value to set.
1.378 + };
1.379 +
1.380 +
1.381 +struct TTestEndpointEngine
1.382 + {
1.383 + TSurfaceParamsRemote iSurfaceParams;
1.384 + TEngineTestCase iEngineTestCase;
1.385 + };
1.386 +
1.387 +// Passed to StartRemoteTestStep() during test startup.
1.388 +struct TTestEndpointEngineConfig
1.389 + {
1.390 + TBool iLogErrors;
1.391 + };
1.392 +
1.393 +// Number of small steps that each test is allowed to contain. Since each test
1.394 +// that uses the engine has at least one table like this, increasing this
1.395 +// hugely will increase the overall memory usage of the application (each
1.396 +// entry is about 28 bytes). So, don't go multiplying by 10 or some such
1.397 +// unless there is a REAL need for that.
1.398 +// THe current tables take up approximately 28 * 80 = 2240 bytes.
1.399 +// As of right now, there are about 100 tests -> 220KB of tables.
1.400 +const TInt KMaxCases = 80;
1.401 +
1.402 +// Should be PLENTY of endpoints [also used for surfaces, images and other
1.403 +// objects that have roughly 1:1 mapping with endpoints. This is dynamically
1.404 +// allocated in the constructor of the engine class.
1.405 +const TInt KMaxEndpoints = 1000;
1.406 +
1.407 +// Max number of surfacetypes we expect to be listed.
1.408 +// This can be increased as and when needed.
1.409 +const TInt KMaxSurfaceList = 4;
1.410 +
1.411 +struct TTestCaseBase
1.412 + {
1.413 + const TText* iRelatedTestIds;
1.414 + const TText* iName;
1.415 + TInt iSurfaceTypeCount;
1.416 + TSurfaceType iSurfaceTypeList[KMaxSurfaceList];
1.417 + };
1.418 +
1.419 +// Structure for lists of cases to execute
1.420 +struct TTestCase
1.421 + {
1.422 + // Use anonymous struct to avoid changing code all over the place.
1.423 + TTestCaseBase iBase;
1.424 + TEngineTestCase iEngineTestCase[KMaxCases];
1.425 + };
1.426 +
1.427 +struct TTestCases
1.428 + {
1.429 + const TTestCase *iCase;
1.430 + TInt iCount;
1.431 + };
1.432 +
1.433 +#endif