Loading drivers/media/platform/msm/sde/rotator/sde_rotator_dev.c +66 −25 Original line number Diff line number Diff line Loading @@ -1422,6 +1422,61 @@ int sde_rotator_inline_get_pixfmt_caps(struct platform_device *pdev, } EXPORT_SYMBOL(sde_rotator_inline_get_pixfmt_caps); /* * _sde_rotator_inline_cleanup - perform inline related request cleanup * This function assumes rot_dev->mgr lock has been taken when called. * @handle: Pointer to rotator context * @request: Pointer to rotation request * return: 0 if success; -EAGAIN if cleanup should be retried */ static int _sde_rotator_inline_cleanup(void *handle, struct sde_rotator_request *request) { struct sde_rotator_ctx *ctx; struct sde_rotator_device *rot_dev; int ret; if (!handle || !request) { SDEROT_ERR("invalid rotator handle/request\n"); return -EINVAL; } ctx = handle; rot_dev = ctx->rot_dev; if (!rot_dev || !rot_dev->mgr) { SDEROT_ERR("invalid rotator device\n"); return -EINVAL; } if (request->committed) { /* wait until request is finished */ sde_rot_mgr_unlock(rot_dev->mgr); mutex_unlock(&rot_dev->lock); ret = wait_event_timeout(ctx->wait_queue, sde_rotator_is_request_retired(request), msecs_to_jiffies(rot_dev->streamoff_timeout)); mutex_lock(&rot_dev->lock); sde_rot_mgr_lock(rot_dev->mgr); if (!ret) { SDEROT_ERR("timeout w/o retire s:%d\n", ctx->session_id); SDEROT_EVTLOG(ctx->session_id, SDE_ROT_EVTLOG_ERROR); sde_rotator_abort_inline_request(rot_dev->mgr, ctx->private, request->req); return -EAGAIN; } else if (ret == 1) { SDEROT_ERR("timeout w/ retire s:%d\n", ctx->session_id); SDEROT_EVTLOG(ctx->session_id, SDE_ROT_EVTLOG_ERROR); } } sde_rotator_req_finish(rot_dev->mgr, ctx->private, request->req); sde_rotator_retire_request(request); return 0; } /* * sde_rotator_inline_commit - commit given rotator command * @handle: Pointer to rotator context Loading Loading @@ -1449,7 +1504,7 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, ctx = handle; rot_dev = ctx->rot_dev; if (!rot_dev) { if (!rot_dev || !rot_dev->mgr) { SDEROT_ERR("invalid rotator device\n"); return -EINVAL; } Loading Loading @@ -1481,6 +1536,7 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, (cmd->video_mode << 5) | (cmd_type << 24)); mutex_lock(&rot_dev->lock); sde_rot_mgr_lock(rot_dev->mgr); if (cmd_type == SDE_ROTATOR_INLINE_CMD_VALIDATE || Loading Loading @@ -1690,30 +1746,12 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, } request = cmd->priv_handle; req = request->req; if (request->committed) { /* wait until request is finished */ sde_rot_mgr_unlock(rot_dev->mgr); ret = wait_event_timeout(ctx->wait_queue, sde_rotator_is_request_retired(request), msecs_to_jiffies(rot_dev->streamoff_timeout)); if (!ret) { SDEROT_ERR("timeout w/o retire s:%d\n", ctx->session_id); SDEROT_EVTLOG(ctx->session_id, SDE_ROT_EVTLOG_ERROR); } else if (ret == 1) { SDEROT_ERR("timeout w/ retire s:%d\n", ctx->session_id); SDEROT_EVTLOG(ctx->session_id, SDE_ROT_EVTLOG_ERROR); } sde_rot_mgr_lock(rot_dev->mgr); } /* attempt single retry if first cleanup attempt failed */ if (_sde_rotator_inline_cleanup(handle, request) == -EAGAIN) _sde_rotator_inline_cleanup(handle, request); sde_rotator_req_finish(rot_dev->mgr, ctx->private, req); sde_rotator_retire_request(request); cmd->priv_handle = NULL; } else if (cmd_type == SDE_ROTATOR_INLINE_CMD_ABORT) { if (!cmd->priv_handle) { ret = -EINVAL; Loading @@ -1722,11 +1760,13 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, } request = cmd->priv_handle; if (!sde_rotator_is_request_retired(request)) sde_rotator_abort_inline_request(rot_dev->mgr, ctx->private, request->req); } sde_rot_mgr_unlock(rot_dev->mgr); mutex_unlock(&rot_dev->lock); return 0; error_handle_request: Loading @@ -1739,6 +1779,7 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, error_invalid_handle: error_init_request: sde_rot_mgr_unlock(rot_dev->mgr); mutex_unlock(&rot_dev->lock); return ret; } EXPORT_SYMBOL(sde_rotator_inline_commit); Loading drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ * When in sbuf mode, select a much longer wait, to allow the other driver * to detect timeouts and abort if necessary. */ #define KOFF_TIMEOUT_SBUF (2000) #define KOFF_TIMEOUT_SBUF (10000) /* default stream buffer headroom in lines */ #define DEFAULT_SBUF_HEADROOM 20 Loading Loading
drivers/media/platform/msm/sde/rotator/sde_rotator_dev.c +66 −25 Original line number Diff line number Diff line Loading @@ -1422,6 +1422,61 @@ int sde_rotator_inline_get_pixfmt_caps(struct platform_device *pdev, } EXPORT_SYMBOL(sde_rotator_inline_get_pixfmt_caps); /* * _sde_rotator_inline_cleanup - perform inline related request cleanup * This function assumes rot_dev->mgr lock has been taken when called. * @handle: Pointer to rotator context * @request: Pointer to rotation request * return: 0 if success; -EAGAIN if cleanup should be retried */ static int _sde_rotator_inline_cleanup(void *handle, struct sde_rotator_request *request) { struct sde_rotator_ctx *ctx; struct sde_rotator_device *rot_dev; int ret; if (!handle || !request) { SDEROT_ERR("invalid rotator handle/request\n"); return -EINVAL; } ctx = handle; rot_dev = ctx->rot_dev; if (!rot_dev || !rot_dev->mgr) { SDEROT_ERR("invalid rotator device\n"); return -EINVAL; } if (request->committed) { /* wait until request is finished */ sde_rot_mgr_unlock(rot_dev->mgr); mutex_unlock(&rot_dev->lock); ret = wait_event_timeout(ctx->wait_queue, sde_rotator_is_request_retired(request), msecs_to_jiffies(rot_dev->streamoff_timeout)); mutex_lock(&rot_dev->lock); sde_rot_mgr_lock(rot_dev->mgr); if (!ret) { SDEROT_ERR("timeout w/o retire s:%d\n", ctx->session_id); SDEROT_EVTLOG(ctx->session_id, SDE_ROT_EVTLOG_ERROR); sde_rotator_abort_inline_request(rot_dev->mgr, ctx->private, request->req); return -EAGAIN; } else if (ret == 1) { SDEROT_ERR("timeout w/ retire s:%d\n", ctx->session_id); SDEROT_EVTLOG(ctx->session_id, SDE_ROT_EVTLOG_ERROR); } } sde_rotator_req_finish(rot_dev->mgr, ctx->private, request->req); sde_rotator_retire_request(request); return 0; } /* * sde_rotator_inline_commit - commit given rotator command * @handle: Pointer to rotator context Loading Loading @@ -1449,7 +1504,7 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, ctx = handle; rot_dev = ctx->rot_dev; if (!rot_dev) { if (!rot_dev || !rot_dev->mgr) { SDEROT_ERR("invalid rotator device\n"); return -EINVAL; } Loading Loading @@ -1481,6 +1536,7 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, (cmd->video_mode << 5) | (cmd_type << 24)); mutex_lock(&rot_dev->lock); sde_rot_mgr_lock(rot_dev->mgr); if (cmd_type == SDE_ROTATOR_INLINE_CMD_VALIDATE || Loading Loading @@ -1690,30 +1746,12 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, } request = cmd->priv_handle; req = request->req; if (request->committed) { /* wait until request is finished */ sde_rot_mgr_unlock(rot_dev->mgr); ret = wait_event_timeout(ctx->wait_queue, sde_rotator_is_request_retired(request), msecs_to_jiffies(rot_dev->streamoff_timeout)); if (!ret) { SDEROT_ERR("timeout w/o retire s:%d\n", ctx->session_id); SDEROT_EVTLOG(ctx->session_id, SDE_ROT_EVTLOG_ERROR); } else if (ret == 1) { SDEROT_ERR("timeout w/ retire s:%d\n", ctx->session_id); SDEROT_EVTLOG(ctx->session_id, SDE_ROT_EVTLOG_ERROR); } sde_rot_mgr_lock(rot_dev->mgr); } /* attempt single retry if first cleanup attempt failed */ if (_sde_rotator_inline_cleanup(handle, request) == -EAGAIN) _sde_rotator_inline_cleanup(handle, request); sde_rotator_req_finish(rot_dev->mgr, ctx->private, req); sde_rotator_retire_request(request); cmd->priv_handle = NULL; } else if (cmd_type == SDE_ROTATOR_INLINE_CMD_ABORT) { if (!cmd->priv_handle) { ret = -EINVAL; Loading @@ -1722,11 +1760,13 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, } request = cmd->priv_handle; if (!sde_rotator_is_request_retired(request)) sde_rotator_abort_inline_request(rot_dev->mgr, ctx->private, request->req); } sde_rot_mgr_unlock(rot_dev->mgr); mutex_unlock(&rot_dev->lock); return 0; error_handle_request: Loading @@ -1739,6 +1779,7 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd, error_invalid_handle: error_init_request: sde_rot_mgr_unlock(rot_dev->mgr); mutex_unlock(&rot_dev->lock); return ret; } EXPORT_SYMBOL(sde_rotator_inline_commit); Loading
drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ * When in sbuf mode, select a much longer wait, to allow the other driver * to detect timeouts and abort if necessary. */ #define KOFF_TIMEOUT_SBUF (2000) #define KOFF_TIMEOUT_SBUF (10000) /* default stream buffer headroom in lines */ #define DEFAULT_SBUF_HEADROOM 20 Loading