Skip to contentSkip to conversation

X and intelfb fight over videomode

DISCUSSION David Härdeman 2 participants 9 messages Nov 17, 2005 – Nov 18, 2005 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

Using the information from this thread:
http://marc.theaimsgroup.com/?t=112593256400003&r=1&w=2

I've now compiled a kernel with the intelfb and fbcon drivers linked in (no other fb drivers). By booting the kernel with vga=0x318 I get a 1024x768@16bpp console and drm/agp also seems happy.

However, as soon as X starts, the following message is printed to the kernel log:

mtrr: base(0xe0020000) is not aligned on a size(0x300000) boundary [drm:drm_unlock] *ERROR* Process 3013 using kernel context 0

Everything seems to work in X though. The first time that I switch from X to a vc, the screen stays black for a few seconds before I get the VC and then I get this:

intelfb: Changing the video mode is not supported.
intelfb: ring buffer : space: 61488 wanted 65472
intelfb: lockup - turning off hardware acceleration

I have X set to also use 1024x768@16bpp, what else do I need to do to make sure that intelfb and X play nice together?

Re,
David

PS
Please CC me on any replies

#1 lore raw
Quoted 17 lines · David Härdeman

Using the information from this thread:
http://marc.theaimsgroup.com/?t=112593256400003&r=1&w=2

I've now compiled a kernel with the intelfb and fbcon drivers linked in (no other fb drivers). By booting the kernel with vga=0x318 I get a 1024x768@16bpp console and drm/agp also seems happy.

However, as soon as X starts, the following message is printed to the kernel log:

mtrr: base(0xe0020000) is not aligned on a size(0x300000) boundary [drm:drm_unlock] *ERROR* Process 3013 using kernel context 0

Everything seems to work in X though. The first time that I switch from X to a vc, the screen stays black for a few seconds before I get the VC and then I get this:

Quoted 7 lines

intelfb: Changing the video mode is not supported.
intelfb: ring buffer : space: 61488 wanted 65472
intelfb: lockup - turning off hardware acceleration

I have X set to also use 1024x768@16bpp, what else do I need to do to make sure that intelfb and X play nice together?

Try booting with video=intelfb:1024x768-16@60,mtrr=0. Do not include the vga=0x318 option. This prevents intelfb from changing the videomode.

Tony

#2 lore raw
Quoted 5 lines · Antonino A. Daplas
Quoted 1 line · David Härdeman

intelfb: Changing the video mode is not supported.

Try booting with video=intelfb:1024x768-16@60,mtrr=0. Do not include the vga=0x318 option. This prevents intelfb from changing the videomode.

It seems that intelfb can't change it no matter what....booting with video=intelfb:1024x768-16@60,mtrr=0 gives me the usual vga console and no framebuffer. The following is printed during boot:

[...]
Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected an Intel 855 Chipset.
agpgart: Detected 8060K stolen memory.
agpgart: AGP aperture is 128M @ 0xe0000000
[drm] Initialized drm 1.0.0 20040925
intelfb: Framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G/915G chipsets
intelfb: Version 0.9.2
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:02.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11
intelfb: 00:02.0: Intel(R) 852GM, aperture size 128MB, stolen memory 8060kB
intelfb: Non-CRT device is enabled ( LVDS port ). Disabling mode switching.
intelfb: Video mode must be programmed at boot time.
[...]

On the other hand, the vga=0x318 gives a 1024x768 console (and the vc <-> X fight) with the following messages during boot:

[...]
Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected an Intel 855 Chipset.
agpgart: Detected 8060K stolen memory.
agpgart: AGP aperture is 128M @ 0xe0000000
[drm] Initialized drm 1.0.0 20040925
intelfb: Framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G/915G chipsets
intelfb: Version 0.9.2
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:02.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11
intelfb: 00:02.0: Intel(R) 852GM, aperture size 128MB, stolen memory 8060kB
intelfb: Non-CRT device is enabled ( LVDS port ). Disabling mode switching.
intelfb: Initial video mode is 1024x768-32@60.
intelfb: Changing the video mode is not supported.
Console: switching to colour frame buffer device 128x48
[...]

