drm_dma.c revision d0538f66491267879b7418b21ad78e3dcc2dcc83
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * drm_dma.c -- DMA IOCTL and function support -*- linux-c -*-
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Created: Fri Mar 19 14:30:16 1999 by faith@valinux.com
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * All Rights Reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Permission is hereby granted, free of charge, to any person obtaining a
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * copy of this software and associated documentation files (the "Software"),
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * to deal in the Software without restriction, including without limitation
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * and/or sell copies of the Software, and to permit persons to whom the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Software is furnished to do so, subject to the following conditions:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * The above copyright notice and this permission notice (including the next
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * paragraph) shall be included in all copies or substantial portions of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Software.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * OTHER DEALINGS IN THE SOFTWARE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Authors:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Rickard E. (Rik) Faith <faith@valinux.com>
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Gareth Hughes <gareth@valinux.com>
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma ident "%Z%%M% %I% %E% SMI"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl dev->dma = drm_calloc(1, sizeof (*dev->dma), DRM_MEM_DMA);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl return (0);
9512fe850e98fdd448c638ca63fdd92a8a510255ahl /* Clear dma buffers */
9512fe850e98fdd448c638ca63fdd92a8a510255ahl for (i = 0; i <= DRM_MAX_ORDER; i++) {
if (!buf)
if (!dma)
case DRM_LIST_NONE:
case DRM_LIST_WAIT:
return (EINVAL);