diff options
Diffstat (limited to 'drivers/media/platform/s5p-mfc/s5p_mfc_dec.c')
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index aef83d13182c..6ee21bb71398 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | |||
@@ -415,7 +415,6 @@ static int vidioc_reqbufs(struct file *file, void *priv, | |||
415 | struct s5p_mfc_dev *dev = video_drvdata(file); | 415 | struct s5p_mfc_dev *dev = video_drvdata(file); |
416 | struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); | 416 | struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); |
417 | int ret = 0; | 417 | int ret = 0; |
418 | unsigned long flags; | ||
419 | 418 | ||
420 | if (reqbufs->memory != V4L2_MEMORY_MMAP) { | 419 | if (reqbufs->memory != V4L2_MEMORY_MMAP) { |
421 | mfc_err("Only V4L2_MEMORY_MAP is supported\n"); | 420 | mfc_err("Only V4L2_MEMORY_MAP is supported\n"); |
@@ -497,11 +496,8 @@ static int vidioc_reqbufs(struct file *file, void *priv, | |||
497 | s5p_mfc_clock_off(); | 496 | s5p_mfc_clock_off(); |
498 | return -ENOMEM; | 497 | return -ENOMEM; |
499 | } | 498 | } |
500 | if (s5p_mfc_ctx_ready(ctx)) { | 499 | if (s5p_mfc_ctx_ready(ctx)) |
501 | spin_lock_irqsave(&dev->condlock, flags); | 500 | set_work_bit_irqsave(ctx); |
502 | set_bit(ctx->num, &dev->ctx_work_bits); | ||
503 | spin_unlock_irqrestore(&dev->condlock, flags); | ||
504 | } | ||
505 | s5p_mfc_try_run(dev); | 501 | s5p_mfc_try_run(dev); |
506 | s5p_mfc_wait_for_done_ctx(ctx, | 502 | s5p_mfc_wait_for_done_ctx(ctx, |
507 | S5P_FIMV_R2H_CMD_INIT_BUFFERS_RET, 0); | 503 | S5P_FIMV_R2H_CMD_INIT_BUFFERS_RET, 0); |
@@ -576,7 +572,6 @@ static int vidioc_streamon(struct file *file, void *priv, | |||
576 | { | 572 | { |
577 | struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); | 573 | struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); |
578 | struct s5p_mfc_dev *dev = ctx->dev; | 574 | struct s5p_mfc_dev *dev = ctx->dev; |
579 | unsigned long flags; | ||
580 | int ret = -EINVAL; | 575 | int ret = -EINVAL; |
581 | 576 | ||
582 | mfc_debug_enter(); | 577 | mfc_debug_enter(); |
@@ -589,9 +584,7 @@ static int vidioc_streamon(struct file *file, void *priv, | |||
589 | ctx->output_state = QUEUE_FREE; | 584 | ctx->output_state = QUEUE_FREE; |
590 | s5p_mfc_alloc_instance_buffer(ctx); | 585 | s5p_mfc_alloc_instance_buffer(ctx); |
591 | s5p_mfc_alloc_dec_temp_buffers(ctx); | 586 | s5p_mfc_alloc_dec_temp_buffers(ctx); |
592 | spin_lock_irqsave(&dev->condlock, flags); | 587 | set_work_bit_irqsave(ctx); |
593 | set_bit(ctx->num, &dev->ctx_work_bits); | ||
594 | spin_unlock_irqrestore(&dev->condlock, flags); | ||
595 | s5p_mfc_clean_ctx_int_flags(ctx); | 588 | s5p_mfc_clean_ctx_int_flags(ctx); |
596 | s5p_mfc_try_run(dev); | 589 | s5p_mfc_try_run(dev); |
597 | 590 | ||
@@ -875,18 +868,14 @@ static int s5p_mfc_start_streaming(struct vb2_queue *q, unsigned int count) | |||
875 | { | 868 | { |
876 | struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); | 869 | struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); |
877 | struct s5p_mfc_dev *dev = ctx->dev; | 870 | struct s5p_mfc_dev *dev = ctx->dev; |
878 | unsigned long flags; | ||
879 | 871 | ||
880 | v4l2_ctrl_handler_setup(&ctx->ctrl_handler); | 872 | v4l2_ctrl_handler_setup(&ctx->ctrl_handler); |
881 | if (ctx->state == MFCINST_FINISHING || | 873 | if (ctx->state == MFCINST_FINISHING || |
882 | ctx->state == MFCINST_FINISHED) | 874 | ctx->state == MFCINST_FINISHED) |
883 | ctx->state = MFCINST_RUNNING; | 875 | ctx->state = MFCINST_RUNNING; |
884 | /* If context is ready then dev = work->data;schedule it to run */ | 876 | /* If context is ready then dev = work->data;schedule it to run */ |
885 | if (s5p_mfc_ctx_ready(ctx)) { | 877 | if (s5p_mfc_ctx_ready(ctx)) |
886 | spin_lock_irqsave(&dev->condlock, flags); | 878 | set_work_bit_irqsave(ctx); |
887 | set_bit(ctx->num, &dev->ctx_work_bits); | ||
888 | spin_unlock_irqrestore(&dev->condlock, flags); | ||
889 | } | ||
890 | s5p_mfc_try_run(dev); | 879 | s5p_mfc_try_run(dev); |
891 | return 0; | 880 | return 0; |
892 | } | 881 | } |
@@ -953,11 +942,8 @@ static void s5p_mfc_buf_queue(struct vb2_buffer *vb) | |||
953 | } else { | 942 | } else { |
954 | mfc_err("Unsupported buffer type (%d)\n", vq->type); | 943 | mfc_err("Unsupported buffer type (%d)\n", vq->type); |
955 | } | 944 | } |
956 | if (s5p_mfc_ctx_ready(ctx)) { | 945 | if (s5p_mfc_ctx_ready(ctx)) |
957 | spin_lock_irqsave(&dev->condlock, flags); | 946 | set_work_bit_irqsave(ctx); |
958 | set_bit(ctx->num, &dev->ctx_work_bits); | ||
959 | spin_unlock_irqrestore(&dev->condlock, flags); | ||
960 | } | ||
961 | s5p_mfc_try_run(dev); | 947 | s5p_mfc_try_run(dev); |
962 | } | 948 | } |
963 | 949 | ||