From patchwork Mon Oct 9 12:24:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 9992839 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 B96C760230 for ; Mon, 9 Oct 2017 12:25:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABF5628606 for ; Mon, 9 Oct 2017 12:25:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0ED4287BF; Mon, 9 Oct 2017 12:25:44 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 429F828606 for ; Mon, 9 Oct 2017 12:25:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754144AbdJIMZ3 (ORCPT ); Mon, 9 Oct 2017 08:25:29 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:52673 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754141AbdJIMZZ (ORCPT ); Mon, 9 Oct 2017 08:25:25 -0400 Received: by mail-wm0-f54.google.com with SMTP id k4so22958071wmc.1 for ; Mon, 09 Oct 2017 05:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6DfgBOnPxC9PGg+MN8wzllXXzw10kSmTrggh+PjocTQ=; b=d7fFEPYayiBqMshBDxyrrs9Yg59nbKRbamHo5/mhvr5PnGImPo5w+ilA/Jg/jximIs WI/w0Z6wbdfZgk6x+OZEmLU2KLP01N7jZYuecckTu/9AUn+ctkhMQRDsxeAUG2fxBKce hKbdtpbpWEnN5hWuZGA0+zGSBJqMkvlGX1kEw= 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=6DfgBOnPxC9PGg+MN8wzllXXzw10kSmTrggh+PjocTQ=; b=mz7mMXz4pm//G1MZGVboT/5yKB5ysi4xl4VkPwF+RH/C4SfaySVJvJ9EssdgFejfnD 5cyPdN7096ZeSDCuvqP9UUsr+zsHB8sLp0icirXtwaBZRyTuLEu01PBuOJRALVsY5ToZ HhWtiy8yN6WfcHasbOAtMHFc7KarMCho/12jT1GulHkU64XbbPCR4kIdQoF/cax5A9CH txmyTPyxYmZFUwOwyzyyR5T0fNQ0cwR17WA94N8T7/iYFDEmT8qMQqKhSuxNMuprntpq 37x0pPTjDR5WNREcZNjixAg2wL+FW6caOKhPLerNzyfpkA5727MoSodM0I+3pkchaeT8 jbMA== X-Gm-Message-State: AMCzsaUgwjxSKCYdam4agvgW2MzwzdNtAMyURlHqKfpLF9p4czOh9OLh 4lZu45EJca76DeSUQ5VNHSOz1g== X-Google-Smtp-Source: AOwi7QB0y6l5Ab7NLqZoGsXtJJLKlr5Yzg4hO28U2me2/rhUvgqbuQx+ak7gKr04lz8H+7I1A8eCtQ== X-Received: by 10.28.247.13 with SMTP id v13mr5023898wmh.140.1507551924480; Mon, 09 Oct 2017 05:25:24 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id q188sm6679034wmb.43.2017.10.09.05.25.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 05:25:23 -0700 (PDT) From: Stanimir Varbanov To: Hans Verkuil Cc: Nicolas Dufresne , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH 2/2] media: venus: venc: fix bytesused v4l2_plane field Date: Mon, 9 Oct 2017 15:24:58 +0300 Message-Id: <20171009122458.3053-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171009122458.3053-1-stanimir.varbanov@linaro.org> References: <20171009122458.3053-1-stanimir.varbanov@linaro.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 This fixes wrongly filled bytesused field of v4l2_plane structure by include data_offset in the plane, Also fill data_offset and bytesused for capture type of buffers only. Signed-off-by: Stanimir Varbanov Tested-by: Nicolas Dufresne --- drivers/media/platform/qcom/venus/venc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 6f123a387cf9..9445ad492966 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -963,15 +963,16 @@ static void venc_buf_done(struct venus_inst *inst, unsigned int buf_type, if (!vbuf) return; - vb = &vbuf->vb2_buf; - vb->planes[0].bytesused = bytesused; - vb->planes[0].data_offset = data_offset; - vbuf->flags = flags; if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + vb = &vbuf->vb2_buf; + vb2_set_plane_payload(vb, 0, bytesused + data_offset); + vb->planes[0].data_offset = data_offset; vb->timestamp = timestamp_us * NSEC_PER_USEC; vbuf->sequence = inst->sequence_cap++; + + WARN_ON(vb2_get_plane_payload(vb, 0) > vb2_plane_size(vb, 0)); } else { vbuf->sequence = inst->sequence_out++; }