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: 115206 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2494984qgn; Mon, 9 Oct 2017 05:25:31 -0700 (PDT) X-Received: by 10.84.194.3 with SMTP id g3mr9168445pld.246.1507551931500; Mon, 09 Oct 2017 05:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507551931; cv=none; d=google.com; s=arc-20160816; b=tHgOpHTCZBmVrQwV9bSLjCFyxT7WwS1GiOMMmijYIVsQGOy0lxgyuiMuY0WlZmomWw S+1TMzaFhMeoRd0OFspKOlCbVgfshC/SBsP//6w1VUL2ZNa0OE+5yJrlO9pJtMsA0LAm dPfe3urClgvfRrJbfXKUHV0jdgqXtIZpp6rvSF64BLZYVaHFESKdi3UM48I5/vVEitmD EtVKl4uTksX3T1em76idXxHErErh6yme+fDkQftoO9cR7R6+hOu7xz7WZK7mIV6GktRR 1BmQpXaq0kqaBY6V6VictppMw9ihrFwIfKfOBwKcx1zcer4b/YB325E0l6sr6PRbN8B2 lE5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=6DfgBOnPxC9PGg+MN8wzllXXzw10kSmTrggh+PjocTQ=; b=et2YHStoCF1NIurKmiyR+/l5ENpVhKvzvKN69jQsEeDCWvikf9NnDIhNS+4apUbEou hBNXs95LGQuHF6zShamzgE7djS1frCCQAu9Du3zII1bVHxcxLEiOQH4hLRijtK6HmfAL sx5PKiP7hU55XURe6OMGnt0H3Awrwb7xLGTWbnV9+j53cKYVHMSzm6rUf7X6pD+b3YEl AnPhU4yaJZT1LpHPGWqeYY1fZMDTdfWhzRN4LVURg5/rlzP/cJxIesV5qoam2oK19RRZ pN84+l2MESPI4AhuHfFM/zvky+1h9dkkZqTBtBBw/ZdAA4Jccittu7SBLMp/Y4mSG/m+ Fztg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d7fFEPYa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si2899982pgu.91.2017.10.09.05.25.31; Mon, 09 Oct 2017 05:25:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d7fFEPYa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754168AbdJIMZa (ORCPT + 26 others); Mon, 9 Oct 2017 08:25:30 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:51506 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754123AbdJIMZZ (ORCPT ); Mon, 9 Oct 2017 08:25:25 -0400 Received: by mail-wm0-f42.google.com with SMTP id f4so22954580wme.0 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=jW90Dtvr26dWOieJmricCtZ1CIk9SLlC9Szwa2T4o9NrzV4WdW4v6rR9K97JAXGWLW yGLJgRKCa52E/23U8bqL/jT9mWfpww+/iigBGNnjqwcKAvMgmw2xaXE/LtfQVvbfl4V/ jO8leFmXzE8gH0Y5zNc3fXG3UbmTDVCqqSaWyNcReT6L30eDxDoDdIAYf6NKRQelhc66 XDtExHErw8D6HSM5MbItXLVU6LUtfPb/8shyZNr+ibJv1UHTVD+bh0umyPnBbZIPVoNC mcYmI/dyVsGiZzwJ/Dj6koUbOYmk5IzMphrjY15J4ls0s/Dr8ov9yZSSEslofBzwbP1h umcQ== X-Gm-Message-State: AMCzsaX2udj2Fwxkmw5UlndvoKTVoeHyVaWal/kyDkjQWg2tkVToCHfY WKJiJE5cEsutITGUt/RnvVlZHA== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/media/platform/qcom/venus/venc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.11.0 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++; }