Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8339425ybi; Tue, 9 Jul 2019 13:46:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6r7KIcHqxzNZ4WVYObRSolmVjyQbKUBo/w9/qdBDB0JPZ5O8moz8eQoUfXlVNiq9Ohgjk X-Received: by 2002:a63:fa4e:: with SMTP id g14mr32694811pgk.237.1562705175765; Tue, 09 Jul 2019 13:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562705175; cv=none; d=google.com; s=arc-20160816; b=hxvKiSjvOwA2jIdCMdyfieFSPVc36DelWdbrBDLFmAk4RvMtny9vfMfzMtm6OxW+a9 iSJHopy0/iOIAsbxgefpAYIslAMGkDakOUTXqjXvSefXLLXMxCPXX1J7J4N2OY7ggGZ5 TYJijSGlBdAPPK3qUA4Uyk2ZdbRYVO8mGmSrLS7aL7T4igt5pEILzDwMMM1vXEk1V02F tvVJbG13JfrJQ85Ig9Bsx5u4CfkZBteFlJ/0iOfxxImijDZKukJOF/AFFJs6WWRjmEI5 OlD4BT9A13cl45apMMsuIy6wRfgi2/bhmolX3eyn4naI4Tb+C6bEx/LFMZ27s0gpT3cC 8J9Q== 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 :message-id:date:subject:cc:to:from; bh=rZBFvof9WNCcs4adxmc1m7A3kn22RM8De7sOEFIvwa8=; b=RzkoR5zztaBPisifC3+3TvDefIy0sRk6C1IVmXtRSQzacTwuBN5YX2A+8p7quUmYJ4 qJBuwq7vwBQUnnOGBNaqlyDRs6lMwU2DDfmPbEkwovtMPpK4VVOC5BDzJ6kJJo9yVFAh zR/27VvWUQR4khz6h8BbJ3jSJGz5WvKv8/0zMIk/PHqi06s3kgJw0bPlRVyQOWp92YLO Dr9TqSZGz/1Ibg6AQ/eTygeWZF56KEHmqC7v6SF+AQ6W26VHkKL1rMhaEMJnK6CD6D0/ glmDlqmje4aco+e4EZLDgr7ZLgqjFhtQaRpVdJtfpETjqwd6f+GtwOwL/ouTeEjO/pRL I+sw== 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 m189si23466082pgm.443.2019.07.09.13.46.00; Tue, 09 Jul 2019 13:46:15 -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 S1729074AbfGITnl (ORCPT + 99 others); Tue, 9 Jul 2019 15:43:41 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:45376 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfGITnl (ORCPT ); Tue, 9 Jul 2019 15:43:41 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id 4786F28AFAE From: Helen Koike To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, linux-kernel@vger.kernel.org, kernel@collabora.com, skhan@linuxfoundation.org, Helen Koike Subject: [PATCH 1/2] media: Revert "media: vimc: Remove or modify stream checks" Date: Tue, 9 Jul 2019 16:43:26 -0300 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 3c1b9ac753e99005d7ee0a883d6e5b577ba32aa9. Required to Revert "media: vimc: propagate pixel format in the stream" which introduced the stream object in the vimc_ent_device struct. Signed-off-by: Helen Koike --- drivers/media/platform/vimc/vimc-debayer.c | 5 ++++- drivers/media/platform/vimc/vimc-scaler.c | 7 +++++-- drivers/media/platform/vimc/vimc-sensor.c | 6 +++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-debayer.c b/drivers/media/platform/vimc/vimc-debayer.c index 00598fbf3cba..72adba6cf892 100644 --- a/drivers/media/platform/vimc/vimc-debayer.c +++ b/drivers/media/platform/vimc/vimc-debayer.c @@ -262,7 +262,7 @@ static int vimc_deb_set_fmt(struct v4l2_subdev *sd, if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { /* Do not change the format while stream is on */ - if (vdeb->ved.stream) + if (vdeb->src_frame) return -EBUSY; sink_fmt = &vdeb->sink_fmt; @@ -329,6 +329,9 @@ static int vimc_deb_s_stream(struct v4l2_subdev *sd, int enable) const struct v4l2_format_info *pix_info; unsigned int frame_size; + if (vdeb->src_frame) + return 0; + /* We only support translating bayer to RGB24 */ if (src_pixelformat != V4L2_PIX_FMT_RGB24) { dev_err(vdeb->dev, diff --git a/drivers/media/platform/vimc/vimc-scaler.c b/drivers/media/platform/vimc/vimc-scaler.c index c7123a45c55b..5f31c1e351a3 100644 --- a/drivers/media/platform/vimc/vimc-scaler.c +++ b/drivers/media/platform/vimc/vimc-scaler.c @@ -148,7 +148,7 @@ static int vimc_sca_set_fmt(struct v4l2_subdev *sd, if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { /* Do not change the format while stream is on */ - if (vsca->ved.stream) + if (vsca->src_frame) return -EBUSY; sink_fmt = &vsca->sink_fmt; @@ -203,6 +203,9 @@ static int vimc_sca_s_stream(struct v4l2_subdev *sd, int enable) const struct v4l2_format_info *pix_info; unsigned int frame_size; + if (vsca->src_frame) + return 0; + if (!vimc_sca_is_pixfmt_supported(pixelformat)) { dev_err(vsca->dev, "pixfmt (0x%08x) is not supported\n", pixelformat); @@ -324,7 +327,7 @@ static void *vimc_sca_process_frame(struct vimc_ent_device *ved, ved); /* If the stream in this node is not active, just return */ - if (!ved->stream) + if (!vsca->src_frame) return ERR_PTR(-EINVAL); vimc_sca_fill_src_frame(vsca, sink_frame); diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c index 51359472eef2..c47454cc7f70 100644 --- a/drivers/media/platform/vimc/vimc-sensor.c +++ b/drivers/media/platform/vimc/vimc-sensor.c @@ -131,7 +131,7 @@ static int vimc_sen_set_fmt(struct v4l2_subdev *sd, if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { /* Do not change the format while stream is on */ - if (vsen->ved.stream) + if (vsen->frame) return -EBUSY; mf = &vsen->mbus_format; @@ -187,6 +187,10 @@ static int vimc_sen_s_stream(struct v4l2_subdev *sd, int enable) const struct v4l2_format_info *pix_info; unsigned int frame_size; + if (vsen->kthread_sen) + /* tpg is already executing */ + return 0; + /* Calculate the frame size */ pix_info = v4l2_format_info(pixelformat); frame_size = vsen->mbus_format.width * pix_info->bpp[0] * -- 2.20.1