From patchwork Thu Feb 28 12:35:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10832983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37AA613B5 for ; Thu, 28 Feb 2019 12:35:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 280582EB7E for ; Thu, 28 Feb 2019 12:35:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEE292EBAB; Thu, 28 Feb 2019 12:35:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6544B2EB7E for ; Thu, 28 Feb 2019 12:35:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731846AbfB1Mft (ORCPT ); Thu, 28 Feb 2019 07:35:49 -0500 Received: from lb3-smtp-cloud7.xs4all.net ([194.109.24.31]:49475 "EHLO lb3-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725918AbfB1Mft (ORCPT ); Thu, 28 Feb 2019 07:35:49 -0500 Received: from marune.fritz.box ([IPv6:2001:983:e9a7:1:28f6:efa6:3b03:d09a]) by smtp-cloud7.xs4all.net with ESMTPA id zKuggBTbGLMwIzKuhgcTAJ; Thu, 28 Feb 2019 13:35:47 +0100 From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil Subject: [PATCH 1/2] cobalt: replace VB2_BUF_STATE_REQUEUEING by _ERROR Date: Thu, 28 Feb 2019 13:35:45 +0100 Message-Id: <20190228123546.76270-2-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190228123546.76270-1-hverkuil-cisco@xs4all.nl> References: <20190228123546.76270-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfGDv3lcSAipOMnayQFgYMK638BjNGZdIQd+bZqjuP6AHmgsbUC3VOc9VrS5P5yDMoF2q/N2DOutNH3mN4VMPGA8spYfXmtg7hVr45lDuUipg8K7KU332 YlpaY/kfvFMymu61xX1L6Sm8eRL/ScnJmYoFlSrOiroK49krdR1KxXcBSFWXSvHtvUAhimywX7NavCz6SI32hoxcRivdwIEhCkdo59a8h181w6aLyvF/Nc0b CwrpSj7VKXtDqLn7oxjDoy2LYY4c1wkqSd9IonEp4bEfU9grL2i1qG4eD0VUlWqo Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The cobalt driver is the only driver that uses VB2_BUF_STATE_REQUEUEING. Replace it by VB2_BUF_STATE_ERROR so we can drop support for the REQUEUEING state. The requeueing state was used in the cobalt driver to optimize buffer handling while waiting for a valid signal: by requeueing buffers internally there was no need for userspace to handle and requeue buffers with the ERROR flag set. However, requeueing also makes the buffer handling unordered, which is generally a bad idea. Requeueing also does not work with requests and any future fence support. Since it is really a minor optimization in the cobalt driver it is best to just return the buffer in an ERROR state. With this change support for requeueing can now be removed in vb2. Signed-off-by: Hans Verkuil --- drivers/media/pci/cobalt/cobalt-irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cobalt/cobalt-irq.c b/drivers/media/pci/cobalt/cobalt-irq.c index 04783e78cc12..a518927abae1 100644 --- a/drivers/media/pci/cobalt/cobalt-irq.c +++ b/drivers/media/pci/cobalt/cobalt-irq.c @@ -128,7 +128,7 @@ static void cobalt_dma_stream_queue_handler(struct cobalt_stream *s) cb->vb.sequence = s->sequence++; vb2_buffer_done(&cb->vb.vb2_buf, (skip || s->unstable_frame) ? - VB2_BUF_STATE_REQUEUEING : VB2_BUF_STATE_DONE); + VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE); } irqreturn_t cobalt_irq_handler(int irq, void *dev_id)