* [patch 1/1] intelfb-voffset
@ 2005-05-27 22:09 sylvain.meyer
2005-05-27 22:50 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: sylvain.meyer @ 2005-05-27 22:09 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: akpm, adaplas, sylvain.meyer
From: Sylvain Meyer <sylvain.meyer@worldonline.fr>
- Add voffset option to avoid conficts with Xorg i810 driver
- Remove __initdata from module param variables
Signed-off-by: Sylvain Meyer <sylvain.meyer@worldonline.fr>
---
linux-2.6.12-rc4-root/drivers/video/intelfb/intelfbdrv.c | 38 +++++++++------
1 files changed, 23 insertions(+), 15 deletions(-)
diff -puN drivers/video/intelfb/intelfbdrv.c~intelfb-voffset drivers/video/intelfb/intelfbdrv.c
--- linux-2.6.12-rc4/drivers/video/intelfb/intelfbdrv.c~intelfb-voffset 2005-05-27 23:55:33.000000000 +0200
+++ linux-2.6.12-rc4-root/drivers/video/intelfb/intelfbdrv.c 2005-05-28 00:01:20.000000000 +0200
@@ -228,22 +228,25 @@ MODULE_DESCRIPTION(
MODULE_LICENSE("Dual BSD/GPL");
MODULE_DEVICE_TABLE(pci, intelfb_pci_table);
-static int accel __initdata = 1;
-static int vram __initdata = 4;
-static int hwcursor __initdata = 1;
-static int mtrr __initdata = 1;
-static int fixed __initdata = 0;
-static int noinit __initdata = 0;
-static int noregister __initdata = 0;
-static int probeonly __initdata = 0;
-static int idonly __initdata = 0;
-static int bailearly __initdata = 0;
-static char *mode __initdata = NULL;
+static int accel = 1;
+static int vram = 4;
+static int voffset = 48;
+static int hwcursor = 1;
+static int mtrr = 1;
+static int fixed = 0;
+static int noinit = 0;
+static int noregister = 0;
+static int probeonly = 0;
+static int idonly = 0;
+static int bailearly = 0;
+static char *mode = NULL;
module_param(accel, bool, S_IRUGO);
MODULE_PARM_DESC(accel, "Enable console acceleration");
module_param(vram, int, S_IRUGO);
MODULE_PARM_DESC(vram, "System RAM to allocate to framebuffer in MiB");
+module_param(voffset, int, S_IRUGO);
+MODULE_PARM_DESC(voffset, "Offset of framebuffer in MiB");
module_param(hwcursor, bool, S_IRUGO);
MODULE_PARM_DESC(hwcursor, "Enable HW cursor");
module_param(mtrr, bool, S_IRUGO);
@@ -503,6 +506,7 @@ intelfb_pci_register(struct pci_dev *pde
struct agp_bridge_data *bridge;
int aperture_bar = 0;
int mmio_bar = 1;
+ int offset;
DBG_MSG("intelfb_pci_register\n");
@@ -659,17 +663,21 @@ intelfb_pci_register(struct pci_dev *pde
return -ENODEV;
}
+ if (MB(voffset) < stolen_size)
+ offset = (stolen_size >> 12);
+ else
+ offset = ROUND_UP_TO_PAGE(MB(voffset))/GTT_PAGE_SIZE;
+
/* set the mem offsets - set them after the already used pages */
if (dinfo->accel) {
- dinfo->ring.offset = (stolen_size >> 12)
- + gtt_info.current_memory;
+ dinfo->ring.offset = offset + gtt_info.current_memory;
}
if (dinfo->hwcursor) {
- dinfo->cursor.offset = (stolen_size >> 12) +
+ dinfo->cursor.offset = offset +
+ gtt_info.current_memory + (dinfo->ring.size >> 12);
}
if (dinfo->fbmem_gart) {
- dinfo->fb.offset = (stolen_size >> 12) +
+ dinfo->fb.offset = offset +
+ gtt_info.current_memory + (dinfo->ring.size >> 12)
+ (dinfo->cursor.size >> 12);
}
_
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 1/1] intelfb-voffset
2005-05-27 22:09 [patch 1/1] intelfb-voffset sylvain.meyer
@ 2005-05-27 22:50 ` Andrew Morton
2005-05-28 9:02 ` Sylvain Meyer
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2005-05-27 22:50 UTC (permalink / raw)
Cc: linux-fbdev-devel, adaplas, sylvain.meyer
sylvain.meyer@worldonline.fr wrote:
>
> - Add voffset option to avoid conficts with Xorg i810 driver
Please provide more info.
- How does it "avoid conflicts"?
- How is the user to know that he needs to provide this module parameter?
- Is it not possible to prevent these "conflicts" without the use of a
module parameter?
IOW: it's really a cop-out to require that the user know about some obscure
module parameter to be able to amke their system work correctly. We
really, really want these things to "just work".
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Re: [patch 1/1] intelfb-voffset
2005-05-27 22:50 ` Andrew Morton
@ 2005-05-28 9:02 ` Sylvain Meyer
0 siblings, 0 replies; 3+ messages in thread
From: Sylvain Meyer @ 2005-05-28 9:02 UTC (permalink / raw)
To: linux-fbdev-devel
Andrew Morton a écrit:
>sylvain.meyer@worldonline.fr wrote:
>
>
>>- Add voffset option to avoid conficts with Xorg i810 driver
>>
>>
>
>Please provide more info.
>
>- How does it "avoid conflicts"?
>
It avoids conflicts in using memory allocations for framebuffer, hw
cursor and ring buffer which cannot be corrupted by the X driver. The
problem seems to be the exclusive use of BIOS calls in the X driver
instead of direct access to the hardware as in the intelfb driver. I
don't know what the BIOS do but i can see the corruption. In the X
driver, the BIOS is called to increase the stolen memory (part of the
aperture memory already allocated by the BIOS) if it is too small. I
think it's part of the problem.
>
>- How is the user to know that he needs to provide this module parameter?
>
The default parameter should be ok with default configuration of the
X driver. If VideoRam parameter is increased in xorg.conf, maybe a
different voffset should be passed to the linux kernel (now VideoRam
defaults to 32MB, voffset to 48 MB).
Anyway, if i have spare time this week-end, i'll come with a small
doc. Just to to know, i borrowed this idea to the i810 driver, so the
parameter is already in use today.
>
>- Is it not possible to prevent these "conflicts" without the use of a
> module parameter?
>
If i had the datasheet of the chips, maybe but now without lobbying
Intel and working blind, my answer is no. Sorry.
>IOW: it's really a cop-out to require that the user know about some obscure
>module parameter to be able to amke their system work correctly. We
>really, really want these things to "just work".
>
>
Yes, I share your concern but now I don't know how to do it.
Sylvain
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-05-28 9:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-27 22:09 [patch 1/1] intelfb-voffset sylvain.meyer
2005-05-27 22:50 ` Andrew Morton
2005-05-28 9:02 ` Sylvain Meyer
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).