aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2015-12-02 06:22:28 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-12-23 13:54:22 -0200
commit05d1d0f020d90afd6af48a98af1e9be846eed642 (patch)
treeb2f8bda526a72a6721bb51b31d56748b2813d10f /drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
parent[media] s5p-mfc: constify s5p_mfc_codec_ops structures (diff)
downloadlinux-dev-05d1d0f020d90afd6af48a98af1e9be846eed642.tar.xz
linux-dev-05d1d0f020d90afd6af48a98af1e9be846eed642.zip
[media] s5p-mfc: use one implementation of s5p_mfc_get_new_ctx
Both version of MFC driver use functions with the same body and name. The patch moves them to common location. It also simplifies it. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c')
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
index b95845347348..f68653f12254 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
@@ -1507,30 +1507,6 @@ static int s5p_mfc_encode_one_frame_v6(struct s5p_mfc_ctx *ctx)
return 0;
}
-static inline int s5p_mfc_get_new_ctx(struct s5p_mfc_dev *dev)
-{
- unsigned long flags;
- int new_ctx;
- int cnt;
-
- spin_lock_irqsave(&dev->condlock, flags);
- mfc_debug(2, "Previous context: %d (bits %08lx)\n", dev->curr_ctx,
- dev->ctx_work_bits);
- new_ctx = (dev->curr_ctx + 1) % MFC_NUM_CONTEXTS;
- cnt = 0;
- while (!test_bit(new_ctx, &dev->ctx_work_bits)) {
- new_ctx = (new_ctx + 1) % MFC_NUM_CONTEXTS;
- cnt++;
- if (cnt > MFC_NUM_CONTEXTS) {
- /* No contexts to run */
- spin_unlock_irqrestore(&dev->condlock, flags);
- return -EAGAIN;
- }
- }
- spin_unlock_irqrestore(&dev->condlock, flags);
- return new_ctx;
-}
-
static inline void s5p_mfc_run_dec_last_frames(struct s5p_mfc_ctx *ctx)
{
struct s5p_mfc_dev *dev = ctx->dev;