[COMMON] media: smfc: force non-shareable read
authorCho KyongHo <pullip.cho@samsung.com>
Tue, 3 Jan 2017 16:21:35 +0000 (01:21 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:19 +0000 (20:22 +0300)
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 <pullip.cho@samsung.com>
drivers/media/platform/exynos/smfc/smfc.c

index 824c44d93a8edbab48c32df972ccdf1c49cc3c0a..050559b6d74bfff084e1a9bc585ebd0fa8ad36c7 100644 (file)
@@ -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);