Subversion Repositories Kolibri OS

Rev

Rev 4560 | Rev 5271 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4560 Rev 5060
Line 1... Line -...
1
/* drm_pci.h -- PCI DMA memory management wrappers for DRM -*- linux-c -*- */
-
 
2
/**
-
 
3
 * \file drm_pci.c
-
 
4
 * \brief Functions and ioctls to manage PCI memory
-
 
5
 *
-
 
6
 * \warning These interfaces aren't stable yet.
-
 
7
 *
-
 
8
 * \todo Implement the remaining ioctl's for the PCI pools.
-
 
9
 * \todo The wrappers here are so thin that they would be better off inlined..
-
 
10
 *
-
 
11
 * \author José Fonseca 
-
 
12
 * \author Leif Delgass 
-
 
13
 */
-
 
14
 
-
 
15
/*
1
/*
16
 * Copyright 2003 José Fonseca.
2
 * Copyright 2003 José Fonseca.
17
 * Copyright 2003 Leif Delgass.
3
 * Copyright 2003 Leif Delgass.
18
 * All Rights Reserved.
4
 * All Rights Reserved.
19
 *
5
 *
Line 36... Line 22...
36
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37
 */
23
 */
Line 38... Line 24...
38
 
24
 
39
//#include 
25
//#include 
40
//#include 
26
//#include 
41
//#include 
27
#include 
42
#include 
28
#include 
Line 43... Line 29...
43
#include 
29
#include 
44
 
-
 
45
#include 
-
 
46
 
-
 
47
/**********************************************************************/
-
 
48
/** \name PCI memory */
-
 
49
/*@{*/
30
 
50
 
31
#include 
-
 
32
/**
-
 
33
 * drm_pci_alloc - Allocate a PCI consistent memory block, for DMA.
-
 
34
 * @dev: DRM device
-
 
35
 * @size: size of block to allocate
-
 
36
 * @align: alignment of block
-
 
37
 *
51
/**
38
 * Return: A handle to the allocated memory block on success or NULL on
52
 * \brief Allocate a PCI consistent memory block, for DMA.
39
 * failure.
53
 */
40
 */
54
drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align)
41
drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align)
55
{
-
 
56
	drm_dma_handle_t *dmah;
42
{
57
#if 1
43
	drm_dma_handle_t *dmah;
58
	unsigned long addr;
-
 
Line 59... Line 44...
59
	size_t sz;
44
	unsigned long addr;
60
#endif
45
	size_t sz;
61
 
46
 
62
	/* pci_alloc_consistent only guarantees alignment to the smallest
47
	/* pci_alloc_consistent only guarantees alignment to the smallest
Line 108... Line 93...
108
				  dmah->busaddr);
93
				  dmah->busaddr);
109
	}
94
	}
110
}
95
}
Line 111... Line 96...
111
 
96
 
112
/**
97
/**
-
 
98
 * drm_pci_free - Free a PCI consistent memory block
-
 
99
 * @dev: DRM device
113
 * \brief Free a PCI consistent memory block
100
 * @dmah: handle to memory block
114
 */
101
 */
115
void drm_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah)
102
void drm_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah)
116
{
103
{
117
	__drm_pci_free(dev, dmah);
104
	__drm_pci_free(dev, dmah);
Line 243... Line 230...
243
	return 0;
230
	return 0;
244
err:
231
err:
245
	return ret;
232
	return ret;
246
}
233
}
Line 247... Line -...
247
 
-
 
248
 
234
 
249
static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p)
235
static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p)
250
{
236
{
251
	if ((p->busnum >> 8) != drm_get_pci_domain(dev) ||
237
	if ((p->busnum >> 8) != drm_get_pci_domain(dev) ||
252
	    (p->busnum & 0xff) != dev->pdev->bus->number ||
238
	    (p->busnum & 0xff) != dev->pdev->bus->number ||
Line 334... Line 320...
334
 
320
 
Line 335... Line 321...
335
	DRM_DEBUG("\n");
321
	DRM_DEBUG("\n");
336
 
-
 
337
 
-
 
338
	dev->pdev = pdev;
-
 
339
	dev->pci_device = pdev->device;
322
 
340
	dev->pci_vendor = pdev->vendor;
323
 
341
 
324
	dev->pdev = pdev;
Line 342... Line -...
342
#ifdef __alpha__
-
 
Line 343... Line 325...
343
	dev->hose = pdev->sysdata;
325
#ifdef __alpha__
344
#endif
326
	dev->hose = pdev->sysdata;
345
 
327
#endif
346
//   mutex_lock(&drm_global_mutex);
328