From patchwork Tue Jun 25 10:52: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: 2775891 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 6D124C0AB1 for ; Tue, 25 Jun 2013 10:53:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8912C2021C for ; Tue, 25 Jun 2013 10:53:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B6BB420219 for ; Tue, 25 Jun 2013 10:53:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752660Ab3FYKxK (ORCPT ); Tue, 25 Jun 2013 06:53:10 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:9399 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812Ab3FYKxJ (ORCPT ); Tue, 25 Jun 2013 06:53:09 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MOY00MO13KK0W40@mailout4.samsung.com> for linux-media@vger.kernel.org; Tue, 25 Jun 2013 19:53:08 +0900 (KST) X-AuditID: cbfee61b-b7f8e6d00000524c-c7-51c97693b213 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id CB.26.21068.39679C15; Tue, 25 Jun 2013 19:53:08 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MOY005X93JQYJK0@mmp1.samsung.com>; Tue, 25 Jun 2013 19:53:07 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, a.hajda@samsung.com, j.anaszewski@samsung.com, Sylwester Nawrocki Subject: [PATCH v2 5/6] exynos4-is: Set valid initial format on FIMC.n subdevs Date: Tue, 25 Jun 2013 12:52:34 +0200 Message-id: <1372157555-29557-3-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1372157555-29557-1-git-send-email-s.nawrocki@samsung.com> References: <1372157555-29557-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFJMWRmVeSWpSXmKPExsVy+t9jAd0pZScDDbZNYbK4te4cq0Xv1eeM Fmeb3rBb9GzYympx+E07qwOrR9+WVYwenzfJBTBFcdmkpOZklqUW6dslcGV8e97JVDBPpOL3 2k2sDYxTBbsYOTkkBEwkHl3vZYewxSQu3FvP1sXIxSEksIhRYum2JywQTgeTxKcHhxhBqtgE DCV6j/aB2SIC8hJPem+wgdjMAtUSN79NZQKxhQX8JE727warYRFQlThy5ifYBl4BN4kV5xaz djFyAG1TkJgzyQYkzCngLtEw4w4LiC0EVHJw0xv2CYy8CxgZVjGKphYkFxQnpeca6RUn5haX 5qXrJefnbmIEh8gz6R2MqxosDjEKcDAq8fB+iDsRKMSaWFZcmXuIUYKDWUmE91DWyUAh3pTE yqrUovz4otKc1OJDjNIcLErivAdbrQOFBNITS1KzU1MLUotgskwcnFINjE7ORWsZb1fVHOK5 7B2yM89NtOTgzl/vShsEN93d9MHftpO7YH/ns56nDi1J2r6TvpRG3f/FtSwq5IK82u9lTAHz TnByO02/uve+jEvGt3nFWo+LtTglL/+TqvpT8ajBcZ/Ar6LMkqBt7Xo6Zomv5nj7/48XfNS0 bGuvuU+CXMI/oSOFcx0eKbEUZyQaajEXFScCALYfvBoNAgAA 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.2 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 Ensure there are valid initial image formats on the FIMC.n subdev pads. 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 {