Loading drivers/media/platform/msm/vidc/venus_hfi.c +47 −19 Original line number Original line Diff line number Diff line Loading @@ -553,6 +553,25 @@ static int venus_hfi_read_register(struct venus_hfi_device *device, u32 reg) return rc; return rc; } } static void venus_hfi_set_registers(struct venus_hfi_device *device) { struct reg_set *reg_set; int i; if (!device->res) { dprintk(VIDC_ERR, "device resources null, cannot set registers\n"); return; } reg_set = &device->res->reg_set; for (i = 0; i < reg_set->count; i++) { venus_hfi_write_register(device, reg_set->reg_tbl[i].reg, reg_set->reg_tbl[i].value, 0); } } static int venus_hfi_core_start_cpu(struct venus_hfi_device *device) static int venus_hfi_core_start_cpu(struct venus_hfi_device *device) { { u32 ctrl_status = 0, count = 0, rc = 0; u32 ctrl_status = 0, count = 0, rc = 0; Loading Loading @@ -987,6 +1006,7 @@ static inline int venus_hfi_power_off(struct venus_hfi_device *device) venus_hfi_unvote_buses(device, DDR_MEM); venus_hfi_unvote_buses(device, DDR_MEM); device->power_enabled = 0; device->power_enabled = 0; dprintk(VIDC_INFO, "entering power collapse\n"); already_disabled: already_disabled: return rc; return rc; } } Loading Loading @@ -1026,17 +1046,44 @@ static inline int venus_hfi_power_on(struct venus_hfi_device *device) goto err_enable_clk; goto err_enable_clk; } } /* * Re-program all of the registers that get reset as a result of * regulator_disable() and _enable() */ venus_hfi_set_registers(device); venus_hfi_write_register(device, VIDC_UC_REGION_ADDR, (u32)device->iface_q_table.align_device_addr, 0); venus_hfi_write_register(device, VIDC_UC_REGION_SIZE, SHARED_QSIZE, 0); venus_hfi_write_register(device, VIDC_CPU_CS_SCIACMDARG2, (u32)device->iface_q_table.align_device_addr, device->iface_q_table.align_virtual_addr); if (!IS_ERR_OR_NULL(device->sfr.align_device_addr)) venus_hfi_write_register(device, VIDC_SFR_ADDR, (u32)device->sfr.align_device_addr, 0); if (!IS_ERR_OR_NULL(device->qdss.align_device_addr)) venus_hfi_write_register(device, VIDC_MMAP_ADDR, (u32)device->qdss.align_device_addr, 0); /* Reboot the firmware */ rc = venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_RESUME); rc = venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_RESUME); if (rc) { if (rc) { dprintk(VIDC_ERR, "Failed to resume video core %d\n", rc); dprintk(VIDC_ERR, "Failed to resume video core %d\n", rc); goto err_set_video_state; goto err_set_video_state; } } /* Wait for boot completion */ rc = venus_hfi_reset_core(device); rc = venus_hfi_reset_core(device); if (rc) { if (rc) { dprintk(VIDC_ERR, "Failed to reset venus core\n"); dprintk(VIDC_ERR, "Failed to reset venus core\n"); goto err_reset_core; goto err_reset_core; } } device->power_enabled = 1; device->power_enabled = 1; dprintk(VIDC_INFO, "resuming from power collapse\n"); return rc; return rc; err_reset_core: err_reset_core: venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); Loading Loading @@ -1534,25 +1581,6 @@ fail_alloc_queue: return -ENOMEM; return -ENOMEM; } } static void venus_hfi_set_registers(struct venus_hfi_device *device) { struct reg_set *reg_set; int i; if (!device->res) { dprintk(VIDC_ERR, "device resources null, cannot set registers\n"); return; } reg_set = &device->res->reg_set; for (i = 0; i < reg_set->count; i++) { venus_hfi_write_register(device, reg_set->reg_tbl[i].reg, reg_set->reg_tbl[i].value, 0); } } static int venus_hfi_sys_set_debug(struct venus_hfi_device *device, u32 debug) static int venus_hfi_sys_set_debug(struct venus_hfi_device *device, u32 debug) { { u8 packet[VIDC_IFACEQ_VAR_SMALL_PKT_SIZE]; u8 packet[VIDC_IFACEQ_VAR_SMALL_PKT_SIZE]; Loading Loading
drivers/media/platform/msm/vidc/venus_hfi.c +47 −19 Original line number Original line Diff line number Diff line Loading @@ -553,6 +553,25 @@ static int venus_hfi_read_register(struct venus_hfi_device *device, u32 reg) return rc; return rc; } } static void venus_hfi_set_registers(struct venus_hfi_device *device) { struct reg_set *reg_set; int i; if (!device->res) { dprintk(VIDC_ERR, "device resources null, cannot set registers\n"); return; } reg_set = &device->res->reg_set; for (i = 0; i < reg_set->count; i++) { venus_hfi_write_register(device, reg_set->reg_tbl[i].reg, reg_set->reg_tbl[i].value, 0); } } static int venus_hfi_core_start_cpu(struct venus_hfi_device *device) static int venus_hfi_core_start_cpu(struct venus_hfi_device *device) { { u32 ctrl_status = 0, count = 0, rc = 0; u32 ctrl_status = 0, count = 0, rc = 0; Loading Loading @@ -987,6 +1006,7 @@ static inline int venus_hfi_power_off(struct venus_hfi_device *device) venus_hfi_unvote_buses(device, DDR_MEM); venus_hfi_unvote_buses(device, DDR_MEM); device->power_enabled = 0; device->power_enabled = 0; dprintk(VIDC_INFO, "entering power collapse\n"); already_disabled: already_disabled: return rc; return rc; } } Loading Loading @@ -1026,17 +1046,44 @@ static inline int venus_hfi_power_on(struct venus_hfi_device *device) goto err_enable_clk; goto err_enable_clk; } } /* * Re-program all of the registers that get reset as a result of * regulator_disable() and _enable() */ venus_hfi_set_registers(device); venus_hfi_write_register(device, VIDC_UC_REGION_ADDR, (u32)device->iface_q_table.align_device_addr, 0); venus_hfi_write_register(device, VIDC_UC_REGION_SIZE, SHARED_QSIZE, 0); venus_hfi_write_register(device, VIDC_CPU_CS_SCIACMDARG2, (u32)device->iface_q_table.align_device_addr, device->iface_q_table.align_virtual_addr); if (!IS_ERR_OR_NULL(device->sfr.align_device_addr)) venus_hfi_write_register(device, VIDC_SFR_ADDR, (u32)device->sfr.align_device_addr, 0); if (!IS_ERR_OR_NULL(device->qdss.align_device_addr)) venus_hfi_write_register(device, VIDC_MMAP_ADDR, (u32)device->qdss.align_device_addr, 0); /* Reboot the firmware */ rc = venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_RESUME); rc = venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_RESUME); if (rc) { if (rc) { dprintk(VIDC_ERR, "Failed to resume video core %d\n", rc); dprintk(VIDC_ERR, "Failed to resume video core %d\n", rc); goto err_set_video_state; goto err_set_video_state; } } /* Wait for boot completion */ rc = venus_hfi_reset_core(device); rc = venus_hfi_reset_core(device); if (rc) { if (rc) { dprintk(VIDC_ERR, "Failed to reset venus core\n"); dprintk(VIDC_ERR, "Failed to reset venus core\n"); goto err_reset_core; goto err_reset_core; } } device->power_enabled = 1; device->power_enabled = 1; dprintk(VIDC_INFO, "resuming from power collapse\n"); return rc; return rc; err_reset_core: err_reset_core: venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); Loading Loading @@ -1534,25 +1581,6 @@ fail_alloc_queue: return -ENOMEM; return -ENOMEM; } } static void venus_hfi_set_registers(struct venus_hfi_device *device) { struct reg_set *reg_set; int i; if (!device->res) { dprintk(VIDC_ERR, "device resources null, cannot set registers\n"); return; } reg_set = &device->res->reg_set; for (i = 0; i < reg_set->count; i++) { venus_hfi_write_register(device, reg_set->reg_tbl[i].reg, reg_set->reg_tbl[i].value, 0); } } static int venus_hfi_sys_set_debug(struct venus_hfi_device *device, u32 debug) static int venus_hfi_sys_set_debug(struct venus_hfi_device *device, u32 debug) { { u8 packet[VIDC_IFACEQ_VAR_SMALL_PKT_SIZE]; u8 packet[VIDC_IFACEQ_VAR_SMALL_PKT_SIZE]; Loading