linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erik-Jan <ej.lfs@xs4all.nl>
To: linux-fbdev@vger.kernel.org
Subject: Re: PROBLEM: loading viafb module turns screen to black on VN896
Date: Sat, 02 Jan 2010 22:25:48 +0000	[thread overview]
Message-ID: <4B3FC7EC.604@xs4all.nl> (raw)
In-Reply-To: <4B2E133B.9060502@web.de>

[-- Attachment #1: Type: text/plain, Size: 980 bytes --]

Julian Wollrath wrote:
 > Hi,
 >
 > since I switched from 2.6.31.8 to 2.6.32.2 loading the viafb module
 > turns the screen to black, there is no graphic output on the screen 
anymore.

I had the same sort of problem with CLE266. Only I didn't get a black 
screen, but a scrambled-up screen, as if the timings were wrong.
Not surprisingly, it all has to do with the 2D engine rewrite (around 
commit c3e25673843153ea75fda79a47cf12f10a25ca37) that has been done in 
2.6.32.

I found a few small things in the initialization of the framebuffer, 
that were present in 2.6.31 but removed in 2.6.32.
Attached a patch that puts these changes back in. I don't know if I've 
done some bad things (never done any kernel coding before) nor if it is 
OK for all the different VIA hardware out there, but on my CLE266 it now 
works as before.

The changes to accel.c are needed for a correct boot; the other changes 
are needed for changing the framebuffer mode with fbset.

Bye,
Erik-Jan




[-- Attachment #2: linux-2.6.32.2-viafb.patch --]
[-- Type: text/plain, Size: 2360 bytes --]

diff -Naur linux-2.6.32.2-orig/drivers/video/via/accel.c linux-2.6.32.2/drivers/video/via/accel.c
--- linux-2.6.32.2-orig/drivers/video/via/accel.c	2009-12-31 00:38:03.000000000 +0100
+++ linux-2.6.32.2/drivers/video/via/accel.c	2009-12-31 00:38:23.000000000 +0100
@@ -137,7 +137,7 @@
 			tmp, dst_pitch);
 		return -EINVAL;
 	}
-	tmp = (tmp >> 3) | (dst_pitch << (16 - 3));
+	tmp = VIA_PITCH_ENABLE | (tmp >> 3) | (dst_pitch << (16 - 3));
 	writel(tmp, engine + 0x38);
 
 	if (op == VIA_BITBLT_FILL)
@@ -352,6 +352,9 @@
 	viapar->shared->vq_vram_addr = viapar->fbmem_free;
 	viapar->fbmem_used += VQ_SIZE;
 
+	/* Init 2D engine reg to reset 2D engine */
+	writel(0x0, engine + VIA_REG_KEYCONTROL);
+
 	/* Init AGP and VQ regs */
 	switch (chip_name) {
 	case UNICHROME_K8M890:
diff -Naur linux-2.6.32.2-orig/drivers/video/via/hw.c linux-2.6.32.2/drivers/video/via/hw.c
--- linux-2.6.32.2-orig/drivers/video/via/hw.c	2009-12-18 23:27:07.000000000 +0100
+++ linux-2.6.32.2/drivers/video/via/hw.c	2010-01-01 19:04:30.000000000 +0100
@@ -2348,6 +2348,7 @@
 		}
 	}
 
+	viafb_update_fix(viafbinfo);
 	viafb_set_primary_pitch(viafbinfo->fix.line_length);
 	viafb_set_secondary_pitch(viafb_dual_fb ? viafbinfo1->fix.line_length
 		: viafbinfo->fix.line_length);
diff -Naur linux-2.6.32.2-orig/drivers/video/via/viafbdev.c linux-2.6.32.2/drivers/video/via/viafbdev.c
--- linux-2.6.32.2-orig/drivers/video/via/viafbdev.c	2009-12-18 23:27:07.000000000 +0100
+++ linux-2.6.32.2/drivers/video/via/viafbdev.c	2010-01-01 19:03:21.000000000 +0100
@@ -54,7 +54,7 @@
 static struct fb_ops viafb_ops;
 
 
-static void viafb_update_fix(struct fb_info *info)
+void viafb_update_fix(struct fb_info *info)
 {
 	u32 bpp = info->var.bits_per_pixel;
 
diff -Naur linux-2.6.32.2-orig/drivers/video/via/viafbdev.h linux-2.6.32.2/drivers/video/via/viafbdev.h
--- linux-2.6.32.2-orig/drivers/video/via/viafbdev.h	2009-12-18 23:27:07.000000000 +0100
+++ linux-2.6.32.2/drivers/video/via/viafbdev.h	2010-01-01 19:03:42.000000000 +0100
@@ -99,6 +99,7 @@
 void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
 			  int mode_index);
 int viafb_get_mode_index(int hres, int vres);
+void viafb_update_fix(struct fb_info *info);
 u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
 	*plvds_setting_info, struct lvds_chip_information
 	*plvds_chip_info, u8 index);

  parent reply	other threads:[~2010-01-02 22:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-20 12:06 PROBLEM: loading viafb module turns screen to black on VN896 Julian Wollrath
2009-12-20 13:33 ` Florian Tobias Schandinat
2010-01-02 22:25 ` Erik-Jan [this message]
2010-01-04 19:37 ` Florian Tobias Schandinat
2010-01-05 21:41 ` Erik-Jan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B3FC7EC.604@xs4all.nl \
    --to=ej.lfs@xs4all.nl \
    --cc=linux-fbdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).