return -EINVAL;
}
- if ((err = hwmem_activate (hwmem_ptr)) < 0) {
- logerr (TAG, "Fail to activate hwmem\n");
- return err;
- }
-
if ((err = hwmem_get_data (hwmem_ptr, &data_ptr)) < 0) {
logerr (TAG, "Error setting data in hwmem, errno: %d\n", err);
goto out;
if (err == 0)
return err2;
}
-
+
return err;
}
return err;
}
+ if ((err = hwmem_activate (hwmem_ptr)) < 0) {
+ logerr (TAG, "Fail to activate hwmem\n");
+ return err;
+ }
+
/** handles all the buffer types */
if ((err = setup_hwmem (dev, model, hwmem_ptr)) < 0) {
goto out_free;
void *data_ptr;
npu_dev = data;
- buffer_ptr_verify = libnpupriv.host_handle->getCurrentOutputBuffer(&err);
- if (buffer_ptr_verify == NULL) {
- logerr (TAG, "Error getting current output buffer, errno: %d", err);
- }
- assert (buffer_ptr_verify == buffer_ptr);
DEVICE_LOCK();
DEVICE_UNLOCK();
if (cb != NULL) {
+ /** This should not be done for sync call, else sync cannot do this */
+ buffer_ptr_verify = libnpupriv.host_handle->getCurrentOutputBuffer(&err);
+ if (buffer_ptr_verify == NULL) {
+ logerr (TAG, "Error getting current output buffer, errno: %d", err);
+ }
+ assert (buffer_ptr_verify == buffer_ptr);
+
output_buf = malloc (sizeof (output_buffer));
if (output_buf == NULL) {
logerr (TAG, "Failed allocating output buffer.");