[RAMEN9610-10029][COMMON] media: mfc: fix wrong mem type check
authorAyoung Sim <a.sim@samsung.com>
Mon, 17 Sep 2018 06:46:44 +0000 (15:46 +0900)
committerhskang <hs1218.kang@samsung.com>
Fri, 28 Dec 2018 09:53:51 +0000 (18:53 +0900)
When an error occures during header parsing,
the driver dumps the header stream.
In order to print the header stream, driver should get the KVA
when only the memory type of source buffer is DMA_BUF type.
This patch fixs this type condition.

Change-Id: I557bef77b54aae266e6d75e76814c506239d4260
Signed-off-by: Ayoung Sim <a.sim@samsung.com>
drivers/media/platform/exynos/mfc/mfc_data_struct.h
drivers/media/platform/exynos/mfc/mfc_dec_v4l2.c
drivers/media/platform/exynos/mfc/mfc_dec_vb2.c
drivers/media/platform/exynos/mfc/mfc_isr.c

index 5ff8764f7d2ee161ed0ef91cbb20baec32cb2905..5c8224849fb989743e47ecf1ef0e6be7406ca68b 100644 (file)
@@ -1325,7 +1325,6 @@ struct mfc_dec {
        unsigned long remained_size;
        dma_addr_t y_addr_for_pb;
 
-       enum v4l2_memory dst_memtype;
        int sei_parse;
 
        int cr_left, cr_right, cr_top, cr_bot;
index efebbfa0b3730359c9441f15a678550087121c23..785de4bcbbf141e04f083ef781826cba866f7f25 100644 (file)
@@ -619,8 +619,6 @@ static int mfc_dec_reqbufs(struct file *file, void *priv,
                        return ret;
                }
 
-               dec->dst_memtype = reqbufs->memory;
-
                if (ctx->capture_state != QUEUE_FREE) {
                        mfc_err_ctx("Bufs have already been requested\n");
                        return -EINVAL;
index fc24322ae065f07ea8bbaa0162b991de1c309363..bcc8a2629e3d8bac09134502c5b145f356e6626a 100644 (file)
@@ -446,7 +446,7 @@ static void mfc_dec_buf_queue(struct vb2_buffer *vb)
        if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
                mfc_debug(2, "[BUFINFO] ctx[%d] add src index:%d, addr: 0x%08llx\n",
                                ctx->num, vb->index, buf->addr[0][0]);
-               if (dec->dst_memtype == V4L2_MEMORY_DMABUF &&
+               if (vb->memory == V4L2_MEMORY_DMABUF &&
                                ctx->state < MFCINST_HEAD_PARSED && !ctx->is_drm)
                        stream_vir = vb2_plane_vaddr(vb, 0);
 
@@ -466,7 +466,7 @@ static void mfc_dec_buf_queue(struct vb2_buffer *vb)
                                        ctx->num, vb->index, i, buf->addr[0][i]);
                mfc_store_dpb(ctx, vb);
 
-               if ((dec->dst_memtype == V4L2_MEMORY_USERPTR || dec->dst_memtype == V4L2_MEMORY_DMABUF) &&
+               if ((vb->memory == V4L2_MEMORY_USERPTR || vb->memory == V4L2_MEMORY_DMABUF) &&
                                mfc_is_queue_count_same(&ctx->buf_queue_lock,
                                        &ctx->dst_buf_queue, dec->total_dpb_count))
                        ctx->capture_state = QUEUE_BUFS_MMAPED;
index 7892589366db481f3fd9fb89825dd60c9305807b..30d82a27066d3f7df2a9251a3b13a430601d0107 100644 (file)
@@ -1001,12 +1001,12 @@ static inline void __mfc_handle_error(struct mfc_ctx *ctx,
                        if (src_mb) {
                                stream_vir = src_mb->vir_addr;
                                strm_size = src_mb->vb.vb2_buf.planes[0].bytesused;
-                               if (strm_size > 32)
-                                       strm_size = 32;
+                               if (strm_size > 640)
+                                       strm_size = 640;
 
                                if (stream_vir && strm_size)
                                        print_hex_dump(KERN_ERR, "No header: ",
-                                                       DUMP_PREFIX_ADDRESS, strm_size, 0,
+                                                       DUMP_PREFIX_ADDRESS, 32, 4,
                                                        stream_vir, strm_size, false);
 
                                vb2_buffer_done(&src_mb->vb.vb2_buf, VB2_BUF_STATE_DONE);