From patchwork Tue Nov 22 05:26:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Osciak X-Patchwork-Id: 8528 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RSisr-00063W-0L; Tue, 22 Nov 2011 06:27:05 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1RSisq-00021m-GA; Tue, 22 Nov 2011 06:27:04 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751423Ab1KVF1A (ORCPT + 4 others); Tue, 22 Nov 2011 00:27:00 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:41643 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159Ab1KVF07 (ORCPT ); Tue, 22 Nov 2011 00:26:59 -0500 Received: by mail-iy0-f174.google.com with SMTP id e36so8242144iag.19 for ; Mon, 21 Nov 2011 21:26:59 -0800 (PST) Received: by 10.42.135.66 with SMTP id o2mr17537317ict.0.1321939619330; Mon, 21 Nov 2011 21:26:59 -0800 (PST) Received: from localhost.localdomain (50-76-36-29-ip-static.hfc.comcastbusiness.net. [50.76.36.29]) by mx.google.com with ESMTPS id j1sm31332632igq.2.2011.11.21.21.26.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Nov 2011 21:26:58 -0800 (PST) From: Pawel Osciak To: linux-media@vger.kernel.org Cc: mingchen@quicinc.com, hverkuil@xs4all.nl, Pawel Osciak , Marek Szyprowski Subject: [PATCH v1 2/2] vb2: add support for app_offset field of the v4l2_plane struct Date: Mon, 21 Nov 2011 21:26:37 -0800 Message-Id: <1321939597-6239-3-git-send-email-pawel@osciak.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1321939597-6239-1-git-send-email-pawel@osciak.com> References: <1321939597-6239-1-git-send-email-pawel@osciak.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.11.22.51516 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1100_1199 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -4.2 (----) X-LSpam-Report: No, score=-4.2 required=5.0 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 autolearn=ham The app_offset can only be set by userspace and will be passed by vb2 to the driver. Signed-off-by: Pawel Osciak CC: Marek Szyprowski --- drivers/media/video/videobuf2-core.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c index 979e544..41cc8e9 100644 --- a/drivers/media/video/videobuf2-core.c +++ b/drivers/media/video/videobuf2-core.c @@ -830,6 +830,11 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b, } } + /* App offset can only be set by userspace, for all types */ + for (plane = 0; plane < vb->num_planes; ++plane) + v4l2_planes[plane].app_offset = + b->m.planes[plane].app_offset; + if (b->memory == V4L2_MEMORY_USERPTR) { for (plane = 0; plane < vb->num_planes; ++plane) { v4l2_planes[plane].m.userptr =