[COMMON] fimc-is2: fixed image dump error in kernel 4.14
authorEunyoung Lee <ey470.lee@samsung.com>
Fri, 15 Jun 2018 02:57:06 +0000 (11:57 +0900)
committerEunyoung Lee <ey470.lee@samsung.com>
Tue, 19 Jun 2018 08:57:05 +0000 (17:57 +0900)
Change-Id: I5c8d3f8e3976a5b99aa96d3b67cc0a2ad020d13d
Signed-off-by: Eunyoung Lee <ey470.lee@samsung.com>
drivers/media/platform/exynos/fimc-is2/fimc-is-debug.c
drivers/media/platform/exynos/fimc-is2/fimc-is-video.c

index 18a7d8bdd226854c70005d28ec07ef608cf8290f..a56df9ead68e5b7fc9898c700d538bd1a3af2840 100644 (file)
@@ -657,7 +657,7 @@ int fimc_is_debug_dma_dump(struct fimc_is_queue *queue, u32 index, u32 vid, u32
 
                        if (!i) {
                                /* first plane for image */
-                               flags = O_TRUNC | O_CREAT | O_WRONLY | O_APPEND;
+                               flags = O_TRUNC | O_CREAT | O_EXCL | O_WRONLY | O_APPEND;
                                total_size += bin.size;
                        } else {
                                /* after first plane for image */
@@ -690,7 +690,7 @@ int fimc_is_debug_dma_dump(struct fimc_is_queue *queue, u32 index, u32 vid, u32
                bin.size = queue->framecfg.size[buf->num_planes - 1];
 
                /* last plane for meta */
-               flags = O_TRUNC | O_CREAT | O_WRONLY;
+               flags = O_TRUNC | O_CREAT | O_EXCL | O_WRONLY;
                total_size = bin.size;
 
                ret = put_filesystem_binary(filename, &bin, flags);
index 9a9e9e4a19fbe924bb9d6a4c538c54dd98fb27fc..a35f889cfa50ae006f7b8671bbe285992f17f210 100644 (file)
@@ -1720,6 +1720,13 @@ int fimc_is_video_dqbuf(struct fimc_is_video_ctx *vctx,
 
        queue->buf_dqe++;
 
+#ifdef DBG_IMAGE_DUMP
+       fimc_is_debug_dma_dump(queue, buf->index, video->id, DBG_DMA_DUMP_IMAGE);
+#endif
+#ifdef DBG_META_DUMP
+       fimc_is_debug_dma_dump(queue, buf->index, video->id, DBG_DMA_DUMP_META);
+#endif
+
        ret = vb2_dqbuf(queue->vbq, buf, blocking);
        if (ret) {
                mverr("vb2_dqbuf is fail(%d)", vctx,  video, ret);
@@ -1731,13 +1738,6 @@ int fimc_is_video_dqbuf(struct fimc_is_video_ctx *vctx,
                goto p_err;
        }
 
-#ifdef DBG_IMAGE_DUMP
-       fimc_is_debug_dma_dump(queue, buf->index, video->id, DBG_DMA_DUMP_IMAGE);
-#endif
-#ifdef DBG_META_DUMP
-       fimc_is_debug_dma_dump(queue, buf->index, video->id, DBG_DMA_DUMP_META);
-#endif
-
 p_err:
        TIME_QUEUE(TMQ_DQ);
        return ret;