From patchwork Thu Sep 7 18:42:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 9942715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DE936600CB for ; Thu, 7 Sep 2017 18:46:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC09F287FA for ; Thu, 7 Sep 2017 18:46:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D12AA287FE; Thu, 7 Sep 2017 18:46:14 +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=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 6242E287FA for ; Thu, 7 Sep 2017 18:46:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755918AbdIGSm5 (ORCPT ); Thu, 7 Sep 2017 14:42:57 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:33769 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755740AbdIGSmy (ORCPT ); Thu, 7 Sep 2017 14:42:54 -0400 Received: by mail-qt0-f193.google.com with SMTP id h15so336962qta.0; Thu, 07 Sep 2017 11:42:54 -0700 (PDT) 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=XG3acp0zG4eAibnE433nHv9u5kx8xwEavy/Ob6VaSJM=; b=RZYS4J6sTDQ+rBcqmHiOJiUJIBbJ360OjVpwROVffnPOw2qu3nbNXqqyj8R2Ye8P1F rfr/E6LcciNtLDsRqY7gaXfSqC0/51GqnnL4W02Zmg3zFjfFlGDQ2zPQM3BCee9arWU4 mKcsGvrKYQNo2ju/sQkgvKnNEDgt3hXCDRqpzKymmNNeYuD/0Qvg8PcDXDrWjgFdWCfd ZBr9U9/kviI3harifpMUL3es73jRY0v7KusQPXYXKAWVyvLWPP/aWJn7ytJS2/wWHQ2/ nBJaOLmR1aj1UHwYgU/wmjFcsNaYg7TrYurAe7TF27G9XkFkysDnrKYByULUBrSvP8on 1D+w== X-Gm-Message-State: AHPjjUj5B22/gfYN2zB4hrR3H4jZqrPYiJxC3LPbUZPBr6cEb1Beuqv+ 242CY5HFBD4dbrbl5fs= X-Google-Smtp-Source: AOwi7QBR8eBzQy/Sn3/OJqTAzDeOmuh8aRBQtrta5KTYXR2njCVnrtWjeURoiiEPFAUCYbV294Qa2A== X-Received: by 10.200.34.33 with SMTP id o30mr475190qto.49.1504809773446; Thu, 07 Sep 2017 11:42:53 -0700 (PDT) Received: from localhost.localdomain ([187.10.21.246]) by smtp.gmail.com with ESMTPSA id v30sm213216qtg.70.2017.09.07.11.42.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 11:42:52 -0700 (PDT) From: Gustavo Padovan To: linux-media@vger.kernel.org Cc: Hans Verkuil , Mauro Carvalho Chehab , Shuah Khan , linux-kernel@vger.kernel.org, Gustavo Padovan Subject: [PATCH v3 06/15] [media] vivid: assign the specific device to the vb2_queue->dev Date: Thu, 7 Sep 2017 15:42:17 -0300 Message-Id: <20170907184226.27482-7-gustavo@padovan.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170907184226.27482-1-gustavo@padovan.org> References: <20170907184226.27482-1-gustavo@padovan.org> 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 From: Gustavo Padovan Instead of assigning the global v4l2 device, assign the specific device. This was causing trouble when using using V4L2 events with vivid devices. The device's queue should be the same we opened in userspace. This is needed for the upcoming V4L2_EVENT_BUF_QUEUED support. The current vivid code isn't wrong, it just needs to be changed so V4L2_EVENT_BUF_QUEUED can be supported. The change doesn't affect any other behaviour of vivid. Signed-off-by: Gustavo Padovan Acked-by: Hans Verkuil --- drivers/media/platform/vivid/vivid-core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-core.c b/drivers/media/platform/vivid/vivid-core.c index 5f316a5e38db..608bcceed463 100644 --- a/drivers/media/platform/vivid/vivid-core.c +++ b/drivers/media/platform/vivid/vivid-core.c @@ -1070,7 +1070,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->min_buffers_needed = 2; q->lock = &dev->mutex; - q->dev = dev->v4l2_dev.dev; + q->dev = &dev->vid_cap_dev.dev; ret = vb2_queue_init(q); if (ret) @@ -1090,7 +1090,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->min_buffers_needed = 2; q->lock = &dev->mutex; - q->dev = dev->v4l2_dev.dev; + q->dev = &dev->vid_out_dev.dev; ret = vb2_queue_init(q); if (ret) @@ -1110,7 +1110,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->min_buffers_needed = 2; q->lock = &dev->mutex; - q->dev = dev->v4l2_dev.dev; + q->dev = &dev->vbi_cap_dev.dev; ret = vb2_queue_init(q); if (ret) @@ -1130,7 +1130,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->min_buffers_needed = 2; q->lock = &dev->mutex; - q->dev = dev->v4l2_dev.dev; + q->dev = &dev->vbi_out_dev.dev; ret = vb2_queue_init(q); if (ret) @@ -1149,7 +1149,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->min_buffers_needed = 8; q->lock = &dev->mutex; - q->dev = dev->v4l2_dev.dev; + q->dev = &dev->sdr_cap_dev.dev; ret = vb2_queue_init(q); if (ret)