From patchwork Fri Oct 20 21:50:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 10021065 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 D63CA60234 for ; Fri, 20 Oct 2017 21:54:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C78A728C1A for ; Fri, 20 Oct 2017 21:54:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9B3F28DBC; Fri, 20 Oct 2017 21:54:33 +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=-4.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB 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 4479428C1A for ; Fri, 20 Oct 2017 21:54:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753359AbdJTVyS (ORCPT ); Fri, 20 Oct 2017 17:54:18 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:56924 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753259AbdJTVus (ORCPT ); Fri, 20 Oct 2017 17:50:48 -0400 Received: by mail-qt0-f193.google.com with SMTP id z28so20143057qtz.13; Fri, 20 Oct 2017 14:50:47 -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=+fIHq7f6arySwsczvzv4yn4MzoPys5bEW5m1FyufnHg=; b=IfjJssqBXyab7bwXpulq9eyhABjVto8zpgx5XsFgv37YbTQxFiflLMAn/GCH9LHKP3 tdgsJxaAYxqkLSw+PkJJ0P+l5HERQtpal80swilwhnMEaCsOH26LeQhuCOzQoQ16CPgJ hWnqM9DCXg9vTC4qIrV/BdPB/e62bHJM1gUEHScMG6tXyK8HPPp3L9BYlT1jojFXnByH d9sjR5zZwZHXGXQctuLey0JuOxc9boO3oup4LqSnNh9IrSClhxt9OviZE5oRzy4jF1us VMUwsFRrwD0WQiDfomsD1LH1GhZpHBzcNw6FdN00C0z1c7sDhqQ8Coe6RgYhMbtD6+9r 7iKg== X-Gm-Message-State: AMCzsaWpk2z096SmLcTdXuFPC6S8j+TgZOhF1iP6ezWXmkwDGbcJWvsl +45lGtidfYkkFtubOr2LQ5Gu78Ib X-Google-Smtp-Source: ABhQp+TvRzGrFJlJj36jeHmbHRnRzLdgu7fEWfvlu1Rkku78EfD1SeXJG3tD2gJNo4SMdTPWu5ohCA== X-Received: by 10.200.8.78 with SMTP id x14mr9714146qth.316.1508536247065; Fri, 20 Oct 2017 14:50:47 -0700 (PDT) Received: from localhost.localdomain (189-19-125-192.dsl.telesp.net.br. [189.19.125.192]) by smtp.gmail.com with ESMTPSA id j4sm1167039qkf.75.2017.10.20.14.50.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 14:50:46 -0700 (PDT) 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 , linux-kernel@vger.kernel.org, Gustavo Padovan Subject: [RFC v4 07/17] [media] vivid: assign the specific device to the vb2_queue->dev Date: Fri, 20 Oct 2017 19:50:02 -0200 Message-Id: <20171020215012.20646-8-gustavo@padovan.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171020215012.20646-1-gustavo@padovan.org> References: <20171020215012.20646-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 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_OUT_FENCE support. The current vivid code isn't wrong, it just needs to be changed so V4L2_EVENT_OUT_FENCE 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)