* [PATCH] 2.5.5-pre1 fix build error in drivers/video/vesafb.c
@ 2002-02-14 15:47 Steven Cole
2002-02-14 16:37 ` Gerd Knorr
0 siblings, 1 reply; 3+ messages in thread
From: Steven Cole @ 2002-02-14 15:47 UTC (permalink / raw)
To: linux-kernel; +Cc: Gerd Knorr
Hello all,
This patch is some hackery-quackery to fix a problem with drivers/video/vesafb.c.
I got the following error building 2.5.5-pre1. I also had this error with 2.5.4-preX,
but after seeing the discussions relating to bus_to_virt etc., I hoped that a
real fix would appear.
drivers/video/video.o: In function `vesafb_init':
drivers/video/video.o(.text.init+0x154b): undefined reference to `bus_to_virt_not_defined_use_pci_map'
make: *** [vmlinux] Error 1
Quoting Andrew Morton in his recent interview with kerneltrap.org,
"One hot tip: if you spot a bug which is being ignored, send a completely botched fix
to the mailing list. This causes thousands of kernel developers to rally to the cause.
Nobody knows why this happens. (I really have deliberately done this several times. It works)."
Well this bug is certainly not being ignored, but here is my completely botched fix.
Cheers,
Steven
--- linux-2.5.5-pre1/drivers/video/vesafb.c.orig Thu Feb 14 08:16:25 2002
+++ linux-2.5.5-pre1/drivers/video/vesafb.c Thu Feb 14 08:17:24 2002
@@ -550,7 +550,7 @@
ypan = pmi_setpal = 0; /* not available or some DOS TSR ... */
if (ypan || pmi_setpal) {
- pmi_base = (unsigned short*)bus_to_virt(((unsigned long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off);
+ pmi_base = (unsigned short*)phys_to_virt(((unsigned long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off);
pmi_start = (void*)((char*)pmi_base + pmi_base[1]);
pmi_pal = (void*)((char*)pmi_base + pmi_base[2]);
printk(KERN_INFO "vesafb: pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] 2.5.5-pre1 fix build error in drivers/video/vesafb.c
2002-02-14 15:47 [PATCH] 2.5.5-pre1 fix build error in drivers/video/vesafb.c Steven Cole
@ 2002-02-14 16:37 ` Gerd Knorr
2002-02-14 17:02 ` Steven Cole
0 siblings, 1 reply; 3+ messages in thread
From: Gerd Knorr @ 2002-02-14 16:37 UTC (permalink / raw)
To: Steven Cole; +Cc: linux-kernel
> - pmi_base = (unsigned short*)bus_to_virt(((unsigned long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off);
> + pmi_base = (unsigned short*)phys_to_virt(((unsigned long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off);
Looks fine to me. While s/bus/phys/ isn't the approximate fix for many
drivers, at this place it is correct. The address is a segment:offset
pointer to a physical memory address somewhere in the VESA BIOS.
Gerd
--
Man muß die Software wacker hüten
weil in der Welt die Hacker wüten
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] 2.5.5-pre1 fix build error in drivers/video/vesafb.c
2002-02-14 16:37 ` Gerd Knorr
@ 2002-02-14 17:02 ` Steven Cole
0 siblings, 0 replies; 3+ messages in thread
From: Steven Cole @ 2002-02-14 17:02 UTC (permalink / raw)
To: Gerd Knorr, Steven Cole
Cc: linux-kernel, Martin Dalecki, Alan Cox, Linus Torvalds
On Thursday 14 February 2002 09:37 am, Gerd Knorr wrote:
> > - pmi_base = (unsigned short*)bus_to_virt(((unsigned
> > long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off); +
> > pmi_base = (unsigned short*)phys_to_virt(((unsigned
> > long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off);
>
> Looks fine to me. While s/bus/phys/ isn't the approximate fix for many
> drivers, at this place it is correct. The address is a segment:offset
> pointer to a physical memory address somewhere in the VESA BIOS.
>
> Gerd
Thanks. Do to some cut-and-paste haste, my original patch converted tabs
to spaces, so that patch won't apply. Here is a correct version for anyone
wanting to use it. Also, my net connnection was down this morning, so I failed
to see the other recent thread about this subject, [PATCH} 2.5.5-pre1 VESA fb.
Adding those correspondents to the cc list.
Steven
--- linux-2.5.5-pre1/drivers/video/vesafb.c.orig Thu Feb 14 08:16:25 2002
+++ linux-2.5.5-pre1/drivers/video/vesafb.c Thu Feb 14 08:17:24 2002
@@ -550,7 +550,7 @@
ypan = pmi_setpal = 0; /* not available or some DOS TSR ... */
if (ypan || pmi_setpal) {
- pmi_base = (unsigned short*)bus_to_virt(((unsigned long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off);
+ pmi_base = (unsigned short*)phys_to_virt(((unsigned long)screen_info.vesapm_seg << 4) + screen_info.vesapm_off);
pmi_start = (void*)((char*)pmi_base + pmi_base[1]);
pmi_pal = (void*)((char*)pmi_base + pmi_base[2]);
printk(KERN_INFO "vesafb: pmi: set display start = %p, set palette = %p\n",pmi_start,pmi_pal);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-02-14 17:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-14 15:47 [PATCH] 2.5.5-pre1 fix build error in drivers/video/vesafb.c Steven Cole
2002-02-14 16:37 ` Gerd Knorr
2002-02-14 17:02 ` Steven Cole
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®