From patchwork Fri Sep 13 06:59:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhou Zhu X-Patchwork-Id: 2881881 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A68199F1C0 for ; Fri, 13 Sep 2013 07:10:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83BB4203F1 for ; Fri, 13 Sep 2013 07:10:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B5452039A for ; Fri, 13 Sep 2013 07:10:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755428Ab3IMHKJ (ORCPT ); Fri, 13 Sep 2013 03:10:09 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:54417 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755072Ab3IMHKJ (ORCPT ); Fri, 13 Sep 2013 03:10:09 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.14.5/8.14.5) with SMTP id r8D70dO6005222; Fri, 13 Sep 2013 00:00:39 -0700 Received: from sc-owa02.marvell.com ([199.233.58.137]) by mx0b-0016f401.pphosted.com with ESMTP id 1etwrt00ej-19 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Fri, 13 Sep 2013 00:00:38 -0700 Received: from maili.marvell.com (10.93.76.43) by sc-owa02.marvell.com (10.93.76.22) with Microsoft SMTP Server id 8.3.213.0; Fri, 13 Sep 2013 00:00:35 -0700 Received: from localhost (unknown [10.38.36.226]) by maili.marvell.com (Postfix) with ESMTP id 631301CCD9C; Fri, 13 Sep 2013 00:00:35 -0700 (PDT) From: Zhou Zhu To: , Tomi Valkeinen , Jean-Christophe Plagniol-Villard , Haojian Zhuang CC: Jing Xiang , Guoqing Li , Zhou Zhu , "Jett.Zhou" , Zhou Zhu Subject: [PATCH V5 4/5] video: mmp: calculate pitch value when fb set win Date: Fri, 13 Sep 2013 14:59:48 +0800 Message-ID: <1379055589-26132-5-git-send-email-zzhu3@marvell.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1379055589-26132-1-git-send-email-zzhu3@marvell.com> References: <1379055589-26132-1-git-send-email-zzhu3@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-09-13_03:2013-09-13, 2013-09-13, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1305240000 definitions=main-1309120225 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Jing Xiang Add new func mmpfb_set_win to make code clean, it will do resolution and fmt setting of win in mmpfb_set_win. Signed-off-by: Jing Xiang Signed-off-by: Jett.Zhou Signed-off-by: Zhou Zhu Reviewed-by: Daniel Drake --- drivers/video/mmp/fb/mmpfb.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/video/mmp/fb/mmpfb.c b/drivers/video/mmp/fb/mmpfb.c index 4ab95b8..19fd913 100644 --- a/drivers/video/mmp/fb/mmpfb.c +++ b/drivers/video/mmp/fb/mmpfb.c @@ -392,12 +392,23 @@ static int var_update(struct fb_info *info) return 0; } +static void mmpfb_set_win(struct fb_info *info) +{ + struct mmpfb_info *fbi = info->par; + struct mmp_win win; + + memset(&win, 0, sizeof(win)); + win.xsrc = win.xdst = fbi->mode.xres; + win.ysrc = win.ydst = fbi->mode.yres; + win.pix_fmt = fbi->pix_fmt; + mmp_overlay_set_win(fbi->overlay, &win); +} + static int mmpfb_set_par(struct fb_info *info) { struct mmpfb_info *fbi = info->par; struct fb_var_screeninfo *var = &info->var; struct mmp_addr addr; - struct mmp_win win; struct mmp_mode mode; int ret; @@ -409,11 +420,8 @@ static int mmpfb_set_par(struct fb_info *info) fbmode_to_mmpmode(&mode, &fbi->mode, fbi->output_fmt); mmp_path_set_mode(fbi->path, &mode); - memset(&win, 0, sizeof(win)); - win.xsrc = win.xdst = fbi->mode.xres; - win.ysrc = win.ydst = fbi->mode.yres; - win.pix_fmt = fbi->pix_fmt; - mmp_overlay_set_win(fbi->overlay, &win); + /* set window related info */ + mmpfb_set_win(info); /* set address always */ memset(&addr, 0, sizeof(addr)); @@ -427,16 +435,12 @@ static int mmpfb_set_par(struct fb_info *info) static void mmpfb_power(struct mmpfb_info *fbi, int power) { struct mmp_addr addr; - struct mmp_win win; struct fb_var_screeninfo *var = &fbi->fb_info->var; /* for power on, always set address/window again */ if (power) { - memset(&win, 0, sizeof(win)); - win.xsrc = win.xdst = fbi->mode.xres; - win.ysrc = win.ydst = fbi->mode.yres; - win.pix_fmt = fbi->pix_fmt; - mmp_overlay_set_win(fbi->overlay, &win); + /* set window related info */ + mmpfb_set_win(fbi->fb_info); /* set address always */ memset(&addr, 0, sizeof(addr));