Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1253557pxa; Thu, 20 Aug 2020 06:51:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4PsjBdrmglOS9ZDdJ/eNChofAZ11cWdl2TVZbz9l0n3lQha1Z/0M5wcsLuiU4aA1I3JEQ X-Received: by 2002:a17:906:7f05:: with SMTP id d5mr3342901ejr.122.1597931483690; Thu, 20 Aug 2020 06:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931483; cv=none; d=google.com; s=arc-20160816; b=aPqqvTCdBinue75o7P3epsvSWwN77bgHyG3slVaRw5ARzgbeFnk7CkbvP6OQ9Rjawk N10rGy+3T6jM5X7/zACpciawDvks34KLbFApmOvW9gMqGuuxd83CsXdZ6kqplO5b5brw Ld4+jBn+a12xZI9sDggzJo8TcA4SmXdlKotsuYGD6FyzO9vaUZgRD07l2XRKQT9WLE16 KibdYPULRRalCQm3b3N5HU9KvJCFXFQUesQsvmFQP88jLZBYBj4KnFVFqmMG41ytntUn IN8HyAbyd9l4B1859w7vHaGq9A8667aD6ig7uII4lSkVSl9KgsyMfTY8qLFlPk87EMzW xBgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Uz2C26GYyU/BNWDxtyeVt4qL0aMwhhZEadreLWSP4TI=; b=wiIAKm5Ry4zUC0zqQanJTOcHoJOr3sWA+vwqcItC4dfj5QNqDsKdLHyvFUUYNi6XU+ SwEsRiTt3urR5jvE/cPi/grs6h2v5y+eunOPc9HWfoJ2azjxSI7IVtNSCiVKHUQBDz9r Rg9941yxaNiwNEq7wRi3pN5vv4E6tMC1V+mfQGsoaWRVPJqgV4lTb8+kgpsreq2XpZUk crXU2nm59GP3nATTalchn/XzG4DcXtzatJGaa1RQ39qf1yxKYwgvwuG+8hiUjrcF7wxy NZK+JOFLIkyna61AxlQ1VbFmmA5+lKi7mECLFxpjc6SowlZN6605gpG6hL9kQziSWG2W ganw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LKazDKGC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz27si1281866ejb.27.2020.08.20.06.50.59; Thu, 20 Aug 2020 06:51:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LKazDKGC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729288AbgHTNjS (ORCPT + 99 others); Thu, 20 Aug 2020 09:39:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:42046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728180AbgHTJap (ORCPT ); Thu, 20 Aug 2020 05:30:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD11920724; Thu, 20 Aug 2020 09:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915845; bh=Mbyu94M5Ib3Jy3y7GVySoutrnyeR4/0pRXPAij6sL4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LKazDKGCafaNUVDgBNfyEV8cVeKSznq4Y0awl/uYofqKIrdSM6nB3rvyoGPiARFta T7P3EqwoQkgJqZFMSSAAHTCSsu2xNWHi09ayOah3DnwE44vjZeFrFOWcLUFDbJ+fo9 5J2Qrxj5cw3166OBhCbb23sXyXVM1Ii7L7Onc6A4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dafna Hirschfeld , Tomasz Figa , Helen Koike , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.8 126/232] media: staging: rkisp1: rsz: set default format if the given format is not RKISP1_ISP_SD_SRC Date: Thu, 20 Aug 2020 11:19:37 +0200 Message-Id: <20200820091618.918297764@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dafna Hirschfeld [ Upstream commit 206003b18bb264521607440752814ccff59f91f3 ] When setting the sink format of the 'rkisp1_resizer' the format should be supported by 'rkisp1_isp' on the video source pad. This patch checks this condition and sets the format to default if the condition is false. Fixes: 56e3b29f9f6b "media: staging: rkisp1: add streaming paths" Signed-off-by: Dafna Hirschfeld Reviewed-by: Tomasz Figa Acked-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/rkisp1/rkisp1-common.h | 3 +++ drivers/staging/media/rkisp1/rkisp1-isp.c | 3 --- drivers/staging/media/rkisp1/rkisp1-resizer.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-common.h b/drivers/staging/media/rkisp1/rkisp1-common.h index 0c4fe503adc90..12bd9d05050db 100644 --- a/drivers/staging/media/rkisp1/rkisp1-common.h +++ b/drivers/staging/media/rkisp1/rkisp1-common.h @@ -22,6 +22,9 @@ #include "rkisp1-regs.h" #include "uapi/rkisp1-config.h" +#define RKISP1_ISP_SD_SRC BIT(0) +#define RKISP1_ISP_SD_SINK BIT(1) + #define RKISP1_ISP_MAX_WIDTH 4032 #define RKISP1_ISP_MAX_HEIGHT 3024 #define RKISP1_ISP_MIN_WIDTH 32 diff --git a/drivers/staging/media/rkisp1/rkisp1-isp.c b/drivers/staging/media/rkisp1/rkisp1-isp.c index abfedb604303f..b21a67aea433c 100644 --- a/drivers/staging/media/rkisp1/rkisp1-isp.c +++ b/drivers/staging/media/rkisp1/rkisp1-isp.c @@ -23,9 +23,6 @@ #define RKISP1_ISP_DEV_NAME RKISP1_DRIVER_NAME "_isp" -#define RKISP1_ISP_SD_SRC BIT(0) -#define RKISP1_ISP_SD_SINK BIT(1) - /* * NOTE: MIPI controller and input MUX are also configured in this file. * This is because ISP Subdev describes not only ISP submodule (input size, diff --git a/drivers/staging/media/rkisp1/rkisp1-resizer.c b/drivers/staging/media/rkisp1/rkisp1-resizer.c index e188944941b58..a2b35961bc8b7 100644 --- a/drivers/staging/media/rkisp1/rkisp1-resizer.c +++ b/drivers/staging/media/rkisp1/rkisp1-resizer.c @@ -542,7 +542,7 @@ static void rkisp1_rsz_set_sink_fmt(struct rkisp1_resizer *rsz, which); sink_fmt->code = format->code; mbus_info = rkisp1_isp_mbus_info_get(sink_fmt->code); - if (!mbus_info) { + if (!mbus_info || !(mbus_info->direction & RKISP1_ISP_SD_SRC)) { sink_fmt->code = RKISP1_DEF_FMT; mbus_info = rkisp1_isp_mbus_info_get(sink_fmt->code); } -- 2.25.1