hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/gpu/drm/i810/i810_dma.c
....@@ -30,13 +30,20 @@
3030 *
3131 */
3232
33
-#include <drm/drmP.h>
34
-#include <drm/i810_drm.h>
35
-#include "i810_drv.h"
36
-#include <linux/interrupt.h> /* For task queue support */
3733 #include <linux/delay.h>
38
-#include <linux/slab.h>
39
-#include <linux/pagemap.h>
34
+#include <linux/mman.h>
35
+#include <linux/pci.h>
36
+
37
+#include <drm/drm_agpsupport.h>
38
+#include <drm/drm_device.h>
39
+#include <drm/drm_drv.h>
40
+#include <drm/drm_file.h>
41
+#include <drm/drm_ioctl.h>
42
+#include <drm/drm_irq.h>
43
+#include <drm/drm_print.h>
44
+#include <drm/i810_drm.h>
45
+
46
+#include "i810_drv.h"
4047
4148 #define I810_BUF_FREE 2
4249 #define I810_BUF_CLIENT 1
....@@ -213,9 +220,9 @@
213220 if (dev_priv->ring.virtual_start)
214221 drm_legacy_ioremapfree(&dev_priv->ring.map, dev);
215222 if (dev_priv->hw_status_page) {
216
- pci_free_consistent(dev->pdev, PAGE_SIZE,
217
- dev_priv->hw_status_page,
218
- dev_priv->dma_status_page);
223
+ dma_free_coherent(&dev->pdev->dev, PAGE_SIZE,
224
+ dev_priv->hw_status_page,
225
+ dev_priv->dma_status_page);
219226 }
220227 kfree(dev->dev_private);
221228 dev->dev_private = NULL;
....@@ -391,8 +398,8 @@
391398
392399 /* Program Hardware Status Page */
393400 dev_priv->hw_status_page =
394
- pci_zalloc_consistent(dev->pdev, PAGE_SIZE,
395
- &dev_priv->dma_status_page);
401
+ dma_alloc_coherent(&dev->pdev->dev, PAGE_SIZE,
402
+ &dev_priv->dma_status_page, GFP_KERNEL);
396403 if (!dev_priv->hw_status_page) {
397404 dev->dev_private = (void *)dev_priv;
398405 i810_dma_cleanup(dev);
....@@ -846,11 +853,11 @@
846853 i810_wait_ring(dev, dev_priv->ring.Size - 8);
847854 }
848855
849
-static int i810_flush_queue(struct drm_device *dev)
856
+static void i810_flush_queue(struct drm_device *dev)
850857 {
851858 drm_i810_private_t *dev_priv = dev->dev_private;
852859 struct drm_device_dma *dma = dev->dma;
853
- int i, ret = 0;
860
+ int i;
854861 RING_LOCALS;
855862
856863 i810_kernel_lost_context(dev);
....@@ -875,7 +882,7 @@
875882 DRM_DEBUG("still on client\n");
876883 }
877884
878
- return ret;
885
+ return;
879886 }
880887
881888 /* Must be called with the lock held */