Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +12 −49 Original line number Diff line number Diff line Loading @@ -1280,8 +1280,6 @@ static void handle_sys_error(enum hal_command_response cmd, void *data) return; } core->state = VIDC_CORE_UNINIT; call_hfi_op(hdev, unload_fw, hdev->hfi_device_data); dprintk(VIDC_DBG, "Firmware unloaded\n"); } mutex_unlock(&core->lock); } Loading Loading @@ -2143,15 +2141,17 @@ static int msm_comm_init_core_done(struct msm_vidc_inst *inst) return rc; } int msm_comm_load_fw(struct msm_vidc_core *core) static int msm_comm_init_core(struct msm_vidc_inst *inst) { int rc = 0; struct hfi_device *hdev; struct msm_vidc_core *core; if (!core || !core->device) if (!inst || !inst->core || !inst->core->device) return -EINVAL; hdev = core->device; core = inst->core; hdev = core->device; mutex_lock(&core->lock); if (core->state >= VIDC_CORE_INIT) { dprintk(VIDC_INFO, "Video core: %d is already in state: %d\n", Loading @@ -2159,57 +2159,24 @@ int msm_comm_load_fw(struct msm_vidc_core *core) goto core_already_inited; } if (core->state < VIDC_CORE_LOADED) { rc = call_hfi_op(hdev, load_fw, hdev->hfi_device_data); if (rc) { dprintk(VIDC_ERR, "Failed to load video firmware\n"); mutex_unlock(&core->lock); goto fail_load_fw; } core->state = VIDC_CORE_LOADED; dprintk(VIDC_DBG, "Firmware downloaded\n"); } if (core->state == VIDC_CORE_LOADED) { init_completion(&core->completions [SYS_MSG_INDEX(HAL_SYS_INIT_DONE)]); rc = call_hfi_op(hdev, core_init, hdev->hfi_device_data); if (rc) { dprintk(VIDC_ERR, "Failed to init core, id = %d\n", core->id); mutex_unlock(&core->lock); goto fail_core_init; } core->state = VIDC_CORE_INIT; } core_already_inited: change_inst_state(inst, MSM_VIDC_CORE_INIT); mutex_unlock(&core->lock); return rc; fail_core_init: mutex_lock(&core->lock); call_hfi_op(hdev, unload_fw, hdev->hfi_device_data); core->state = VIDC_CORE_UNINIT; mutex_unlock(&core->lock); fail_load_fw: return rc; } static int msm_comm_init_core(struct msm_vidc_inst *inst) { int rc = 0; if (!inst || !inst->core) return -EINVAL; rc = msm_comm_load_fw(inst->core); if (rc) { dprintk(VIDC_ERR, "%s - firmware loading failed\n", __func__); return rc; } change_inst_state(inst, MSM_VIDC_CORE_INIT); return rc; } Loading Loading @@ -4687,11 +4654,7 @@ void msm_vidc_fw_unload_handler(struct work_struct *work) return; } } core->state = VIDC_CORE_UNINIT; call_hfi_op(hdev, unload_fw, hdev->hfi_device_data); dprintk(VIDC_DBG, "Firmware unloaded\n"); } mutex_unlock(&core->lock); } Loading drivers/media/platform/msm/vidc/msm_vidc_common.h +0 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,6 @@ int msm_comm_smem_cache_operations(struct msm_vidc_inst *inst, struct msm_smem *msm_comm_smem_user_to_kernel(struct msm_vidc_inst *inst, int fd, u32 offset, enum hal_buffer buffer_type); enum hal_video_codec get_hal_codec(int fourcc); int msm_comm_load_fw(struct msm_vidc_core *core); int msm_comm_check_core_init(struct msm_vidc_core *core); int msm_comm_get_inst_load(struct msm_vidc_inst *inst, enum load_calc_quirks quirks); Loading drivers/media/platform/msm/vidc/venus_hfi.c +12 −35 Original line number Diff line number Diff line Loading @@ -89,6 +89,8 @@ static struct hal_session *__get_session(struct venus_hfi_device *device, u32 session_id); static int __iface_cmdq_write(struct venus_hfi_device *device, void *pkt); static int __load_fw(struct venus_hfi_device *device); static void __unload_fw(struct venus_hfi_device *device); /** Loading Loading @@ -2131,6 +2133,12 @@ static int venus_hfi_core_init(void *device) dev = device; mutex_lock(&dev->lock); rc = __load_fw(dev); if (rc) { dprintk(VIDC_ERR, "Failed to load Venus FW\n"); goto err_load_fw; } __set_state(dev, VENUS_STATE_INIT); dev->intr_status = 0; Loading @@ -2149,6 +2157,7 @@ static int venus_hfi_core_init(void *device) __set_registers(dev); enable_irq(dev->hal_data->irq); if (!dev->hal_client) { dev->hal_client = msm_smem_new_client( SMEM_ION, dev->res, MSM_VIDC_UNKNOWN); Loading @@ -2174,7 +2183,6 @@ static int venus_hfi_core_init(void *device) goto err_core_init; } enable_irq(dev->hal_data->irq); __write_register(dev, VIDC_CTRL_INIT, 0x1); rc = __core_start_cpu(dev); if (rc) { Loading Loading @@ -2203,6 +2211,8 @@ static int venus_hfi_core_init(void *device) err_core_init: __set_state(dev, VENUS_STATE_DEINIT); disable_irq_nosync(dev->hal_data->irq); __unload_fw(dev); err_load_fw: mutex_unlock(&dev->lock); return rc; } Loading Loading @@ -2246,6 +2256,7 @@ static int venus_hfi_core_release(void *dev) mutex_lock(&device->lock); rc = __core_release(device); __unload_fw(device); mutex_unlock(&device->lock); return rc; Loading Loading @@ -4381,24 +4392,6 @@ fail_init_res: return rc; } static int venus_hfi_load_fw(void *dev) { int rc = 0; struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s Invalid paramter: %p\n", __func__, device); return -EINVAL; } mutex_lock(&device->lock); rc = __load_fw(device); mutex_unlock(&device->lock); return rc; } static void __unload_fw(struct venus_hfi_device *device) { if (!device->resources.fw.cookie) Loading @@ -4414,20 +4407,6 @@ static void __unload_fw(struct venus_hfi_device *device) __deinit_resources(device); } static void venus_hfi_unload_fw(void *dev) { struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s Invalid paramter: %p\n", __func__, device); return; } mutex_lock(&device->lock); __unload_fw(device); mutex_unlock(&device->lock); } static int venus_hfi_get_fw_info(void *dev, enum fw_info info) { int rc = 0; Loading Loading @@ -4658,8 +4637,6 @@ static void venus_init_hfi_callbacks(struct hfi_device *hdev) hdev->scale_clocks = venus_hfi_scale_clocks; hdev->vote_bus = venus_hfi_vote_buses; hdev->unvote_bus = venus_hfi_unvote_buses; hdev->load_fw = venus_hfi_load_fw; hdev->unload_fw = venus_hfi_unload_fw; hdev->get_fw_info = venus_hfi_get_fw_info; hdev->get_core_capabilities = venus_hfi_get_core_capabilities; hdev->suspend = venus_hfi_suspend; Loading drivers/media/platform/msm/vidc/vidc_hfi_api.h +0 −2 Original line number Diff line number Diff line Loading @@ -1444,8 +1444,6 @@ struct hfi_device { int (*vote_bus)(void *dev, struct vidc_bus_vote_data *data, int num_data); int (*unvote_bus)(void *dev); int (*load_fw)(void *dev); void (*unload_fw)(void *dev); int (*get_fw_info)(void *dev, enum fw_info info); int (*session_clean)(void *sess); int (*get_core_capabilities)(void *dev); Loading Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +12 −49 Original line number Diff line number Diff line Loading @@ -1280,8 +1280,6 @@ static void handle_sys_error(enum hal_command_response cmd, void *data) return; } core->state = VIDC_CORE_UNINIT; call_hfi_op(hdev, unload_fw, hdev->hfi_device_data); dprintk(VIDC_DBG, "Firmware unloaded\n"); } mutex_unlock(&core->lock); } Loading Loading @@ -2143,15 +2141,17 @@ static int msm_comm_init_core_done(struct msm_vidc_inst *inst) return rc; } int msm_comm_load_fw(struct msm_vidc_core *core) static int msm_comm_init_core(struct msm_vidc_inst *inst) { int rc = 0; struct hfi_device *hdev; struct msm_vidc_core *core; if (!core || !core->device) if (!inst || !inst->core || !inst->core->device) return -EINVAL; hdev = core->device; core = inst->core; hdev = core->device; mutex_lock(&core->lock); if (core->state >= VIDC_CORE_INIT) { dprintk(VIDC_INFO, "Video core: %d is already in state: %d\n", Loading @@ -2159,57 +2159,24 @@ int msm_comm_load_fw(struct msm_vidc_core *core) goto core_already_inited; } if (core->state < VIDC_CORE_LOADED) { rc = call_hfi_op(hdev, load_fw, hdev->hfi_device_data); if (rc) { dprintk(VIDC_ERR, "Failed to load video firmware\n"); mutex_unlock(&core->lock); goto fail_load_fw; } core->state = VIDC_CORE_LOADED; dprintk(VIDC_DBG, "Firmware downloaded\n"); } if (core->state == VIDC_CORE_LOADED) { init_completion(&core->completions [SYS_MSG_INDEX(HAL_SYS_INIT_DONE)]); rc = call_hfi_op(hdev, core_init, hdev->hfi_device_data); if (rc) { dprintk(VIDC_ERR, "Failed to init core, id = %d\n", core->id); mutex_unlock(&core->lock); goto fail_core_init; } core->state = VIDC_CORE_INIT; } core_already_inited: change_inst_state(inst, MSM_VIDC_CORE_INIT); mutex_unlock(&core->lock); return rc; fail_core_init: mutex_lock(&core->lock); call_hfi_op(hdev, unload_fw, hdev->hfi_device_data); core->state = VIDC_CORE_UNINIT; mutex_unlock(&core->lock); fail_load_fw: return rc; } static int msm_comm_init_core(struct msm_vidc_inst *inst) { int rc = 0; if (!inst || !inst->core) return -EINVAL; rc = msm_comm_load_fw(inst->core); if (rc) { dprintk(VIDC_ERR, "%s - firmware loading failed\n", __func__); return rc; } change_inst_state(inst, MSM_VIDC_CORE_INIT); return rc; } Loading Loading @@ -4687,11 +4654,7 @@ void msm_vidc_fw_unload_handler(struct work_struct *work) return; } } core->state = VIDC_CORE_UNINIT; call_hfi_op(hdev, unload_fw, hdev->hfi_device_data); dprintk(VIDC_DBG, "Firmware unloaded\n"); } mutex_unlock(&core->lock); } Loading
drivers/media/platform/msm/vidc/msm_vidc_common.h +0 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,6 @@ int msm_comm_smem_cache_operations(struct msm_vidc_inst *inst, struct msm_smem *msm_comm_smem_user_to_kernel(struct msm_vidc_inst *inst, int fd, u32 offset, enum hal_buffer buffer_type); enum hal_video_codec get_hal_codec(int fourcc); int msm_comm_load_fw(struct msm_vidc_core *core); int msm_comm_check_core_init(struct msm_vidc_core *core); int msm_comm_get_inst_load(struct msm_vidc_inst *inst, enum load_calc_quirks quirks); Loading
drivers/media/platform/msm/vidc/venus_hfi.c +12 −35 Original line number Diff line number Diff line Loading @@ -89,6 +89,8 @@ static struct hal_session *__get_session(struct venus_hfi_device *device, u32 session_id); static int __iface_cmdq_write(struct venus_hfi_device *device, void *pkt); static int __load_fw(struct venus_hfi_device *device); static void __unload_fw(struct venus_hfi_device *device); /** Loading Loading @@ -2131,6 +2133,12 @@ static int venus_hfi_core_init(void *device) dev = device; mutex_lock(&dev->lock); rc = __load_fw(dev); if (rc) { dprintk(VIDC_ERR, "Failed to load Venus FW\n"); goto err_load_fw; } __set_state(dev, VENUS_STATE_INIT); dev->intr_status = 0; Loading @@ -2149,6 +2157,7 @@ static int venus_hfi_core_init(void *device) __set_registers(dev); enable_irq(dev->hal_data->irq); if (!dev->hal_client) { dev->hal_client = msm_smem_new_client( SMEM_ION, dev->res, MSM_VIDC_UNKNOWN); Loading @@ -2174,7 +2183,6 @@ static int venus_hfi_core_init(void *device) goto err_core_init; } enable_irq(dev->hal_data->irq); __write_register(dev, VIDC_CTRL_INIT, 0x1); rc = __core_start_cpu(dev); if (rc) { Loading Loading @@ -2203,6 +2211,8 @@ static int venus_hfi_core_init(void *device) err_core_init: __set_state(dev, VENUS_STATE_DEINIT); disable_irq_nosync(dev->hal_data->irq); __unload_fw(dev); err_load_fw: mutex_unlock(&dev->lock); return rc; } Loading Loading @@ -2246,6 +2256,7 @@ static int venus_hfi_core_release(void *dev) mutex_lock(&device->lock); rc = __core_release(device); __unload_fw(device); mutex_unlock(&device->lock); return rc; Loading Loading @@ -4381,24 +4392,6 @@ fail_init_res: return rc; } static int venus_hfi_load_fw(void *dev) { int rc = 0; struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s Invalid paramter: %p\n", __func__, device); return -EINVAL; } mutex_lock(&device->lock); rc = __load_fw(device); mutex_unlock(&device->lock); return rc; } static void __unload_fw(struct venus_hfi_device *device) { if (!device->resources.fw.cookie) Loading @@ -4414,20 +4407,6 @@ static void __unload_fw(struct venus_hfi_device *device) __deinit_resources(device); } static void venus_hfi_unload_fw(void *dev) { struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s Invalid paramter: %p\n", __func__, device); return; } mutex_lock(&device->lock); __unload_fw(device); mutex_unlock(&device->lock); } static int venus_hfi_get_fw_info(void *dev, enum fw_info info) { int rc = 0; Loading Loading @@ -4658,8 +4637,6 @@ static void venus_init_hfi_callbacks(struct hfi_device *hdev) hdev->scale_clocks = venus_hfi_scale_clocks; hdev->vote_bus = venus_hfi_vote_buses; hdev->unvote_bus = venus_hfi_unvote_buses; hdev->load_fw = venus_hfi_load_fw; hdev->unload_fw = venus_hfi_unload_fw; hdev->get_fw_info = venus_hfi_get_fw_info; hdev->get_core_capabilities = venus_hfi_get_core_capabilities; hdev->suspend = venus_hfi_suspend; Loading
drivers/media/platform/msm/vidc/vidc_hfi_api.h +0 −2 Original line number Diff line number Diff line Loading @@ -1444,8 +1444,6 @@ struct hfi_device { int (*vote_bus)(void *dev, struct vidc_bus_vote_data *data, int num_data); int (*unvote_bus)(void *dev); int (*load_fw)(void *dev); void (*unload_fw)(void *dev); int (*get_fw_info)(void *dev, enum fw_info info); int (*session_clean)(void *sess); int (*get_core_capabilities)(void *dev); Loading