From 078f142bbac2ea5f59bdd5d51d357710c8dc2470 Mon Sep 17 00:00:00 2001 From: Viktor Walter Date: Wed, 28 Feb 2024 11:53:40 +0100 Subject: [PATCH] More printouts in the compute lib --- include/compute_lib/compute_lib.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)