From patchwork Sun Sep 2 13:06:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 145728 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1485047ljw; Sun, 2 Sep 2018 06:26:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYEd8BdYbzUaiWQY7J8cigbb43OgnPJZb2uDpJJJKJeJKrHKKwK8HUuSNfdnchRfAR0EMjg X-Received: by 2002:a17:902:7d83:: with SMTP id a3-v6mr23965426plm.0.1535894815225; Sun, 02 Sep 2018 06:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535894815; cv=none; d=google.com; s=arc-20160816; b=CGmGPSS2RtH8fDZcQxL9x4dob0xgGrebBsun4tp4zUhejXhhIda25bI9s0Ktk+bBgZ GwelcNiNgsisJCw1NEiBIFtafxPQopst9jORnV4j4HRs2E15EeO54JSQIAIWIhZhHFnU PKV8SD9ue9EM3+/w738ZYeXKB7s0Cf/BOrVQM9BeDCMJX8HIxZwy16QYoqG93y0IFb3Q kwxNlaCrJSpClBLpg3ZtxYOr+hivIOG3sP/TXzVc+DRT4jSyB71tVzB84NPOgl0ohKU0 wjUOznA6do12uT/ZRIZNSebgoYC+7uQJlliW/ei/LAniq3haTAggI/lJDKSggfACr+Qf 6CWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ikwtyhgKPHG14egAcrPKxvRF2bzPb/t6/V+GF0n1onw=; b=ZdS74YyP1GFPGPXUcuoJnI9mR2EGGHGAMhB2POSi/VsxGfLTaUqkzeFA+6DnW/UiKC SH7n/ZNCW8L/x71nFLKHREqYpYPvWXBiKv+Xlay/GP5kSIrqHi4aC4Q1vDWJrY9vElZZ Emixb1aRL3Cs2hEDiLDlb1R0j6L7ocM5amosh+dJH04Te0WJwsd4AMqapZr9t7TaoAuX yuuQYYNiggkZdEeVj/QnEpDo3O02Y2MId4TxkQsYxovpQM6jjQg34ZY1VRvuYR1XwovM AtkLG9IZ9Y9RyWdip9f6dLRJSpEK7wL8vyH62iiO68xQkzb4z44u4KOFXPekgQ+g1F0d lBTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=QQxi1G+6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u129-v6si15507852pfb.247.2018.09.02.06.26.54; Sun, 02 Sep 2018 06:26:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=QQxi1G+6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729152AbeIBRma (ORCPT + 32 others); Sun, 2 Sep 2018 13:42:30 -0400 Received: from mail-eopbgr680128.outbound.protection.outlook.com ([40.107.68.128]:38064 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728912AbeIBRWS (ORCPT ); Sun, 2 Sep 2018 13:22:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ikwtyhgKPHG14egAcrPKxvRF2bzPb/t6/V+GF0n1onw=; b=QQxi1G+6zZ78yfSlStLloknjHo+ZEOvXvPxQSNYOfrT1d/ejOSvKeP+WF28bIS0sZm6h16bGpAnj1Qs+teSKA7JXt97caqJhGMbtdRMcY5v1SVdwFOKUqxWTrvjdedq/EeJeiKW5USPECuw2VUyoxJ45iSo2dUHMAISBE/Z6qJM= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0629.namprd21.prod.outlook.com (10.175.115.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.7; Sun, 2 Sep 2018 13:06:30 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::7c3a:eea8:1391:1611]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::7c3a:eea8:1391:1611%7]) with mapi id 15.20.1143.000; Sun, 2 Sep 2018 13:06:30 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Todor Tomov , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH AUTOSEL 4.14 18/89] media: camss: csid: Configure data type and decode format properly Thread-Topic: [PATCH AUTOSEL 4.14 18/89] media: camss: csid: Configure data type and decode format properly Thread-Index: AQHUQr3EJ5oznQXc/UGsSMZ+0mreWg== Date: Sun, 2 Sep 2018 13:06:30 +0000 Message-ID: <20180902064918.183387-18-alexander.levin@microsoft.com> References: <20180902064918.183387-1-alexander.levin@microsoft.com> In-Reply-To: <20180902064918.183387-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR21MB0629; 6:HaHHAF2PlLUtR8DwuuyfM3onVlf2r+GmdogYWA23DILO2ovRK09s4dwyRAVv7R6in9nQroz+ufS5s7EnUimTUgzC+ACsI5oNi1jOYH5DG5ugbIeqxB54rBGnejp5lbJrEQAABUaqD3s+leU0ihfK8N16aOqn4fVawGIwQyAmoY/YIguTQm4AtMtZNlHVvvhQ3Skcus0MShDpLeDOO2DFJIJg44nod39dJCzPF26moGufhH3L2f1C5lMH3QQk2UFeuDhzIr7zkOIhR3IQw4dLDNcfI59CuKBtK15cI8UONAfV25bXnWCk/dt7gsj7HgrmHzkMQHgxxddgm3jAudJgYmDia1MDRmDY5ZiXgL7DShC5cRnJX/zb+7BsO1REDNkJjOEE8tIq8pxqiEQCu307Mb8HMB9hm2eiw1Dg13hTozpUphsf/rgINStU+XClP1nS3Th/jh1etBDlVN24tm2oZw==; 5:dRPpZjmaf8bGf9hKqmXL19d5YDSAF7Ic7k4QRFjCmvQCmIwGwnzfl+D3DP/8/jqy3DSq9jUvpzbjPxLsknO2Cra9FUp4W9RkbfjXZNnaGedxtClEp4A/X01QdTmSr7fdJPWJ79f4XGb6ohorlR6QST4R02uewzaRTqi9/H70SZk=; 7:t9Fnz4kfE4EDLrHOMGA4NamuWIq05aIhEc2OSmE8ewMa93EL4TiXqCIectKBjf89kNuoypxrFbl41NugicfgH85t6V9xdDGpL6j4JKG/I9sTsiSo86qy5RmSn9hbjYVHO9N6XJxSdMN7/UhgLdYlS6O9yewp+hsL1lF8s4eGtSeI+naITx3OreJ9XWAc9kPOBl3WDFHz3AoPQrP8X/RIyBD7T760CDyy2874TxCt7Dj2V5LiMoJnPhtvJbwIDO1L x-ms-office365-filtering-correlation-id: a3e3bd88-17f0-4f5e-81f6-08d610d4e6aa x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(4534165)(4627221)(201703031133081)(201702281549075)(5600074)(711020)(4618075)(2017052603328)(7193020); SRVR:CY4PR21MB0629; x-ms-traffictypediagnostic: CY4PR21MB0629: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(95692535739014); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231340)(944501410)(52105095)(2018427008)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699049)(76991033); SRVR:CY4PR21MB0629; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0629; x-forefront-prvs: 078310077C x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(366004)(136003)(396003)(39860400002)(189003)(199004)(6486002)(8936002)(6512007)(22452003)(53936002)(6436002)(66066001)(4326008)(186003)(25786009)(86362001)(2900100001)(107886003)(76176011)(486006)(68736007)(36756003)(99286004)(2501003)(5250100002)(110136005)(54906003)(106356001)(316002)(105586002)(10290500003)(72206003)(10090500001)(8676002)(478600001)(14454004)(5660300001)(476003)(1076002)(3846002)(305945005)(446003)(6116002)(217873002)(6346003)(11346002)(97736004)(81156014)(7736002)(81166006)(2906002)(102836004)(86612001)(26005)(6506007)(256004)(2616005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0629; H:CY4PR21MB0776.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: aBzSjS06fz2xupwWfW075+keyjoCTvJnVkGcctkgwJTqYdjqREzUH9WuHSZc4YpvzRPSAmqtcT70sVWBFtMnqvNSKc2x9gm8piUm6RDny+W1uC8jJFNgBlwz2aZv4+4CzAolKYQ5En7zxXQYMSLRo/RbP97r0AYo5Tq8jKxxz0JhcSfyHk9MsWaJ9B6poplRZbqIs77tc5U/f86tjTIrRoU9yqhsr+GT60Wk7tXOEhsn02SPaV1Fwy3wfiAq6RatVqKbfZ5UDsEbd01OaAZoOtCFzGcGWOvzqJmH39XImWPWTxb81fzZYdzyOq9S/Psx78Lu32SJuj2Ggb1xSCQRUDkJKjsp15QIdIZspxcPlsA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3e3bd88-17f0-4f5e-81f6-08d610d4e6aa X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2018 13:06:30.6887 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0629 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Todor Tomov [ Upstream commit c628e78899ff8006b5f9d8206da54ed3bb994342 ] The CSID decodes the input data stream. When the input comes from the Test Generator the format of the stream is set on the source media pad. When the input comes from the CSIPHY the format is the one on the sink media pad. Use the proper format for each case. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- .../media/platform/qcom/camss-8x16/camss-csid.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/media/platform/qcom/camss-8x16/camss-csid.c b/drivers/media/platform/qcom/camss-8x16/camss-csid.c index 64df82817de3..4882ee25bd75 100644 --- a/drivers/media/platform/qcom/camss-8x16/camss-csid.c +++ b/drivers/media/platform/qcom/camss-8x16/camss-csid.c @@ -392,9 +392,6 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable) !media_entity_remote_pad(&csid->pads[MSM_CSID_PAD_SINK])) return -ENOLINK; - dt = csid_get_fmt_entry(csid->fmt[MSM_CSID_PAD_SRC].code)-> - data_type; - if (tg->enabled) { /* Config Test Generator */ struct v4l2_mbus_framefmt *f = @@ -416,6 +413,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable) writel_relaxed(val, csid->base + CAMSS_CSID_TG_DT_n_CGG_0(0)); + dt = csid_get_fmt_entry( + csid->fmt[MSM_CSID_PAD_SRC].code)->data_type; + /* 5:0 data type */ val = dt; writel_relaxed(val, csid->base + @@ -425,6 +425,9 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable) val = tg->payload_mode; writel_relaxed(val, csid->base + CAMSS_CSID_TG_DT_n_CGG_2(0)); + + df = csid_get_fmt_entry( + csid->fmt[MSM_CSID_PAD_SRC].code)->decode_format; } else { struct csid_phy_config *phy = &csid->phy; @@ -439,13 +442,16 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable) writel_relaxed(val, csid->base + CAMSS_CSID_CORE_CTRL_1); + + dt = csid_get_fmt_entry( + csid->fmt[MSM_CSID_PAD_SINK].code)->data_type; + df = csid_get_fmt_entry( + csid->fmt[MSM_CSID_PAD_SINK].code)->decode_format; } /* Config LUT */ dt_shift = (cid % 4) * 8; - df = csid_get_fmt_entry(csid->fmt[MSM_CSID_PAD_SINK].code)-> - decode_format; val = readl_relaxed(csid->base + CAMSS_CSID_CID_LUT_VC_n(vc)); val &= ~(0xff << dt_shift);