From patchwork Wed Nov 15 17:10:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo F. Padovan" X-Patchwork-Id: 45467 Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eF1E8-0006o7-0B; Wed, 15 Nov 2017 17:11:52 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933281AbdKORLq (ORCPT + 1 other); Wed, 15 Nov 2017 12:11:46 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:53451 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755597AbdKORLP (ORCPT ); Wed, 15 Nov 2017 12:11:15 -0500 Received: by mail-qt0-f196.google.com with SMTP id n61so35956507qte.10; Wed, 15 Nov 2017 09:11:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zwfpRBe/9K5ie+SBDdFwPw3RUCUaFKfWKvyX4SY+0/k=; b=XtPjLzXy8c29gjsZisDjp7s0fTl37eouyhOQ7sw50r4QHZEt7ZOwcqHz1JCFYMMopP lHIDhUFwvaNTL2PSc7J4X0Kt7IKa1HjGhPEJtoGbjRrX+3vKAgYvbcCVJhmDp2lIhgJ2 OlQAzdIRA4Mz+7heKM+v996X24Dvszu9olAFP5nvwbzrIS89JtfyWwLhJdd56ESECQrw 3sdTO6cwXS/ikmRY2/raDjmj/jkXY9L4QURJaf17txrQQnnDqy9P1yamCn/hubUH+Rov NQJhMqbuLucE4RapxBu+cQkDCE8lXEa7bkW3uK3W+mt83hWFqg4gjQd0Cd7WTU3TfE+i v50A== X-Gm-Message-State: AJaThX5PoG10vr4C/Q2qnUSfIXvzjt+A406zGSmKShKNINKs/SSzeX7j IReAOjZAOnu//UNxaHojqeU0UKE2 X-Google-Smtp-Source: AGs4zMZWhkWKcRgC1sKrS3J3UYGi/wwoYY2IeifnNr6Tb/Nawn3044oqngtFxArHVxCHZPoD9446Bg== X-Received: by 10.55.18.92 with SMTP id c89mr25552605qkh.297.1510765873877; Wed, 15 Nov 2017 09:11:13 -0800 (PST) Received: from localhost.localdomain ([179.110.36.75]) by smtp.gmail.com with ESMTPSA id p85sm15211633qkp.94.2017.11.15.09.11.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Nov 2017 09:11:13 -0800 (PST) From: Gustavo Padovan To: linux-media@vger.kernel.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Shuah Khan , Pawel Osciak , Alexandre Courbot , Sakari Ailus , Brian Starkey , Thierry Escande , linux-kernel@vger.kernel.org, Gustavo Padovan Subject: [RFC v5 02/11] [media] vivid: add the V4L2_CAP_ORDERED capability Date: Wed, 15 Nov 2017 15:10:48 -0200 Message-Id: <20171115171057.17340-3-gustavo@padovan.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171115171057.17340-1-gustavo@padovan.org> References: <20171115171057.17340-1-gustavo@padovan.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Gustavo Padovan vivid guarantees the ordering of buffer when processing then, so add the V4L2_CAP_ORDERED capability to inform userspace of that. Signed-off-by: Gustavo Padovan --- drivers/media/platform/vivid/vivid-core.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-core.c b/drivers/media/platform/vivid/vivid-core.c index 5f316a5e38db..f19391fa2d6a 100644 --- a/drivers/media/platform/vivid/vivid-core.c +++ b/drivers/media/platform/vivid/vivid-core.c @@ -801,7 +801,8 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) dev->vid_cap_caps = dev->multiplanar ? V4L2_CAP_VIDEO_CAPTURE_MPLANE : V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY; - dev->vid_cap_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + dev->vid_cap_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE | + V4L2_CAP_ORDERED; if (dev->has_audio_inputs) dev->vid_cap_caps |= V4L2_CAP_AUDIO; if (in_type_counter[TV]) @@ -814,7 +815,8 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) V4L2_CAP_VIDEO_OUTPUT; if (dev->has_fb) dev->vid_out_caps |= V4L2_CAP_VIDEO_OUTPUT_OVERLAY; - dev->vid_out_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + dev->vid_out_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE | + V4L2_CAP_ORDERED; if (dev->has_audio_outputs) dev->vid_out_caps |= V4L2_CAP_AUDIO; } @@ -822,7 +824,8 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) /* set up the capabilities of the vbi capture device */ dev->vbi_cap_caps = (dev->has_raw_vbi_cap ? V4L2_CAP_VBI_CAPTURE : 0) | (dev->has_sliced_vbi_cap ? V4L2_CAP_SLICED_VBI_CAPTURE : 0); - dev->vbi_cap_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + dev->vbi_cap_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE | + V4L2_CAP_ORDERED; if (dev->has_audio_inputs) dev->vbi_cap_caps |= V4L2_CAP_AUDIO; if (in_type_counter[TV]) @@ -832,24 +835,26 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) /* set up the capabilities of the vbi output device */ dev->vbi_out_caps = (dev->has_raw_vbi_out ? V4L2_CAP_VBI_OUTPUT : 0) | (dev->has_sliced_vbi_out ? V4L2_CAP_SLICED_VBI_OUTPUT : 0); - dev->vbi_out_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + dev->vbi_out_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE | + V4L2_CAP_ORDERED; if (dev->has_audio_outputs) dev->vbi_out_caps |= V4L2_CAP_AUDIO; } if (dev->has_sdr_cap) { /* set up the capabilities of the sdr capture device */ dev->sdr_cap_caps = V4L2_CAP_SDR_CAPTURE | V4L2_CAP_TUNER; - dev->sdr_cap_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + dev->sdr_cap_caps |= V4L2_CAP_STREAMING | V4L2_CAP_READWRITE | + V4L2_CAP_ORDERED; } /* set up the capabilities of the radio receiver device */ if (dev->has_radio_rx) dev->radio_rx_caps = V4L2_CAP_RADIO | V4L2_CAP_RDS_CAPTURE | V4L2_CAP_HW_FREQ_SEEK | V4L2_CAP_TUNER | - V4L2_CAP_READWRITE; + V4L2_CAP_READWRITE | V4L2_CAP_ORDERED; /* set up the capabilities of the radio transmitter device */ if (dev->has_radio_tx) dev->radio_tx_caps = V4L2_CAP_RDS_OUTPUT | V4L2_CAP_MODULATOR | - V4L2_CAP_READWRITE; + V4L2_CAP_READWRITE | V4L2_CAP_ORDERED; ret = -ENOMEM; /* initialize the test pattern generator */