Oh, I also have a quick little script for getting the latest version... check attachment.
EDIT: Before using... read the comments (goes without saying).
Oh, I also have a quick little script for getting the latest version... check attachment.
EDIT: Before using... read the comments (goes without saying).
Last edited by shadowdude1794; March 24th, 2009 at 07:24 AM.
Also, I got bored and edited the wiki. I added on an example file of a grub.cfg, as well as cleaned up some things.
I think it is all covered at rev 2036, not sure how far you got.. I have to checkout 2036 myself. EDIT 2043 now.
links -
bean123 #453
http://ubuntuforums.org/showpost.php...&postcount=453
-----
loadrom.diff was an addon
http://lists.gnu.org/archive/html/gr.../msg00314.html
-------
Updated grub wiki
http://grub.enbug.org/TestingOnMacbook
--------
SVN rev 2036 last related change by bean.
http://svn.savannah.gnu.org/viewvc?v...&revision=2036
boot module replaced by minicmd.
-----------------------
Last edited by pxwpxw; March 24th, 2009 at 12:11 PM.
svn rev 2043 patched loadrom.diff on imac81 x86_64 with ati fglrx.
I find loadrom needs time when called in menuentry, otherwise linux load fails or loadrom fails. So I had to use sleep.
Then it works very nicely with agp.
This is not apparent from command line with manual entry pauses.Code:insmod sleep menuentry "loadrom hd0,4 sda4" { search --set /ivt.bin loadrom /bios.bin /ivt.bin sleep 1 root=hd0,4 linux /vmlinuz root=/dev/sda4 video=vesafb initrd /initrd.img }
---------------------
Also posted on grub-devel list.
Last edited by pxwpxw; March 24th, 2009 at 03:24 PM.
Hi,
I have discovered the cause for screen distortion for intel agp driver. It's in drivers/char/agp/intel-agp.c, inside intel_i965_driver structure:
Remove .needs_scratch_page = true and recompile. The reason is that in bios mode, there is a 4K BIOS popup space, which doesn't exists in efi. Setting needs_scratch_page to true would mess up the gart table and therefore the screen. With this line gone, I can boot smoothly into console mode, although the x.org driver still needs to read bios, so loadbios is required as before.Code:static const struct agp_bridge_driver intel_i965_driver = { .owner = THIS_MODULE, .aperture_sizes = intel_i830_sizes, .size_type = FIXED_APER_SIZE, .num_aperture_sizes = 4, .needs_scratch_page = true, .configure = intel_i915_configure, .fetch_size = intel_i9xx_fetch_size, .cleanup = intel_i915_cleanup, .tlb_flush = intel_i810_tlbflush, .mask_memory = intel_i965_mask_memory, .masks = intel_i810_masks, .agp_enable = intel_i810_agp_enable, .cache_flush = global_cache_flush, .create_gatt_table = intel_i965_create_gatt_table, .free_gatt_table = intel_i830_free_gatt_table, .insert_memory = intel_i915_insert_entries, .remove_memory = intel_i915_remove_entries, .alloc_by_type = intel_i830_alloc_by_type, .free_by_type = intel_i810_free_by_type, .agp_alloc_page = agp_generic_alloc_page, .agp_destroy_page = agp_generic_destroy_page, .agp_type_to_mask_type = intel_i830_type_to_mask_type, .chipset_flush = intel_i915_chipset_flush, };
Besides intel_i965_driver, intel_810_driver,intel_830_driver,intel_915_driver ,intel_g33_driver all have needs_scratch_page set, others having such chipset can test if changing its value to false can solve the screen problem.
BTW, even without needs_scratch_page, bios mode boots ok.
Last edited by bean123; March 24th, 2009 at 04:09 PM.
Last edited by pxwpxw; March 24th, 2009 at 04:58 PM. Reason: effective
Thanks, but
I cant find it, wheres the source?
Tried -
xf86-video-intel-2.6.99.902
http://cgit.freedesktop.org/xorg/dri...6-video-intel/
Yeah, although with my new finding with agp, perhaps it would be better to just use fbdev. fbdev is easier to setup, works for every card, and have some 2d acceel. I'm running glxgears in agp enabled fbdev, it's about 1000 FPS, although not as smooth as pc mode.
Now I'm looking for a way to do the treaking in grub so that users don't need to patch their kernels.
It's in the kernel source, drivers/char/agp directory.I cant find it, wheres the source?
Tried -
xf86-video-intel-2.6.99.902
http://cgit.freedesktop.org/xorg/dri...6-video-intel/
EDIT: BTW, from your previous log files, I think your mb21 is 945 chipset, so you should change the intel_915_driver structure. mbp41 and mb81 don't use intel-agp though, but I guess the cause should be similar.
Last edited by bean123; March 24th, 2009 at 05:12 PM.
Hi,
I've found the real cause of this issue, it's actually caused by the wired gart layout in efi platform.
In pc mode, gart is a continuous block, frame buffer first, then 4K bios popup area.
But in efi mode, it's split into three blocks:Code:Gart Offset Physical Address 0x0000 - 0x3DFB => 0x3F000000 - 0x3FF7E000
The two range 0x0000 - 0x3DBF and 0x4000 - 0x7DBF mapped to the same physical address, changing either one of them would cause screen distortion. 0x8000 - 0x803F could be something similar to the bios popup area.Code:Gart Offset Physical Address 0x0000 - 0x3DBF => 0x3F000000 - 0x3FF6F000 0x3DC0 - 0x3FFF => Not used 0x4000 - 0x7DBF => 0x3F000000 - 0x3FF6F000 0x7DC0 - 0x7FFF => Not used 0x8000 - 0x803F => 0x3FF70000 - 0x3FF7F000
The gtt_entries member of agp_brige structure should be set to the number of gtt entries reserved. Linux calculates this value using aperture size plus the bios popup, this is correct for pc mode, but wrong for efi.
When needs_scratch_page is set, it initializes all the entries beyond gtt_entries to the scratch page address. In efi mode, all entries from 0x4000 is overwritten, this is the reason for screen distortion.
Therefore, setting needs_scratch_page to false doesn't really solve the problem, it just hides it. Entries from 0x4000 is still treated by system as free, so a latter agp allocation request could get the same range. To fix it properly, we need to increase the value of gtt_entries to include the whole area. In my case, we could do it like this:
3967 = 0x3DFC / 4 (pc mode reserved entries)Code:if (intel_private.gtt_entries == 3967) intel_private.gtt_entries = 8208;
8208 = 0x8040 / 4 (efi mode reserved entries)
This wouldn't break pc, as there is no harm reserving more page than necessary.
Unfortunately, this patch has to be done in linux side, which needs to change the gtt_entries calculation algorithm to account for the strange gart layout in efi platform.
Bookmarks