From patchwork Thu Jan 23 19:44:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 3531281 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 9008A9F1C3 for ; Thu, 23 Jan 2014 19:44:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0FDA20173 for ; Thu, 23 Jan 2014 19:44:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D434A2012E for ; Thu, 23 Jan 2014 19:44:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752317AbaAWToF (ORCPT ); Thu, 23 Jan 2014 14:44:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18553 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752973AbaAWToD (ORCPT ); Thu, 23 Jan 2014 14:44:03 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0NJi12w006123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 23 Jan 2014 14:44:01 -0500 Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0NJi0Fh027774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jan 2014 14:44:01 -0500 Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id s0NJi09o013660; Thu, 23 Jan 2014 14:44:00 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id s0NJi0q8013656; Thu, 23 Jan 2014 14:44:00 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Thu, 23 Jan 2014 14:44:00 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen cc: linux-fbdev@vger.kernel.org Subject: [PATCH 10/10] tgafb: avoid restriction on modes with line length not a multiple of 64 Message-ID: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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.5 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 In tgafb there is a restriction that prevents the user from setting a videomode with line length not a multiple of 64 bytes (for example, 800x600 is not allowed). The reason for this restriction it that functions copyarea_line_8bpp and copyarea_line_32bpp can not handle a line length that is not a multiple of 64 bytes. This patch removes this restriction on mode setting and makes sure that the functions copyarea_line_8bpp and copyarea_line_32bpp are called only if line length is a multiple of 64 bytes. If we set a mode 800x600, the functions copyarea_line_8bpp and copyarea_line_32bpp are not used, generic functions for copying are used instead and it works just fine. Signed-off-by: Mikulas Patocka --- drivers/video/tgafb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-3.8-rc3-fast/drivers/video/tgafb.c =================================================================== --- linux-3.8-rc3-fast.orig/drivers/video/tgafb.c 2013-01-10 23:43:44.000000000 +0100 +++ linux-3.8-rc3-fast/drivers/video/tgafb.c 2013-01-10 23:43:49.000000000 +0100 @@ -198,8 +198,8 @@ tgafb_check_var(struct fb_var_screeninfo return -EINVAL; /* Some of the acceleration routines assume the line width is - a multiple of 64 bytes. */ - if (var->xres * (par->tga_type == TGA_TYPE_8PLANE ? 1 : 4) % 64) + a multiple of 8 bytes. */ + if (var->xres * (par->tga_type == TGA_TYPE_8PLANE ? 1 : 4) % 8) return -EINVAL; return 0; @@ -1286,7 +1286,7 @@ tgafb_copyarea(struct fb_info *info, con bpp = info->var.bits_per_pixel; /* Detect copies of the entire line. */ - if (width * (bpp >> 3) == line_length) { + if (!(line_length & 63) && width * (bpp >> 3) == line_length) { if (bpp == 8) copyarea_line_8bpp(info, dy, sy, height, width); else