From patchwork Thu Oct 11 06:46:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 10636137 X-Patchwork-Delegate: agross@codeaurora.org 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 3996816B1 for ; Thu, 11 Oct 2018 06:46:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 169582AF2C for ; Thu, 11 Oct 2018 06:46:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 073882AF9C; Thu, 11 Oct 2018 06:46:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 80C0C2AF2C for ; Thu, 11 Oct 2018 06:46:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727245AbeJKOMP (ORCPT ); Thu, 11 Oct 2018 10:12:15 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:44596 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbeJKOMP (ORCPT ); Thu, 11 Oct 2018 10:12:15 -0400 Received: by mail-pl1-f194.google.com with SMTP id p25-v6so3712050pli.11 for ; Wed, 10 Oct 2018 23:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Qehop1mbGHd5EyLAVWNETV3o1NhcD/oA3XpnKQJXnos=; b=jpVsnuvvo2rrILrbEpz2t9mkbZaOuVCu6V0WjTIEsXoAL0fcSbYCNSCOIDnuwcGvf3 AA/YvQK1jPE5a65bcZv0Qti72XIwH2s+iujIFXv5EWIdA59IX+026KXCk8z7m1QN4H2h XcxHn+aHmLBws1j54WapgT6tIUhip9pgFSmMo= 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:mime-version :content-transfer-encoding; bh=Qehop1mbGHd5EyLAVWNETV3o1NhcD/oA3XpnKQJXnos=; b=caSN2adu2xO4K0Zl1wbpMkKBXejJehOO5V1T2RNFRxJBn8pc4+2+ra9V2z4RWrhHyV 8Mo5VxGWsCjJBLHYhWhukMiolGHZ6AX4TnobqxuI5ngYxTNfFtmnd20p6NM1iVAwMuM6 l2mEruHUZE9BxQ7whkp9t26Sp3+5jF0PjdrAb73LsKVXFqfpQI/iKQGO2G2aklM/6FrN BCFrqRSw4eW7gOtAr3th9b0MRKCs0Nt01pVVPBEOBDMRX8M0M2pburpXDutMIMZCBPEw K7ly8YZqVef7SIh89rIL9q5ZKoeXlcKGAsfr8EQ66KCouMpUH18WuGtI30yG/RmqSwqR ZNfQ== X-Gm-Message-State: ABuFfoj4vqAhh6lI9ekoSX5uoIo0ZDtbN+CtAGayQmBrToZsOt81Ua66 EHli0XbYqoLYca5NiX0WZczb1A== X-Google-Smtp-Source: ACcGV60TQN/j1joR5O+y14AmgrA0QBz2R+w9zmPVVwPy5LrM6Fdu6kw2pgHEFhdYLANEfCulDqdLSA== X-Received: by 2002:a17:902:6ac7:: with SMTP id i7-v6mr336949plt.268.1539240384184; Wed, 10 Oct 2018 23:46:24 -0700 (PDT) Received: from acourbot.tok.corp.google.com ([2401:fa00:4:4:9712:8cf1:d0f:7d33]) by smtp.gmail.com with ESMTPSA id 189-v6sm41336699pfe.121.2018.10.10.23.46.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 23:46:23 -0700 (PDT) From: Alexandre Courbot To: Stanimir Varbanov , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [PATCH] media: venus: support VB2_USERPTR IO mode Date: Thu, 11 Oct 2018 15:46:08 +0900 Message-Id: <20181011064608.37435-1-acourbot@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The venus codec can work just fine with USERPTR buffers. Enable this possibility. Signed-off-by: Alexandre Courbot --- drivers/media/platform/qcom/venus/vdec.c | 4 ++-- drivers/media/platform/qcom/venus/venc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 33320c5025313f..dfc2260e8d213a 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -984,7 +984,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, int ret; src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; - src_vq->io_modes = VB2_MMAP | VB2_DMABUF; + src_vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; src_vq->ops = &vdec_vb2_ops; src_vq->mem_ops = &vb2_dma_sg_memops; @@ -999,7 +999,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, return ret; dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - dst_vq->io_modes = VB2_MMAP | VB2_DMABUF; + dst_vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; dst_vq->ops = &vdec_vb2_ops; dst_vq->mem_ops = &vb2_dma_sg_memops; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index d2805b5e28a1b2..71ca59a24991be 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1073,7 +1073,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, int ret; src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; - src_vq->io_modes = VB2_MMAP | VB2_DMABUF; + src_vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; src_vq->ops = &venc_vb2_ops; src_vq->mem_ops = &vb2_dma_sg_memops; @@ -1090,7 +1090,7 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, return ret; dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - dst_vq->io_modes = VB2_MMAP | VB2_DMABUF; + dst_vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; dst_vq->ops = &venc_vb2_ops; dst_vq->mem_ops = &vb2_dma_sg_memops;