From patchwork Fri Jun 21 13:00:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2762521 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 569B9C0AB1 for ; Fri, 21 Jun 2013 13:02:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 201C720246 for ; Fri, 21 Jun 2013 13:02:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6125820242 for ; Fri, 21 Jun 2013 13:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422678Ab3FUNCA (ORCPT ); Fri, 21 Jun 2013 09:02:00 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:24501 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422804Ab3FUNBp (ORCPT ); Fri, 21 Jun 2013 09:01:45 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MOQ0022TUUHPVH0@mailout1.samsung.com> for linux-media@vger.kernel.org; Fri, 21 Jun 2013 22:01:44 +0900 (KST) X-AuditID: cbfee61a-b7f3b6d000006edd-06-51c44eb8faf4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 50.3F.28381.8BE44C15; Fri, 21 Jun 2013 22:01:44 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MOQ00AYQUT2OU80@mmp2.samsung.com>; Fri, 21 Jun 2013 22:01:44 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, j.anaszewski@samsung.com, a.hajda@samsung.com, Sylwester Nawrocki Subject: [PATCH 5/6] exynos4-is: Set valid initial format on FIMC.n subdevs Date: Fri, 21 Jun 2013 15:00:34 +0200 Message-id: <1371819636-13499-3-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1371819636-13499-1-git-send-email-s.nawrocki@samsung.com> References: <1371819636-13499-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJJMWRmVeSWpSXmKPExsVy+t9jQd0dfkcCDXZtE7S4te4cq0Xv1eeM Fmeb3rBb9GzYympx+E07qwOrR9+WVYwenzfJBTBFcdmkpOZklqUW6dslcGW8m/COseCycMWB 5UcZGxhvCnQxcnJICJhIrF45nwXCFpO4cG89WxcjF4eQwHRGiRXzT7BDOB1MEnPfvQOrYhMw lOg92scIYosIyEs86b3BBmIzC1RLrJ+1hh3EFhbwltj7cj0ziM0ioCrxeME/oDgHB6+Am8Sr DQogpoSAgsScSTYgFZwC7hKLb+1jBbGFgCoOPP7JOIGRdwEjwypG0dSC5ILipPRcQ73ixNzi 0rx0veT83E2M4AB5JrWDcWWDxSFGAQ5GJR7eFSqHA4VYE8uKK3MPMUpwMCuJ8AbfAQrxpiRW VqUW5ccXleakFh9ilOZgURLnPdBqHSgkkJ5YkpqdmlqQWgSTZeLglGpg7Dbec3U119TWPRHS 0ZptjpVz1uhN+2qhpjpb762IrpjGnUbtG01z/n5N51zH4LIpIYZ5jpvPskPRsc1sGl3eky9y lE5daOt6Oa44tPlQqnf/DNHZS3NPa85Y7fT0wPw2rxnGMZ1/Oi+d3HNFXv9my721l7cl98wM EOVex1+0LqNNd6Jz2rkPSizFGYmGWsxFxYkAw4sPdQwCAAA= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/platform/exynos4-is/fimc-capture.c | 19 +++++++++++++++++-- drivers/media/platform/exynos4-is/fimc-core.h | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c index 2b045b6..fb27ff7 100644 --- a/drivers/media/platform/exynos4-is/fimc-capture.c +++ b/drivers/media/platform/exynos4-is/fimc-capture.c @@ -1722,8 +1722,8 @@ static int fimc_capture_set_default_format(struct fimc_dev *fimc) struct v4l2_format fmt = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, .fmt.pix_mp = { - .width = 640, - .height = 480, + .width = FIMC_DEFAULT_WIDTH, + .height = FIMC_DEFAULT_HEIGHT, .pixelformat = V4L2_PIX_FMT_YUYV, .field = V4L2_FIELD_NONE, .colorspace = V4L2_COLORSPACE_JPEG, @@ -1741,6 +1741,7 @@ static int fimc_register_capture_device(struct fimc_dev *fimc, struct vb2_queue *q = &fimc->vid_cap.vbq; struct fimc_ctx *ctx; struct fimc_vid_cap *vid_cap; + struct fimc_fmt *fmt; int ret = -ENOMEM; ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); @@ -1788,6 +1789,20 @@ static int fimc_register_capture_device(struct fimc_dev *fimc, if (ret) goto err_free_ctx; + /* Default format configuration */ + fmt = fimc_find_format(NULL, NULL, FMT_FLAGS_CAM, 0); + vid_cap->ci_fmt.width = FIMC_DEFAULT_WIDTH; + vid_cap->ci_fmt.height = FIMC_DEFAULT_HEIGHT; + vid_cap->ci_fmt.code = fmt->mbus_code; + + ctx->s_frame.width = FIMC_DEFAULT_WIDTH; + ctx->s_frame.height = FIMC_DEFAULT_HEIGHT; + ctx->s_frame.fmt = fmt; + + fmt = fimc_find_format(NULL, NULL, FMT_FLAGS_WRITEBACK, 0); + vid_cap->wb_fmt = vid_cap->ci_fmt; + vid_cap->wb_fmt.code = fmt->mbus_code; + vid_cap->vd_pad.flags = MEDIA_PAD_FL_SINK; ret = media_entity_init(&vfd->entity, 1, &vid_cap->vd_pad, 0); if (ret) diff --git a/drivers/media/platform/exynos4-is/fimc-core.h b/drivers/media/platform/exynos4-is/fimc-core.h index 0f25ce0..65c8ce7 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.h +++ b/drivers/media/platform/exynos4-is/fimc-core.h @@ -47,6 +47,8 @@ #define FIMC_DEF_MIN_SIZE 16 #define FIMC_DEF_HEIGHT_ALIGN 2 #define FIMC_DEF_HOR_OFFS_ALIGN 1 +#define FIMC_DEFAULT_WIDTH 640 +#define FIMC_DEFAULT_HEIGHT 480 /* indices to the clocks array */ enum {