From 52b9ef4104671ac50969f05dbe5086f219a71926 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 25 May 2010 22:46:33 +0000 Subject: [PATCH] nouveau: Fix fbcon corruption with font width not divisible by 8 (Closes: #583162) svn path=/dists/sid/linux-2.6/; revision=15766 --- debian/changelog | 2 + ...fbcon-corruption-with-font-width-not.patch | 58 +++++++++++++++++++ ...-use-ALIGN-instead-of-open-coding-it.patch | 57 ++++++++++++++++++ debian/patches/series/14 | 2 + 4 files changed, 119 insertions(+) create mode 100644 debian/patches/bugfix/all/drm-nouveau-Fix-fbcon-corruption-with-font-width-not.patch create mode 100644 debian/patches/bugfix/all/drm-nouveau-use-ALIGN-instead-of-open-coding-it.patch diff --git a/debian/changelog b/debian/changelog index 346f9080d..51ddde43a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,8 @@ linux-2.6 (2.6.32-14) UNRELEASED; urgency=low * [x86] Disable e_powersaver cpufreq driver as unsafe. It has already been blacklisted by cpufrequtils. The acpi-cpufreq driver can be used instead on some VIA C7 systems. (Closes: #566208) + * nouveau: Fix fbcon corruption with font width not divisible by 8 + (Closes: #583162) [ Bastian Blank ] * Update Xen patch. diff --git a/debian/patches/bugfix/all/drm-nouveau-Fix-fbcon-corruption-with-font-width-not.patch b/debian/patches/bugfix/all/drm-nouveau-Fix-fbcon-corruption-with-font-width-not.patch new file mode 100644 index 000000000..33d87e7e8 --- /dev/null +++ b/debian/patches/bugfix/all/drm-nouveau-Fix-fbcon-corruption-with-font-width-not.patch @@ -0,0 +1,58 @@ +From: Marcin Koƛcielnicki +Date: Sat, 27 Feb 2010 18:13:35 +0000 +Subject: [PATCH] drm/nouveau: Fix fbcon corruption with font width not divisible by 8 + +commit c82b88d578847909797945824851a6a9a84f9c20 upstream. + +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 +Signed-off-by: Francisco Jerez +Signed-off-by: Ben Skeggs +--- + 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 3da90c2..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 = ALIGN(image->width, 32); +- 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 993c712..25a3cd8 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 + diff --git a/debian/patches/bugfix/all/drm-nouveau-use-ALIGN-instead-of-open-coding-it.patch b/debian/patches/bugfix/all/drm-nouveau-use-ALIGN-instead-of-open-coding-it.patch new file mode 100644 index 000000000..e10b1ee67 --- /dev/null +++ b/debian/patches/bugfix/all/drm-nouveau-use-ALIGN-instead-of-open-coding-it.patch @@ -0,0 +1,57 @@ +From: Matt Turner +Date: Wed, 24 Feb 2010 23:27:10 -0500 +Subject: [PATCH] drm/nouveau: use ALIGN instead of open coding it + +commit 3bfc7d22d0400e85a93e835d4398dcbe0af68b0b upstream. + +CC: Ben Skeggs +Signed-off-by: Matt Turner +Signed-off-by: Ben Skeggs +--- + drivers/gpu/drm/nouveau/nv04_fbcon.c | 2 +- + drivers/gpu/drm/nouveau/nv50_fbcon.c | 2 +- + drivers/gpu/drm/nouveau/nv50_instmem.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/nouveau/nv04_fbcon.c b/drivers/gpu/drm/nouveau/nv04_fbcon.c +index fd01caa..3da90c2 100644 +--- a/drivers/gpu/drm/nouveau/nv04_fbcon.c ++++ b/drivers/gpu/drm/nouveau/nv04_fbcon.c +@@ -118,7 +118,7 @@ nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) + return; + } + +- width = (image->width + 31) & ~31; ++ width = ALIGN(image->width, 32); + dsize = (width * image->height) >> 5; + + if (info->fix.visual == FB_VISUAL_TRUECOLOR || +diff --git a/drivers/gpu/drm/nouveau/nv50_fbcon.c b/drivers/gpu/drm/nouveau/nv50_fbcon.c +index 0f57cdf..993c712 100644 +--- a/drivers/gpu/drm/nouveau/nv50_fbcon.c ++++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c +@@ -109,7 +109,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) + return; + } + +- width = (image->width + 31) & ~31; ++ width = ALIGN(image->width, 32); + dwords = (width * image->height) >> 5; + + BEGIN_RING(chan, NvSub2D, 0x0814, 2); +diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c +index f0dc4e3..de1f5b0 100644 +--- a/drivers/gpu/drm/nouveau/nv50_instmem.c ++++ b/drivers/gpu/drm/nouveau/nv50_instmem.c +@@ -390,7 +390,7 @@ nv50_instmem_populate(struct drm_device *dev, struct nouveau_gpuobj *gpuobj, + if (gpuobj->im_backing) + return -EINVAL; + +- *sz = (*sz + (NV50_INSTMEM_PAGE_SIZE-1)) & ~(NV50_INSTMEM_PAGE_SIZE-1); ++ *sz = ALIGN(*sz, NV50_INSTMEM_PAGE_SIZE); + if (*sz == 0) + return -EINVAL; + +-- +1.7.1 + diff --git a/debian/patches/series/14 b/debian/patches/series/14 index 6eab0d292..c2c9e5762 100644 --- a/debian/patches/series/14 +++ b/debian/patches/series/14 @@ -14,3 +14,5 @@ + bugfix/all/drm-i915-use-pipe_control-instruction-on-ironlake-and-sandy-bridge.patch + bugfix/all/drm-i915-fix-non-ironlake-965-class-crashes.patch + bugfix/all/drm-i915-disable-fbc-on-915gm-and-945gm.patch ++ bugfix/all/drm-nouveau-use-ALIGN-instead-of-open-coding-it.patch ++ bugfix/all/drm-nouveau-Fix-fbcon-corruption-with-font-width-not.patch