From 04a2b76dcebc47b8224e7d92f80e35455a81e209 Mon Sep 17 00:00:00 2001 From: Cho KyongHo Date: Wed, 4 Jan 2017 01:21:35 +0900 Subject: [PATCH] [COMMON] media: smfc: force non-shareable read SMFC/JPEG is connected with MCSC by HWFC. Therefore write DMA of MCSC and the read DMA of SMFC should be in the same shareability domain. However MCSC is always in non-shareable domain by Exynos8895 and SMFC is in inner-shareable domain in Exynos8895. Due to HWFC, SMFC should not wait until MCSC driver to invalidate cache lines when MCSC finishes DMA write because SMFC starts reading as soon as MCSC starts writing. Therefore, the read DMA of SMFC should be non-shareable and cache maintenance operations do not effect if HWFC is enabled. Change-Id: I8e5d7878b0b2f6e35a33903b0683b45a6dcd7514 Signed-off-by: Cho KyongHo --- drivers/media/platform/exynos/smfc/smfc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/media/platform/exynos/smfc/smfc.c b/drivers/media/platform/exynos/smfc/smfc.c index 824c44d93a8e..050559b6d74b 100644 --- a/drivers/media/platform/exynos/smfc/smfc.c +++ b/drivers/media/platform/exynos/smfc/smfc.c @@ -265,6 +265,18 @@ static int smfc_vb2_buf_prepare(struct vb2_buffer *vb) return -EINVAL; } } + + /* + * FIXME: handle this + * There is no chance to clean CPU caches if HWFC is + * enabled because the compression starts before the + * image producer completes writing. + * Therefore, the image producer (MCSC) and the read DMA + * of JPEG/SMFC should access the memory with the same + * shareability attributes. + if (ctx->enable_hwfc) + clean_cache = false; + */ } else { /* buffer contains JPEG stream to decompress */ int ret = smfc_parse_jpeg_header(ctx, vb); -- 2.20.1