From patchwork Thu Jul 19 00:39:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1213541 Return-Path: X-Original-To: patchwork-linux-fbdev@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 DC7D740071 for ; Thu, 19 Jul 2012 00:39:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651Ab2GSAj3 (ORCPT ); Wed, 18 Jul 2012 20:39:29 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:52317 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752543Ab2GSAj0 (ORCPT ); Wed, 18 Jul 2012 20:39:26 -0400 Received: from avalon.ideasonboard.com (unknown [91.178.56.248]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D8AC435A8C; Thu, 19 Jul 2012 02:39:21 +0200 (CEST) From: Laurent Pinchart To: linux-fbdev@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH 7/9] fbdev: sh_mobile_lcdc: Support horizontal panning Date: Thu, 19 Jul 2012 02:39:20 +0200 Message-Id: <1342658362-19491-8-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1342658362-19491-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1342658362-19491-1-git-send-email-laurent.pinchart@ideasonboard.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Signed-off-by: Laurent Pinchart --- drivers/video/sh_mobile_lcdcfb.c | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 68011b5..aeb7585 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -1493,7 +1493,7 @@ static const struct fb_fix_screeninfo sh_mobile_lcdc_overlay_fix = { .type = FB_TYPE_PACKED_PIXELS, .visual = FB_VISUAL_TRUECOLOR, .accel = FB_ACCEL_NONE, - .xpanstep = 0, + .xpanstep = 1, .ypanstep = 1, .ywrapstep = 0, .capabilities = FB_CAP_FOURCC, @@ -1714,9 +1714,14 @@ sh_mobile_lcdc_overlay_fb_init(struct sh_mobile_lcdc_overlay *ovl) else info->fix.visual = FB_VISUAL_TRUECOLOR; - if (ovl->format->fourcc == V4L2_PIX_FMT_NV12 || - ovl->format->fourcc == V4L2_PIX_FMT_NV21) + switch (ovl->format->fourcc) { + case V4L2_PIX_FMT_NV16: + case V4L2_PIX_FMT_NV61: + info->fix.xpanstep = 2; + case V4L2_PIX_FMT_NV12: + case V4L2_PIX_FMT_NV21: info->fix.ypanstep = 2; + } /* Initialize variable screen information. */ var = &info->var; @@ -1771,7 +1776,7 @@ static const struct fb_fix_screeninfo sh_mobile_lcdc_fix = { .type = FB_TYPE_PACKED_PIXELS, .visual = FB_VISUAL_TRUECOLOR, .accel = FB_ACCEL_NONE, - .xpanstep = 0, + .xpanstep = 1, .ypanstep = 1, .ywrapstep = 0, .capabilities = FB_CAP_FOURCC, @@ -2209,9 +2214,14 @@ sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch, else info->fix.visual = FB_VISUAL_TRUECOLOR; - if (ch->format->fourcc == V4L2_PIX_FMT_NV12 || - ch->format->fourcc == V4L2_PIX_FMT_NV21) + switch (ch->format->fourcc) { + case V4L2_PIX_FMT_NV16: + case V4L2_PIX_FMT_NV61: + info->fix.xpanstep = 2; + case V4L2_PIX_FMT_NV12: + case V4L2_PIX_FMT_NV21: info->fix.ypanstep = 2; + } /* Initialize variable screen information using the first mode as * default.