Author: hawk                         Date: Fri Nov 27 23:04:16 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fixes for ATI Mach64 DRM to build on new kernels

---- Files affected:
packages/kernel-desktop:
   kernel-gpu-drm-mach64-2.6.31.patch (NONE -> 1.1)  (NEW), 
kernel-gpu-drm-mach64-fixes.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/kernel-desktop/kernel-gpu-drm-mach64-2.6.31.patch
diff -u /dev/null packages/kernel-desktop/kernel-gpu-drm-mach64-2.6.31.patch:1.1
--- /dev/null   Sat Nov 28 00:04:16 2009
+++ packages/kernel-desktop/kernel-gpu-drm-mach64-2.6.31.patch  Sat Nov 28 
00:04:10 2009
@@ -0,0 +1,100 @@
+Adapt mach64 to build with 2.6.31 series kernels
+
+Signed-off-by: Thomas Backlund <[email protected]>
+
+diff -urp linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64/mach64_dma.c 
linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64.fixed/mach64_dma.c
+--- linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64/mach64_dma.c     
2009-07-23 00:24:12.000000000 +0300
++++ linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64.fixed/mach64_dma.c       
2009-07-23 02:28:21.000000000 +0300
+@@ -1006,7 +1006,7 @@ static int mach64_do_dma_init(struct drm
+ 
+       DRM_DEBUG("\n");
+ 
+-      dev_priv = drm_alloc(sizeof(drm_mach64_private_t), DRM_MEM_DRIVER);
++      dev_priv = kmalloc(sizeof(drm_mach64_private_t), GFP_KERNEL);
+       if (dev_priv == NULL)
+               return -ENOMEM;
+ 
+@@ -1386,8 +1386,7 @@ int mach64_do_cleanup_dma(struct drm_dev
+ 
+               mach64_destroy_freelist(dev);
+ 
+-              drm_free(dev_priv, sizeof(drm_mach64_private_t),
+-                       DRM_MEM_DRIVER);
++              kfree(dev_priv);
+               dev->dev_private = NULL;
+       }
+ 
+@@ -1476,8 +1475,8 @@ int mach64_init_freelist(struct drm_devi
+       for (i = 0; i < dma->buf_count; i++) {
+               if ((entry =
+                    (drm_mach64_freelist_t *)
+-                   drm_alloc(sizeof(drm_mach64_freelist_t),
+-                             DRM_MEM_BUFLISTS)) == NULL)
++                   kmalloc(sizeof(drm_mach64_freelist_t),
++                             GFP_KERNEL)) == NULL)
+                       return -ENOMEM;
+               memset(entry, 0, sizeof(drm_mach64_freelist_t));
+               entry->buf = dma->buflist[i];
+@@ -1500,18 +1499,18 @@ void mach64_destroy_freelist(struct drm_
+       list_for_each_safe(ptr, tmp, &dev_priv->pending) {
+               list_del(ptr);
+               entry = list_entry(ptr, drm_mach64_freelist_t, list);
+-              drm_free(entry, sizeof(*entry), DRM_MEM_BUFLISTS);
++              kfree(entry);
+       }
+       list_for_each_safe(ptr, tmp, &dev_priv->placeholders) {
+               list_del(ptr);
+               entry = list_entry(ptr, drm_mach64_freelist_t, list);
+-              drm_free(entry, sizeof(*entry), DRM_MEM_BUFLISTS);
++              kfree(entry);
+       }
+ 
+       list_for_each_safe(ptr, tmp, &dev_priv->free_list) {
+               list_del(ptr);
+               entry = list_entry(ptr, drm_mach64_freelist_t, list);
+-              drm_free(entry, sizeof(*entry), DRM_MEM_BUFLISTS);
++              kfree(entry);
+       }
+ }
+ 
+diff -urp linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64/mach64_state.c 
linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64.fixed/mach64_state.c
+--- linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64/mach64_state.c   
2009-07-23 00:24:12.000000000 +0300
++++ linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64.fixed/mach64_state.c     
2009-07-23 02:29:24.000000000 +0300
+@@ -490,12 +490,12 @@ static __inline__ int copy_from_user_ver
+       unsigned long n = bytes;        /* dwords remaining in buffer */
+       u32 *from, *orig_from;
+ 
+-      from = drm_alloc(bytes, DRM_MEM_DRIVER);
++      from = kmalloc(bytes, GFP_KERNEL);
+       if (from == NULL)
+               return -ENOMEM;
+ 
+       if (DRM_COPY_FROM_USER(from, ufrom, bytes)) {
+-              drm_free(from, bytes, DRM_MEM_DRIVER);
++              kfree(from);
+               return -EFAULT;
+       }
+       orig_from = from; /* we'll be modifying the "from" ptr, so save it */
+@@ -526,19 +526,19 @@ static __inline__ int copy_from_user_ver
+                               to += count;
+                       } else {
+                               DRM_ERROR("Got bad command: 0x%04x\n", reg);
+-                              drm_free(orig_from, bytes, DRM_MEM_DRIVER);
++                              kfree(orig_from);
+                               return -EACCES;
+                       }
+               } else {
+                       DRM_ERROR
+                           ("Got bad command count(=%u) dwords 
remaining=%lu\n",
+                            count, n);
+-                      drm_free(orig_from, bytes, DRM_MEM_DRIVER);
++                      kfree(orig_from);
+                       return -EINVAL;
+               }
+       }
+ 
+-      drm_free(orig_from, bytes, DRM_MEM_DRIVER);
++      kfree(orig_from);
+       if (n == 0)
+               return 0;
+       else {

================================================================
Index: packages/kernel-desktop/kernel-gpu-drm-mach64-fixes.patch
diff -u /dev/null packages/kernel-desktop/kernel-gpu-drm-mach64-fixes.patch:1.1
--- /dev/null   Sat Nov 28 00:04:16 2009
+++ packages/kernel-desktop/kernel-gpu-drm-mach64-fixes.patch   Sat Nov 28 
00:04:10 2009
@@ -0,0 +1,97 @@
+Fix/cleanup mach64 drm module for building with current kernel.
+
+Signed-off-by: Herton Ronaldo Krzesinski <[email protected]>
+
+---
+ drivers/gpu/drm/mach64/mach64_dma.c   |    9 +--------
+ drivers/gpu/drm/mach64/mach64_drv.c   |   11 +----------
+ drivers/gpu/drm/mach64/mach64_state.c |    4 ++--
+ 3 files changed, 4 insertions(+), 20 deletions(-)
+
+diff -p -up linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c.orig 
linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c
+--- linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c.orig      2008-12-10 
12:19:14.000000000 -0500
++++ linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c   2008-12-10 
13:34:19.000000000 -0500
+@@ -834,14 +834,8 @@ static int mach64_bm_dma_test(struct drm
+ 
+       /* FIXME: get a dma buffer from the freelist here */
+       DRM_DEBUG("Allocating data memory ...\n");
+-#ifdef __FreeBSD__
+-      DRM_UNLOCK();
+-#endif
+       cpu_addr_dmah =
+           drm_pci_alloc(dev, 0x1000, 0x1000, 0xfffffffful);
+-#ifdef __FreeBSD__
+-      DRM_LOCK();
+-#endif
+       if (!cpu_addr_dmah) {
+               DRM_INFO("data-memory allocation failed!\n");
+               return -ENOMEM;
+@@ -1375,8 +1369,7 @@ int mach64_do_cleanup_dma(struct drm_dev
+        * may not have been called from userspace and after dev_private
+        * is freed, it's too late.
+        */
+-      if (dev->irq)
+-              drm_irq_uninstall(dev);
++      drm_irq_uninstall(dev);
+ 
+       if (dev->dev_private) {
+               drm_mach64_private_t *dev_priv = dev->dev_private;
+diff -p -up linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c.orig 
linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c
+--- linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c.orig      2008-12-10 
12:13:13.000000000 -0500
++++ linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c   2008-12-10 
12:16:54.000000000 -0500
+@@ -38,7 +38,6 @@ static struct pci_device_id pciidlist[] 
+       mach64_PCI_IDS
+ };
+ 
+-static int probe(struct pci_dev *pdev, const struct pci_device_id *ent);
+ static struct drm_driver driver = {
+       .driver_features =
+           DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_HAVE_DMA
+@@ -68,8 +67,6 @@ static struct drm_driver driver = {
+       .pci_driver = {
+               .name = DRIVER_NAME,
+               .id_table = pciidlist,
+-              .probe = probe,
+-              .remove = __devexit_p(drm_cleanup_pci),
+       },
+ 
+       .name = DRIVER_NAME,
+@@ -80,16 +77,10 @@ static struct drm_driver driver = {
+       .patchlevel = DRIVER_PATCHLEVEL,
+ };
+ 
+-static int probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+-{
+-      return drm_get_dev(pdev, ent, &driver);
+-}
+-
+-
+ static int __init mach64_init(void)
+ {
+       driver.num_ioctls = mach64_max_ioctl;
+-      return drm_init(&driver, pciidlist);
++      return drm_init(&driver);
+ }
+ 
+ static void __exit mach64_exit(void)
+diff -p -up linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c.orig 
linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c
+--- linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c.orig    2008-12-10 
12:13:13.000000000 -0500
++++ linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c 2008-12-10 
13:38:54.000000000 -0500
+@@ -455,7 +455,7 @@ static int mach64_do_get_frames_queued(d
+       head = ring->head;
+ 
+       start = (MACH64_MAX_QUEUED_FRAMES -
+-               DRM_MIN(MACH64_MAX_QUEUED_FRAMES, sarea_priv->frames_queued));
++               min(MACH64_MAX_QUEUED_FRAMES, sarea_priv->frames_queued));
+ 
+       if (head == tail) {
+               sarea_priv->frames_queued = 0;
+@@ -895,7 +895,7 @@ int mach64_get_param(struct drm_device *
+               value = mach64_do_get_frames_queued(dev_priv);
+               break;
+       case MACH64_PARAM_IRQ_NR:
+-              value = dev->irq;
++              value = drm_dev_to_irq(dev);
+               break;
+       default:
+               return -EINVAL;
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to