diff --git a/include/compute_lib/compute_lib.c b/include/compute_lib/compute_lib.c index 74baec6..ec5c91c 100644 --- a/include/compute_lib/compute_lib.c +++ b/include/compute_lib/compute_lib.c @@ -39,6 +39,7 @@ int compute_lib_init(compute_lib_instance_t* inst) fprintf(stderr, "[ComputeLib]: Selecting the main renderer path %s", COMPUTE_LIB_GPU_DRI_PATH); inst->fd = open(COMPUTE_LIB_GPU_DRI_PATH, O_RDWR); if (inst->fd <= 0) { + fprintf(stderr, "[ComputeLib]: Failed to open main renderer path %s", COMPUTE_LIB_GPU_DRI_PATH); compute_lib_deinit(inst); return COMPUTE_LIB_ERROR_GPU_DRI_PATH; } @@ -46,10 +47,12 @@ int compute_lib_init(compute_lib_instance_t* inst) fprintf(stderr, "[ComputeLib]: Selecting the backup renderer path %s", COMPUTE_LIB_GPU_DRI_BACKUP_PATH); inst->fd = open(COMPUTE_LIB_GPU_DRI_BACKUP_PATH, O_RDWR); if (inst->fd <= 0) { + fprintf(stderr, "[ComputeLib]: Failed to open backup renderer path %s", COMPUTE_LIB_GPU_DRI_BACKUP_PATH); compute_lib_deinit(inst); return COMPUTE_LIB_ERROR_GPU_DRI_BACKUP_PATH; } } + fprintf(stderr, "[ComputeLib]: Opened the renderer."); inst->gbm = gbm_create_device(inst->fd); if (inst->gbm == NULL) { @@ -115,30 +118,38 @@ int compute_lib_init(compute_lib_instance_t* inst) void compute_lib_deinit(compute_lib_instance_t* inst) { + fprintf(stderr, "[ComputeLib]: De-initializing Compute lib..."); if (inst->ctx != EGL_NO_CONTEXT && inst->dpy != NULL) { + fprintf(stderr, "[ComputeLib]: Destroying context..."); eglDestroyContext(inst->dpy, inst->ctx); } inst->ctx = EGL_NO_CONTEXT; if (inst->dpy != NULL) { + fprintf(stderr, "[ComputeLib]: Terminating..."); eglTerminate(inst->dpy); } inst->dpy = NULL; if (inst->gbm != NULL) { + fprintf(stderr, "[ComputeLib]: Destroying device..."); gbm_device_destroy(inst->gbm); } inst->gbm = NULL; if (inst->fd > 0) { + fprintf(stderr, "[ComputeLib]: Closing renderer file..."); close(inst->fd); } inst->fd = 0; + fprintf(stderr, "[ComputeLib]: Flushing error queue..."); compute_lib_error_queue_flush(inst, NULL); + fprintf(stderr, "[ComputeLib]: Deleting error queue..."); queue_delete(inst->error_queue); inst->initialised = false; + fprintf(stderr, "[ComputeLib]: De-initialized."); } int compute_lib_error_queue_flush(compute_lib_instance_t* inst, FILE* out)