Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5428072img; Wed, 27 Mar 2019 08:20:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbmI/xCQp9biHXEbEKfgjqcwk/uDMVWUCvdUJaAODLBLbf/+MPjigZCUPk+4aMJkovpoGe X-Received: by 2002:a63:30c5:: with SMTP id w188mr10861064pgw.76.1553700013816; Wed, 27 Mar 2019 08:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553700013; cv=none; d=google.com; s=arc-20160816; b=hHptUxYoifxV/dqkCPg7H6oH6FWD2I7mjuI16K4lst4ANv3DeKkkynK/Bb8sWpFA6p Y/YOJFk9/mG4Rf4DI4nlvMkUkwCM1imvzTlBrDjjUSEVmkIvsjtL0pdJmaG0Alcyerpc XXpsAjuywGaHuG8wzE2DUk0r2jhOgGhAY8887KsVGsJrgRP8xfT0EfKOxrHmM+Vf0kvw cqi3WE3ytg1JCUWqZSv2swN8rhZTFNL1KuMckCtnAzzvabf+LET084C1xeyoMLz6N9LG dyPMPrDXUxr3qt69Ygp+u+1yec2GXDKOTtMpCWi6Cwop0VFdjJ7hQprdrbbGXjLMaboP gtLA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6pqvJOhSy+uWjJQnpC5Aj8R7xbYGz9zWMRnK8wzGikA=; b=0CcvJtHEXGVPqeJUVNwSPBNngpNHgvEmvYrbZWB2jiCpRsGAbCWlmm78qkacWkRBUJ LygsJy0gssPQFA1X2F3+CwwryyTk0tWxYwl+J3idOgk/jr0p3zd8q7IGY0ieQPFiKoPZ 37SzGA3IvDqH7Q4nfbGtXTlNdGsIQ27euNwzeRLwMnorqBuVHqt8YLk++1vJhKUpUP52 3OYjuCnwxKOG0kkyDX7HPUstKqn4G/Gyk1teFckhcdr7bhV9b2Zrc6kUByMAHrntsPEG L3E69rdig5I1tnSqRIiPMbWIKLdPy3Vcc7XwYdjqVIE4dJYZO2VrLrlPV3K2X57V0mHO S3Nw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si17928797pfi.28.2019.03.27.08.19.57; Wed, 27 Mar 2019 08:20:13 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725764AbfC0PTG (ORCPT + 99 others); Wed, 27 Mar 2019 11:19:06 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48500 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbfC0PTF (ORCPT ); Wed, 27 Mar 2019 11:19:05 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: tonyk) with ESMTPSA id 37F44281FF2 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= To: linux-media@vger.kernel.org Cc: mchehab@kernel.org, hverkuil@xs4all.nl, helen.koike@collabora.com, lucmaga@gmail.com, linux-kernel@vger.kernel.org, kernel@collabora.com, lkcamp@lists.libreplanetbr.org Subject: [PATCH v2 04/15] media: vimc: cap: Dynamically define stream pixelformat Date: Wed, 27 Mar 2019 12:17:32 -0300 Message-Id: <20190327151743.18528-5-andrealmeid@collabora.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190327151743.18528-1-andrealmeid@collabora.com> References: <20190327151743.18528-1-andrealmeid@collabora.com> 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 Define the pixelformat of the streamer depending to the mode (single/multiplanar). Signed-off-by: André Almeida --- Change in v2: - Add a macro to check if device is in multiplanar mode. Now, this check is done using the capture device capabilities, rather than using the multiplanar module parameter drivers/media/platform/vimc/vimc-capture.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c index de52f20b5c85..add6df565fa9 100644 --- a/drivers/media/platform/vimc/vimc-capture.c +++ b/drivers/media/platform/vimc/vimc-capture.c @@ -28,6 +28,10 @@ #define VIMC_CAP_DRV_NAME "vimc-capture" +/* Checks if the device supports multiplanar capture */ +#define IS_MULTIPLANAR(vcap) \ + (vcap->vdev.device_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) + static const u32 vimc_cap_supported_pixfmt[] = { V4L2_PIX_FMT_BGR24, V4L2_PIX_FMT_RGB24, @@ -282,7 +286,12 @@ static int vimc_cap_start_streaming(struct vb2_queue *vq, unsigned int count) return ret; } - vcap->stream.producer_pixfmt = vcap->format.fmt.pix.pixelformat; + if (IS_MULTIPLANAR(vcap)) + vcap->stream.producer_pixfmt = + vcap->format.fmt.pix_mp.pixelformat; + else + vcap->stream.producer_pixfmt = + vcap->format.fmt.pix.pixelformat; ret = vimc_streamer_s_stream(&vcap->stream, &vcap->ved, 1); if (ret) { -- 2.21.0