(I tried X in 1024x768-32bpp after seeing the messages from the vga=... boot but the problems remained)

Suggestions?

//David

#3 lore raw
Quoted 11 lines · David Härdeman
Quoted 5 lines · Antonino A. Daplas
Quoted 1 line · David Härdeman

intelfb: Changing the video mode is not supported.

Try booting with video=intelfb:1024x768-16@60,mtrr=0. Do not include the vga=0x318 option. This prevents intelfb from changing the videomode.

It seems that intelfb can't change it no matter what....booting with video=intelfb:1024x768-16@60,mtrr=0 gives me the usual vga console and no framebuffer. The following is printed during boot:

Ah, okay, you have a flatpanel display, so you really need vesa to program the mode.

Quoted 2 lines

Suggestions?

The main problem is that when check_var fails, set_par is not called which means that the ringbuffer is not set up correctly after switching from X.

Try this first, then we'll think of a definitive solution later.

Open drivers/video/intelfb/intelfbdrv.c and look at intelfb_check_var().

Look for this particular snippet...

	if (FIXED_MODE(dinfo) &&
	    (change_var ||
	     var->yres_virtual > dinfo->initial_var.yres_virtual ||
	     var->yres_virtual < dinfo->initial_var.yres ||
	     var->xoffset || var->nonstd)) {
		if (first) {
			ERR_MSG("Changing the video mode is not supported.\n");
			first = 0;
		}
		return -EINVAL;
	}

And then insert a line so it looks like this:

	if (FIXED_MODE(dinfo) &&
	    (change_var ||
	     var->yres_virtual > dinfo->initial_var.yres_virtual ||
	     var->yres_virtual < dinfo->initial_var.yres ||
	     var->xoffset || var->nonstd)) {
		if (first) {
			ERR_MSG("Changing the video mode is not supported.\n");
			first = 0;
		}
		intelfb_set_par(info); /* insert this line */
		return -EINVAL;
	}
#4 lore raw
In reply to David Härdeman
Quoted 6 lines · David Härdeman
Quoted 2 lines · Antonino A. Daplas
Quoted 1 line · David Härdeman

intelfb: Changing the video mode is not supported.

Suggestions?

Ignore the hack I mentioned in the previous thread. Try this patch instead.

Tony

drivers/video/intelfb/intelfbdrv.c +8 -0
@@ -1283,6 +1283,14 @@ intelfb_set_par(struct fb_info *info)
 
 	if (FIXED_MODE(dinfo)) {
 		ERR_MSG("Changing the video mode is not supported.\n");
+
+		/* 
+		 * We need to at least initialize the 2D engine even
+		 * if changing the mode is not allowed
+		 */
+		if (ACCEL(dinfo, info))
+			intelfbhw_2d_start(dinfo);
+
 		return -EINVAL;
 	}
 
#5 lore raw
Quoted 1 line · Antonino A. Daplas

Ignore the hack I mentioned in the previous thread. Try this patch instead.

Didn't help, the messages remain the same (tried with vga=0x318 and video=intelfb:1024x768-32@60,mtrr=0 vga=0x318).

Boot:
intelfb: 00:02.0: Intel(R) 852GM, aperture size 128MB, stolen memory 8060kB
intelfb: Non-CRT device is enabled ( LVDS port ). Disabling mode switching.
intelfb: Initial video mode is 1024x768-32@60.
intelfb: Changing the video mode is not supported.
Console: switching to colour frame buffer device 128x48

Starting X:
mtrr: base(0xe0020000) is not aligned on a size(0x300000) boundary [drm:drm_unlock] *ERROR* Process 2976 using kernel context 0

First time I switch from X to VC:
intelfb: Changing the video mode is not supported.
intelfb: ring buffer : space: 6024 wanted 65472
intelfb: lockup - turning off hardware acceleration

