Deleted Added
full compact
i915_dma.c (182080) i915_dma.c (182883)
1/* i915_dma.c -- DMA support for the I915 -*- linux-c -*-
2 */
3/*-
4 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the

--- 13 unchanged lines hidden (view full) ---

22 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 *
27 */
28
29#include <sys/cdefs.h>
1/* i915_dma.c -- DMA support for the I915 -*- linux-c -*-
2 */
3/*-
4 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the

--- 13 unchanged lines hidden (view full) ---

22 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
23 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 *
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/dev/drm/i915_dma.c 182080 2008-08-23 20:59:12Z rnoland $");
30__FBSDID("$FreeBSD: head/sys/dev/drm/i915_dma.c 182883 2008-09-09 02:05:03Z rnoland $");
31
32#include "dev/drm/drmP.h"
33#include "dev/drm/drm.h"
34#include "dev/drm/i915_drm.h"
35#include "dev/drm/i915_drv.h"
36
37/* Really want an OS-independent resettable timer. Would like to have
38 * this loop run for (eg) 3 sec, but have the timer reset every time

--- 206 unchanged lines hidden (view full) ---

245 dev_priv->allow_batchbuffer = 1;
246
247 /* Enable vblank on pipe A for older X servers
248 */
249 dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A;
250
251 /* Program Hardware Status Page */
252 if (!I915_NEED_GFX_HWS(dev)) {
31
32#include "dev/drm/drmP.h"
33#include "dev/drm/drm.h"
34#include "dev/drm/i915_drm.h"
35#include "dev/drm/i915_drv.h"
36
37/* Really want an OS-independent resettable timer. Would like to have
38 * this loop run for (eg) 3 sec, but have the timer reset every time

--- 206 unchanged lines hidden (view full) ---

245 dev_priv->allow_batchbuffer = 1;
246
247 /* Enable vblank on pipe A for older X servers
248 */
249 dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A;
250
251 /* Program Hardware Status Page */
252 if (!I915_NEED_GFX_HWS(dev)) {
253 dev_priv->status_page_dmah =
254 drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff);
255
256 if (!dev_priv->status_page_dmah) {
253 drm_dma_handle_t *dmah;
254#ifdef __FreeBSD__
255 DRM_UNLOCK();
256#endif
257 dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff);
258#ifdef __FreeBSD__
259 DRM_LOCK();
260#endif
261 if (!dmah) {
257 i915_dma_cleanup(dev);
258 DRM_ERROR("Can not allocate hardware status page\n");
259 return -ENOMEM;
260 }
262 i915_dma_cleanup(dev);
263 DRM_ERROR("Can not allocate hardware status page\n");
264 return -ENOMEM;
265 }
261 dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr;
262 dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr;
266 dev_priv->status_page_dmah = dmah;
267 dev_priv->hw_status_page = dmah->vaddr;
268 dev_priv->dma_status_page = dmah->busaddr;
263
264 memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
265
266 I915_WRITE(0x02080, dev_priv->dma_status_page);
267 }
268 DRM_DEBUG("Enabled hardware status page\n");
269#ifdef I915_HAVE_BUFFER
270 mutex_init(&dev_priv->cmdbuf_mutex);

--- 936 unchanged lines hidden ---
269
270 memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
271
272 I915_WRITE(0x02080, dev_priv->dma_status_page);
273 }
274 DRM_DEBUG("Enabled hardware status page\n");
275#ifdef I915_HAVE_BUFFER
276 mutex_init(&dev_priv->cmdbuf_mutex);

--- 936 unchanged lines hidden ---