Fabrice FACORAT <[EMAIL PROTECTED]> writes:

> Unfortunately you do it ( upgrade to 2.4.9 emu10k1 driver ), and 
> unfortunately it breaks lot of thing. One example ? I can't play Diablo II 
> LOD under wine anymore. The same for Baldur's gate II. It was my biggest fear.
> 
> here is the error reporting by wine :
> err:midi:OSS_MidiInit ioctl on midi info for device 0 failed.

Would you be kind enough to recompile a kernel with the patch attached
and tell if it works then ?

-- 
"It's entirely untested, but it looks good and compiles. Ship it!"
                                                          --Linus

--- linux/drivers/sound/emu10k1/audio.c.chmou   Wed Sep  5 15:38:46 2001
+++ linux/drivers/sound/emu10k1/audio.c Wed Sep  5 17:41:36 2001
@@ -1027,6 +1027,7 @@
        struct woinst *woinst = NULL;
        struct wiinst *wiinst = NULL;
        unsigned long flags;
+       int i;
 
        DPF(2, "emu10k1_audio_mmap()\n");
 
@@ -1050,6 +1051,22 @@
                                ERROR();
                                return -EINVAL;
                        }
+                       /* Now mark the pages as reserved, otherwise remap_page_range 
+doesn't do what we want */
+                       for (i = 0; i < woinst->buffer.pages; i++)
+                               
+mem_map_reserve(virt_to_page(woinst->buffer.mem[0].addr[i]));
+               }
+               size = vma->vm_end - vma->vm_start;
+               if (size > (PAGE_SIZE * woinst->buffer.pages)) {
+                       spin_unlock_irqrestore(&woinst->lock, flags);
+                       unlock_kernel();
+                       return -EINVAL;
+               }
+               for (i = 0; i < woinst->buffer.pages; i++) {
+                       if (remap_page_range(vma->vm_start + (i * PAGE_SIZE), 
+virt_to_phys(woinst->buffer.mem[0].addr[i]), PAGE_SIZE, vma->vm_page_prot)) {
+                               spin_unlock_irqrestore(&woinst->lock, flags);
+                               unlock_kernel();
+                               return -EAGAIN;
+                       }
                }
 
                woinst->mmapped = 1;
@@ -1254,6 +1271,12 @@
                                                spin_lock_irqsave(&woinst->lock, 
flags);
                                        }
                                }
+                       }
+                       if (woinst->mmapped) {
+                               int i;
+                               /* Undo marking the pages as reserved */
+                               for (i = 0; i < woinst->buffer.pages; i++)
+                                       
+mem_map_reserve(virt_to_page(woinst->buffer.mem[0].addr[i]));
                        }
                        emu10k1_waveout_close(wave_dev);
                }

Reply via email to