From: Cho KyongHo Date: Tue, 3 Jan 2017 16:21:35 +0000 (+0900) Subject: [COMMON] media: smfc: force non-shareable read X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=04a2b76dcebc47b8224e7d92f80e35455a81e209;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 --- 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);