1 /* i915_dma.c -- DMA support for the I915 -*- linux-c -*-
4 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
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.
34 #define IS_I965G(dev) (dev->pci_device == 0x2972 || \
35 dev->pci_device == 0x2982 || \
36 dev->pci_device == 0x2992 || \
37 dev->pci_device == 0x29A2)
40 /* Really want an OS-independent resettable timer. Would like to have
41 * this loop run for (eg) 3 sec, but have the timer reset every time
42 * the head pointer changes, so that EBUSY only happens if the ring
43 * actually stalls for (eg) 3 seconds.
45 int i915_wait_ring(drm_device_t * dev, int n, const char *caller)
47 drm_i915_private_t *dev_priv = dev->dev_private;
48 drm_i915_ring_buffer_t *ring = &(dev_priv->ring);
49 u32 last_head = I915_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
52 for (i = 0; i < 10000; i++) {
53 ring->head = I915_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
54 ring->space = ring->head - (ring->tail + 8);
56 ring->space += ring->Size;
60 dev_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT;
62 if (ring->head != last_head)
65 last_head = ring->head;
68 return DRM_ERR(EBUSY);
71 void i915_kernel_lost_context(drm_device_t * dev)
73 drm_i915_private_t *dev_priv = dev->dev_private;
74 drm_i915_ring_buffer_t *ring = &(dev_priv->ring);
76 ring->head = I915_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
77 ring->tail = I915_READ(LP_RING + RING_TAIL) & TAIL_ADDR;
78 ring->space = ring->head - (ring->tail + 8);
80 ring->space += ring->Size;
82 if (ring->head == ring->tail)
83 dev_priv->sarea_priv->perf_boxes |= I915_BOX_RING_EMPTY;
86 static int i915_dma_cleanup(drm_device_t * dev)
88 /* Make sure interrupts are disabled here because the uninstall ioctl
89 * may not have been called from userspace and after dev_private
90 * is freed, it's too late.
93 drm_irq_uninstall(dev);
95 if (dev->dev_private) {
96 drm_i915_private_t *dev_priv =
97 (drm_i915_private_t *) dev->dev_private;
99 if (dev_priv->ring.virtual_start) {
100 drm_core_ioremapfree(&dev_priv->ring.map, dev);
103 if (dev_priv->status_page_dmah) {
104 drm_pci_free(dev, dev_priv->status_page_dmah);
105 /* Need to rewrite hardware status page */
106 I915_WRITE(0x02080, 0x1ffff000);
109 drm_free(dev->dev_private, sizeof(drm_i915_private_t),
112 dev->dev_private = NULL;
118 static int i915_initialize(drm_device_t * dev,
119 drm_i915_private_t * dev_priv,
120 drm_i915_init_t * init)
122 memset(dev_priv, 0, sizeof(drm_i915_private_t));
125 if (!dev_priv->sarea) {
126 DRM_ERROR("can not find sarea!\n");
127 dev->dev_private = (void *)dev_priv;
128 i915_dma_cleanup(dev);
129 return DRM_ERR(EINVAL);
132 dev_priv->mmio_map = drm_core_findmap(dev, init->mmio_offset);
133 if (!dev_priv->mmio_map) {
134 dev->dev_private = (void *)dev_priv;
135 i915_dma_cleanup(dev);
136 DRM_ERROR("can not find mmio map!\n");
137 return DRM_ERR(EINVAL);
140 dev_priv->sarea_priv = (drm_i915_sarea_t *)
141 ((u8 *) dev_priv->sarea->handle + init->sarea_priv_offset);
143 dev_priv->ring.Start = init->ring_start;
144 dev_priv->ring.End = init->ring_end;
145 dev_priv->ring.Size = init->ring_size;
146 dev_priv->ring.tail_mask = dev_priv->ring.Size - 1;
148 dev_priv->ring.map.offset = init->ring_start;
149 dev_priv->ring.map.size = init->ring_size;
150 dev_priv->ring.map.type = 0;
151 dev_priv->ring.map.flags = 0;
152 dev_priv->ring.map.mtrr = 0;
154 drm_core_ioremap(&dev_priv->ring.map, dev);
156 if (dev_priv->ring.map.handle == NULL) {
157 dev->dev_private = (void *)dev_priv;
158 i915_dma_cleanup(dev);
159 DRM_ERROR("can not ioremap virtual address for"
161 return DRM_ERR(ENOMEM);
164 dev_priv->ring.virtual_start = dev_priv->ring.map.handle;
166 dev_priv->back_offset = init->back_offset;
167 dev_priv->front_offset = init->front_offset;
168 dev_priv->current_page = 0;
169 dev_priv->sarea_priv->pf_current_page = dev_priv->current_page;
171 /* We are using separate values as placeholders for mechanisms for
172 * private backbuffer/depthbuffer usage.
174 dev_priv->use_mi_batchbuffer_start = 0;
176 /* Allow hardware batchbuffers unless told otherwise.
178 dev_priv->allow_batchbuffer = 1;
180 /* Program Hardware Status Page */
181 dev_priv->status_page_dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE,
184 if (!dev_priv->status_page_dmah) {
185 dev->dev_private = (void *)dev_priv;
186 i915_dma_cleanup(dev);
187 DRM_ERROR("Can not allocate hardware status page\n");
188 return DRM_ERR(ENOMEM);
190 dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr;
191 dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr;
193 memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
194 DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
196 I915_WRITE(0x02080, dev_priv->dma_status_page);
197 DRM_DEBUG("Enabled hardware status page\n");
199 dev->dev_private = (void *)dev_priv;
204 static int i915_dma_resume(drm_device_t * dev)
206 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
208 DRM_DEBUG("%s\n", __FUNCTION__);
210 if (!dev_priv->sarea) {
211 DRM_ERROR("can not find sarea!\n");
212 return DRM_ERR(EINVAL);
215 if (!dev_priv->mmio_map) {
216 DRM_ERROR("can not find mmio map!\n");
217 return DRM_ERR(EINVAL);
220 if (dev_priv->ring.map.handle == NULL) {
221 DRM_ERROR("can not ioremap virtual address for"
223 return DRM_ERR(ENOMEM);
226 /* Program Hardware Status Page */
227 if (!dev_priv->hw_status_page) {
228 DRM_ERROR("Can not find hardware status page\n");
229 return DRM_ERR(EINVAL);
231 DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
233 I915_WRITE(0x02080, dev_priv->dma_status_page);
234 DRM_DEBUG("Enabled hardware status page\n");
239 static int i915_dma_init(DRM_IOCTL_ARGS)
242 drm_i915_private_t *dev_priv;
243 drm_i915_init_t init;
246 DRM_COPY_FROM_USER_IOCTL(init, (drm_i915_init_t __user *) data,
251 dev_priv = drm_alloc(sizeof(drm_i915_private_t),
253 if (dev_priv == NULL)
254 return DRM_ERR(ENOMEM);
255 retcode = i915_initialize(dev, dev_priv, &init);
257 case I915_CLEANUP_DMA:
258 retcode = i915_dma_cleanup(dev);
260 case I915_RESUME_DMA:
261 retcode = i915_dma_resume(dev);
271 /* Implement basically the same security restrictions as hardware does
272 * for MI_BATCH_NON_SECURE. These can be made stricter at any time.
274 * Most of the calculations below involve calculating the size of a
275 * particular instruction. It's important to get the size right as
276 * that tells us where the next instruction to check is. Any illegal
277 * instruction detected will be given a size of zero, which is a
278 * signal to abort the rest of the buffer.
280 static int do_validate_cmd(int cmd)
282 switch (((cmd >> 29) & 0x7)) {
284 switch ((cmd >> 23) & 0x3f) {
286 return 1; /* MI_NOOP */
288 return 1; /* MI_FLUSH */
290 return 0; /* disallow everything else */
294 return 0; /* reserved */
296 return (cmd & 0xff) + 2; /* 2d commands */
298 if (((cmd >> 24) & 0x1f) <= 0x18)
301 switch ((cmd >> 24) & 0x1f) {
305 switch ((cmd >> 16) & 0xff) {
307 return (cmd & 0x1f) + 2;
309 return (cmd & 0xf) + 2;
311 return (cmd & 0xffff) + 2;
315 return (cmd & 0xffff) + 1;
319 if ((cmd & (1 << 23)) == 0) /* inline vertices */
320 return (cmd & 0x1ffff) + 2;
321 else if (cmd & (1 << 17)) /* indirect random */
322 if ((cmd & 0xffff) == 0)
323 return 0; /* unknown length, too hard */
325 return (((cmd & 0xffff) + 1) / 2) + 1;
327 return 2; /* indirect sequential */
338 static int validate_cmd(int cmd)
340 int ret = do_validate_cmd(cmd);
342 /* printk("validate_cmd( %x ): %d\n", cmd, ret); */
347 static int i915_emit_cmds(drm_device_t * dev, int __user * buffer, int dwords)
349 drm_i915_private_t *dev_priv = dev->dev_private;
353 if ((dwords+1) * sizeof(int) >= dev_priv->ring.Size - 8)
354 return DRM_ERR(EINVAL);
356 BEGIN_LP_RING((dwords+1)&~1);
358 for (i = 0; i < dwords;) {
361 if (DRM_COPY_FROM_USER_UNCHECKED(&cmd, &buffer[i], sizeof(cmd))) {
363 return DRM_ERR(EINVAL);
365 if ((sz = validate_cmd(cmd)) == 0 || i + sz > dwords)
366 return DRM_ERR(EINVAL);
371 if (DRM_COPY_FROM_USER_UNCHECKED(&cmd, &buffer[i],
373 return DRM_ERR(EINVAL);
387 static int i915_emit_box(drm_device_t * dev,
388 drm_clip_rect_t __user * boxes,
389 int i, int DR1, int DR4)
391 drm_i915_private_t *dev_priv = dev->dev_private;
395 if (DRM_COPY_FROM_USER_UNCHECKED(&box, &boxes[i], sizeof(box))) {
399 if (box.y2 <= box.y1 || box.x2 <= box.x1 || box.y2 <= 0 || box.x2 <= 0) {
400 DRM_ERROR("Bad box %d,%d..%d,%d\n",
401 box.x1, box.y1, box.x2, box.y2);
402 return DRM_ERR(EINVAL);
407 OUT_RING(GFX_OP_DRAWRECT_INFO_I965);
408 OUT_RING((box.x1 & 0xffff) | (box.y1 << 16));
409 OUT_RING(((box.x2 - 1) & 0xffff) | ((box.y2 - 1) << 16));
414 OUT_RING(GFX_OP_DRAWRECT_INFO);
416 OUT_RING((box.x1 & 0xffff) | (box.y1 << 16));
417 OUT_RING(((box.x2 - 1) & 0xffff) | ((box.y2 - 1) << 16));
426 /* XXX: Emitting the counter should really be moved to part of the IRQ
427 * emit. For now, do it in both places:
430 static void i915_emit_breadcrumb(drm_device_t *dev)
432 drm_i915_private_t *dev_priv = dev->dev_private;
435 dev_priv->sarea_priv->last_enqueue = ++dev_priv->counter;
437 if (dev_priv->counter > 0x7FFFFFFFUL)
438 dev_priv->sarea_priv->last_enqueue = dev_priv->counter = 1;
441 OUT_RING(CMD_STORE_DWORD_IDX);
443 OUT_RING(dev_priv->counter);
448 static int i915_dispatch_cmdbuffer(drm_device_t * dev,
449 drm_i915_cmdbuffer_t * cmd)
451 int nbox = cmd->num_cliprects;
452 int i = 0, count, ret;
455 DRM_ERROR("alignment");
456 return DRM_ERR(EINVAL);
459 i915_kernel_lost_context(dev);
461 count = nbox ? nbox : 1;
463 for (i = 0; i < count; i++) {
465 ret = i915_emit_box(dev, cmd->cliprects, i,
471 ret = i915_emit_cmds(dev, (int __user *)cmd->buf, cmd->sz / 4);
476 i915_emit_breadcrumb( dev );
480 static int i915_dispatch_batchbuffer(drm_device_t * dev,
481 drm_i915_batchbuffer_t * batch)
483 drm_i915_private_t *dev_priv = dev->dev_private;
484 drm_clip_rect_t __user *boxes = batch->cliprects;
485 int nbox = batch->num_cliprects;
489 if ((batch->start | batch->used) & 0x7) {
490 DRM_ERROR("alignment");
491 return DRM_ERR(EINVAL);
494 i915_kernel_lost_context(dev);
496 count = nbox ? nbox : 1;
498 for (i = 0; i < count; i++) {
500 int ret = i915_emit_box(dev, boxes, i,
501 batch->DR1, batch->DR4);
506 if (dev_priv->use_mi_batchbuffer_start) {
508 OUT_RING(MI_BATCH_BUFFER_START | (2 << 6));
509 OUT_RING(batch->start | MI_BATCH_NON_SECURE);
513 OUT_RING(MI_BATCH_BUFFER);
514 OUT_RING(batch->start | MI_BATCH_NON_SECURE);
515 OUT_RING(batch->start + batch->used - 4);
521 i915_emit_breadcrumb( dev );
525 static int i915_dispatch_flip(drm_device_t * dev)
527 drm_i915_private_t *dev_priv = dev->dev_private;
530 DRM_DEBUG("%s: page=%d pfCurrentPage=%d\n",
532 dev_priv->current_page,
533 dev_priv->sarea_priv->pf_current_page);
535 i915_kernel_lost_context(dev);
538 OUT_RING(INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE);
543 OUT_RING(CMD_OP_DISPLAYBUFFER_INFO | ASYNC_FLIP);
545 if (dev_priv->current_page == 0) {
546 OUT_RING(dev_priv->back_offset);
547 dev_priv->current_page = 1;
549 OUT_RING(dev_priv->front_offset);
550 dev_priv->current_page = 0;
556 OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_PLANE_A_FLIP);
560 dev_priv->sarea_priv->last_enqueue = dev_priv->counter++;
563 OUT_RING(CMD_STORE_DWORD_IDX);
565 OUT_RING(dev_priv->counter);
569 dev_priv->sarea_priv->pf_current_page = dev_priv->current_page;
573 static int i915_quiescent(drm_device_t * dev)
575 drm_i915_private_t *dev_priv = dev->dev_private;
577 i915_kernel_lost_context(dev);
578 return i915_wait_ring(dev, dev_priv->ring.Size - 8, __FUNCTION__);
581 static int i915_flush_ioctl(DRM_IOCTL_ARGS)
585 LOCK_TEST_WITH_RETURN(dev, filp);
587 return i915_quiescent(dev);
590 static int i915_batchbuffer(DRM_IOCTL_ARGS)
593 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
594 u32 *hw_status = dev_priv->hw_status_page;
595 drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *)
596 dev_priv->sarea_priv;
597 drm_i915_batchbuffer_t batch;
600 if (!dev_priv->allow_batchbuffer) {
601 DRM_ERROR("Batchbuffer ioctl disabled\n");
602 return DRM_ERR(EINVAL);
605 DRM_COPY_FROM_USER_IOCTL(batch, (drm_i915_batchbuffer_t __user *) data,
608 DRM_DEBUG("i915 batchbuffer, start %x used %d cliprects %d\n",
609 batch.start, batch.used, batch.num_cliprects);
611 LOCK_TEST_WITH_RETURN(dev, filp);
613 if (batch.num_cliprects && DRM_VERIFYAREA_READ(batch.cliprects,
614 batch.num_cliprects *
615 sizeof(drm_clip_rect_t)))
616 return DRM_ERR(EFAULT);
618 ret = i915_dispatch_batchbuffer(dev, &batch);
620 sarea_priv->last_dispatch = (int)hw_status[5];
624 static int i915_cmdbuffer(DRM_IOCTL_ARGS)
627 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
628 u32 *hw_status = dev_priv->hw_status_page;
629 drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *)
630 dev_priv->sarea_priv;
631 drm_i915_cmdbuffer_t cmdbuf;
634 DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_i915_cmdbuffer_t __user *) data,
637 DRM_DEBUG("i915 cmdbuffer, buf %p sz %d cliprects %d\n",
638 cmdbuf.buf, cmdbuf.sz, cmdbuf.num_cliprects);
640 LOCK_TEST_WITH_RETURN(dev, filp);
642 if (cmdbuf.num_cliprects &&
643 DRM_VERIFYAREA_READ(cmdbuf.cliprects,
644 cmdbuf.num_cliprects *
645 sizeof(drm_clip_rect_t))) {
646 DRM_ERROR("Fault accessing cliprects\n");
647 return DRM_ERR(EFAULT);
650 ret = i915_dispatch_cmdbuffer(dev, &cmdbuf);
652 DRM_ERROR("i915_dispatch_cmdbuffer failed\n");
656 sarea_priv->last_dispatch = (int)hw_status[5];
660 static int i915_do_cleanup_pageflip(drm_device_t * dev)
662 drm_i915_private_t *dev_priv = dev->dev_private;
664 DRM_DEBUG("%s\n", __FUNCTION__);
665 if (dev_priv->current_page != 0)
666 i915_dispatch_flip(dev);
671 static int i915_flip_bufs(DRM_IOCTL_ARGS)
675 DRM_DEBUG("%s\n", __FUNCTION__);
677 LOCK_TEST_WITH_RETURN(dev, filp);
679 return i915_dispatch_flip(dev);
682 static int i915_getparam(DRM_IOCTL_ARGS)
685 drm_i915_private_t *dev_priv = dev->dev_private;
686 drm_i915_getparam_t param;
690 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
691 return DRM_ERR(EINVAL);
694 DRM_COPY_FROM_USER_IOCTL(param, (drm_i915_getparam_t __user *) data,
697 switch (param.param) {
698 case I915_PARAM_IRQ_ACTIVE:
699 value = dev->irq ? 1 : 0;
701 case I915_PARAM_ALLOW_BATCHBUFFER:
702 value = dev_priv->allow_batchbuffer ? 1 : 0;
704 case I915_PARAM_LAST_DISPATCH:
705 value = READ_BREADCRUMB(dev_priv);
708 DRM_ERROR("Unknown parameter %d\n", param.param);
709 return DRM_ERR(EINVAL);
712 if (DRM_COPY_TO_USER(param.value, &value, sizeof(int))) {
713 DRM_ERROR("DRM_COPY_TO_USER failed\n");
714 return DRM_ERR(EFAULT);
720 static int i915_setparam(DRM_IOCTL_ARGS)
723 drm_i915_private_t *dev_priv = dev->dev_private;
724 drm_i915_setparam_t param;
727 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
728 return DRM_ERR(EINVAL);
731 DRM_COPY_FROM_USER_IOCTL(param, (drm_i915_setparam_t __user *) data,
734 switch (param.param) {
735 case I915_SETPARAM_USE_MI_BATCHBUFFER_START:
736 dev_priv->use_mi_batchbuffer_start = param.value;
738 case I915_SETPARAM_TEX_LRU_LOG_GRANULARITY:
739 dev_priv->tex_lru_log_granularity = param.value;
741 case I915_SETPARAM_ALLOW_BATCHBUFFER:
742 dev_priv->allow_batchbuffer = param.value;
745 DRM_ERROR("unknown parameter %d\n", param.param);
746 return DRM_ERR(EINVAL);
752 int i915_driver_load(drm_device_t *dev, unsigned long flags)
754 /* i915 has 4 more counters */
756 dev->types[6] = _DRM_STAT_IRQ;
757 dev->types[7] = _DRM_STAT_PRIMARY;
758 dev->types[8] = _DRM_STAT_SECONDARY;
759 dev->types[9] = _DRM_STAT_DMA;
764 void i915_driver_lastclose(drm_device_t * dev)
766 if (dev->dev_private) {
767 drm_i915_private_t *dev_priv = dev->dev_private;
768 i915_mem_takedown(&(dev_priv->agp_heap));
770 i915_dma_cleanup(dev);
773 void i915_driver_preclose(drm_device_t * dev, DRMFILE filp)
775 if (dev->dev_private) {
776 drm_i915_private_t *dev_priv = dev->dev_private;
777 if (dev_priv->page_flipping) {
778 i915_do_cleanup_pageflip(dev);
780 i915_mem_release(dev, filp, dev_priv->agp_heap);
784 drm_ioctl_desc_t i915_ioctls[] = {
785 [DRM_IOCTL_NR(DRM_I915_INIT)] = {i915_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
786 [DRM_IOCTL_NR(DRM_I915_FLUSH)] = {i915_flush_ioctl, DRM_AUTH},
787 [DRM_IOCTL_NR(DRM_I915_FLIP)] = {i915_flip_bufs, DRM_AUTH},
788 [DRM_IOCTL_NR(DRM_I915_BATCHBUFFER)] = {i915_batchbuffer, DRM_AUTH},
789 [DRM_IOCTL_NR(DRM_I915_IRQ_EMIT)] = {i915_irq_emit, DRM_AUTH},
790 [DRM_IOCTL_NR(DRM_I915_IRQ_WAIT)] = {i915_irq_wait, DRM_AUTH},
791 [DRM_IOCTL_NR(DRM_I915_GETPARAM)] = {i915_getparam, DRM_AUTH},
792 [DRM_IOCTL_NR(DRM_I915_SETPARAM)] = {i915_setparam, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
793 [DRM_IOCTL_NR(DRM_I915_ALLOC)] = {i915_mem_alloc, DRM_AUTH},
794 [DRM_IOCTL_NR(DRM_I915_FREE)] = {i915_mem_free, DRM_AUTH},
795 [DRM_IOCTL_NR(DRM_I915_INIT_HEAP)] = {i915_mem_init_heap, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
796 [DRM_IOCTL_NR(DRM_I915_CMDBUFFER)] = {i915_cmdbuffer, DRM_AUTH},
797 [DRM_IOCTL_NR(DRM_I915_DESTROY_HEAP)] = { i915_mem_destroy_heap, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY },
798 [DRM_IOCTL_NR(DRM_I915_SET_VBLANK_PIPE)] = { i915_vblank_pipe_set, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY },
799 [DRM_IOCTL_NR(DRM_I915_GET_VBLANK_PIPE)] = { i915_vblank_pipe_get, DRM_AUTH },
802 int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
805 * Determine if the device really is AGP or not.
807 * All Intel graphics chipsets are treated as AGP, even if they are really
810 * \param dev The device to be tested.
813 * A value of 1 is always retured to indictate every i9x5 is AGP.
815 int i915_driver_device_is_agp(drm_device_t * dev)