From patchwork Fri Aug 17 19:15:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 10569327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0109F1390 for ; Fri, 17 Aug 2018 19:16:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E400B2BE15 for ; Fri, 17 Aug 2018 19:16:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D74A82BE1B; Fri, 17 Aug 2018 19:16:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82FA12BE15 for ; Fri, 17 Aug 2018 19:16:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727738AbeHQWVJ (ORCPT ); Fri, 17 Aug 2018 18:21:09 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728148AbeHQWU2 (ORCPT ); Fri, 17 Aug 2018 18:20:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B1868011454; Fri, 17 Aug 2018 19:15:53 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54FA01010430; Fri, 17 Aug 2018 19:15:53 +0000 (UTC) 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 w7HJFrCJ000375; Fri, 17 Aug 2018 15:15:53 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w7HJFqEA000371; Fri, 17 Aug 2018 15:15:52 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Fri, 17 Aug 2018 15:15:52 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Bartlomiej Zolnierkiewicz cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH] mach64: fix console corruption in 24bpp mode Message-ID: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 17 Aug 2018 19:15:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 17 Aug 2018 19:15:53 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mpatocka@redhat.com' RCPT:'' Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There's console font corruption when using the mach64 driver in 24bpp mode. In 24bpp mode, the mach64 accelerator is set up for 8-bpp mode (with horizontal width and stride multiplied by 3). In this mode, the accelerator can't even possibly support color expansion. Consquently, we have to use an unaccelerated function cfb_imageblit for color expansion. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org --- drivers/video/fbdev/aty/mach64_accel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-stable/drivers/video/fbdev/aty/mach64_accel.c =================================================================== --- linux-stable.orig/drivers/video/fbdev/aty/mach64_accel.c 2018-04-20 18:11:01.000000000 +0200 +++ linux-stable/drivers/video/fbdev/aty/mach64_accel.c 2018-08-13 17:37:04.000000000 +0200 @@ -291,7 +291,8 @@ void atyfb_imageblit(struct fb_info *inf if (!image->width || !image->height) return; if (!par->accel_flags || - (image->depth != 1 && info->var.bits_per_pixel != image->depth)) { + (image->depth != 1 && info->var.bits_per_pixel != image->depth) || + (image->depth == 1 && info->var.bits_per_pixel == 24)) { cfb_imageblit(info, image); return; }