From patchwork Mon Nov 25 08:32:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11259989 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1AB8D1390 for ; Mon, 25 Nov 2019 08:33:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC7DF20823 for ; Mon, 25 Nov 2019 08:33:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j2Zn8kNS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="DDoujrnx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC7DF20823 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3iLQ3vQukJVrAfiy7nsFJ0tdYhGcXem5Mu+Aovof6I0=; b=j2Zn8kNSHuEN2c EPE75kbBGzIvBS0C9iW12F8EfdljqOdScm1Zzx1NYa9JkYZhVoLVH2z9tSbRl1aps18R6EZ2kD3Id +qEu/wgMQkX1bP/2fcLXlL2UtCojBe8O7MyhI25VlBi3U4y15vCQOSaYT3KiWKM+eTyOTkWNtGQ43 3yqtZ2KcVpYxfL+8yW7GpSKxlkwj+nr/MUusKGwxJeKXyr1By5KVXe+YSIqdYMIZYv/NFRfD+L+4t eFBlK5hiy+q7SxdDQ9GcUQuIiCboWMSHLB/3IFTZgx0598a/cFgvAS2zj/gZoOPnwM41RL/8UpYkM RyFH6zJRqKCoigceev9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9nx-0006Dz-Gk; Mon, 25 Nov 2019 08:33:09 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9ni-00063g-P1 for linux-arm-kernel@lists.infradead.org; Mon, 25 Nov 2019 08:32:57 +0000 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Eugen.Hristev@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="Eugen.Hristev@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; spf=Pass smtp.mailfrom=Eugen.Hristev@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: 0va2IPncWJ3NkQljTNVIaniEGRecAPnmKRFwHI0oNupbclmspc6mCAiihfAQABEULcWFbb+mrN B8axA/r6oA+jxq/gG/Mfb0tnRf82k+vF/G1ltIZHEklMaz0XKn8Fgel+iCsh+GsRJyhTwpdLtU PI7lfXwzffGDWg9EiRU3kb86jEX+geinz3XeNvVvm8yMokM8M3NQEckpmpQiQwiRRsXg/WwSnn bdNsoRYZ9wbNmehzslzcfgX7K7iOvsSZ3J4qoVjwmKe+Fxr9TH5s6RPoEAy1994jRnfJqv6C0M 3cY= X-IronPort-AV: E=Sophos;i="5.69,241,1571727600"; d="scan'208";a="59582540" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Nov 2019 01:32:49 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 25 Nov 2019 01:32:49 -0700 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 25 Nov 2019 01:32:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B3hxoeg4uX4cFvOvyNH814prm+DW12fxS3ThfkFyU7a1elUuQqIS5wFjJyQWvkeMznJLZBEmOcWmX0t26HyFY4XNeEA96tJRigDyvjsmmyH93A10O9CHcQ+78byz8rywGNfkfOlyuZ7hyuN8ClsB5OEFTiDsMD5rQZqBi+O2z3OqympnEaLkax6libVME9AMWXNK/Hs7PKap0InbJPgugxlnKc3b+pWqHhq0i5x/lAHoDxjHCLOf9eQwD3h72UIOkDNTYwBCchxLj/IJWSs1VL3IaboFRtz2t5aiZ5KcF6/1aXuRv+gztSMCxW2s4w6NI6kM2GHI3W4x1QXQNDLLWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K74n2UhTJbXQwpy5EpqPZKIWWuXb6+qwTmW7OjKVt7U=; b=OtSYYRTCimOAm+Lhwg7yoEH12F8xZ9/iaKHVOv/UOcFaM8731V2Tc5G4tn9ZlPX4SnMyfVlq4gCeVlBBCZg3hWiNR9O4yjTvDsUHf9M41u9s5W2wvqpvpbbX81GrdpzMgU16vo2WfJt1AaFEUa0TcRShMzudAlQW7lOqWy2NtGd3x2UWDSZQlKpX9DsgXbdVd1J4D56uIK9r/zYGxPYQjTzWMSIY5onsuywTd102WN9ewtbnZYgJFUMwJa6yntxpcsPdYTDS6viuV+LhJU2FQBtjzBr93NUM3bLlkjP2bTwnUN6DuQCgH7cN6+btc/nuzErWnSXq2lXnO6mbD9l3rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K74n2UhTJbXQwpy5EpqPZKIWWuXb6+qwTmW7OjKVt7U=; b=DDoujrnxx3X0epY+/D2hgQYWkaGUNEIBx73RSA8TezPdFvlWb/2sdMkUNmziUDe9m10D3urUtyCxmHmbMjYs6oarPMyGBED2KcyTy/XCkH4zeubUjOFjZq7BNRmUdDoXvlsaMcrf7WZZ8GtMoOfg6Yb3j6qONWTEq5jhxMqWMFM= Received: from DM5PR11MB1242.namprd11.prod.outlook.com (10.168.108.8) by DM5PR11MB1418.namprd11.prod.outlook.com (10.168.102.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17; Mon, 25 Nov 2019 08:32:48 +0000 Received: from DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1]) by DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1%12]) with mapi id 15.20.2474.023; Mon, 25 Nov 2019 08:32:48 +0000 From: To: , , , Subject: [PATCH 1/5] media: atmel: atmel-isc-base: allow 8 bit direct dump Thread-Topic: [PATCH 1/5] media: atmel: atmel-isc-base: allow 8 bit direct dump Thread-Index: AQHVo2rqiDAOU7qyfkq3Wl1/znPirw== Date: Mon, 25 Nov 2019 08:32:48 +0000 Message-ID: <1574670712-31992-2-git-send-email-eugen.hristev@microchip.com> References: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> In-Reply-To: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> Accept-Language: en-US, ro-RO Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM4PR07CA0029.eurprd07.prod.outlook.com (2603:10a6:205:1::42) To DM5PR11MB1242.namprd11.prod.outlook.com (2603:10b6:3:14::8) x-mailer: git-send-email 2.7.4 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2329dc29-c26b-444f-07c1-08d771820d4d x-ms-traffictypediagnostic: DM5PR11MB1418: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0232B30BBC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(396003)(366004)(136003)(189003)(199004)(305945005)(2201001)(66476007)(66556008)(76176011)(64756008)(66446008)(26005)(81156014)(81166006)(4326008)(3846002)(50226002)(5660300002)(25786009)(86362001)(8676002)(6116002)(2501003)(52116002)(66946007)(6436002)(66066001)(256004)(6486002)(446003)(14454004)(2906002)(386003)(71200400001)(102836004)(14444005)(6512007)(2616005)(11346002)(6506007)(478600001)(71190400001)(36756003)(110136005)(107886003)(99286004)(186003)(7736002)(8936002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR11MB1418; H:DM5PR11MB1242.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vjHUFIIcYmcyqtKFjG9HuS4rhXU32sKrWDn+cQgI+3wQIYra+6hRb2DLvEX1tnJwN5Nd6v35EDL+tVeLH/wIcFyveiXCPbWO/LoFbYmmn9ppdvLj6JTLc8SHoBSGPBijDRbutWrehY3nKT6jFYZjezApST94i5YFRdRBbim0zAJ/2p3vEgy1t9uN20s1AiFmVuSi90yS9s8rQsirOUka0fOm1k0AA0ULIYdOPuF73PHAFApQsl7ErLczpiDJadhO0n73G7e43/nY5pIuMoyCT9bfIvcmieIFTZ8va8o4DtqUwSWtXxndR/162N7THIGTscf9fLlRBhiEY9oBUGExThX4MPLW8lpJgIkMVGu8MqljOWF+FZmiAElq0wkvR/2/Sl51C1nxABAOyyxRsQPf2TVpBQCEw3QM8iVBv4WVIdvqMK6/bah2ajsw2AgpwrPh MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 2329dc29-c26b-444f-07c1-08d771820d4d X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2019 08:32:48.0962 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 1UJPpjqiy0OX5XjKKthHOtntgc8xa1Xgod2OWzlqo/0CbJaI5llPE+W+C++BUTFD2LsvRVwDqO8s7hqDZHxIsRqj41uGbNRysfCwypElGaM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1418 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191125_003254_816007_56FB9FE8 X-CRM114-Status: GOOD ( 11.79 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.147.91 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eugen.Hristev@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Eugen Hristev In case the format that the sensor sends is 8 bit only (like GREY for example) we need to be able to bypass ISC pipeline and directly dump 8 bits. That's why the hardcoded value of 16 bpp is not correct in all cases. This change allows the output format to decide what is the correct bpp (bits per pixel) such that the result is in the proper format. Signed-off-by: Eugen Hristev --- drivers/media/platform/atmel/atmel-isc-base.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index 604374a..0cfb524 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1049,18 +1049,10 @@ static int isc_try_validate_formats(struct isc_device *isc) /* * Configures the RLP and DMA modules, depending on the output format * configured for the ISC. - * If direct_dump == true, just dump raw data 8 bits. + * If direct_dump == true, just dump raw data 8/16 bits depending on format. */ static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump) { - if (direct_dump) { - isc->try_config.rlp_cfg_mode = ISC_RLP_CFG_MODE_DAT8; - isc->try_config.dcfg_imode = ISC_DCFG_IMODE_PACKED8; - isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED; - isc->try_config.bpp = 16; - return 0; - } - switch (isc->try_config.fourcc) { case V4L2_PIX_FMT_SBGGR8: case V4L2_PIX_FMT_SGBRG8: @@ -1141,6 +1133,14 @@ static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump) default: return -EINVAL; } + + if (direct_dump) { + isc->try_config.rlp_cfg_mode = ISC_RLP_CFG_MODE_DAT8; + isc->try_config.dcfg_imode = ISC_DCFG_IMODE_PACKED8; + isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED; + return 0; + } + return 0; } From patchwork Mon Nov 25 08:32:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11259995 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16C121390 for ; Mon, 25 Nov 2019 08:33:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF57C20823 for ; Mon, 25 Nov 2019 08:33:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kxzxeJ1D"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="uqw1WD25" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF57C20823 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=C2QgURCi1nnqRmpqoQdJAQqzTKHvYbLL42Uh97Kt2FQ=; b=kxzxeJ1D9qsYDd reGDfxQo5mnjFhK/HJsO8XJYuUaGSZjj9WzXU4zogIJhWU83Pz0hGonUP7Q0mfTymDnwGbx2Vf3rq 3gIQeMTkRgwvEacKS/zyunE9prAFLFy0ZnDf9Iv8DZff3yl26iyZRt6gsiUCENbX+3ADumMFF7tmH bpOxAXw7l6gNhsR4Vit8ARPR+N7LTj+XRCahkqL3GSsKfnkXAQJaJvCSjWE56NQ5gJ+xmHa1BpBwn 3jA5XRlkvf+OyF7XugHkZkm/1+M4LkN/O9T+BlXBSYDPIf4fBFJcHto1rqpTG7YZAwFurBL2QKMdi co1BmrrUYRfR9enUykIw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9oC-0006Sa-G0; Mon, 25 Nov 2019 08:33:24 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9nh-000635-DX for linux-arm-kernel@lists.infradead.org; Mon, 25 Nov 2019 08:32:57 +0000 Received-SPF: Pass (esa5.microchip.iphmx.com: domain of Eugen.Hristev@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa5.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="Eugen.Hristev@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa5.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa5.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa5.microchip.iphmx.com; spf=Pass smtp.mailfrom=Eugen.Hristev@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: S/lzWI3NEb4Z8nz4vEkTKQjMS2PLcidkmVQiP1507dhMBAJlZbYGzgQ4RlCVql/4BULMO/eEVM lmveY/DQkptzOAASmCkQ1OSiusIuunXgmcumRwOeglnelUOjb4GnlQoM6rxfxer4MF/EcNyorp yL1wJ0mKnnPQDmoq1S87UnH9TGtI5lJe0ZLbdkl9vOAJcsnz9HZCJmbsTgW39x/OuFZfZ//540 QRW13hLU56dDOtkzoj6YCCmHLqg9DW26kvj2AfHOjZ0/2EtzhqZTFOnOYvjDIWDR02NwUeIDjL A/w= X-IronPort-AV: E=Sophos;i="5.69,241,1571727600"; d="scan'208";a="56746965" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Nov 2019 01:32:53 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 25 Nov 2019 01:32:51 -0700 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 25 Nov 2019 01:32:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JfkrssDbe6+syLRpH+Uy8YapZy9sxBj+LRU6CtBTcKS3A8iCylH7phdG/S8BWbRQ4SQbSdYH86Uu/ngs+beUc8e4WuqEmqSNapOIKcjPvcf0rjR6jvagiISY0z5yJZCQfSXa4xa3eq8TJyUUZd6ZkFsCIogO/wN0p1IsW2ApiCvCCXkZoIPKsJ4KZd9oe9/QLzV9cB2FtRVkMrX2uQPVCFAdQM7nHYApEN5WfivdT7f7j8eZ15rNLp98vaXIDc2+4RmboiiBaKGE8DNXZnz3r8MkCM9iOncaG1+JpT1wty+tE4nl65ZErFYnpffaj6fJXjgdurW0N/akBKEB4c1kcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZleAsWziOMXRJHWRHE5G4URkfXQ8+kd83xIimRGanB8=; b=goisjdc1y050fGm9ZZsx/drkdA5HIdDASsKQymTWfmRKhhM8Kjg+XxA4lqC1Au3iJ7dE8Z9v1ByJHQjqAKV4F+asF3RsIo3h3sZvEq/RvdMfpNH0W1A/cmr0P+d9mDO8nOPsoOvyH2W6G0D2WazHsnv9u4Tz5rfe1rl/4pCn0BPmhAWQ07AlqxNeZcbxhbVoSI+oqww/YfdCcsGR7j0PUQYGQ6bQlTf5za+RQ8uVAo002y/di6a+ysFx04TNZATGxV+M7JEfSj4hZZMcEN+F/fk3DH1Olr/vDtujiJsU2ygtRks7ogH5azzRO3Sn+2b6B+3qJCtnFZZATsqLCmiRcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZleAsWziOMXRJHWRHE5G4URkfXQ8+kd83xIimRGanB8=; b=uqw1WD25GAC1vwEyxuEifriLculNElX+ohIFuW6jiKWEC0VSfWFjH9yJ+5/iZ5PL+fsYcjr7YNRZv3rHtvO5oVGVqDa81p5wNx0Zr5z8yDlFBEJED9ydxiu+SgpLg86ln3UJr7rbhhnGpEvR1GyTLXXT+WRb6TqX8UYAJNtHhh8= Received: from DM5PR11MB1242.namprd11.prod.outlook.com (10.168.108.8) by DM5PR11MB1418.namprd11.prod.outlook.com (10.168.102.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17; Mon, 25 Nov 2019 08:32:50 +0000 Received: from DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1]) by DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1%12]) with mapi id 15.20.2474.023; Mon, 25 Nov 2019 08:32:50 +0000 From: To: , , , Subject: [PATCH 2/5] media: atmel: atmel-isc-base: add support for Y10 format Thread-Topic: [PATCH 2/5] media: atmel: atmel-isc-base: add support for Y10 format Thread-Index: AQHVo2rrq/UUfdSxpEGLC81Cyy1KqQ== Date: Mon, 25 Nov 2019 08:32:49 +0000 Message-ID: <1574670712-31992-3-git-send-email-eugen.hristev@microchip.com> References: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> In-Reply-To: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> Accept-Language: en-US, ro-RO Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM4PR07CA0029.eurprd07.prod.outlook.com (2603:10a6:205:1::42) To DM5PR11MB1242.namprd11.prod.outlook.com (2603:10b6:3:14::8) x-mailer: git-send-email 2.7.4 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bc01cbf9-f5fd-444b-8809-08d771820e5a x-ms-traffictypediagnostic: DM5PR11MB1418: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-forefront-prvs: 0232B30BBC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(396003)(366004)(136003)(189003)(199004)(305945005)(2201001)(66476007)(66556008)(76176011)(64756008)(66446008)(26005)(81156014)(81166006)(4326008)(3846002)(50226002)(5660300002)(25786009)(86362001)(8676002)(6116002)(2501003)(52116002)(66946007)(6436002)(66066001)(256004)(6486002)(446003)(14454004)(2906002)(386003)(71200400001)(102836004)(14444005)(6512007)(2616005)(11346002)(6506007)(478600001)(71190400001)(36756003)(110136005)(107886003)(99286004)(186003)(7736002)(8936002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR11MB1418; H:DM5PR11MB1242.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: d2F3ShzBZNUOvrv1oYi0emvCGj3z1/IdcFTxFK0pSe4TZFJ9Zc1/mtWDMSFPMLtbKBA2RfR8U8sDCJyksxEKyNKBjZsCtQoL0A/3ZmIj0aAJD5XfU7j9KAOcxhGcw8M1C7ei1ppfnRGHJsYCb2bEWG7v7ywjoytMIcrIxptpCLhkyfcZVfi/UTCiLbjSbHc4y4gNH1b215vYVbLkg73gLNq0nvM4ye3/sMWtGnCJGKsDoeq5qORRZ4NMQYYN75AHDeVk+G5WVx2XPo/tsfYJhjyDa/9BzzbvzGI3JOswdnDVCim2+FGOC2msrCT08ime6lIW9DGXcQ9R6MflLAS5gRsp7UiqLOfz9r+H2qrluBJkcIJo2YCMr5qZWgZWRWhcb+j9KsuiAajcwETVkhZzYigO95F8gwOB/WIf3GRkCyni4IXbTl54m6zQq2D3TQj4 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bc01cbf9-f5fd-444b-8809-08d771820e5a X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2019 08:32:49.8744 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0ER6RfxXZftU7VCI0QSO3RP7UoiXwplfBSMObY+5tvYuODEZSr+jCZzyvjaHAE08TvI5sVTkRIB2J07SMqYWPm3ucQuzGka5CkKymxZg/9g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1418 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191125_003253_511569_341BF25F X-CRM114-Status: GOOD ( 11.79 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.150.166 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eugen.Hristev@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Eugen Hristev The ISC can receive input from sensors using Y10 format directly (10 bits greyscale). In this case, the ISC must dump the data directly, either as GREY (8bit) or Y10 (10bit). Y16 is not supported because we cannot align the MSB 10 bits to the MSB inside the 16bit container. For this format, the ISC internal pipeline cannot work (only works with BAYER), so we must dump the data directly as 8bit/10bit. Signed-off-by: Eugen Hristev --- drivers/media/platform/atmel/atmel-isc-base.c | 35 ++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index 0cfb524..a948294 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -73,6 +73,9 @@ const struct isc_format controller_formats[] = { { .fourcc = V4L2_PIX_FMT_GREY, }, + { + .fourcc = V4L2_PIX_FMT_Y10, + }, }; /* This is a list of formats that the ISC can receive as *input* */ @@ -164,6 +167,12 @@ struct isc_format formats_list[] = { .mbus_code = MEDIA_BUS_FMT_RGB565_2X8_LE, .pfe_cfg0_bps = ISC_PFE_CFG0_BPS_EIGHT, }, + { + .fourcc = V4L2_PIX_FMT_Y10, + .mbus_code = MEDIA_BUS_FMT_Y10_1X10, + .pfe_cfg0_bps = ISC_PFG_CFG0_BPS_TEN, + }, + }; /* Gamma table with gamma 1/2.2 */ @@ -211,6 +220,10 @@ const u32 isc_gamma_table[GAMMA_MAX + 1][GAMMA_ENTRIES] = { #define ISC_IS_FORMAT_RAW(mbus_code) \ (((mbus_code) & 0xf000) == 0x3000) +#define ISC_IS_FORMAT_GREY(mbus_code) \ + (((mbus_code) == MEDIA_BUS_FMT_Y10_1X10) | \ + (((mbus_code) == MEDIA_BUS_FMT_Y8_1X8))) + #define ISC_CTRL_ISC_TO_V4L2(x) ((x) == ISC_WB_O_ZERO_VAL ? 0 : (x)) #define ISC_CTRL_V4L2_TO_ISC(x) ((x) ? (x) : ISC_WB_O_ZERO_VAL) @@ -1026,6 +1039,7 @@ static int isc_try_validate_formats(struct isc_device *isc) rgb = true; break; case V4L2_PIX_FMT_GREY: + case V4L2_PIX_FMT_Y10: ret = 0; grey = true; break; @@ -1033,16 +1047,19 @@ static int isc_try_validate_formats(struct isc_device *isc) /* any other different formats are not supported */ ret = -EINVAL; } - - /* we cannot output RAW/Grey if we do not receive RAW */ - if ((bayer || grey) && - !ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) - return -EINVAL; - v4l2_dbg(1, debug, &isc->v4l2_dev, "Format validation, requested rgb=%u, yuv=%u, grey=%u, bayer=%u\n", rgb, yuv, grey, bayer); + /* we cannot output RAW if we do not receive RAW */ + if ((bayer) && !ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) + return -EINVAL; + + /* we cannot output GREY if we do not receive RAW/GREY */ + if (grey && !ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code) && + !ISC_IS_FORMAT_GREY(isc->try_config.sd_format->mbus_code)) + return -EINVAL; + return ret; } @@ -1130,6 +1147,12 @@ static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump) isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED; isc->try_config.bpp = 8; break; + case V4L2_PIX_FMT_Y10: + isc->try_config.rlp_cfg_mode = ISC_RLP_CFG_MODE_DATY10; + isc->try_config.dcfg_imode = ISC_DCFG_IMODE_PACKED16; + isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED; + isc->try_config.bpp = 16; + break; default: return -EINVAL; } From patchwork Mon Nov 25 08:32:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11259981 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96470138C for ; Mon, 25 Nov 2019 08:33:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6871E20823 for ; Mon, 25 Nov 2019 08:33:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QcqJjuWr"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="FQ/yvW65" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6871E20823 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yQIwZ786q33QKg+NOX1TKASBfVBP3B5zc+7Ldb8iEow=; b=QcqJjuWrPyRTtv aQ2DrFb74iRBg95NN4JNJLzIOI9GJ33prFN00t1ETl3apf59+GJ6TyZFCvRdNFnBE+yl9mfc1kCZ4 LRFvME4Y9+VSO0KKbHltlY2bsKgybwhMsJ04IQPCE7EFStcvAryXnzYGZudAeN1fn7Opg7ZCBacIC hHH6oObR2v7vaNLTmuEEkSgzbHHevqKbHIqKgZko+WoKrWdgjVghvCKvpQjQRbwMt1FKJG4qklzjP QaOd74V0/LJ/3evVbwtoaJ27mlLraStisiz5nmg/QwhueN/RWFiYdI7NNN5GmjChp04iKyNS6LE4H PdhLEoGB6AYgZK9UIV8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9nm-00065e-Bs; Mon, 25 Nov 2019 08:32:58 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9nj-00063H-3H for linux-arm-kernel@lists.infradead.org; Mon, 25 Nov 2019 08:32:57 +0000 Received-SPF: Pass (esa2.microchip.iphmx.com: domain of Eugen.Hristev@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="Eugen.Hristev@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa2.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa2.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa2.microchip.iphmx.com; spf=Pass smtp.mailfrom=Eugen.Hristev@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: THRsbqcjNjd1fCJNvm9umBgjQvQcM4dAIEoLBLGfBbTRsREODJ1/x0wVx8UPf9zOqvkp/7jPSQ BNc88NqO5vzq8A2QMGtD8Ee7ARcAdwDaL4a2T+0qedgXz7t7Abd/koYlWOL7MGjL7KPOyeV2Qd e0heOJ0oupKNcNVHBuO2OmdDpZULP0p0yQN4M6RR/ICMQtehfbkBIvSSGB6GwfSr9Cqaq9b7hJ 68wC+doMXuvLHkDrM4NHDI0GC3VRh/QBMQxxdpvWQV5dfCluYD+VhBeBkjt6r/NwIZTWmVpz6A mvw= X-IronPort-AV: E=Sophos;i="5.69,241,1571727600"; d="scan'208";a="57802239" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Nov 2019 01:32:53 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 25 Nov 2019 01:32:52 -0700 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 25 Nov 2019 01:32:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aojSQSCkXSte1isc2O88eVvKR9JkWqqJCPuD/9cDFotmNZND1Hh21XEINPgdeHZfaobKPKJsin52kPOjI8zN6UyTEuYUMoWe16gPlf/l1syaOkddtKJZ9oQN1cRs5iZM+3jZAuZekBXfLUUBcsV98/UKHELqgCA3oo1fLNvbp/kL/Msu/lM/UUdS50v7pYE/EK0c/JdXVunXXdXepOr7resyV/z9jyO4tzb2wBAKUZNKVFLHv/2El5eOYCP/8O6kYSbTFVYgM9zZMUXPY6ulm9rUN1o3oClvLaJbsmBieT63GD5A9mp2XMT7NH+iCCWoUQl6z7Tt3KLFS1iBJLnm2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3ORKYZoIUnkIZNK3Aa73DW+qkgq7VRNVbbkkt29Xf2w=; b=iI/4JE9hp57DKsWjZpTcV2ScJgj3+dIA4bPcV1Mi0ao1FOssILO7XwojxDSKxws3zbogIsoQtXqW6dLbMjHe6zQCdnJ5lxpRYSTKScIEN3eauvmjYeoI8e+ijbpafg29A+4albX54NP/QzBTzxF1W1lJhiHKQtpt6Nvx8TIb3ZdsPFdqd8jGET5nFzBnFNY4jmXOd+QYUzDXV8ds/0jCigTX5PBK0GI8M56tRRb+K5eMmi+RkysnfLlnfIQzrEHofZbENV+EIbxEljHEDBg2rySKkSDJW9Gi2R6XT8KKnreZN45LAqH1tecBZ6fAV6hm4CZxYON40ZKUofHaFbHEYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3ORKYZoIUnkIZNK3Aa73DW+qkgq7VRNVbbkkt29Xf2w=; b=FQ/yvW657CXsMfpbjWTWm0VP5q+Rw0J9zvAd6erWyr48IlGJheYgTlm+cQIJlU3Y56ZkCittu6EcjyTB01PzFn/aPEhD8FLqUloJSpXzawVHY5IONhmiBInGlB9vrQiuhKjAFeo2GcXvvF463D2gAYhuPHyLxDu15aaQMlLtF+g= Received: from DM5PR11MB1242.namprd11.prod.outlook.com (10.168.108.8) by DM5PR11MB1418.namprd11.prod.outlook.com (10.168.102.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17; Mon, 25 Nov 2019 08:32:51 +0000 Received: from DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1]) by DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1%12]) with mapi id 15.20.2474.023; Mon, 25 Nov 2019 08:32:51 +0000 From: To: , , , Subject: [PATCH 3/5] media: atmel: atmel-isc-base: properly initialize pad_cfg Thread-Topic: [PATCH 3/5] media: atmel: atmel-isc-base: properly initialize pad_cfg Thread-Index: AQHVo2rtEjFpADgo3ki6VWTokYTW7Q== Date: Mon, 25 Nov 2019 08:32:51 +0000 Message-ID: <1574670712-31992-4-git-send-email-eugen.hristev@microchip.com> References: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> In-Reply-To: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> Accept-Language: en-US, ro-RO Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM4PR07CA0029.eurprd07.prod.outlook.com (2603:10a6:205:1::42) To DM5PR11MB1242.namprd11.prod.outlook.com (2603:10b6:3:14::8) x-mailer: git-send-email 2.7.4 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d5c05a23-75ed-42cd-b686-08d771820f57 x-ms-traffictypediagnostic: DM5PR11MB1418: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1468; x-forefront-prvs: 0232B30BBC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(396003)(366004)(136003)(189003)(199004)(305945005)(2201001)(66476007)(66556008)(76176011)(64756008)(66446008)(26005)(81156014)(81166006)(4326008)(3846002)(50226002)(5660300002)(25786009)(86362001)(8676002)(6116002)(2501003)(52116002)(66946007)(6436002)(66066001)(256004)(6486002)(446003)(14454004)(2906002)(386003)(71200400001)(102836004)(14444005)(6512007)(2616005)(11346002)(6506007)(478600001)(71190400001)(36756003)(110136005)(107886003)(99286004)(186003)(7736002)(4744005)(8936002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR11MB1418; H:DM5PR11MB1242.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GOfdHOZTFneVKRGiRFWLQQWpY2uaMF2ckqBQ4aezQ4iNbMeSUSpSVbZ55VaMQyBoUIUiO4e/HOx4487GzspdHbmOeeG+eb8c2J21PUfNF/gnMFPFOWgh1nhMlLYbluPP282lx++mjX4W7wTDVShmpv22rWZYhyOGbzCEhkGKIC5DoreO99JwqGi1zax3sh3LC3jxwnWZqc2FD/3YYnedy+12WYmgSRXk86MoZUk580EJXYpwdKZ3sW1rBjAPKHvtVX5MCVImnpGEOMkxVlmvf4ElpBI4NdIcJ756YL4HKunQSN5eAy5akymgYN5XmLPXPP4PFaeprVSN4LrSUQSXqWdpWBxjMkg3pqaosmbu18j+bDQrJK8pbgUt66B/+kJfNn4JleuYJvEo2T7tnrLmdFB/9riJmceLTaWYw9bbCmz/GOZVN9erxA07gOoxUFDO MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d5c05a23-75ed-42cd-b686-08d771820f57 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2019 08:32:51.6196 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VGDdFHNTaJRoFTeYIyR1vHDkS38w8VDV2ivR1nVPx7XpO4PAvkxjZ3JtmuvSKFOjzq5Iql467hPOtuYFUVQo9RhLmVfE+DI90jX6ulaTOgA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1418 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191125_003255_167266_6D0FF529 X-CRM114-Status: UNSURE ( 9.76 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eugen.Hristev@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Eugen Hristev In try_fmt, properly initialize the pad_cfg variable to zeros. This can be used by various calls from the subdev, so it's better to have it initialized. Signed-off-by: Eugen Hristev --- drivers/media/platform/atmel/atmel-isc-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index a948294..7c73bcd 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1239,7 +1239,7 @@ static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f, int i; struct isc_format *sd_fmt = NULL, *direct_fmt = NULL; struct v4l2_pix_format *pixfmt = &f->fmt.pix; - struct v4l2_subdev_pad_config pad_cfg; + struct v4l2_subdev_pad_config pad_cfg = {0}; struct v4l2_subdev_format format = { .which = V4L2_SUBDEV_FORMAT_TRY, }; From patchwork Mon Nov 25 08:32:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11259999 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F322D138C for ; Mon, 25 Nov 2019 08:33:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0EFB20409 for ; Mon, 25 Nov 2019 08:33:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VXSkEjX/"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="dDJWumwV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0EFB20409 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+74B6iLry26XvyLmlGHcdW+6umBnV8EU6ruUTAMGiWM=; b=VXSkEjX/enoVBQ rS8qKVTPYJsUcNhLqODWIQC2nlP6chB4mo+oBqD5vVrDXRNLOxv2yROIMe6foSw0FR5xCSOI4qX/n Uvvyugz4zpNa1AslwE67wMQ59/jgs2LKbE7UOrxp4MP7VhtP9dgkE6if1AoeoXRwpFJ1Mza3xzUqE R1+mZPcSGyuh35sn5xg8M4GasZo/JqfyAxWsJ4rH1QYXLc9U1LxpJoS5NOje09w9ELwr9+Fk/l7O9 8q5LwG1OOvt5nWNU7ODBZEC7girNqzUA09wkjMNI/szEZqo0B4PTBrXrShRMRCgHK7GQtPfSiSk3X L89RLf/PaZITBZ1gL45Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9ob-0006vs-QV; Mon, 25 Nov 2019 08:33:49 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9nk-00064W-HC for linux-arm-kernel@lists.infradead.org; Mon, 25 Nov 2019 08:32:58 +0000 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Eugen.Hristev@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="Eugen.Hristev@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; spf=Pass smtp.mailfrom=Eugen.Hristev@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: 5x4y3u3sX/XuWfSBk8Y1NBjEBG7S5BaJJq6XB9SdTWa7upytfLZxDzPKdmEH2mwVbhAGZg47RL ULuD+GwPZNeIF23ZGu6A1BZ5WOuG5WObRWnF7cCqRf7Ck9QiFi8iMAYjb9I4k6Vzw26Ev4NmYG VjZw9dZcSg+790/7aDJWpEW0oE1yUSmo3qHMB8iNO5mhVUi0cOaOQE63REHlRMHcJmFMAamwj4 P5jPrb7abc0aVE9XXQW7FdyFLt6tr41ZR+YMofMq7FvhoGAD89PsbPxCvlUYAEctBOz/Npbg56 Jww= X-IronPort-AV: E=Sophos;i="5.69,241,1571727600"; d="scan'208";a="59582554" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Nov 2019 01:32:54 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 25 Nov 2019 01:32:54 -0700 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 25 Nov 2019 01:32:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P4cVq01jrd9SYlvtFITUDwq+A/0z4WywamYIRd5iTyWUw5DrW/QP7jFGHyGN30sJkj20bxSCOo3LWnv7Wzon3uWB3aBoGLWK5WNTDDCh85hoWUlVsJtIy+j3LwdMsHZzXHBtadLhoNCRaSsDWjMnQXPtP+ihBISZbFlyQNrG/BhJRQ/DR7jWJ8Uu2/LN4SHkECjhrE0ZB/gUCjzTlvIdr6AhGGJYwpyJKh2+uX3Ux/ar2ijSBclnzQJ98hrr1Hwq6DFUhTi1oGhcsyVSXSgV+tCWTPxf/dyEBjf0vgFUCjfUN/JMkELQlisGdZd0G7TUp9vK9dUVt5Ud7d1G8XUkww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+ODnUOcqY0KalriTcExTCa9U7N8wvQUUlGpEuL53z34=; b=KsTlz7Y3PtpycZk37SYKr1TgG9otj03xAWT6uZE5hYlHCmdo58Gc7QWYivOz2nmB7yqXmFlc4qWaOOu55tbzUilTiRT/DS0Dsokugja8OzXCwcCZGjuxC2NU0BjLshZQZ/9sZKKtn8AfdDzcVWrvEDqftzDyv57ca9mNY7Sfm3KWfWMQwvL4TrbT8Yw8NIvq4+ZdgzwJ4VdfCLbClZ1+5trRBAvuKEpQZTePIbzEx5ERqmyv6Zc5yUAEXUwZTsvc90pA75acHDLHZedgcOuzHeXJQdpWsOWX5p/U4thlgMk52El9URs9NLYcqC80MHvkTAaHpDJG1lCLWM1X2FmJBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+ODnUOcqY0KalriTcExTCa9U7N8wvQUUlGpEuL53z34=; b=dDJWumwV0MP6jCZE7AsKGGODEAiII24r/o4biihomD+mvVfRSwMtzufYnJWbc4Sw9NPvA47KS70RFvyNRq+mGZFFOWgDhxsFx2UNNUpJFdLtSV0ziSg6778gLZx44DDGArMTmjcWU59TOwrUxVLb5mWEEd/aPNPp6spt5m2vnjo= Received: from DM5PR11MB1242.namprd11.prod.outlook.com (10.168.108.8) by DM5PR11MB1418.namprd11.prod.outlook.com (10.168.102.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17; Mon, 25 Nov 2019 08:32:53 +0000 Received: from DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1]) by DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1%12]) with mapi id 15.20.2474.023; Mon, 25 Nov 2019 08:32:53 +0000 From: To: , , , Subject: [PATCH 4/5] media: atmel: atmel-isc-base: fix enum calls default format Thread-Topic: [PATCH 4/5] media: atmel: atmel-isc-base: fix enum calls default format Thread-Index: AQHVo2rtyZwWiP6YTkSg0h1tviYJpw== Date: Mon, 25 Nov 2019 08:32:53 +0000 Message-ID: <1574670712-31992-5-git-send-email-eugen.hristev@microchip.com> References: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> In-Reply-To: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> Accept-Language: en-US, ro-RO Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM4PR07CA0029.eurprd07.prod.outlook.com (2603:10a6:205:1::42) To DM5PR11MB1242.namprd11.prod.outlook.com (2603:10b6:3:14::8) x-mailer: git-send-email 2.7.4 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 136d7c3d-b6bc-45aa-e4b0-08d77182105d x-ms-traffictypediagnostic: DM5PR11MB1418: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2449; x-forefront-prvs: 0232B30BBC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(396003)(366004)(136003)(189003)(199004)(305945005)(2201001)(66476007)(66556008)(76176011)(64756008)(66446008)(26005)(81156014)(81166006)(4326008)(3846002)(50226002)(5660300002)(25786009)(86362001)(8676002)(6116002)(2501003)(52116002)(66946007)(6436002)(66066001)(256004)(6486002)(446003)(14454004)(2906002)(386003)(71200400001)(102836004)(6512007)(2616005)(11346002)(6506007)(478600001)(71190400001)(36756003)(110136005)(107886003)(99286004)(186003)(7736002)(8936002)(316002)(461764006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR11MB1418; H:DM5PR11MB1242.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: driQ8bkwk581uJ0o1b9kFRi0qqeSqDZL/ynCQezw62J1zJcnluSmpcSO93ybZq4hxp90IPzTZV4KWm9f77sHBT+4b35kgkbzHsYjdMP5whWeB5munwn9Qcj8j5x8OPMMMMJLidj1McpEgloV6J2/YXCaMcbUfbVi2hatFfTKFQ9zBXpi4pktbVKQ+/UC4SjMkp+tES1Tv7dVkP3MTet7YNU7Dihs+rT+tngq/GIoPZGuCrwmdSFz2j2e8EapqO2mzoRFWhd6EQhvtZO/C6XpZt6NMl1CKRn2tjg5mJ8O5RX4K1bwQitTAMH/7+mpZccRqyEpxCSovZ73WclVI6S3PIXA2+GWa8OvYeXNc2pQjiIERBk0jGJakUXkkvx7krUYWFEh2q8qq74acD4TVIDjjAJISR+8X/kPYLyfgCNtT8jVVkSYtLq1eGJnh57qIa9Q MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 136d7c3d-b6bc-45aa-e4b0-08d77182105d X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2019 08:32:53.3079 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: v3g9Ql0WAe63YWp0+wOotNZF1JvmqLvgf8w/EgyCUdc7FtujhcFI5KWVLkSEU7mxXUCgnEEsjn/8jkG5vVctZkV44ChXjATIzQOZL3Cdq84= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1418 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191125_003256_612831_88AD8DB0 X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.147.91 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eugen.Hristev@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Eugen Hristev With some sensors, the mbus code must match the one that sensor supports. In this case we should initialize the mbus_code of the fse/fie before calling the subdev, and not after. Signed-off-by: Eugen Hristev --- drivers/media/platform/atmel/atmel-isc-base.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index 7c73bcd..1bb1dd5 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1461,6 +1461,7 @@ static int isc_enum_framesizes(struct file *file, void *fh, { struct isc_device *isc = video_drvdata(file); struct v4l2_subdev_frame_size_enum fse = { + .code = isc->config.sd_format->mbus_code, .index = fsize->index, .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; @@ -1483,8 +1484,6 @@ static int isc_enum_framesizes(struct file *file, void *fh, if (ret) return ret; - fse.code = isc->config.sd_format->mbus_code; - fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; fsize->discrete.width = fse.max_width; fsize->discrete.height = fse.max_height; @@ -1497,6 +1496,7 @@ static int isc_enum_frameintervals(struct file *file, void *fh, { struct isc_device *isc = video_drvdata(file); struct v4l2_subdev_frame_interval_enum fie = { + .code = isc->config.sd_format->mbus_code, .index = fival->index, .width = fival->width, .height = fival->height, @@ -1521,7 +1521,6 @@ static int isc_enum_frameintervals(struct file *file, void *fh, if (ret) return ret; - fie.code = isc->config.sd_format->mbus_code; fival->type = V4L2_FRMIVAL_TYPE_DISCRETE; fival->discrete = fie.interval; From patchwork Mon Nov 25 08:32:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11260001 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D464A138C for ; Mon, 25 Nov 2019 08:34:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B0D4F20748 for ; Mon, 25 Nov 2019 08:34:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="W0WXm9uH"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="eHmEPg9y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0D4F20748 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x+RlIygp9O+gYuwU4WFhov5gCRh+SzW3oaIE9TE9pRo=; b=W0WXm9uHgI9aQ+ wcxg8ajMGQ5P0pe7oCpwt2etsLhMnMGKlBDAkVaJnCgns/oSUD52XqukWkfA3omGFcIvhN1KJVwjh UVspkUHY8vXg6MfQbS9MpacnpSGMpWi2NAEQ+aSR6se4Y2YzswnYT5k3nmFeCI7A1kbclLa9sqR0Z Jyp6BRx7ODU76UNAZP83RDbzW136zroNIeuuV/EnzADdfIs5D6dnKJExPl2Qo0Ac0orvkRnoIFJJR YPdFU5aEZvBG0CVcjRhgR6No0Y1VKvEOPdtGOqDNqHuoWurc9b19ri8E6o+OoxiIfhfltmT9swVAF x5qE7yl6U3hZWke0gXug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9om-00078X-Ci; Mon, 25 Nov 2019 08:34:00 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iZ9nl-00063g-AQ for linux-arm-kernel@lists.infradead.org; Mon, 25 Nov 2019 08:32:58 +0000 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Eugen.Hristev@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="Eugen.Hristev@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Eugen.Hristev@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; spf=Pass smtp.mailfrom=Eugen.Hristev@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: oo5guDN1lTG39BcF3GpeZgKz+iVVifCj5LMim4k+78AGB8dcF65r9o2ugvrv8fypvj46VoRuwD ogVPmzV4Yw6I1EMVwsxp2cEs00ImIwynOvYs9wl2L1r7fTcTYkWstmnNMavResQJlNv9JsrAJD I87fJHeRpEVA32dl9LV/26KKW2aGQrlnavyW/mSQFv0ueplCiCrto6ZtQaMFGlCPlLN21rkYjt vQ3UAFepM0WLrsFFvn+azNvWrylWdQydFZ4oPzD9aWiTUc8kMXt4yp9GqrB2n9e8WtUkuGilhe iRY= X-IronPort-AV: E=Sophos;i="5.69,241,1571727600"; d="scan'208";a="59582558" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Nov 2019 01:32:56 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 25 Nov 2019 01:32:55 -0700 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 25 Nov 2019 01:32:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UzOc9138n3H/feOjzEngAENTzz+Ov6NoGuxiK9P4s8ylhKcpQdGcBGbgtMB8VzflaYsJGH22BNxBpG/lT3KCaEm+rr652dWDIiRsV2vq+Ww2th5rkJWEUhyKNJ0/MeXD7GmEL6Hk6CZIXkr/Him0QWhKhQkePQRebeu6GDfyUZ4x1EHiz/YygBbBHlNSlhZbVrOAoHb7IGtNPv+O0wb7Xvqc93Hg4h3kcB6MxCIEVRwAEH5u9C7U1PFBxnrtG3rUV5eM1E21S8NKbd/fB9gDcR5NEVyX6/3YyZKYlPKgyAq+cvHV18CwMUdAZHNj7BvPnqqbeztWrs4Y+YRIzjKF7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fyswuBMeaaZBwxuehW9hnY9QSH6XzNPXkUY02doMxNA=; b=B278OxQKb4h0s1NnzoS/4OMAyjpkXtEGJNbXeZkvYTloJdzCtHx8H1n+VujF/PcCSatZCPq5NHD6oMPNOTt3pm4SG3McMZjVdcISJnHQ+Oa949dOgibmsrnRcRolMom249j/FrruXnrPFHQPDgPlFTYViky03rgx/mhPk6se3ss2y5tY9Kl5cNo86cV/JAjDcPoCFqHj44/qNQl/GwVrBvw6AEdW3k9lpyRap2XLB6Gk+mJaKed/8NQ9b571sRG8Guap3Q5vf2tJbZEpwk652Rz+TVnWGec2UnkbMOnU07FykdqMcuWfBPj6AjIOPmCJg5H1ATbZXFlPxbf14ZXLfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fyswuBMeaaZBwxuehW9hnY9QSH6XzNPXkUY02doMxNA=; b=eHmEPg9ykh/LWaRrrWPxKXo0rgnUjdsaSlqdpfga68qjtHGjchWiKQiI11mj/68ApdNxlNPbUP51JHLjLOWlRZf+SVAIEjW3M8ksXOoPcFNf4MifkBEp2YShAC3TQ06Yl2OaOhsZInsZHepEEJs6Sf6R0RueyA68n69UBTPZVAA= Received: from DM5PR11MB1242.namprd11.prod.outlook.com (10.168.108.8) by DM5PR11MB1418.namprd11.prod.outlook.com (10.168.102.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17; Mon, 25 Nov 2019 08:32:54 +0000 Received: from DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1]) by DM5PR11MB1242.namprd11.prod.outlook.com ([fe80::9039:e0e8:9032:20c1%12]) with mapi id 15.20.2474.023; Mon, 25 Nov 2019 08:32:55 +0000 From: To: , , , Subject: [PATCH 5/5] media: atmel: atmel-isc-base: initialize the try_crop for the pads in try_fmt Thread-Topic: [PATCH 5/5] media: atmel: atmel-isc-base: initialize the try_crop for the pads in try_fmt Thread-Index: AQHVo2ru8tcTV/dUgUG1OTeEMRIkuQ== Date: Mon, 25 Nov 2019 08:32:54 +0000 Message-ID: <1574670712-31992-6-git-send-email-eugen.hristev@microchip.com> References: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> In-Reply-To: <1574670712-31992-1-git-send-email-eugen.hristev@microchip.com> Accept-Language: en-US, ro-RO Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM4PR07CA0029.eurprd07.prod.outlook.com (2603:10a6:205:1::42) To DM5PR11MB1242.namprd11.prod.outlook.com (2603:10b6:3:14::8) x-mailer: git-send-email 2.7.4 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [94.177.32.156] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 37699cef-dd7d-4e66-aaf5-08d77182115d x-ms-traffictypediagnostic: DM5PR11MB1418: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0232B30BBC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(396003)(366004)(136003)(189003)(199004)(305945005)(2201001)(66476007)(66556008)(76176011)(64756008)(66446008)(26005)(81156014)(81166006)(4326008)(3846002)(50226002)(5660300002)(25786009)(86362001)(8676002)(6116002)(2501003)(52116002)(66946007)(6436002)(66066001)(256004)(6486002)(446003)(14454004)(2906002)(386003)(71200400001)(102836004)(6512007)(2616005)(11346002)(6506007)(478600001)(71190400001)(36756003)(110136005)(107886003)(99286004)(186003)(7736002)(8936002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR11MB1418; H:DM5PR11MB1242.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wRCHEu5f2Ql2TdoNuGfCgyS7cxMEYSiAyamgY6h4klHEw8+/sCrzYs15bv3avW0GMB5HJYhwqaBUIo+Uuv+JMB7GW144tbYrfIcMjv3jaZcTs0t+czhr+jI1Qn7POJgcJ5Yz/QKA/c2dnom/tZbzy0KbMaAgn4qTP85elE1DsWb9DtUoQABSSkrVJ07Zh+t/b2VJDP93/gu1W9vbGU88emsWFBKu0YUwuR3eTAAy4nUPcaRITgRC0gpO4Y5hMBkE6PqqBr6VF8oFMyf01iNVd5TzfRyBuBNGw3B4aeaI51VDZ8rUMF/FcEGB60qXRtbhHvOcg/FDWkj3HFDVWW+WVpCQYgN9/btzM/D70+xai50ElHbXwDeDLPJm9gfhPoTERXhlRiL5rxwJx6twfO3cSbS7i+qKKPfSLszdN7D7ZIueZt0+sMDNrSTCvMMdhkaz MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 37699cef-dd7d-4e66-aaf5-08d77182115d X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2019 08:32:54.8912 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CKdC/67AKhQgOz7HFAgQIqfDDylK73EvUi3+YLvL7DIylPO+O4ksV00rBF27qE7zo2UlMyEO0xX1kMO3WTMxRw0pEEK2cFaQJkamvyt4sNU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1418 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191125_003257_384328_875D2E1E X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.147.91 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eugen.Hristev@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Eugen Hristev When requesting format from sensor, some sensors call the subdev_get_try_crop which for ISC was not properly initialized, and this causes errors in determining proper image resolutions. To accommodate for this, when trying a format (in try_fmt), first attempt to obtain the framesize for this format from sensor. In case this fails, use the maximum ISC width/height as try_crop, otherwise provide the first size height/width from the sensor. Signed-off-by: Eugen Hristev --- drivers/media/platform/atmel/atmel-isc-base.c | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index 1bb1dd5..511f0c5 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1233,6 +1233,36 @@ static int isc_try_configure_pipeline(struct isc_device *isc) return 0; } +static void isc_try_fse(struct isc_device *isc, + struct v4l2_subdev_pad_config *pad_cfg) +{ + int ret; + struct v4l2_subdev_frame_size_enum fse = {0}; + /* + * If we do not know yet which format the subdev is using, we cannot + * do anything. + */ + if (!isc->try_config.sd_format) + return; + + fse.code = isc->try_config.sd_format->mbus_code; + fse.which = V4L2_SUBDEV_FORMAT_TRY; + + ret = v4l2_subdev_call(isc->current_subdev->sd, pad, enum_frame_size, + pad_cfg, &fse); + /* + * Attempt to obtain format size from subdev. If not available, + * just use the maximum ISC can receive. + */ + if (ret) { + pad_cfg->try_crop.width = ISC_MAX_SUPPORT_WIDTH; + pad_cfg->try_crop.height = ISC_MAX_SUPPORT_HEIGHT; + } else { + pad_cfg->try_crop.width = fse.max_width; + pad_cfg->try_crop.height = fse.max_height; + } +} + static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f, u32 *code) { @@ -1336,6 +1366,9 @@ static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f, if (ret) goto isc_try_fmt_err; + /* Obtain frame sizes if possible to have crop requirements ready */ + isc_try_fse(isc, &pad_cfg); + v4l2_fill_mbus_format(&format.format, pixfmt, mbus_code); ret = v4l2_subdev_call(isc->current_subdev->sd, pad, set_fmt, &pad_cfg, &format);