From patchwork Tue Oct 10 07:52:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 9995239 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 3B09C603B5 for ; Tue, 10 Oct 2017 07:53:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CFC827FA8 for ; Tue, 10 Oct 2017 07:53:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 221B028068; Tue, 10 Oct 2017 07:53:29 +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 B36BA27FA8 for ; Tue, 10 Oct 2017 07:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752207AbdJJHxP (ORCPT ); Tue, 10 Oct 2017 03:53:15 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:57328 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754585AbdJJHxO (ORCPT ); Tue, 10 Oct 2017 03:53:14 -0400 Received: by mail-wm0-f41.google.com with SMTP id l68so2568351wmd.5 for ; Tue, 10 Oct 2017 00:53:14 -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=sT85+UbEv5kL3C6vjBjEGDIgW0oIwSx48pOKjNpgbpE=; b=F12qdVlGp3rbshM7uzGPSSHsT6ECinjDxOJ7Daalzk83tXbg1W0DDhIr6IpCZ7YnIK zen3vViZ88FHFBtbF14g8VFIeGmc9hl2u5zH8A+DFC/YM9K53Tan8N5eB5B2YHliCD2O ud3vHSjLw0fCklcWcoec8HSq+nKCBpJv4NBSg= 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=sT85+UbEv5kL3C6vjBjEGDIgW0oIwSx48pOKjNpgbpE=; b=rSrxsTVyCdmar/pzN9trp8oaEjW9Zq3UCbrzMDhtkNJWEn038NBAUY+Jdq6UZ7zXhc 9PXzfYhzGUNB/DyMpR+Txj51wkd4RZjR9nK3vZMxlyfZrBp5EaGlp+ASssHMyx6AFam8 BVXBtYKca1oBEt0r6laxA/EgnWZoKMeI5F2oyPk002QpjqSoPsetZ7CZtg8qQr95BjgZ 9Vj2DvLQod50NUXANF8YkBkLOqWRgZDqoqUTKf+CQJpNdhYhwUp9z1G0dIkISd5kQXi1 0KrHTPrUIhUuiJ43rz7DpqbnnvU0MXF+oE5GCezeWX/47W+O0D+yUw37bEPQmxU7Me7h fxXg== X-Gm-Message-State: AMCzsaV2Y2bgnHG77ADqYgKBC93HA/RSoUhUAWi9wzfJNtGvoqnnM6Lj h/cNngzH6lmL5VOTcjME0+8djg== X-Google-Smtp-Source: AOwi7QCcSSo7hw3YdkVXr9ZLqrNpso3kgnQvxW/Xjv6Ll03QjaPQzY44kyFQ59eNVsDiUvM7V+OAaw== X-Received: by 10.223.139.85 with SMTP id v21mr12514029wra.70.1507621993328; Tue, 10 Oct 2017 00:53:13 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id p78sm19975351wma.11.2017.10.10.00.53.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Oct 2017 00:53:12 -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 v2] media: venus: venc: fix bytesused v4l2_plane field Date: Tue, 10 Oct 2017 10:52:36 +0300 Message-Id: <20171010075236.26424-1-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171009122458.3053-2-stanimir.varbanov@linaro.org> References: <20171009122458.3053-2-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 --- v2: Just delete pointless WARN_ON. drivers/media/platform/qcom/venus/venc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 6f123a387cf9..3fcf0e9b7b29 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -963,13 +963,12 @@ 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++; } else {