Other suggestions?

//David

#6 lore raw
Quoted 15 lines · David Härdeman
Quoted 2 lines · Antonino A. Daplas

Ignore the hack I mentioned in the previous thread. Try this patch instead.

Didn't help, the messages remain the same (tried with vga=0x318 and video=intelfb:1024x768-32@60,mtrr=0 vga=0x318).

Boot:
intelfb: 00:02.0: Intel(R) 852GM, aperture size 128MB, stolen memory 8060kB
intelfb: Non-CRT device is enabled ( LVDS port ). Disabling mode switching.
intelfb: Initial video mode is 1024x768-32@60.
intelfb: Changing the video mode is not supported.
Console: switching to colour frame buffer device 128x48

Quoted 9 lines

Starting X:
mtrr: base(0xe0020000) is not aligned on a size(0x300000) boundary [drm:drm_unlock] *ERROR* Process 2976 using kernel context 0

First time I switch from X to VC:
intelfb: Changing the video mode is not supported.
intelfb: ring buffer : space: 6024 wanted 65472
intelfb: lockup - turning off hardware acceleration

Well, intelfb is at the mercy of X if it's in 'fixed mode'.

Quoted 1 line

Other suggestions?

I'm adding Sylvain, the intelfb maintainer, to the CC list.

How about this one? It also resets the ringbuffer before re-initializing it again.

Tony

drivers/video/intelfb/intelfbdrv.c +10 -0
index 427689e..f1e7778 100644
@@ -1283,6 +1283,16 @@ intelfb_set_par(struct fb_info *info)
 
 	if (FIXED_MODE(dinfo)) {
 		ERR_MSG("Changing the video mode is not supported.\n");
+
+		/* 
+		 * We need to at least initialize the 2D engine even
+		 * if changing the mode is not allowed
+		 */
+		if (ACCEL(dinfo, info)) {
+			intelfbhw_2d_stop(dinfo);
+			intelfbhw_2d_start(dinfo);
+		}
+
 		return -EINVAL;
 	}
 
#7 lore raw
Quoted 7 lines · Antonino A. Daplas
Quoted 5 lines · David Härdeman

First time I switch from X to VC:
intelfb: Changing the video mode is not supported.
intelfb: ring buffer : space: 6024 wanted 65472
intelfb: lockup - turning off hardware acceleration

Quoted 8 lines

Well, intelfb is at the mercy of X if it's in 'fixed mode'.

Quoted 1 line

Other suggestions?

I'm adding Sylvain, the intelfb maintainer, to the CC list.

How about this one? It also resets the ringbuffer before re-initializing it again.

That made no change at all unfortunately, the messages are exactly the same as before...

//David

#8 lore raw
Quoted 12 lines · David Härdeman
Quoted 11 lines · Antonino A. Daplas
Quoted 5 lines · David Härdeman

First time I switch from X to VC:
intelfb: Changing the video mode is not supported.
intelfb: ring buffer : space: 6024 wanted 65472
intelfb: lockup - turning off hardware acceleration

Well, intelfb is at the mercy of X if it's in 'fixed mode'.

Quoted 1 line

Other suggestions?

Quoted 7 lines
Quoted 4 lines

I'm adding Sylvain, the intelfb maintainer, to the CC list.

How about this one? It also resets the ringbuffer before re-initializing it again.

That made no change at all unfortunately, the messages are exactly the same as before...

That's the limit to what I can do (I don't have the hardware) and let's just wait for the maintainer to respond.

For now, you can eliminate that message by turning acceleration off.

video=intelfb:accel:0

Another solution is to disable direct rendering, but I don't think you want that.

Tony

PS: I saw this problem before with i810fb, and this is because the i810 driver of X and i810fb shared the same ringbuffer. But the i810 chipset has 2 ringbuffers, so I just made i810fb use the ringbuffer that is not touched by X/DRI. (I don't know the status now since I don't have this chipset anymore). That is one solution.