From patchwork Wed Sep 5 13:25:08 2012 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: 1409291 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DE8353FC71 for ; Wed, 5 Sep 2012 13:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752593Ab2IEN0P (ORCPT ); Wed, 5 Sep 2012 09:26:15 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:13686 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366Ab2IEN0O (ORCPT ); Wed, 5 Sep 2012 09:26:14 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M9V00IXQPBMZZE0@mailout2.samsung.com>; Wed, 05 Sep 2012 22:26:12 +0900 (KST) X-AuditID: cbfee61b-b7f056d000002c30-cb-504752f4f18b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id EE.EB.11312.4F257405; Wed, 05 Sep 2012 22:26:12 +0900 (KST) Received: from amdc248.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 <0M9V00J9BPAEPR50@mmp2.samsung.com>; Wed, 05 Sep 2012 22:26:12 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: sw0312.kim@samsung.com, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki , Kyungmin Park Subject: [PATCH 2/2] s5p-fimc: fimc-lite: Propagate frame format on the subdev Date: Wed, 05 Sep 2012 15:25:08 +0200 Message-id: <1346851508-16705-2-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.11.3 In-reply-to: <1346851508-16705-1-git-send-email-s.nawrocki@samsung.com> References: <1346851508-16705-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKJMWRmVeSWpSXmKPExsVy+t9jQd0vQe4BBt8uylr0bNjKajHj/D4m ByaPz5vkAhijuGxSUnMyy1KL9O0SuDK+v/vOVvCQp6L9Y2gD4xWuLkYODgkBE4mdT4y6GDmB TDGJC/fWs3UxcnEICUxnlDjd2cIC4bQzSbSvAXE4OdgEDCV6j/YxgtgiAvIST3pvgHUwC8xk lDh59w0rSEJYwE/i+bQZzCAbWARUJV51KoOEeQXcJF7eP88EsU1R4sf3NcwgNqeAu0TLvzNg M4WAavp3/GacwMi7gJFhFaNoakFyQXFSeq6RXnFibnFpXrpecn7uJkaw559J72Bc1WBxiFGA g1GJh1fhr1uAEGtiWXFl7iFGCQ5mJRHeS4HuAUK8KYmVValF+fFFpTmpxYcYpTlYlMR5nc7Z BQgJpCeWpGanphakFsFkmTg4pRoYm+UPdEc8+PG+OZcx/tPDCaohij38C9n/WgvHVDay1bYJ vWyLY7/kM3/XRrn1of/mLePk4VGuPmAqWGV68PH/F1Hn7MwOb7urfFHu0eXCpYrS33tKcw0f PHKXPTbZTipeetoX3q/Tt7De2BJYecH8q+XRpjM3O+I0Hwrs+xKu2nHyY17oLqVIJZbijERD Leai4kQAh8r0G/gBAAA= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org When setting image format on subdev's sink pad there was no propagation to the source pad. This resulted in wrong reported format on the source pad and wrong device configuration when used from subdev interace level only. Correct this by propagating format from the sink to the source pad. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/video/s5p-fimc/fimc-lite.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/s5p-fimc/fimc-lite.c b/drivers/media/video/s5p-fimc/fimc-lite.c index 9289008..cd4cf12 100644 --- a/drivers/media/video/s5p-fimc/fimc-lite.c +++ b/drivers/media/video/s5p-fimc/fimc-lite.c @@ -1064,6 +1064,7 @@ static int fimc_lite_subdev_set_fmt(struct v4l2_subdev *sd, struct fimc_lite *fimc = v4l2_get_subdevdata(sd); struct v4l2_mbus_framefmt *mf = &fmt->format; struct flite_frame *sink = &fimc->inp_frame; + struct flite_frame *source = &fimc->out_frame; const struct fimc_fmt *ffmt; v4l2_dbg(1, debug, sd, "pad%d: code: 0x%x, %dx%d", @@ -1097,8 +1098,10 @@ static int fimc_lite_subdev_set_fmt(struct v4l2_subdev *sd, sink->rect.height = mf->height; sink->rect.left = 0; sink->rect.top = 0; - /* Reset source crop rectangle */ - fimc->out_frame.rect = sink->rect; + /* Reset source format and crop rectangle */ + source->rect = sink->rect; + source->f_width = mf->width; + source->f_height = mf->height; } else { /* Allow changing format only on sink pad */ mf->code = fimc->fmt->mbus_code;