From 0db29bbac37f4e4754e77bc99d7a921639ca0732 Mon Sep 17 00:00:00 2001 From: Vikash Garodia Date: Mon, 1 Jun 2020 00:50:26 +0530 Subject: [PATCH] msm: vidc: Configure video context bank for best fit With best fit configuration, the probability of getting a mapping for video buffer increases even when the system is fragmented. Change-Id: I8689447ce1341fd1189b543eb9fb6a2e03edcc94 Signed-off-by: Vikash Garodia --- msm/vidc/msm_vidc_res_parse.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/msm/vidc/msm_vidc_res_parse.c b/msm/vidc/msm_vidc_res_parse.c index ff6df21c3d36..ca4cd5b442c4 100644 --- a/msm/vidc/msm_vidc_res_parse.c +++ b/msm/vidc/msm_vidc_res_parse.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include "msm_vidc_debug.h" @@ -968,6 +969,12 @@ static int msm_vidc_setup_context_bank(struct msm_vidc_platform_resources *res, cb->domain = iommu_get_domain_for_dev(cb->dev); + /* + * When memory is fragmented, below configuration increases the + * possibility to get a mapping for buffer in the configured CB. + */ + iommu_dma_enable_best_fit_algo(cb->dev); + /* * configure device segment size and segment boundary to ensure * iommu mapping returns one mapping (which is required for partial