diff options
| author | Jon Ashburn <jon@lunarg.com> | 2015-01-29 16:54:38 -0700 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-02-04 17:58:10 -0700 |
| commit | 3fd4b119176c5c166c44012b5e09fccb9c637157 (patch) | |
| tree | be9226e71939fa4d167564c0950fdb435d08028f | |
| parent | 40a0fdaf0b3c146fd3d3dab4e0a499bbfa2bb3ba (diff) | |
| download | usermoji-3fd4b119176c5c166c44012b5e09fccb9c637157.tar.xz | |
instance: Remove xglInitAndEnumerateGpus
| -rw-r--r-- | icd/common/icd-alloc.c | 5 | ||||
| -rw-r--r-- | include/xgl.h | 8 | ||||
| -rw-r--r-- | include/xglLayer.h | 1 | ||||
| -rw-r--r-- | loader/loader.c | 90 | ||||
| -rwxr-xr-x | xgl-generate.py | 2 | ||||
| -rw-r--r-- | xgl.py | 7 |
6 files changed, 1 insertions, 112 deletions
diff --git a/icd/common/icd-alloc.c b/icd/common/icd-alloc.c index 5df2c357..30aad783 100644 --- a/icd/common/icd-alloc.c +++ b/icd/common/icd-alloc.c @@ -79,11 +79,6 @@ XGL_RESULT icd_allocator_init(const XGL_ALLOC_CALLBACKS *alloc_cb) if (!alloc_cb) alloc_cb = &default_cb; - /* - * The spec says: Changing the callbacks on subsequent calls to - * xglInitAndEnumerateGpus() causes it to fail with - * XGL_ERROR_INVALID_POINTER error. - */ return (memcmp(&icd_allocator.callbacks, alloc_cb, sizeof(*alloc_cb))) ? XGL_ERROR_INVALID_POINTER : XGL_SUCCESS; } diff --git a/include/xgl.h b/include/xgl.h index 4d4a8c53..d67b4422 100644 --- a/include/xgl.h +++ b/include/xgl.h @@ -2241,7 +2241,6 @@ typedef struct _XGL_DISPATCH_INDIRECT_CMD // ------------------------------------------------------------------------------------------------ // API functions -typedef XGL_RESULT (XGLAPI *xglInitAndEnumerateGpusType)(const XGL_APPLICATION_INFO* pAppInfo, const XGL_ALLOC_CALLBACKS* pAllocCb, uint32_t maxGpus, uint32_t* pGpuCount, XGL_PHYSICAL_GPU* pGpus); typedef XGL_RESULT (XGLAPI *xglCreateInstanceType)(const XGL_APPLICATION_INFO* pAppInfo, const XGL_ALLOC_CALLBACKS* pAllocCb, XGL_INSTANCE* pInstance); typedef XGL_RESULT (XGLAPI *xglDestroyInstanceType)(XGL_INSTANCE instance); typedef XGL_RESULT (XGLAPI *xglEnumerateGpusType)(XGL_INSTANCE instance, uint32_t maxGpus, uint32_t* pGpuCount, XGL_PHYSICAL_GPU* pGpus); @@ -2358,13 +2357,6 @@ typedef XGL_RESULT (XGLAPI *xglCreateRenderPassType)(XGL_DEVICE device, const XG // GPU initialization -XGL_RESULT XGLAPI xglInitAndEnumerateGpus( - const XGL_APPLICATION_INFO* pAppInfo, - const XGL_ALLOC_CALLBACKS* pAllocCb, - uint32_t maxGpus, - uint32_t* pGpuCount, - XGL_PHYSICAL_GPU* pGpus); - XGL_RESULT XGLAPI xglCreateInstance( const XGL_APPLICATION_INFO* pAppInfo, const XGL_ALLOC_CALLBACKS* pAllocCb, diff --git a/include/xglLayer.h b/include/xglLayer.h index 5fb8e8c2..a229b2cf 100644 --- a/include/xglLayer.h +++ b/include/xglLayer.h @@ -26,7 +26,6 @@ typedef struct _XGL_BASE_LAYER_OBJECT typedef struct _XGL_LAYER_DISPATCH_TABLE { xglGetProcAddrType GetProcAddr; - xglInitAndEnumerateGpusType InitAndEnumerateGpus; xglCreateInstanceType CreateInstance; xglDestroyInstanceType DestroyInstance; xglEnumerateGpusType EnumerateGpus; diff --git a/loader/loader.c b/loader/loader.c index 1404dee1..453e69de 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -81,7 +81,6 @@ struct loader_msg_callback { struct loader_scanned_icds { void *handle; xglGetProcAddrType GetProcAddr; - xglInitAndEnumerateGpusType InitAndEnumerateGpus; xglCreateInstanceType CreateInstance; xglDestroyInstanceType DestroyInstance; xglEnumerateGpusType EnumerateGpus; @@ -299,7 +298,6 @@ static void loader_scanned_icd_add(const char *filename) { void *handle; void *fp_gpa, *fp_enumerate, *fp_create_inst, *fp_destroy_inst; - void *fp_init; struct loader_scanned_icds *new_node; handle = dlopen(filename, RTLD_LAZY); @@ -320,7 +318,6 @@ static void loader_scanned_icd_add(const char *filename) LOOKUP(fp_create_inst, CreateInstance); LOOKUP(fp_destroy_inst, DestroyInstance); LOOKUP(fp_enumerate, EnumerateGpus); - LOOKUP(fp_init, InitAndEnumerateGpus); #undef LOOKUP new_node = (struct loader_scanned_icds *) malloc(sizeof(struct loader_scanned_icds)); @@ -334,7 +331,6 @@ static void loader_scanned_icd_add(const char *filename) new_node->CreateInstance = fp_create_inst; new_node->DestroyInstance = fp_destroy_inst; new_node->EnumerateGpus = fp_enumerate; - new_node->InitAndEnumerateGpus = fp_init; new_node->next = loader.scanned_icd_list; loader.scanned_icd_list = new_node; } @@ -988,92 +984,6 @@ LOADER_EXPORT void * XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const char * pN } } -LOADER_EXPORT XGL_RESULT XGLAPI xglInitAndEnumerateGpus(const XGL_APPLICATION_INFO* pAppInfo, const XGL_ALLOC_CALLBACKS* pAllocCb, uint32_t maxGpus, uint32_t* pGpuCount, XGL_PHYSICAL_GPU* pGpus) -{ - static pthread_once_t once = PTHREAD_ONCE_INIT; - struct loader_icd *icd; - uint32_t count = 0; - XGL_RESULT res; - struct loader_scanned_icds *scanned_icds; - - pthread_once(&once, loader_icd_scan); - - // for now only one instance - if (loader.instances == NULL) { - loader.instances = malloc(sizeof(struct loader_instance)); - if (loader.instances == NULL) - return XGL_ERROR_UNAVAILABLE; - memset(loader.instances, 0, sizeof(struct loader_instance)); - - scanned_icds = loader.scanned_icd_list; - while (scanned_icds) { - loader_icd_add(loader.instances, scanned_icds); - scanned_icds = scanned_icds->next; - } - - if (loader.instances->icds == NULL) - return XGL_ERROR_UNAVAILABLE; - } - - // cleanup any prior layer initializations - loader_deactivate_layer(loader.instances); - - - icd = loader.instances->icds; - while (icd) { - XGL_PHYSICAL_GPU gpus[XGL_MAX_PHYSICAL_GPUS]; - XGL_BASE_LAYER_OBJECT * wrappedGpus; - xglGetProcAddrType getProcAddr = icd->scanned_icds->GetProcAddr; - uint32_t n, max = maxGpus - count; - - if (max > XGL_MAX_PHYSICAL_GPUS) { - max = XGL_MAX_PHYSICAL_GPUS; - } - - res = icd->scanned_icds->InitAndEnumerateGpus(pAppInfo, pAllocCb, max, &n, gpus); - if (res == XGL_SUCCESS && n) { - wrappedGpus = (XGL_BASE_LAYER_OBJECT*) malloc(n * sizeof(XGL_BASE_LAYER_OBJECT)); - icd->gpus = wrappedGpus; - icd->gpu_count = n; - icd->loader_dispatch = (XGL_LAYER_DISPATCH_TABLE *) malloc(n * sizeof(XGL_LAYER_DISPATCH_TABLE)); - for (int i = 0; i < n; i++) { - (wrappedGpus + i)->baseObject = gpus[i]; - (wrappedGpus + i)->pGPA = getProcAddr; - (wrappedGpus + i)->nextObject = gpus[i]; - memcpy(pGpus + count, &wrappedGpus, sizeof(*pGpus)); - loader_init_dispatch_table(icd->loader_dispatch + i, getProcAddr, gpus[i]); - const XGL_LAYER_DISPATCH_TABLE * *disp = (const XGL_LAYER_DISPATCH_TABLE * *) gpus[i]; - *disp = icd->loader_dispatch + i; - } - - if (loader_icd_set_global_options(icd) != XGL_SUCCESS || - loader_icd_register_msg_callbacks(icd) != XGL_SUCCESS) { - loader_log(XGL_DBG_MSG_WARNING, 0, - "ICD ignored: failed to migrate settings"); - loader_icd_destroy(icd); - } - count += n; - - if (count >= maxGpus) { - break; - } - } - - icd = icd->next; - } - - /* we have nothing to log anymore */ - loader_msg_callback_clear(); - - /* get layer libraries */ - if (!loader.layer_scanned) - layer_lib_scan(NULL); - - *pGpuCount = count; - - return (count > 0) ? XGL_SUCCESS : res; -} - LOADER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved) { uint32_t gpu_index; diff --git a/xgl-generate.py b/xgl-generate.py index 813d8504..2c5b7db7 100755 --- a/xgl-generate.py +++ b/xgl-generate.py @@ -340,7 +340,7 @@ class LayerInterceptProcSubcommand(Subcommand): # we could get the list from argv if wanted self.intercepted = [proto.name for proto in self.protos - if proto.name not in ["InitAndEnumerateGpus"]] + if proto.name not in ["EnumerateGpus"]] for proto in self.protos: if proto.name == "GetProcAddr": @@ -217,13 +217,6 @@ core = Extension( "XGL_RENDER_PASS", ], protos=[ - Proto("XGL_RESULT", "InitAndEnumerateGpus", - [Param("const XGL_APPLICATION_INFO*", "pAppInfo"), - Param("const XGL_ALLOC_CALLBACKS*", "pAllocCb"), - Param("uint32_t", "maxGpus"), - Param("uint32_t*", "pGpuCount"), - Param("XGL_PHYSICAL_GPU*", "pGpus")]), - Proto("XGL_RESULT", "CreateInstance", [Param("const XGL_APPLICATION_INFO*", "pAppInfo"), Param("const XGL_ALLOC_CALLBACKS*", "pAllocCb"), |
