Bug#583162: linux-image-2.6.32-5-amd64: console font corruption with nouveau
Package: linux-2.6
Version: 2.6.32-13
Severity: normal
Tags: patch fixed-upstream
When a non-default console font size is selected (e.g. by running
"setfont Uni3-Terminus20x10"), nouveau displays corrupted glyphs
rendering the terminal useless.
This has been fixed by commit c82b88d578847909797945824851a6a9a84f9c20:
drm/nouveau: Fix fbcon corruption with font width not divisible by 8
NV50 is nice and has a switch that autoaligns stuff for us. Pre-NV50,
we need to align input bitmap width manually.
Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This does not apply as is, attached is a patch that can be applied
against 2.6.33.4 (I haven't looked at the Debian kernel yet). I
verified that the fix for nv50_fbcon.c works, but I cannot test the one
for nv04_fbcon.c due to lack of hardware. Note that the same patch has
been applied in Ubuntu, see also
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/544739.
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (x86_64)
Kernel: Linux 2.6.34-nouveau (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages linux-image-2.6.32-5-amd64 depends on:
ii debconf [debconf 1.5.32 Debian configuration management sy
ii initramfs-tools 0.94.4 tools for generating an initramfs
ii linux-base 2.6.34-1~experimental.1 Linux image base package
ii module-init-tool 3.12~pre2-3 tools for managing Linux kernel mo
Versions of packages linux-image-2.6.32-5-amd64 recommends:
ii firmware-linux-f 2.6.34-1~experimental.1 Binary firmware for various driver
ii libc6-i686 2.10.2-9 GNU C Library: Shared libraries [i
Versions of packages linux-image-2.6.32-5-amd64 suggests:
ii grub-legacy [grub] 0.97-61 GRand Unified Bootloader (Legacy v
pn linux-doc-2.6.32 <none> (no description available)
Versions of packages linux-image-2.6.32-5-amd64 is related to:
pn firmware-bnx2 <none> (no description available)
pn firmware-bnx2x <none> (no description available)
pn firmware-ipw2x00 <none> (no description available)
pn firmware-ivtv <none> (no description available)
pn firmware-iwlwifi <none> (no description available)
pn firmware-linux <none> (no description available)
pn firmware-linux-nonfree <none> (no description available)
pn firmware-qlogic <none> (no description available)
ii firmware-ralink 0.24 Binary firmware for Ralink RT2561,
pn xen-hypervisor <none> (no description available)
-- debconf information excluded
>From a02fa11e84fb00c6489970570a3d4480f075e020 Mon Sep 17 00:00:00 2001
From: Sven Joachim <svenjoac@gmx.de>
Date: Tue, 25 May 2010 22:24:47 +0200
Subject: [PATCH] drm/nouveau: Fix fbcon corruption with font width not divisible by 8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NV50 is nice and has a switch that autoaligns stuff for us. Pre-NV50,
we need to align input bitmap width manually.
Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Conflicts:
drivers/gpu/drm/nouveau/nv04_fbcon.c
---
drivers/gpu/drm/nouveau/nv04_fbcon.c | 6 +++---
drivers/gpu/drm/nouveau/nv50_fbcon.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nv04_fbcon.c b/drivers/gpu/drm/nouveau/nv04_fbcon.c
index fd01caa..813b25c 100644
--- a/drivers/gpu/drm/nouveau/nv04_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nv04_fbcon.c
@@ -118,8 +118,8 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
return;
}
- width = (image->width + 31) & ~31;
- dsize = (width * image->height) >> 5;
+ width = ALIGN(image->width, 8);
+ dsize = ALIGN(width * image->height, 32) >> 5;
if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
@@ -136,8 +136,8 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
((image->dx + image->width) & 0xffff));
OUT_RING(chan, bg);
OUT_RING(chan, fg);
- OUT_RING(chan, (image->height << 16) | image->width);
OUT_RING(chan, (image->height << 16) | width);
+ OUT_RING(chan, (image->height << 16) | image->width);
OUT_RING(chan, (image->dy << 16) | (image->dx & 0xffff));
while (dsize) {
diff --git a/drivers/gpu/drm/nouveau/nv50_fbcon.c b/drivers/gpu/drm/nouveau/nv50_fbcon.c
index 0f57cdf..195c866 100644
--- a/drivers/gpu/drm/nouveau/nv50_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
@@ -233,7 +233,7 @@ nv50_fbcon_accel_init(struct fb_info *info)
BEGIN_RING(chan, NvSub2D, 0x0808, 3);
OUT_RING(chan, 0);
OUT_RING(chan, 0);
- OUT_RING(chan, 0);
+ OUT_RING(chan, 1);
BEGIN_RING(chan, NvSub2D, 0x081c, 1);
OUT_RING(chan, 1);
BEGIN_RING(chan, NvSub2D, 0x0840, 4);
--
1.7.1
Reply to: