From patchwork Fri Nov 18 23:20:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Parrot X-Patchwork-Id: 9437595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9CB5E60238 for ; Fri, 18 Nov 2016 23:25:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B53029A51 for ; Fri, 18 Nov 2016 23:25:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D85629A56; Fri, 18 Nov 2016 23:25:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 104AD29A51 for ; Fri, 18 Nov 2016 23:25:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753632AbcKRXVU (ORCPT ); Fri, 18 Nov 2016 18:21:20 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:60378 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753543AbcKRXVP (ORCPT ); Fri, 18 Nov 2016 18:21:15 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id uAINLFgJ016965; Fri, 18 Nov 2016 17:21:15 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id uAINLFrZ028915; Fri, 18 Nov 2016 17:21:15 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Fri, 18 Nov 2016 17:21:14 -0600 Received: from uda0869644a.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id uAINKqW0001882; Fri, 18 Nov 2016 17:21:14 -0600 From: Benoit Parrot To: , Hans Verkuil CC: , Tomi Valkeinen , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [Patch v2 23/35] media: ti-vpe: sc: Fix incorrect optimization Date: Fri, 18 Nov 2016 17:20:33 -0600 Message-ID: <20161118232045.24665-24-bparrot@ti.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161118232045.24665-1-bparrot@ti.com> References: <20161118232045.24665-1-bparrot@ti.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nikhil Devshatwar Current scaler library implementation of sc_set_hs_coeffs and sc_set_vs_coeffs tries to return immediately if the calculated coefficient index is already being used. As the same scaler block is going to be used for all the VPE contexts, even if the calculated index is same, the parameters have to be reconfigured for each of the context. Because of this, when multiple contexts use the same coefficients, all other contexts would have zero scaling coefficients. Fix this and also remove the unnecessary hs_index and vs_index fields. Signed-off-by: Nikhil Devshatwar Signed-off-by: Benoit Parrot Acked-by: Hans Verkuil --- drivers/media/platform/ti-vpe/sc.c | 9 --------- drivers/media/platform/ti-vpe/sc.h | 3 --- 2 files changed, 12 deletions(-) diff --git a/drivers/media/platform/ti-vpe/sc.c b/drivers/media/platform/ti-vpe/sc.c index f82d1c7f667f..02f3dae8ae42 100644 --- a/drivers/media/platform/ti-vpe/sc.c +++ b/drivers/media/platform/ti-vpe/sc.c @@ -84,9 +84,6 @@ void sc_set_hs_coeffs(struct sc_data *sc, void *addr, unsigned int src_w, } } - if (idx == sc->hs_index) - return; - cp = scaler_hs_coeffs[idx]; for (i = 0; i < SC_NUM_PHASES * 2; i++) { @@ -101,8 +98,6 @@ void sc_set_hs_coeffs(struct sc_data *sc, void *addr, unsigned int src_w, coeff_h += SC_NUM_TAPS_MEM_ALIGN - SC_H_NUM_TAPS; } - sc->hs_index = idx; - sc->load_coeff_h = true; } @@ -130,9 +125,6 @@ void sc_set_vs_coeffs(struct sc_data *sc, void *addr, unsigned int src_h, idx = VS_LT_9_16_SCALE + sixteenths - 8; } - if (idx == sc->vs_index) - return; - cp = scaler_vs_coeffs[idx]; for (i = 0; i < SC_NUM_PHASES * 2; i++) { @@ -146,7 +138,6 @@ void sc_set_vs_coeffs(struct sc_data *sc, void *addr, unsigned int src_h, coeff_v += SC_NUM_TAPS_MEM_ALIGN - SC_V_NUM_TAPS; } - sc->vs_index = idx; sc->load_coeff_v = true; } diff --git a/drivers/media/platform/ti-vpe/sc.h b/drivers/media/platform/ti-vpe/sc.h index 60e411e05c30..de947db98990 100644 --- a/drivers/media/platform/ti-vpe/sc.h +++ b/drivers/media/platform/ti-vpe/sc.h @@ -189,9 +189,6 @@ struct sc_data { bool load_coeff_h; /* have new h SC coeffs */ bool load_coeff_v; /* have new v SC coeffs */ - unsigned int hs_index; /* h SC coeffs selector */ - unsigned int vs_index; /* v SC coeffs selector */ - struct platform_device *pdev; };