Deleted Added
full compact
drm_bufs.c (207066) drm_bufs.c (207067)
1/*-
2 * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
3 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation

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

24 *
25 * Authors:
26 * Rickard E. (Rik) Faith <faith@valinux.com>
27 * Gareth Hughes <gareth@valinux.com>
28 *
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
3 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation

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

24 *
25 * Authors:
26 * Rickard E. (Rik) Faith <faith@valinux.com>
27 * Gareth Hughes <gareth@valinux.com>
28 *
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/drm/drm_bufs.c 207066 2010-04-22 18:21:25Z rnoland $");
32__FBSDID("$FreeBSD: head/sys/dev/drm/drm_bufs.c 207067 2010-04-22 18:44:23Z rnoland $");
33
34/** @file drm_bufs.c
35 * Implementation of the ioctls for setup of DRM mappings and DMA buffers.
36 */
37
38#include "dev/pci/pcireg.h"
39
40#include "dev/drm/drmP.h"

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

221 }*/
222 break;
223 case _DRM_SCATTER_GATHER:
224 if (!dev->sg) {
225 free(map, DRM_MEM_MAPS);
226 DRM_LOCK();
227 return EINVAL;
228 }
33
34/** @file drm_bufs.c
35 * Implementation of the ioctls for setup of DRM mappings and DMA buffers.
36 */
37
38#include "dev/pci/pcireg.h"
39
40#include "dev/drm/drmP.h"

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

221 }*/
222 break;
223 case _DRM_SCATTER_GATHER:
224 if (!dev->sg) {
225 free(map, DRM_MEM_MAPS);
226 DRM_LOCK();
227 return EINVAL;
228 }
229 map->virtual = (void *)(dev->sg->handle + offset);
230 map->offset = dev->sg->handle + offset;
229 map->virtual = (void *)(dev->sg->vaddr + offset);
230 map->offset = dev->sg->vaddr + offset;
231 break;
232 case _DRM_CONSISTENT:
233 /* Unfortunately, we don't get any alignment specification from
234 * the caller, so we have to guess. drm_pci_alloc requires
235 * a power-of-two alignment, so try to align the bus address of
236 * the map to it size if possible, otherwise just assume
237 * PAGE_SIZE alignment.
238 */

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

739 buf = &entry->buflist[entry->buf_count];
740 buf->idx = dma->buf_count + entry->buf_count;
741 buf->total = alignment;
742 buf->order = order;
743 buf->used = 0;
744
745 buf->offset = (dma->byte_count + offset);
746 buf->bus_address = agp_offset + offset;
231 break;
232 case _DRM_CONSISTENT:
233 /* Unfortunately, we don't get any alignment specification from
234 * the caller, so we have to guess. drm_pci_alloc requires
235 * a power-of-two alignment, so try to align the bus address of
236 * the map to it size if possible, otherwise just assume
237 * PAGE_SIZE alignment.
238 */

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

739 buf = &entry->buflist[entry->buf_count];
740 buf->idx = dma->buf_count + entry->buf_count;
741 buf->total = alignment;
742 buf->order = order;
743 buf->used = 0;
744
745 buf->offset = (dma->byte_count + offset);
746 buf->bus_address = agp_offset + offset;
747 buf->address = (void *)(agp_offset + offset + dev->sg->handle);
747 buf->address = (void *)(agp_offset + offset + dev->sg->vaddr);
748 buf->next = NULL;
749 buf->pending = 0;
750 buf->file_priv = NULL;
751
752 buf->dev_priv_size = dev->driver->buf_priv_size;
753 buf->dev_private = malloc(buf->dev_priv_size, DRM_MEM_BUFS,
754 M_NOWAIT | M_ZERO);
755 if (buf->dev_private == NULL) {

--- 375 unchanged lines hidden ---
748 buf->next = NULL;
749 buf->pending = 0;
750 buf->file_priv = NULL;
751
752 buf->dev_priv_size = dev->driver->buf_priv_size;
753 buf->dev_private = malloc(buf->dev_priv_size, DRM_MEM_BUFS,
754 M_NOWAIT | M_ZERO);
755 if (buf->dev_private == NULL) {

--- 375 unchanged lines hidden ---