rockchip/vcodec: set HW mode to none when hw quit work
[firefly-linux-kernel-4.4.55.git] / drivers / video / rockchip / vcodec / vcodec_service.c
index 2ea76ed5a80f2eff0922a7d794845c8c88df973b..536ad1e05937a4810dfde992bacead2d34c2c92f 100644 (file)
@@ -550,8 +550,13 @@ static void vcodec_exit_mode(struct vpu_subdev_data *data)
        if (data->mmu_dev && test_bit(MMU_ACTIVATED, &data->state)) {
                clear_bit(MMU_ACTIVATED, &data->state);
                rockchip_iovmm_deactivate(data->dev);
-               data->pservice->curr_mode = VCODEC_RUNNING_MODE_NONE;
        }
+       /*
+        * In case of VPU Combo, it require HW switch its running mode
+        * before the other HW component start work. set current HW running
+        * mode to none, can ensure HW switch to its reqired mode properly.
+        */
+       data->pservice->curr_mode = VCODEC_RUNNING_MODE_NONE;
 }
 
 static int vpu_get_clk(struct vpu_service_info *pservice)