From patchwork Wed Nov 17 09:25:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12624091 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A5B9C4332F for ; Wed, 17 Nov 2021 09:25:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7A50613A2 for ; Wed, 17 Nov 2021 09:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235071AbhKQJ2r (ORCPT ); Wed, 17 Nov 2021 04:28:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:58818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235004AbhKQJ2k (ORCPT ); Wed, 17 Nov 2021 04:28:40 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ED5086323F; Wed, 17 Nov 2021 09:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637141142; bh=BNv/RXf2LPs/ZsQ3yHCR8w+D7SMDn51B2wu47lXDf0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lTVIXqitVBgsKQyy+zuTuY/303GUsLAnzEFMnUXSTb8uxL486sslEXILw+upe5ilE HWioAUxQ8fQkOkBcIA4/aQW+Z1uNfmjLdzpVaJBTZiD6yukouAYTMhyup0OAaK4RFF /pgR6hYLeX8+9MKbXAvIxBaMUCwNYIlQOzCwrF4VLJyO9piv1AUiH3C57pNxk+qUkO wy7CMIXIeozu6bTyllAPoaKo3Bdz/4w/vOMBntSJnC0Hob4RMf+A0wZn3e/Gyg6XvR Iokgobt/WlJRHPzTwUm0oNetwJptjAPCs/JSR8RMP5Xd3ebhYYRxxr+xvG8ROL/k5a CaO8DgUsBz+3A== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mnHCF-00Cb6D-Cc; Wed, 17 Nov 2021 09:25:39 +0000 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Deepak R Varma , Greg Kroah-Hartman , Mauro Carvalho Chehab , Sakari Ailus , Tsuchiya Yuto , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 13/13] media: atomisp: sh_css_sp: better support the current firmware Date: Wed, 17 Nov 2021 09:25:38 +0000 Message-Id: X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org As we're using Intel Aero firmware, make the code closer to the driver for such device. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH 00/13] at: https://lore.kernel.org/all/cover.1637140900.git.mchehab+huawei@kernel.org/ drivers/staging/media/atomisp/pci/sh_css_sp.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/sh_css_sp.c b/drivers/staging/media/atomisp/pci/sh_css_sp.c index f6db1f4a0e1d..a11078acb072 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_sp.c +++ b/drivers/staging/media/atomisp/pci/sh_css_sp.c @@ -982,6 +982,7 @@ sh_css_sp_init_stage(struct ia_css_binary *binary, /* Make sure binary name is smaller than allowed string size */ assert(strlen(binary_name) < SH_CSS_MAX_BINARY_NAME - 1); strscpy(sh_css_isp_stage.binary_name, binary_name, SH_CSS_MAX_BINARY_NAME); + sh_css_isp_stage.binary_name[SH_CSS_MAX_BINARY_NAME - 1] = 0; sh_css_isp_stage.mem_initializers = *isp_mem_if; /* @@ -1013,16 +1014,14 @@ sh_css_sp_init_stage(struct ia_css_binary *binary, return err; #ifdef ISP2401 - if (stage == 0) { - pipe = find_pipe_by_num(sh_css_sp_group.pipe[thread_id].pipe_num); - if (!pipe) - return -EINVAL; + pipe = find_pipe_by_num(sh_css_sp_group.pipe[thread_id].pipe_num); + if (!pipe) + return -EINVAL; - if (args->in_frame) - ia_css_get_crop_offsets(pipe, &args->in_frame->info); - else - ia_css_get_crop_offsets(pipe, &binary->in_frame_info); - } + if (args->in_frame) + ia_css_get_crop_offsets(pipe, &args->in_frame->info); + else if (&binary->in_frame_info) + ia_css_get_crop_offsets(pipe, &binary->in_frame_info); #else (void)pipe; /*avoid build warning*/ #endif