public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* X and intelfb fight over videomode
@ 2005-11-17  0:01 David Härdeman
  2005-11-17  1:11 ` Antonino A. Daplas
  0 siblings, 1 reply; 9+ messages in thread
From: David Härdeman @ 2005-11-17  0:01 UTC (permalink / raw)
  To: linux-kernel

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X and intelfb fight over videomode
  2005-11-17  0:01 X and intelfb fight over videomode David Härdeman
@ 2005-11-17  1:11 ` Antonino A. Daplas
  2005-11-17  1:45   ` David Härdeman
  0 siblings, 1 reply; 9+ messages in thread
From: Antonino A. Daplas @ 2005-11-17  1:11 UTC (permalink / raw)
  To: David Härdeman; +Cc: linux-kernel

David Härdeman wrote:
> 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?
> 

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X and intelfb fight over videomode
  2005-11-17  1:11 ` Antonino A. Daplas
@ 2005-11-17  1:45   ` David Härdeman
  2005-11-17  2:03     ` Antonino A. Daplas
  2005-11-17  4:49     ` Antonino A. Daplas
  0 siblings, 2 replies; 9+ messages in thread
From: David Härdeman @ 2005-11-17  1:45 UTC (permalink / raw)
  To: Antonino A. Daplas; +Cc: linux-kernel

On Thu, Nov 17, 2005 at 09:11:53AM +0800, Antonino A. Daplas wrote:
>David Härdeman wrote:
>> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X and intelfb fight over videomode
  2005-11-17  1:45   ` David Härdeman
@ 2005-11-17  2:03     ` Antonino A. Daplas
  2005-11-17  4:49     ` Antonino A. Daplas
  1 sibling, 0 replies; 9+ messages in thread
From: Antonino A. Daplas @ 2005-11-17  2:03 UTC (permalink / raw)
  To: David Härdeman; +Cc: linux-kernel

David Härdeman wrote:
> On Thu, Nov 17, 2005 at 09:11:53AM +0800, Antonino A. Daplas wrote:
>> David Härdeman wrote:
>>> 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.


> 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;
	}


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X and intelfb fight over videomode
  2005-11-17  1:45   ` David Härdeman
  2005-11-17  2:03     ` Antonino A. Daplas
@ 2005-11-17  4:49     ` Antonino A. Daplas
  2005-11-17 23:45       ` David Härdeman
  1 sibling, 1 reply; 9+ messages in thread
From: Antonino A. Daplas @ 2005-11-17  4:49 UTC (permalink / raw)
  To: David Härdeman; +Cc: linux-kernel

David Härdeman wrote:
> On Thu, Nov 17, 2005 at 09:11:53AM +0800, Antonino A. Daplas wrote:
>> David Härdeman wrote:
>>> intelfb: Changing the video mode is not supported.
> 
> 
> Suggestions?

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

Tony

--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -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;
 	}
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X and intelfb fight over videomode
  2005-11-17  4:49     ` Antonino A. Daplas
@ 2005-11-17 23:45       ` David Härdeman
  2005-11-18  1:08         ` Antonino A. Daplas
  0 siblings, 1 reply; 9+ messages in thread
From: David Härdeman @ 2005-11-17 23:45 UTC (permalink / raw)
  To: Antonino A. Daplas; +Cc: Linux Kernel Mailing List

On Thu, Nov 17, 2005 at 12:49:54PM +0800, Antonino A. Daplas wrote:
>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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X and intelfb fight over videomode
  2005-11-17 23:45       ` David Härdeman
@ 2005-11-18  1:08         ` Antonino A. Daplas
  2005-11-18 18:36           ` David Härdeman
  0 siblings, 1 reply; 9+ messages in thread
From: Antonino A. Daplas @ 2005-11-18  1:08 UTC (permalink / raw)
  To: David Härdeman; +Cc: Linux Kernel Mailing List, Sylvain Meyer

David Härdeman wrote:
> On Thu, Nov 17, 2005 at 12:49:54PM +0800, Antonino A. Daplas wrote:
>> 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
> 

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

> 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

diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 427689e..f1e7778 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -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;
 	}
 

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: X and intelfb fight over videomode
  2005-11-18  1:08         ` Antonino A. Daplas
@ 2005-11-18 18:36           ` David Härdeman
  2005-11-18 20:32             ` Antonino A. Daplas
  0 siblings, 1 reply; 9+ messages in thread
From: David Härdeman @ 2005-11-18 18:36 UTC (permalink / raw)
  To: Antonino A. Daplas; +Cc: Linux Kernel Mailing List, Sylvain Meyer

On Fri, Nov 18, 2005 at 09:08:26AM +0800, Antonino A. Daplas wrote:
>David Härdeman wrote:
>> 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'.
>
>> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: X and intelfb fight over videomode
  2005-11-18 18:36           ` David Härdeman
@ 2005-11-18 20:32             ` Antonino A. Daplas
  0 siblings, 0 replies; 9+ messages in thread
From: Antonino A. Daplas @ 2005-11-18 20:32 UTC (permalink / raw)
  To: David Härdeman; +Cc: Linux Kernel Mailing List, Sylvain Meyer

David Härdeman wrote:
> On Fri, Nov 18, 2005 at 09:08:26AM +0800, Antonino A. Daplas wrote:
>> David Härdeman wrote:
>>> 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'.
>>
>>> 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...

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-18 20:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-17  0:01 X and intelfb fight over videomode David Härdeman
2005-11-17  1:11 ` Antonino A. Daplas
2005-11-17  1:45   ` David Härdeman
2005-11-17  2:03     ` Antonino A. Daplas
2005-11-17  4:49     ` Antonino A. Daplas
2005-11-17 23:45       ` David Härdeman
2005-11-18  1:08         ` Antonino A. Daplas
2005-11-18 18:36           ` David Härdeman
2005-11-18 20:32             ` Antonino A. Daplas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox