Commit Graph

1035 Commits (48b5eaf303b60077faed09db77785d7a544ac335)

Author SHA1 Message Date
Ben Skeggs 0e0d954584 nouveau: Add nv40-specific PGRAPH code, not hooked up yet. 2007-01-02 14:52:43 +11:00
Ben Skeggs 2c3bc69ba2 nouveau: Only clobber PFIFO if no channels are already alloc'd
With this change the GPU is responsible for doing the channel switch
itself.  This is needed for the upcoming NV4x PGRAPH context work as
we don't yet know enough to manually swap PGRAPH contexts.
2007-01-02 14:41:34 +11:00
Thomas Hellstrom a16a8a47cd Add some new via chipsets.
Disable 3D functionality and AGP DMA for chipsets with the DX9 3D engine.
2006-12-28 22:17:08 +01:00
Thomas Hellstrom 7859bd61d3 Leftover from previous commit. 2006-12-27 19:46:46 +01:00
Thomas Hellstrom 2980ec22a1 Allow for non-power-of-two texture pitch alignment. 2006-12-27 19:38:33 +01:00
Ben Skeggs c38ede0667 nouveau: return the *actual* type of memory alloc'd to userspace 2006-12-27 01:58:57 +11:00
Ben Skeggs 9e019df757 nouveau: Alloc cmdbuf for each channel individually 2006-12-26 23:30:26 +11:00
Ben Skeggs b7586ab539 nouveau: save/restore endianness flag on FIFO switch
This makes my G5 survive glxinfo and nouveau_demo - airlied
2006-12-21 17:47:10 +11:00
Thomas Hellstrom 3b47b27558 Some via PCI posting flushes. 2006-12-20 13:04:21 +01:00
Dave Airlie e5c4a26a29 Merge branch 'nouveau-1' 2006-12-20 10:30:16 +11:00
Dave Airlie 7458909bea fixup i915 return values from kernel 2006-12-19 21:48:18 +11:00
Dave Airlie 07635f26a9 fix comment in r128 2006-12-19 17:58:20 +11:00
Dave Airlie c52dea9a7d fix some sizes in sis_drv.h 2006-12-19 17:58:16 +11:00
Dave Airlie 8cc82c5033 remove inline from large function 2006-12-19 17:58:12 +11:00
Dave Airlie 13659357ad make a savage function static from kernel 2006-12-19 17:58:09 +11:00
Dave Airlie cb280ad3c0 fix missing DRM_ERR from kernel 2006-12-19 17:58:03 +11:00
Michel Dänzer aefc7a3443 Unify radeon offset checking.
Replace r300_check_offset() with generic radeon_check_offset(), which doesn't
reject valid offsets when the framebuffer area is at the very end of the card's
32 bit address space. Make radeon_check_and_fixup_offset() use
radeon_check_offset() as well.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=7697 .
2006-12-14 19:31:56 +01:00
Ben Skeggs 1a40f3318c Port remaining NV4 RAMIN access from the ddx into the drm.
Should fix lockups seen on NV4 cards.
2006-12-12 00:11:42 +11:00
Stephane Marchesin 30acb90a60 Merge the pciid work.
Add getparams for AGP and FB physical adresses.
Fix the MEM_ALLOC issue properly.
Fix context switches for nv44.
Change the DRM version to 0.0.1.
2006-12-03 10:02:54 +01:00
Michel Dänzer a97bb85c2a Unshare drm_drawable.c again for now.
The current version didn't build on BSD, where the new functionality isn't used
yet anyway. Whoever changes that will hopefully be able to make the OSes share
this file as well.
2006-12-01 10:46:21 +01:00
Ben Skeggs 80d75cf695 Use nouveau_mem.c to allocate RAMIN. 2006-11-30 10:31:42 +11:00
Ben Skeggs b1a9a76971 Wrap access to objects in RAMIN.
This will make it easier to support extra RAMIN in vram at a later point.
2006-11-30 08:35:42 +11:00
Matthieu Castet f48a7685bd For nv10, bit 16 of RAMFC need to be set for 64 bytes fifo context.
When cleaning a fifo, we shouldn't assume everybody use nv40 ;)
Fill DMA_SUBROUTINE fill correct value.
2006-11-28 21:32:03 +01:00
Michel Dänzer ddcb994c3e i915_vblank_tasklet: Try harder to avoid tearing.
Previously, if there were several buffer swaps scheduled for the same vertical
blank, all but the first blit emitted stood a chance of exhibiting tearing. In
order to avoid this, split the blits along slices of each output top to bottom.
2006-11-27 11:32:33 +01:00
Stephane Marchesin 0a364be289 Merge branch 'nouveau-1' of git+ssh://marcheu@git.freedesktop.org/git/mesa/drm into nouveau-1 2006-11-21 23:32:58 +01:00
Ben Skeggs adf71cb29b Don't spam dmesg if PMC_INTSTAT is 0 2006-11-21 11:41:46 +11:00
Ben Skeggs 9ac7a8b0b4 Only return FIFO number if the FIFO is marked as in use.. 2006-11-18 10:09:29 +11:00
Ben Skeggs e9194dd1b0 Check some return vals, fixes a couple of oopses. 2006-11-18 10:03:45 +11:00
Ben Skeggs 18bba3fa29 Dump some useful info when a PGRAPH error occurs.
The "channel" detect doesn't work on my nv40, but the rest
seems to produce sane info.
2006-11-17 08:05:23 +11:00
Stephane Marchesin 5e7f58474d Merge branch 'nouveau-1' of git+ssh://marcheu@git.freedesktop.org/git/mesa/drm into nouveau-1 2006-11-16 14:47:52 +01:00
Ben Skeggs 2fd812f8ef Completely untested NV10/20/30 FIFO context switching changes. 2006-11-14 09:00:31 +11:00
Ben Skeggs 7002082944 Restructure initialisation a bit.
- Do important card init in firstopen
 - Give each channel it's own cmdbuf dma object
 - Move RAMHT config state to the same place as RAMRO/RAMFC
 - Make sure instance mem for objects is *after* RAM{FC,HT,RO}
2006-11-14 08:11:49 +11:00
Ben Skeggs 35bf8fb5cf Merge branch 'nouveau-1' of git+ssh://git.freedesktop.org/git/mesa/drm into nouveau-1 2006-11-14 04:52:08 +11:00
Ben Skeggs 9ef4bbc66c Hack around yet another "X restart borkage without nouveau.ko reload" problem.
On X init, PFIFO and PGRAPH are reset to defaults.  This causes the GPU to
loose the configuration done by the drm.  Perhaps a CARD_INIT ioctl a proper
solution to having this problem again in the future..
2006-11-14 04:51:13 +11:00
Stephane Marchesin 5a0cdf7db3 Merge branch 'master' of git+ssh://marcheu@git.freedesktop.org/git/mesa/drm into nouveau-1 2006-11-11 01:57:05 +01:00
Stephane Marchesin 1123ab0890 Fix memory detection on TNT2 M64/TNT2 vanta. 2006-11-10 02:18:38 +01:00
Eric Anholt 584acab6d6 Add drm_u64_t typedef on non-linux to fix libdrm build. 2006-11-07 09:36:40 -08:00
Dave Airlie f7affda35b drm: fixup page alignment on SAREA map on ppc64 2006-11-06 11:44:36 +11:00
Dave Airlie 2dd3c039fd fixup fifo size so it is page aligned 2006-11-06 11:42:15 +11:00
Dave Airlie 5e55594061 use a uint64_t for this not a pointer 2006-11-06 11:41:51 +11:00
Dave Airlie 1e90b7ee8c Merge branch 'master' into nouveau-1
Conflicts:

	linux-core/Makefile.kernel
2006-11-06 08:03:18 +11:00
Ben Skeggs 0c34d0f31a Leave the bottom 64kb of RAMIN untouched.
The binary driver will screw up either it's init or shutdown, leaving the
screen(s) in an unusable state without this.  Something important in there?
2006-11-06 05:46:03 +11:00
Dave Airlie 94ab96c4d8 nouveau: add compat ioc32 support 2006-11-05 20:39:13 +11:00
Dave Airlie 665c8385c7 add powerpc mmio swapper to NV_READ/WRITE macros 2006-11-05 19:46:53 +11:00
Stephane Marchesin 06639801ce Add some getparams. 2006-11-04 20:39:59 +01:00
Stephane Marchesin 3ea0500be1 Move the context object creation flag handling to the drm. 2006-11-04 16:56:10 +01:00
Thomas Hellstrom decacb2e64 Reserve the new IOCTLs also for *bsd.
Bump libdrm version number to 2.2.0
2006-10-27 13:08:31 +02:00
Thomas Hellstrom f6d5fecdd2 Last minute changes to support multi-page size buffer offset alignments.
This will come in very handy for tiled buffers on intel hardware.
Also add some padding to interface structures to allow future binary backwards
compatible changes.
2006-10-27 11:28:37 +02:00
Thomas Hellstrom d70347bfc0 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm 2006-10-19 17:07:26 +02:00
Thomas Hellstrom e22b04f807 Merging drm-ttm-0-2-branch
Conflicts:

	linux-core/drmP.h
	linux-core/drm_drv.c
	linux-core/drm_irq.c
	linux-core/drm_stub.c
	shared-core/drm.h
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2006-10-18 17:33:19 +02:00
Thomas Hellstrom c34faf224b Remove max number of locked pages check and call, since
that is now handled by the memory accounting.
2006-10-17 20:03:26 +02:00
Ben Skeggs b5cf0d635c Remove hack which delays activation of a additional channel. The previously active channel's state is saved to RAMFC before PFIFO gets clobbered. 2006-10-18 02:37:19 +11:00
Ben Skeggs 725984364b Oops, we have more than 4 subchannels.. 2006-10-18 01:07:48 +11:00
Ben Skeggs 55de3f763f Useful output on a FIFO error interrupt. 2006-10-17 23:44:05 +11:00
Ben Skeggs 07059f4278 typo 2006-10-17 23:08:03 +11:00
Thomas Hellstrom 5881ce1b91 Extend generality for more memory types.
Fix up init and destruction code.
2006-10-17 11:05:37 +02:00
Michael Karcher 561e23a7c2 dev->agp_buffer_map is not initialized for AGP DMA on savages
bug 8662
2006-10-16 22:06:58 -04:00
Ben Skeggs 4b43ee63f9 NV40: *Now* fifo ctx switching works for me..
Ok, I lied before.. it was a fluke it worked and required magic to repeat it..
It actually helps to fill in RAMFC entries in the correct place.

The code also clears RAMIN entirely instead of just the hash-table.
2006-10-17 12:33:49 +11:00
Ben Skeggs 98e718d48f NV40: FIFO context switching now WorksForMe(tm) 2006-10-17 07:29:31 +11:00
Ben Skeggs 1943f39d8c Setup NV40 RAMFC (in wrong location.. but anyway), rearrange the RAMFC setup code a bit. 2006-10-17 06:37:40 +11:00
Ben Skeggs 95486bbde0 Some info on NV40's RAMFC 2006-10-17 06:12:18 +11:00
Stephane Marchesin 93fee5cf22 Merge branch 'master' of git://anongit.freedesktop.org/git/mesa/drm into nouveau-1 2006-10-15 00:12:13 +02:00
Stephane Marchesin 2c5b91aecf Again more work on context switches. They work, sometimes. And when they do they seem to screw up the PGRAPH state. 2006-10-14 16:36:11 +02:00
Dave Airlie 1bab514c0a remove config.h from build no longer exists kbuild does it 2006-10-14 23:38:20 +10:00
Stephane Marchesin 3a0cd7c7e2 Add the missing breaks. 2006-10-14 01:21:31 +02:00
Stephane Marchesin b509abe413 Fix the fifo context size on nv10, nv20 and nv30. 2006-10-13 22:35:22 +02:00
Ben Skeggs 4988074794 Fix some randomness in activating a second channel on NV40 (odd GET/PUT vals). Ch 1 GET now advances, but no ctx_switch. 2006-10-14 06:57:49 +11:00
Stephane Marchesin a9c6c3f21d Oops. 2006-10-12 21:18:55 +02:00
Stephane Marchesin 7ef44b2b8d Still more work on the context switching code. 2006-10-12 17:31:49 +02:00
Thomas Hellstrom 10150df02b Simplify the AGP backend interface somewhat.
Fix buffer bound caching policy changing, Allow
on-the-fly changing of caching policy on bound buffers if the hardware
supports it.

Allow drivers to use driver-specific AGP memory types for TTM AGP pages.
Will make AGP drivers much easier to migrate.
2006-10-12 12:09:16 +02:00
Stephane Marchesin a749d9d5b4 More work on the context switch code. Still doesn't work. I'm mostly convinced it's an initialization issue. 2006-10-12 01:08:15 +02:00
Thomas Hellstrom f2db76e2f2 Big update:
Adapt for new functions in the 2.6.19 kernel.
Remove the ability to have multiple regions in one TTM.
   This simplifies a lot of code.
Remove the ability to access TTMs from user space.
   We don't need it anymore without ttm regions.
Don't change caching policy for evicted buffers. Instead change it only
   when the buffer is accessed by the CPU (on the first page fault).
   This tremendously speeds up eviction rates.
Current code is safe for kernels <= 2.6.14.
Should also be OK with 2.6.19 and above.
2006-10-11 13:40:35 +02:00
Stephane Marchesin dd473411f8 Context switching work.
Added preliminary support for context switches (triggers the interrupts, but hangs after the switch ; something's not quite right yet).
Removed the PFIFO_REINIT ioctl. I hope it's that a good idea...
Requires the upcoming commit to the DDX.
2006-10-11 00:28:15 +02:00
Roland Scheidegger a9f57a2b9c only allow specific type-3 packets to pass the verifier instead of all for r100/r200 as others might be unsafe (r300 already does this), and add checking for these we need but aren't safe. Check the RADEON_CP_INDX_BUFFER packet on both r200 and r300 as it isn't safe neither. 2006-10-10 02:24:19 +02:00
George Sapountzis c9e3aa961e Bug 6242: [mach64] Use private DMA buffers, part #4.
mach64_state.c: convert the DRM_MACH64_BLIT ioctl to submit a pointer to
user-space memory rather than a DMA buffer index, similar to DRM_MACH64_VERTEX.

This change allows the DDX to map the DMA buffers read-only and eliminate a
security problem where a client can alter the contents of the DMA buffer after
submission to the DRM.

This change also affects the DRI/DRM interface. Performace-wise, it basically
affects PCI mode where I get a ~12% speedup for some Mesa demos I tested.
This is mainly due to eliminating an ioctl for allocating the DMA buffer.

mach64_dma.c: move the responsibility for allocating memory for the DMA ring
in PCI mode to the DDX.

This change affects the DDX/DRM interface and unifies a couple of PCI/AGP code
paths for ring memory in the DRM.

Bump the mach64 DRM version major and date.
2006-10-02 22:47:26 +03:00
George Sapountzis f3deef730d Bug 6242: [mach64] Use private DMA buffers, part #3.
Add DRM_PCI_BUFFER_RO flag for mapping PCI DMA buffer read-only. An additional
flag is needed, since PCI DMA buffers do not have an associated map.
2006-10-02 22:47:23 +03:00
George Sapountzis 25760c30d4 Bug 6242: [mach64] Use private DMA buffers, part #2.
Factor out from mach64_dma_dispatch_vertex() the code to reclaim an unsed
buffer, in preperation for using it in mach64_dma_dispatch_blit() also.
2006-10-02 22:47:19 +03:00
George Sapountzis eea150e776 Bug 6242: [mach64] Use private DMA buffers, part #1.
Factor out from mach64_freelist_get() the code to reclaim a completed buffer,
this is to improve readability for me.
2006-10-02 22:47:14 +03:00
George Sapountzis d1b31a228b Bug 6209: [mach64] AGP DMA buffers not mapped correctly.
Map the DMA buffers from the same linear address as the vertex bufs. If
dev->agp_buffer_token is not set, mach64 drm maps the DMA buffers from
linear address 0x0.
2006-10-02 22:46:54 +03:00
Michel Dänzer 16be6ba63a Fix type of second argument to spin_lock_irqsave().
(cherry picked from f6238cf624 commit)
2006-10-02 15:42:07 +02:00
Michel Dänzer f6238cf624 Fix type of second argument to spin_lock_irqsave(). 2006-10-02 15:33:19 +02:00
Felix Kühling 58a23d193f drm_rmdraw: Declare id and idx as signed so testing for < 0 works as intended.
(cherry picked from d583899681 commit)
2006-10-02 11:21:10 +02:00
Felix Kühling d583899681 drm_rmdraw: Declare id and idx as signed so testing for < 0 works as intended. 2006-10-02 10:50:40 +02:00
Thomas Hellstrom 8e908eaf50 Bump driver date. 2006-09-29 14:21:51 +02:00
Michel Dänzer 17a640419a i915: Only schedule vblank tasklet if there are scheduled swaps pending.
This fixes issues on X server startup with versions of xf86-video-intel that
enable the IRQ before they have a context ID.
(cherry picked from 7af93dd984 commit)
2006-09-29 12:55:09 +02:00
Michel Dänzer 48367fdfe6 i915: Only initialize IRQ fields in postinstall, not the PIPE_SET ioctl.
Some other minor changes in preparation for actually disabling user interrupts.
2006-09-29 12:55:09 +02:00
Michel Dänzer 3620a3ec85 i915: Bump minor again to differentiate from vsync changes. 2006-09-29 12:55:09 +02:00
Michel Dänzer 390184df92 i915: Avoid mis-counting vblank interrupts when they're only enabled for pipe A.
It looks like 'after a while', I915REG_INT_IDENTITY_R for some reason always has
VSYNC_PIPEB_FLAG set in the interrupt handler, even though pipe B is disabled.
So we only increase dev->vbl_received if the corresponding bit is also set in
dev->vblank_pipe.
(cherry picked from 881ba56992 commit)
2006-09-29 12:55:09 +02:00
Michel Dänzer c0bff9f9cd i915: Bump minor for swap scheduling ioctl and secondary vblank support.
(cherry picked from 2627131e5d commit)
2006-09-29 12:55:09 +02:00
Michel Dänzer 0a7d9edcfb i915_vblank_swap: Add support for DRM_VBLANK_NEXTONMISS.
(cherry picked from 0356fe260d commit)
2006-09-29 12:55:09 +02:00
Michel Dänzer c47ebd9707 Only return EBUSY after we've established we need to schedule a new swap.
(cherry picked from 50a0284a61 commit)
2006-09-29 12:55:09 +02:00
Michel Dänzer ed82172378 Core vsync: Add flag DRM_VBLANK_NEXTONMISS.
When this flag is set and the target sequence is missed, wait for the next
vertical blank instead of returning immediately.
(cherry picked from 89e323e490 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer c4c47a7eac Fix 'sequence has passed' condition in i915_vblank_swap().
(cherry picked from 7f09f957d9 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer f9aa4f5973 Add SAREA fileds for determining which pipe to sync window buffer swaps to.
(cherry picked from c2bdb76814 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer 4a3d270862 Make handling of dev_priv->vblank_pipe more robust.
Initialize it to default value if it hasn't been set by the X server yet.

In i915_vblank_pipe_set(), only update dev_priv->vblank_pipe and call
i915_enable_interrupt() if the argument passed from userspace is valid to avoid
corrupting dev_priv->vblank_pipe on invalid arguments.
(cherry picked from 87c57cba1a commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer 1f3493f65b DRM_I915_VBLANK_SWAP ioctl: Take drm_vblank_seq_type_t instead of pipe number.
Handle relative as well as absolute target sequence numbers.

Return error if target sequence has already passed, so userspace can deal with
this situation as it sees fit.

On success, return the sequence number of the vertical blank when the buffer
swap is expected to take place.

Also add DRM_IOCTL_I915_VBLANK_SWAP definition for userspace code that may want
to use ioctl() instead of drmCommandWriteRead().
(cherry picked from d5a0f10751 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer 00531cecad Change first valid DRM drawable ID to be 1 instead of 0.
This makes it easier for userspace to know when it needs to allocate an ID.

Also free drawable information memory when it's no longer needed.
(cherry picked from df7551ef73 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer 7d487602a3 Add copyright notice.
(cherry picked from d04751face commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer da75d59cd6 i915: Add ioctl for scheduling buffer swaps at vertical blanks.
This uses the core facility to schedule a driver callback that will be called
ASAP after the given vertical blank interrupt with the HW lock held.
(cherry picked from 257771fa29 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer d7389a9758 Locking and memory management fixes.
(cherry picked from 23d2833aaa commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer f93e482269 Export drm_get_drawable_info symbol from core.
(cherry picked from 43f8675534 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer baa26c5faa Only reallocate cliprect memory if the number of cliprects changes.
Also improve diagnostic output.
(cherry picked from af48be1096 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer 9810ec2737 Add support for tracking drawable information to core
Actually make the existing ioctls for adding and removing drawables do
something useful, and add another ioctl for the X server to update drawable
information. The only kind of drawable information tracked so far is cliprects.
(cherry picked from 29598e5253 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer 596d7e9984 Add support for secondary vertical blank interrupt to i915 driver.
When the vertical blank interrupt is enabled for both pipes, pipe A is
considered primary and pipe B secondary. When it's only enabled for one pipe,
it's always considered primary for backwards compatibility.
(cherry picked from 0c7d7f4361 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer 2735f9e290 Add support for secondary vertical blank interrupt to DRM core.
(cherry picked from ab351505f3 commit)
2006-09-29 12:55:08 +02:00
Thomas Hellstrom ae96e26419 Add a new buffer flag.
Fix up some comments.
2006-09-29 11:46:45 +02:00
Michel Dänzer 7af93dd984 i915: Only schedule vblank tasklet if there are scheduled swaps pending.
This fixes issues on X server startup with versions of xf86-video-intel that
enable the IRQ before they have a context ID.
2006-09-29 10:27:29 +02:00
Michel Dänzer 881ba56992 i915: Avoid mis-counting vblank interrupts when they're only enabled for pipe A.
It looks like 'after a while', I915REG_INT_IDENTITY_R for some reason always has
VSYNC_PIPEB_FLAG set in the interrupt handler, even though pipe B is disabled.
So we only increase dev->vbl_received if the corresponding bit is also set in
dev->vblank_pipe.
2006-09-28 15:41:36 +02:00
Michel Dänzer 2627131e5d i915: Bump minor for swap scheduling ioctl and secondary vblank support. 2006-09-28 15:41:36 +02:00
Michel Dänzer 0356fe260d i915_vblank_swap: Add support for DRM_VBLANK_NEXTONMISS. 2006-09-28 15:41:36 +02:00
Michel Dänzer 50a0284a61 Only return EBUSY after we've established we need to schedule a new swap. 2006-09-28 15:41:36 +02:00
Michel Dänzer 89e323e490 Core vsync: Add flag DRM_VBLANK_NEXTONMISS.
When this flag is set and the target sequence is missed, wait for the next
vertical blank instead of returning immediately.
2006-09-28 15:41:36 +02:00
Michel Dänzer 7f09f957d9 Fix 'sequence has passed' condition in i915_vblank_swap(). 2006-09-28 15:41:36 +02:00
Michel Dänzer c2bdb76814 Add SAREA fileds for determining which pipe to sync window buffer swaps to. 2006-09-28 15:41:36 +02:00
Michel Dänzer 87c57cba1a Make handling of dev_priv->vblank_pipe more robust.
Initialize it to default value if it hasn't been set by the X server yet.

In i915_vblank_pipe_set(), only update dev_priv->vblank_pipe and call
i915_enable_interrupt() if the argument passed from userspace is valid to avoid
corrupting dev_priv->vblank_pipe on invalid arguments.
2006-09-28 15:41:36 +02:00
Michel Dänzer d5a0f10751 DRM_I915_VBLANK_SWAP ioctl: Take drm_vblank_seq_type_t instead of pipe number.
Handle relative as well as absolute target sequence numbers.

Return error if target sequence has already passed, so userspace can deal with
this situation as it sees fit.

On success, return the sequence number of the vertical blank when the buffer
swap is expected to take place.

Also add DRM_IOCTL_I915_VBLANK_SWAP definition for userspace code that may want
to use ioctl() instead of drmCommandWriteRead().
2006-09-28 15:41:36 +02:00
Michel Dänzer df7551ef73 Change first valid DRM drawable ID to be 1 instead of 0.
This makes it easier for userspace to know when it needs to allocate an ID.

Also free drawable information memory when it's no longer needed.
2006-09-28 15:41:36 +02:00
Michel Dänzer d04751face Add copyright notice. 2006-09-28 15:41:36 +02:00
Michel Dänzer 257771fa29 i915: Add ioctl for scheduling buffer swaps at vertical blanks.
This uses the core facility to schedule a driver callback that will be called
ASAP after the given vertical blank interrupt with the HW lock held.
2006-09-28 15:41:36 +02:00
Michel Dänzer 23d2833aaa Locking and memory management fixes. 2006-09-28 15:41:36 +02:00
Michel Dänzer 43f8675534 Export drm_get_drawable_info symbol from core. 2006-09-28 15:41:35 +02:00
Michel Dänzer af48be1096 Only reallocate cliprect memory if the number of cliprects changes.
Also improve diagnostic output.
2006-09-28 15:41:35 +02:00
Michel Dänzer 29598e5253 Add support for tracking drawable information to core
Actually make the existing ioctls for adding and removing drawables do
something useful, and add another ioctl for the X server to update drawable
information. The only kind of drawable information tracked so far is cliprects.
2006-09-28 15:41:35 +02:00
Michel Dänzer 0c7d7f4361 Add support for secondary vertical blank interrupt to i915 driver.
When the vertical blank interrupt is enabled for both pipes, pipe A is
considered primary and pipe B secondary. When it's only enabled for one pipe,
it's always considered primary for backwards compatibility.
2006-09-28 15:41:35 +02:00
Michel Dänzer ab351505f3 Add support for secondary vertical blank interrupt to DRM core. 2006-09-28 15:41:35 +02:00
Thomas Hellstrom c52fafa628 Don't enable fence / buffer objects on non-linux systems.
Bump driver minor and date.
2006-09-28 11:33:03 +02:00
Thomas Hellstrom 273eb7833d Add /proc filesystem buffer / fence object accounting.
Check for NULL pointer in the i915 flush handler.
Remove i915_sync_flush declaration.
2006-09-25 11:51:08 +02:00
Anish Mistry 255f3e6f76 bug 7092 : add pci ids for mach64 in Dell poweredge 4200 2006-09-22 03:43:34 +10:00
Roland Scheidegger 1f71b8d7a4 do a TCL state flush before accessing VAP_CNTL to prevent lockups on r200 when enabling/disabling vertex programs 2006-09-20 19:44:57 +02:00
Thomas Hellstrom fa511a3ff5 Allow for 64-bit map handles of ttms and buffer objects. 2006-09-20 16:31:15 +02:00
Ben Skeggs 22382bd8c5 Add pciid for GeForce Go 6150 (0x0244). 2006-09-17 13:00:27 +10:00
Michel Dänzer 6ba9127753 Use register writes instead of BITBLT_MULTI packets for buffer swap blits.
This takes up two more ring buffer entries per rectangle blitted but makes sure
the blit is performed top to bottom, reducing the likelyhood of tearing.
2006-09-15 16:55:40 +02:00
Thomas Hellstrom f613022cee Allow a "native type" to be associated with a fence sequence.
In the intel case, we can associate a flush with a sequence.
2006-09-15 16:47:09 +02:00
Thomas Hellstrom 49fbeb339c Some bugfixes.
Change the fence object interface somewhat to allow some more flexibility.
Make list IOCTLS really restartable.
Try to avoid busy-waits in the kernel using immediate return to user-space with an -EAGAIN.
2006-09-15 11:18:35 +02:00
Thomas Hellstrom 191e284709 More bugfixes.
Disable the i915 IRQ turnoff for now since it seems to be causing problems.
2006-09-12 12:01:00 +02:00
Dave Airlie 3cc64a943a drm: use radeon specific names for radeon flags 2006-09-12 06:13:14 +10:00
Ben Skeggs aa80e2f48f Add copyright notices while I still remember.. 2006-09-09 07:35:55 +10:00
Thomas Hellstrom 99acb79366 Various bugfixes. 2006-09-08 17:24:38 +02:00
Ben Skeggs 0ef29768ca Fix second start of X server without module reload beforehand, and a couple of other fixes.
- Mark the correct RAMIN slots as free (oops)
- Remove a VRAM alloc that shouldn't have been there (oops)
- Move HT init out of firstopen() and into dma_init()
- Setup PFIFO_RAM{HT,FC,RO} in pfifo_init()
2006-09-07 23:59:19 +10:00
Eric Anholt 55057660f0 Put the PCI device/vendor id in the drm_device_t.
This helps us unbreak FreeBSD DRM from the 965 changes.
2006-09-06 23:25:14 -07:00
Stephane Marchesin d89c623f8e Remove a 64 bit div. 2006-09-07 00:35:17 +02:00
Thomas Hellstrom 6042153968 Fence all unfenced buffers function. 2006-09-05 18:00:25 +02:00
Thomas Hellstrom 034fc31292 i915: Only turn on user IRQs when they are needed. 2006-09-05 14:23:18 +02:00
Thomas Hellstrom 550f51b4bf Buffer object wait IOCTL operation.
Remove option to wait for fence / buffers and block signals.
2006-09-04 21:50:12 +02:00
Ben Skeggs b119966ae6 Allow cmdbuf location(AGP,VRAM) and size to be configured. 2006-09-03 06:36:06 +10:00
Ben Skeggs 97291a6ad0 Use DMA_IN_MEMORY for DMA objects. This is needed for a DDX change that will
be committed soon after this.  Without the change, MEMFORMAT_DMA_OUT appears
to have no effect.
2006-09-02 22:25:26 +10:00
Thomas Hellstrom 405b5d9ca8 Flag bit pattern bugfixes. Remove some error messages. 2006-09-01 18:11:05 +02:00
Thomas Hellstrom ef8e618cf3 Export buffer info on map and validate ioctls.
Add an info ioctl operation.
2006-09-01 16:38:06 +02:00
Thomas Hellstrom 44f6d08988 Validation and fencing. 2006-08-31 21:42:29 +02:00
Thomas Hellstrom ec8c79b79d More mapping synchronization.
libdrm validate and fencing functions.
2006-08-31 14:10:13 +02:00
Thomas Hellstrom d39055174b Remove the buffer object hint field and use it only
as an argument.
Validate stub.
2006-08-30 17:40:07 +02:00
Thomas Hellstrom e47a4fda2e Memory manager init and takedown. 2006-08-30 13:04:08 +02:00
Thomas Hellstrom 033bda07e9 Buffer object reply fill in.
Lindent of drm_bo.c drm_ttm.c
2006-08-30 09:57:35 +02:00
Ben Skeggs 24dddc2754 Add stub {get,set}param ioctls. 2006-08-30 16:55:02 +10:00
Thomas Hellstrom de144ba23c Part of buffer object libdrm interface. 2006-08-29 21:57:37 +02:00
Thomas Hellstrom 23f01c9fe8 Checkpoint commit. Buffer object flags and IOCTL argument list. 2006-08-29 18:40:08 +02:00
Thomas Hellstrom 0dedfc2cd0 Checkpoint ttm addition to buffer objects. 2006-08-29 14:52:02 +02:00
Thomas Hellstrom 279e8d26c6 64-bit IOCTL integer (Michel Dnzer & Brian Paul) 2006-08-29 10:45:34 +02:00
Thomas Hellstrom 2057406470 Buffer object creation. 2006-08-28 17:51:53 +02:00
Thomas Hellstrom 0d67356de4 Proper TTM dereferencing
Initial buffer object creation.
2006-08-28 16:36:37 +02:00
Dave Airlie 3cfab681b3 Merge branch 'master' into nouveau-1 2006-08-29 00:01:19 +10:00
Thomas Hellstrom e181f594a4 Add a 64-bit drm unsigned type for 64-bit clean IOCTLS.
Conversion functions in drmP.h and xf86drm.c.
2006-08-28 09:49:09 +02:00
Thomas Hellstrom 4ddabd1562 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into drm-ttm-0-2-branch
Conflicts:

	linux-core/drmP.h
2006-08-28 09:28:10 +02:00
Dave Airlie 9b984b34e9 drm: lots of small cleanups and whitespace issues fixed up
remove a mach64 warning, align a lot of things from linux kernel
2006-08-28 11:31:43 +10:00
Thomas Hellstrom 928bdc6c1c Initialize i915 saved flush flags. 2006-08-27 21:21:06 +02:00
Thomas Hellstrom b4b7b99760 Remove the ioctl multiplexing, and instead allow for generic
drm ioctls 0x80 - 0xFF.
2006-08-27 21:16:13 +02:00
Thomas Hellstrom 65e7274008 ttm create / destroy / ref / unref ioctl. 2006-08-27 19:03:20 +02:00
Dave Airlie 88928380c8 add pci ids for nouveau 2006-08-27 08:59:50 +10:00
Dave Airlie fef9b30a2b initial import of nouveau code from nouveau CVS 2006-08-27 08:55:02 +10:00
Michel Dänzer b99e332236 Bug #7595: Avoid u32 overflows in radeon_check_and_fixup_offset().
The overflows could cause valid offsets to get rejected under some
circumstances, e.g. when the framebuffer resides at the very end of the card's
address space.
2006-08-26 12:23:47 +02:00
Thomas Hellstrom c488e25ceb More ioctl stubs.
Buffer object locking order documentation.
2006-08-25 20:03:39 +02:00
Thomas Hellstrom 35c8ce6c29 ttm and buffer objects ioctl stubs. 2006-08-25 19:03:42 +02:00
Thomas Hellstrom 4c03030b12 Checkpoint commit
Buffer object code.
2006-08-25 18:05:35 +02:00
Thomas Hellstrom a6535c8db4 Add a fence object class field for future use (For example VSYNC fence objects) 2006-08-22 10:44:09 +02:00
Thomas Hellstrom 7058d06317 Initial i915 buffer object driver 2006-08-22 10:24:48 +02:00
Thomas Hellstrom 700bf80ca9 Bring in stripped TTM functionality. 2006-08-22 09:47:33 +02:00
Thomas Hellstrom e089de33e8 i915 fence object driver implementing 2 fence object types:
0x00 EXE fence. Signals when command stream interpreter has reached the point
where the fence was emitted.
0x01 FLUSH fence. Signals when command stream interpreter has reached the point
where the fence was emitted, and all previous drawing operations have been
completed and flushed.
Implements busy wait (for fastest response time / high CPU) and
lazy wait (User interrupt or timer driven).
2006-08-21 21:36:00 +02:00
Thomas Hellstrom 166da9355d User / Kernel space fence objects (device-independent part). 2006-08-21 21:02:08 +02:00
Dave Airlie 0afb877a37 drm: lots of small cleanups and whitespace issues fixed up
remove a mach64 warning, align a lot of things from linux kernel
2006-08-19 17:59:18 +10:00
Dave Airlie 7a46d41399 i965 code and Linux coding style < 0
smack my whitespace up.
2006-08-10 14:38:50 +10:00
Alan Hourihane 48cb9aceed Add support for Intel i965G chipsets.
This is a patch prepared by Guangdeng Liao based off of Tungsten Graphics's
final code drop.
2006-08-08 15:05:54 -07:00
Michel Dänzer 35066b51ef Revert "Make sure busmastering gets disabled on module unload."
This reverts af7b89d724 commit. It causes an oops
on X server shutdown here, and for the reporter of bug #7629 as well.
2006-07-26 18:21:32 +02:00
Michel Dänzer 645453ce11 Bug #7629: Fix for CHIP_IS_AGP getting 'restored' with non-AGP cards
Commit 2a47f6bfec caused the CHIP_IS_AGP flag to
get 'restored' with PCI(e) cards. I can't think of a way to fix this without
introducing a (otherwise redundant) CHIP_IS_PCI flag.
2006-07-26 18:19:27 +02:00
Adam Jackson af7b89d724 Make sure busmastering gets disabled on module unload. 2006-07-19 15:35:31 -04:00
Michel Dänzer d5e0f8bdaf Use RADEON_RB3D_DSTCACHE_CTLSTAT instead of RADEON_RB2D_DSTCACHE_CTLSTAT.
The latter seems to be a read-only mirror of the former.
2006-07-19 19:18:32 +02:00
Michel Dänzer 2a47f6bfec Make sure CHIP_IS_AGP flag is set when not overriding to PCI mode.
This allows using AGP after overriding to PCI mode in a previous session
without reloading the DRM.
2006-07-19 19:16:26 +02:00
Michel Dänzer c91748e702 When writeback isn't used, actually disable it in the hardware.
Not doing this might waste bus bandwidth or even cause memory corruption or
system crashes on systems that check bus transfers. No such incident has been
reported though.
2006-07-19 19:13:00 +02:00
Michel Dänzer e337eadcec Implement RADEON_PARAM_SCRATCH_OFFSET getparam.
When this succeeds, userspace can read the scratch register contents from the
mapped writeback page directly.
2006-07-19 19:07:06 +02:00
Michel Dänzer 7dea64677b Some debug output when the getparam ioctl is called with an unknown parameter. 2006-07-19 19:01:33 +02:00
Michel Dänzer b9243ce3d5 .cvsignore -> .gitignore
Sort the merged file, remove the redundant explicit .ko lines and add
some generated symlinks.
2006-07-19 18:31:43 +02:00
Thomas Hellstrom 126673d62a Keep hashed user tokens, with the following changes:
32-bit physical device addresses are mapped directly to user-tokens. No
    duplicate maps are allowed, and the addresses are assumed to be outside
    of the range 0x10000000 through 0x30000000. The user-token is identical
    to the 32-bit physical start-address of the map.
64-bit physical device addressed are mapped to user-tokens in the range
0x10000000 to 0x30000000 with page-size increments. The user_token should
    not be interpreted as an address.
Other map types, like upcoming TTM maps are mapped to user-tokens in the
    range
0x10000000 to 0x30000000 with page-size increments. The user_token should
    not be interpreted as an address.
This keeps compatibility with buggy drivers, while still implementing a
    hashed map lookup. The SiS and via device driver major bumps are
    reverted.
2006-07-11 14:37:37 +00:00
Thomas Hellstrom a392349691 Change drm Map handles to be arbitrary 32-bit hash tokens in the range
0x10000000 to 0x90000000 in PAGE_SIZE increments.
Implement hashed map lookups.
This potentially breaks both 2D and 3D drivers. If so, the corresponding
2D and 3D driver should be fixed, and it's corresponding drm device driver
    should have its major bumped as soon as possible.
Bump sis and via drm device driver majors.
The SiS and Unichrome 3D drivers are fixed in Mesa CVS HEAD and
    mesa_6_4_branch.
2006-07-10 13:00:21 +00:00
Thomas Hellstrom c21a7b763a SiS 315 Awareness. 2006-07-05 15:52:35 +00:00
Keith Packard da143d0606 Remove spurious debug messages from i915 vblank config paths 2006-06-22 21:34:44 +00:00
Keith Packard f8891ef802 i915: Save vblank pipe configuration to restore on resume 2006-06-21 00:15:10 +00:00
Keith Packard 83f256e60e Add i915 ioctls to configure pipes for vblank interrupt.
i915 vblanks can be generated from either pipe a or b, however a disabled
    pipe generates no interrupts. This change allows the X server to select
    which pipe generates vblank interrupts.
2006-06-19 20:15:53 +00:00
Thomas Hellstrom 58b63ee5cc Fix buffer cleanup on close. Move memory manager reset from final_context
to lastclose.
2006-06-19 09:12:50 +00:00
Thomas Hellstrom 96f272884d via: Bump version number and date. 2006-06-19 09:01:31 +00:00
Thomas Hellstrom ca1a77683d via:
-Remove out of memory error message.
-Move sman cleanup from final_context to lastclose.
-Add the P4VM800PRO (?) PCI ID.
2006-06-15 18:37:05 +00:00
Thomas Hellstrom 6bacb180ce Merge in the drm-sman-branch 2006-06-06 14:19:00 +00:00
Roland Scheidegger f4e6e4499c Add support for r200 vertex programs (R200_EMIT_VAP_PVS_CNTL, and new
packet type for making it possible to address whole tcl vector space
    and have a larger count)
2006-05-24 18:36:24 +00:00
Roland Scheidegger 9e0320a0ad add forgotten register define for previous commit 2006-05-20 09:20:05 +00:00
Roland Scheidegger e1b627c17e Do a tcl state flush before accessing tcl vector space. This fixes some
more problems with flickering (bug #6637). drm may not be appropriate
    place for this, since doing that flush there might both be overkill and
    insufficient in some cases. However, it's hard to figure out when that
    flush is needed, so this has to suffice. There does not seem to be a
    performance penalty associated with it.
2006-05-20 09:08:18 +00:00
Dave Airlie b1a64b8136 add consts to radeon microcode.
From: tilman
2006-05-18 07:32:37 +00:00
Dave Airlie 30a5787d36 Fix from Benh for ppc r300 scratch 2006-04-23 08:07:57 +00:00
Brian Paul 4a49e6c366 check for __FreeBSD_kernel__ (bug 3810) 2006-04-20 14:26:59 +00:00
Eric Anholt 1327222f9b Err, use "ifndef" rather than "if !", to avoid compiler warning. 2006-04-18 06:12:22 +00:00
Eric Anholt 40b70e3244 Use __LP64__ instead of checking the linux-specific BITS_PER_LONG. 2006-04-18 05:57:28 +00:00
Eric Anholt 63c4d02576 Revert a change that accidentally went in with whitespace changes from
Linux, which broke on FreeBSD. DRM_COPY_*_IOCTL checks for the size
    parameter matching the ioctl's command size there, since the copin/out
    happened earlier.
2006-04-09 20:10:32 +00:00
Eric Anholt 6cb366b5a8 Compile fixes for FreeBSD. 2006-04-08 09:45:43 +00:00
Dave Airlie 299aad03c2 coverity bugfix from the kernel 2006-04-05 08:34:24 +00:00
Dave Airlie 985738f203 radeon fix up the PCI ids for new memory map like the kernel one.. not
perfect but should be very safe... align some other kernel bits i810
    align with kernel
2006-03-25 07:16:14 +00:00
Adam Jackson 9c92b55953 Bump driver date to reflect airlied's last fix. 2006-03-20 21:40:54 +00:00
Dave Airlie 8c8f937b3d make some functions static in via driver 2006-03-19 07:52:53 +00:00
Roland Scheidegger 38376c7fa6 Add missing pci ids for new radeons (most but not all are pcie, r420,
rv380, rv410), with the exception of the rs400 igps. Hopefully they no
    longer lock up with new ddx, but no guarantees... (bug #5413)
2006-03-17 01:35:34 +00:00
Dave Airlie ea40d3dd41 Fix bug I reintroduced 2006-03-08 23:01:32 +00:00
Dave Airlie ef835973b2 fix some use before NULL check 2006-03-08 06:03:45 +00:00
Aapo Tahkola 4436ab86d8 ia64 support for r300_scratch. (not tested) 2006-03-07 01:08:35 +00:00
Aapo Tahkola b3fdf9bb7a Add general-purpose packet for manipulating scratch registers (r300) 2006-03-06 20:08:50 +00:00
Roland Scheidegger 06e8bd2a0d Add all radeon pci ids known by ddx, but only r350/rv350 and below (new
chips may be problematic). Leave the existing entries for new chips in
    though. Remove ids not known by ddx (secondary ids, non-existant,...).
    Correct some entries (name/family). Make the radeon family enum look
    more alike the ddx/dri versions. See #5413
2006-02-25 09:51:15 +00:00
Dave Airlie 4c1c05ad96 missed a piece of benh patch 2006-02-19 12:06:27 +00:00
Dave Airlie d75fa645ed fix brace placement 2006-02-18 05:30:03 +00:00
Dave Airlie eb5666b089 clear i915 interrupts sources on server exit 2006-02-18 04:13:36 +00:00
Dave Airlie 7c18b2565e add proper checking for bitblt multi 2006-02-18 03:21:29 +00:00
Dave Airlie 9fad101da9 add benh's memory management patch 2006-02-18 03:04:30 +00:00
Dave Airlie 4791dc8856 major realigment of DRM CVS with kernel code, makes integration much easier 2006-02-18 02:53:36 +00:00
Thomas Hellstrom 659e9a091d via: Change via_drm.h versioning scheme after lenghty discussion on
unichrome-users.
2006-02-17 17:25:41 +00:00
Keith Whitwell 292d4a5b28 Update the hardware breadcrumb in the sarea on irq reception so that
clients can avoid an ioctl waiting on fences that have already been
    received. Would be even better if the hardware did the update itself.
2006-02-09 23:14:16 +00:00
Alan Hourihane 1f0da9daca fix an error message typo Unkown -> Unknown 2006-01-24 21:24:53 +00:00
Alan Hourihane f19c9eecd1 other part of revert 2006-01-24 21:18:41 +00:00
Alan Hourihane 788750fc8c put back some of Dave's code related to vblank support - accidentally
reverted.
2006-01-24 21:16:54 +00:00
Alan Hourihane 270cffbe43 Fix CMDBUFFER path, add heap destroy and flesh out sarea for rotation
(Tungsten Graphics)
2006-01-23 10:05:22 +00:00
Aapo Tahkola 9a01593f1a Add support for texture cache flushes (R300_TX_CNTL) 2006-01-20 21:45:28 +00:00
Aapo Tahkola 534bfb3742 Sync from r300_reg.h from Mesa. 2006-01-20 21:30:07 +00:00
Alan Hourihane e9732865b7 add Intel i945GM support 2006-01-19 14:14:06 +00:00
Thomas Hellstrom d394c9fa08 via: direction bug in get_user_pages call in via_dmablit.c fixed. Bumped
minor since this causes the via DDX to fail with vlc video player.
2006-01-12 19:08:16 +00:00
Thomas Hellstrom 2e0c281d1a via: Version via_drm.h Alter the drm_via_dmablit_t IOCTL arg. 2006-01-06 11:57:40 +00:00
Thomas Hellstrom a019c10c30 via: Last commit really required a bump of minor. Fix. 2006-01-06 11:52:01 +00:00
Thomas Hellstrom 661004544c via: Combine PCI DMA transfers with stride==width (Idea from Luc
Verhaegen). A somewhat saner PCI DMA transfer size check. Fix some
    typos. Bump patchlevel.
2006-01-06 11:19:06 +00:00
Dave Airlie 2a9dbb2895 make max minor more rational 2006-01-02 05:55:31 +00:00
Dave Airlie bbcba83ef7 The radeon DRM wasn't passing sparse checking in the kernel, this fixes it
by adding a new kernel internal cmd buffer type, that has no userspace
    members, and passes it around.
2006-01-02 05:39:19 +00:00
Dave Airlie 1ad5dfc369 whitespace cleanup/aligment with kernel 2006-01-02 05:22:50 +00:00
Dave Airlie b2be72c444 some fixes from linux kernel 2006-01-02 03:44:23 +00:00
Dave Airlie fb91c500bf complete fix for historic attribution 2006-01-02 03:32:03 +00:00
Dave Airlie 1d86c36655 complete fix for attribution 2006-01-02 03:30:57 +00:00
Dave Airlie 42cd50fa90 Realign via driver with changes in Linux kernel (mainly whitespace) 2006-01-02 03:25:49 +00:00
Dave Airlie 780e90e4a2 add radeon card type get param so userspace can avoid walking PCI 2005-12-29 00:17:51 +00:00
Dave Airlie b14d15ac41 Add vblank support to i915 DRM.. 2005-12-28 23:49:59 +00:00
Dave Airlie 4c988520a8 step back one reported bugs against that patch 2005-12-28 22:36:51 +00:00
Dave Airlie 274fdf482b fix radeon memory mapping from Ben Herrenschmidt 2005-12-16 08:02:17 +00:00
Dave Airlie e7b0176584 Lindent some via files 2005-12-16 07:59:13 +00:00
Dave Airlie 0b4fdc81d1 add texrect support for r300 2005-12-05 01:11:20 +00:00
Eric Anholt f5a9f27bf6 Add RV410 X700PRO PCI ID
Submitted by: Adam K Kirchhoff <adamk@voicenet.com>
2005-12-02 23:55:21 +00:00
Eric Anholt c6344e8df5 Assert an MIT copyright on sis_drm.h, since one was lacking and I created
that particular file. Its contents have changed a good bit since the
    original sis code, and the original sis code didn't care much about
    attribution since it routinely disclaims Precision Insight/VA Linux
    from responsibility. Also, adjust formatting around license headers
    (have a comment open immediately before the "Copyright" line, not as a
    runon of any previous comments) for automatic processing into FreeBSD,
    where /*- is used to signal the beginning of license headers for
    automatic compilation of license lists.
2005-11-28 23:10:41 +00:00
Thomas Hellstrom a5747964ec Fixed long standing 64-bit bug in via memory manager. Bumped via date and
patchlevel.
2005-11-16 10:55:53 +00:00
Thomas Hellstrom c8261e3d24 Loosen via dmablit alignment checks somewhat. Adapt stride check to maximum
sceen size for EXA.
2005-11-15 11:20:47 +00:00
Dave Airlie b5d71f63cd enable i915 32/64 bit ioctls 2005-11-11 12:23:18 +00:00
Dave Airlie 224ebd2c8d RV200 < R200 2005-11-11 10:56:31 +00:00
Dave Airlie 97528041df fix up radeon whitespace 2005-11-11 10:02:10 +00:00
Dave Airlie 3eb577c7c5 mixing breaks in r128 driver.. fixed in kernel 2005-11-11 09:20:34 +00:00
Dave Airlie cec83bf6d3 remove extra spaces 2005-11-11 09:07:08 +00:00
Dave Airlie 9a91674d45 cleanup ioctl/max_ioctl to use header file for extern symbols 2005-11-11 07:45:46 +00:00
Eric Anholt 6481a2e4cd Correct a LOR issue on FreeBSD by allocating temporary space and doing a
single DRM_COPY_FROM_USER rather than DRM_VERIFYAREA_READ followed by
    tons of DRM_COPY_FROM_USER_UNCHECKED. I don't like the look of the
    temporary space allocation, but I like the simplification in the rest
    of the file. Tested with glxgears, tuxracer, and q3 on a savage4.
2005-11-08 21:40:03 +00:00
Eric Anholt a10d8178e3 Initial port of savage to FreeBSD for the AGP and !ShadowStatus case. Adds
drm_mtrr_{add,del} for handling the MTRR setup. Still has a LOR issue
    with DRM_VERIFYAREA_READ/DRM_COPY_FROM_USER_UNCHECKED in savage_bci.c
    -- this won't work with the fine-grained locking in use, and just doing
    a single copyin to a temporary will probably work fine. Also note that
    the module leaks approximately 4 kb on unload.
2005-11-08 20:25:00 +00:00
Eric Anholt 2c6308fe54 Correct a LOR on FreeBSD by allocating a temporary buffer and doing a
single COPY_FROM_USER into it, rather than VERIFYAREA followed by many
    COPY_FROM_USER_UNCHECKEDs.
2005-11-08 09:02:02 +00:00
Eric Anholt 71f9b7357c Fix FreeBSD DRM for latest MGA changes to agp support, which cleans things
up a good bit, I think. Also, remove the agp_uninit() function which
    has lain around as a noop for years now. The FreeBSD DRM is now all
    compiling, with the exception of via. One known sleeping-with-lock-held
    issue remains.
2005-11-08 05:29:26 +00:00
Eric Anholt 1a256df480 Catch FreeBSD up to the pcie gart changes. Required minor modification to
radeon_cp.c to use a drm_local_map_t-type mapping (drm_core_ioremap
    rather than drm_ioremap), which contains private device mapping
    information on BSD. I also changed the ati_pcigart interface to use
    "void *" for pointers to kva rather than "unsigned long". While PCIGART
    support appears to be broken on FreeBSD currently, I think this is not
    new, and BusType PCI remains working on my r100 in Linux.
2005-11-08 02:38:01 +00:00
Ian Romanick 39615ec06e Converts the remaining drm_agp_foo functions to be a drm_agp_foo and
drm_agp_foo_ioctl pair. Modifies the MGA DRM to use the drm_agp_foo
    functions instead of the drm_foo_agp functions. The drm_foo_agp
    functions are no longer exported by drm.ko.
Ensures that dma->seg_count and dma->page_count are properly set in
    drm_addbufs_{agp,sg,fb}. drm_addbufs_pci was already correct.
Ensures that mga_do_agp_dma_bootstrap correctly sets agp_buffer_token.
At this point PCI DMA is still broken.
Xorg bug: #4797 Reviewed by: Dave Airlie, Eric Anholt Signed-off-by: Ian
    Romanick <idr@us.ibm.com>
2005-11-03 00:38:25 +00:00
Thomas Hellstrom b63b771285 via: Sync via_drm.h with 3D driver. Bump via patchlevel and date. 2005-10-22 15:12:05 +00:00
Dave Airlie 6cd0282f64 fix G550 cards 2005-10-20 22:41:26 +00:00
Adam Jackson ea83db57e3 via and r300 still need installed reg headers. 2005-10-20 17:51:57 +00:00
Thomas Hellstrom cf8ce0888a via: PCI DMA bugfixes and DOS due to too many mapped pages checks. 2005-10-20 17:37:32 +00:00
Dave Airlie 763d726c43 dma access also needs some work 2005-10-20 02:35:08 +00:00
Dave Airlie 727e88c4f4 the old init path needs to set WAGP_ENABLE by default 2005-10-20 01:54:38 +00:00
Ian Romanick 4b3ee6c50e Doig a full clean up from mga_do_dma_bootstrap when
mga_do_agp_dma_bootstrap fails causes problems if
    mga_do_pci_dma_bootstrap succeeds. This commit makes it possible to do
    a "minimal" clean up instead. I'm still trying to figure out what is
    causing the failures in mga_do_agp_dma_bootstrap...
Signed-off-by: Ian Romanick <idr@us.ibm.com>
2005-10-14 05:01:19 +00:00
Ian Romanick 1505e316af Fixed a cut-and-paste bug that could cause an oops in mga_do_cleanup_dma
when mga_do_init_dma fails. Still trying to determine why
    mga_do_init_dma is failing.
Signed-off-by: Ian Romanick <idr@us.ibm.com>
2005-10-14 01:25:38 +00:00
Dave Airlie 0a24095cd6 Add X300 RV370 2005-10-13 11:21:31 +00:00
Adam Jackson 62a4673034 Skeleton nv drm driver, to enable DMA in EXA. (Lars Knoll, minor updates by
me)
2005-10-06 23:31:29 +00:00
Dave Airlie f42cdc8dcb Add support to turn writeback off via radeon module option 2005-09-30 06:41:10 +00:00
Dave Airlie 6ff57e2d7c fix pci overriding from userspace 2005-09-30 06:35:09 +00:00
Thomas Hellstrom 903e5701ff Add the via PCI DMA blit code. 2005-09-25 12:54:12 +00:00
Dave Airlie d4dec1db80 hopefully fix server recycling on PCIE 2005-09-25 08:54:31 +00:00
Dave Airlie f1276d3b43 add some pci express chips 2005-09-12 04:37:52 +00:00
Dave Airlie ba8f4fb778 make PCI Express work on 64-bit machines, thanks to Alex Deucher (agd5f) 2005-09-12 04:35:31 +00:00
Dave Airlie 5565a00916 Add GART in FB support for ati pcigart, and PCIE support for r300 2005-09-11 08:51:23 +00:00
Roland Scheidegger 53c8037786 Add support for GL_ATI_fragment_shader, new packets R200_EMIT_PP_AFS_0/1,
R200_EMIT_PP_TXCTLALL_0-5 (replaces R200_EMIT_PP_TXFILTER_0-5, 2 more
    regs) and R200_EMIT_ATF_TFACTOR (replaces R200_EMIT_TFACTOR_0 (8 consts
    instead of 6)
2005-09-09 22:35:49 +00:00
Vladimir Dergachev c8b5a9f8cc Add another R300 PCI id. Submitted by: Daniel Estévez 2005-09-09 12:53:44 +00:00
Dave Airlie 0d346a07a8 convert ioctl flags to use flags instead of separate ints 2005-09-03 03:27:14 +00:00
Eric Anholt 22ec8ebb17 - Don't try to allocate mappings of less than a PAGE_SIZE in MGA DMA code.
- Comment out the "is this mapping/bufs in allocated AGP" bits in BSD
    because they break mga (which uses AGP allocation that doesn't track
    entries). It's not a security issue when we still have the related
    ioctls marked root-only.
- Apply some power-of-two alignment restrictions to hopefully avoid some
    panicing in bad cases of drm_pci_alloc() on FreeBSD.
- Add verbosity to some error handling that I found useful while debugging.
2005-08-26 23:27:19 +00:00
Eric Anholt 9942cad1f6 Add missing .cvsignore files for autotoolery. 2005-08-25 23:11:28 +00:00
Alan Hourihane 01e4364a8f remove i915_pm code as it causes too many issues with current software
suspend, and the DDX driver re-inits the board successfully anyway.
2005-08-22 09:50:12 +00:00
Dave Airlie e2dc70593f We don't need to install all the internal headers files only drm.h and
*_drm.h have user space interfaces
2005-08-21 03:04:32 +00:00
Adam Jackson 017174085f Fix silly install issue by moving the header install rules for shared-core
into shared-core/Makefile.am. Bump to 1.0.3.
2005-08-20 03:32:09 +00:00
Dave Airlie 279e7c113c commit toggle switch to make Linux drm_handle_t unsigned int 2005-08-17 00:14:18 +00:00
Dave Airlie 7af0186f4c add Egberts 32/64 bit patch (its in kernel already...) 2005-08-16 12:51:57 +00:00
Eric Anholt 8c21b783c3 Port the VIA DRM to FreeBSD. Original patch by Jake, with some cleanup by
me to match other drivers and avoid ifdeffing. The linux via_drv.c will
    be moved from shared-core to linux-core soon by repocopy.
Submitted by: Jake Burkholder <jake@FreeBSD.org> Tested by: unichrome
2005-08-15 18:07:12 +00:00
Thomas Hellstrom 4f5961eeee VIA bugvixes by Joris van Rantwijk Initial commit. 2005-08-14 09:52:09 +00:00
Thomas Hellstrom cdf49e5732 Reverting the previous via security-fix commit, since the assumption of
contexts registered with the callers filp was wrong.
2005-08-12 14:19:33 +00:00
Thomas Hellstrom d5e8ab13ff Security fix on via: Checking that the specified context belongs to the
caller on fb / agp memory alloc and free. Otherwise malicious clients
    can register allocations on other clients or free memory used by other
    clients which will lead to severe memory manager inconsistensies.
2005-08-10 19:46:46 +00:00
Jon Smirl 0d81954b0e Make sure savage has 3rd ioctl parameter 2005-08-09 01:40:45 +00:00
Dave Airlie 3a61e9f96c make some functions static in the savage drm driver 2005-08-07 05:37:25 +00:00
Dave Airlie 1cbe97eea1 fix ioctl in r128 drm direction from Egbert Eich. 2005-08-07 05:32:06 +00:00
Eric Anholt c789ea1521 Rename the driver hooks in the DRM to something a little more
understandable: preinit -> load postinit -> (removed) presetup ->
    firstopen postsetup -> (removed) open_helper -> open prerelease ->
    preclose free_filp_priv -> postclose pretakedown -> lastclose
    postcleanup -> unload release -> reclaim_buffers_locked version ->
    (removed)
postinit and version were replaced with generic code in the Linux DRM
    (drivers now set their version numbers and description in the driver
    structure, like on BSD). postsetup wasn't used at all. Fixes the savage
    hooks for initializing and tearing down mappings at the right times.
    Testing involved at least starting X, running glxgears, killing
    glxgears, exiting X, and repeating.
Tested on: FreeBSD (g200, g400, r200, r128) Linux (r200, savage4)
2005-08-05 03:50:23 +00:00
Jon Smirl bb9502ab01 Mark some radeon init variables deprecated. These used to be passed in but
the driver already knew their correct value. For example the physical
    address of the framebuffer and registers.
2005-08-04 13:59:48 +00:00
Jon Smirl ea2c7a895d Split the control of master vs root priv. Everything is still marked as
needing root.
2005-08-04 13:15:27 +00:00
Eric Anholt 3ffd0c188b Whitespace fixups. 2005-08-04 07:46:11 +00:00
Eric Anholt b0da5df90a Fix the MGA driver on BSD by passing in the proper chipset flags to the
driver's preinit routine, and by using DRM_COPY_TO_USER_IOCTL when
    copying out to an ioctl's data pointer. Pulled from the latest version
    of my drm-hook-rename.diff and only compile-tested after that.
2005-08-04 07:42:01 +00:00
Eric Anholt 49bbb6d861 Add a debugging error message from testing new MGA code on BSD. 2005-08-04 07:31:21 +00:00
Eric Anholt 1cc1f49825 Fix issues with buffer aging when more than one dma buffer is discarded in
a cmdbuf, which could lead to hangs.
Submitted by: Aapo Tahkola
2005-07-28 01:44:17 +00:00
Eric Anholt 942545721f Correct a couple of descriptions of files in comments (were just
copy'n'pasted).
Submitted by: jkim
2005-07-27 20:20:30 +00:00
Roland Scheidegger 096e0349ea fix driver date and drm minor version for r300 support 2005-07-27 18:19:11 +00:00
Eric Anholt ab59dd285c Add latest r300 support from r300.sf.net CVS. Patch submitted by volodya,
with BSD fix from jkim and the r300_reg.h license from Nicolai Haehnle.
    Big thanks to everyone involved!
2005-07-20 21:17:47 +00:00
Dave Airlie d3d3184fe4 revert last change due to me bring up too early 2005-07-16 03:11:53 +00:00
Dave Airlie 9803eb179c up the version 2005-07-16 02:07:14 +00:00
Dave Airlie d6d67dbf92 Egbert noticed this issue, but changing the IOW to IOWR mess up
compatiblity with userspace..
2005-07-16 02:03:03 +00:00
Thomas Hellstrom 567113788c VIA: Fix sparse warnings (Alexey Dobriyan) 2005-07-15 21:22:51 +00:00
Jon Smirl d41af11ee3 Add sysfs attribute dri_library_name on Linux. code in share-core/via_drv.c
is ok to be shared, it will be passive on BSD.
2005-07-03 17:16:12 +00:00
Alan Hourihane 2b427bee9b Move to linux specific directory 2005-06-29 11:36:37 +00:00
Dave Airlie 964c57e71f add mga and r128 32/64 bits
This is Egberts code, ported to Pauls framework by me..
2005-06-29 11:22:39 +00:00
Eric Anholt 5d96c74ff1 - Remove drm_initmap and replace its usage with drm_addmap. This reduces
code duplication, and it also hands you the map pointer so you don't
    need to re-find it.
- Remove the permanent maps flag. Instead, for register and framebuffer
    maps, we always check whether there's already a map of that type and
    offset around. Move the Radeon map initialization into presetup (first
    open) so it happens again after every takedown.
- Remove the split cleanup of maps between driver takedown (last close) and
    cleanup (module unload). Instead, always tear down maps on takedown,
    and drivers can recreate them on first open.
- Make MGA always use addmap, instead of allocating consistent memory in
    the PCI case and then faking up a map for it, which accomplished nearly
    the same thing, in a different order. Note that the maps are exposed to
    the user again: we may want to expose a flag to avoid this, but it's
    not a security concern, and saves us a lot of code.
- Remove rmmaps in the MGA driver. Since the function is only called during
    takedown anyway, we can let them die a natural death.
- Make removal of maps happen in one function, which is called by both
    drm_takedown and drm_rmmap_ioctl.
Reviewed by: idr (previous revision) Tested on: mga (old/new/pci dma),
    radeon, savage
2005-06-28 20:58:34 +00:00
Dave Airlie 6397722f19 add compat code from Paul Mackerras 2005-06-28 13:02:20 +00:00
Alan Hourihane b6b270a260 Given that BenH says using the sysdev approach for DRM is bogus, I'll yank
the code for it, rather than introducing something that isn't going to
    work 100% of the time.
2005-06-28 08:03:33 +00:00
Alan Hourihane e2d76b0642 Reverse the pm_message_t patch for now, it appears that the 2.6.12 release
didn't have it.
2005-06-27 15:17:12 +00:00
Alan Hourihane 1a6780348c Check for 2.6.12 suspend/resume changes (pm_message_t) 2005-06-27 12:39:02 +00:00
Alan Hourihane fa24ccccf4 Check dev_priv 2005-06-27 11:41:40 +00:00
Alan Hourihane d6af201663 Save state of registers for suspend/resume. 2005-06-27 11:39:44 +00:00
Alan Hourihane cdc50eba6a Fix suspend problem when i915 private hasn't been initialized yet. 2005-06-24 08:56:12 +00:00
Jon Smirl 9fb77e869f Change initialization of savage register access to _DRM_READ_ONLY. Flags of
zero does not mean no privs, instead it grants write access
    _DRM_READ_ONLY only applies to non-root users. Problem is only in CVS,
    initmaps are not in the kernel yet.
2005-06-21 02:20:02 +00:00
Jon Smirl 298b6fcedb Change initialization of radeon register access to _DRM_READ_ONLY. Flags of
zero does not mean no privs, instead it grants write access
    _DRM_READ_ONLY only applies to non-root users. Problem is only in CVS,
    initmaps are not in the kernel yet.
2005-06-20 15:40:48 +00:00
Jon Smirl ae2264d3c9 Remove I2C support from radeon driver. Same support is available from
radeonfb.
2005-06-19 04:15:58 +00:00
Dave Airlie 71df0eed34 fix up drm_alloc_agp to take a dev arg and not pass crappy agpgart around 2005-06-17 09:09:17 +00:00
Ian Romanick 72cfc797b5 Adds support for PCI cards to MGA DRM
This patch adds serveral new ioctls and a new query to get_param query to
    support PCI MGA cards.
Two ioctls were added to implement interrupt based waiting. With this
    change, the client-side driver no longer needs to map the primary DMA
    region or the MMIO region. Previously, end-of-frame waiting was done by
    busy waiting in the client-side driver until one of the MMIO registers
    (the current DMA pointer) matched a pointer to the end of primary DMA
    space. By using interrupts, the busy waiting and the extra mappings are
    removed.
A third ioctl was added to bootstrap DMA. This ioctl, which is used by the
    X-server, moves a *LOT* of code from the X-server into the kernel. This
    allows the kernel to do whatever needs to be done to setup DMA buffers.
    The entire process and the locations of the buffers are hidden from
    user-mode.
Additionally, a get_param query was added to differentiate between G4x0
    cards and G550 cards. A gap was left in the numbering sequence so that,
    if needed, G450 cards could be distinguished from G400 cards. According
    to Ville Syrjälä, the G4x0 cards and the G550 cards handle
    anisotropic filtering differently. This seems the most compatible way
    to let the client-side driver know which card it's own. Doing this very
    small change now eliminates the need to bump the DRM minor version
    twice.
http://marc.theaimsgroup.com/?l=dri-devel&m=106625815319773&w=2
A number of ioctl handlers in linux-core were also modified so that they
    could be called in-kernel. In these cases, the in-kernel callable
    version kept the existing name (e.g., drm_agp_acquire) and the ioctl
    handler added _ioctl to the name (e.g., drm_agp_acquire_ioctl).
This patch also replaces the drm_agp_do_release function with
    drm_agp_release. drm_agp_release (drm_core_agp_release in the previous
    patch) is very similar to drm_agp_do_release, and I saw no reason to
    have both.
This commit *breaks the build* on BSD. Eric said that he would make the
    required updates to the BSD side soon.
Xorg bug: 3259 Reviewed by: Eric Anholt
2005-06-14 22:34:11 +00:00
Dave Airlie 3585bdf7d8 fix up drm.h for C++ include as this can be included in user programs 2005-06-11 10:08:39 +00:00
Dave Airlie f4aa8ab715 add dragonfly #define from Xorg CVS 2005-06-10 01:21:23 +00:00
Ian Romanick dfc650bd80 Completely re-initialize DMA settings
There were two problems. First, the 'warp' and 'primary' pointers weren't
    cleared, so mga_do_cleanup_dma, which gets called multiple times, would
    try to ioremapfree them multiple times. This resulted in the new error
    messages to syslog. The second problem was the, since the dev_private
    structure isn't reallocated and cleaned out in mga_do_init_dma, when
    the server is reloaded idle-waits would wait for impossible values.
I have given this patch some more riggorous testing. This includes:
- Load module, start server, run GL app, stop server, unload module.
- Load module, start server, run GL app, stop server, unload module, reload
    module, restart server, run GL app.
- Load module, start server, run GL app, stop server, restart server, run
    GL app, stop server, unload module.
In all three cases, everything worked as expected. Please let me know if
    there are any further regressions with this patch.
Xorg bug: 3408 Reported by: Chris Rankin
2005-06-09 21:18:56 +00:00
Dave Airlie 9f2f010763 fix some issues with radeon interrupt handling
From: Dave Airlie + Benjamin Herrenschmidt
2005-06-06 11:35:43 +00:00
Alan Hourihane 246c617c87 Fix copyrights 2005-06-06 09:18:44 +00:00
Dave Airlie 83cb150449 Remove warnings about code mixed with declerations.. 2005-06-04 06:14:58 +00:00
Ian Romanick 1d678a518e Minor clean-ups. The drm_mga_fullscreen_t stuff has been dead for a looong
time. Remove it and an out-dated comment.
2005-06-03 22:53:32 +00:00
Ian Romanick 8e7c130ef7 Move the deallocation of dev_private. Since dev_private is allocated when
the driver is loaded and is always expected to be around, it should
    only be deallocated when the driver is unloaded.
Xorg bug: #3408 Reported by: Chris Rankin
2005-06-03 22:45:21 +00:00
Alan Hourihane 45f1db8db9 Re-implement the power management.
There's two choices when fb is or isn't loaded as we treat ourselves as a
    PCI driver in the latter case.
If we are a PCI driver, then register the suspend/resume functions
    directly. If not, then we register as a sysdev and pick up the
    suspend/resume actions and pump them down into a generic *power
    function.
It'll be nice when this little mess is sorted out with regard to being a
    real PCI driver ;-/
2005-05-28 00:00:08 +00:00
Ian Romanick 4a84416c45 Modify drm_driver::device_is_agp to return a tri-state value to indicate
that a device absolutely is, absolutely is not, or may or may not be
    AGP. Modify the i915 DRM to use this to force all i9x5 devices to be
    "AGP" (even the PCI-e devices).
Reported by: Lukas Hejtmanek
2005-05-27 23:42:11 +00:00
Dave Airlie c9abd2fec5 add radeon registers from VHA code these are the "unknown" registers 2005-05-27 07:23:44 +00:00
Thomas Hellstrom e1fd79b31e VIA:
64-bit fixes. Bumped driver date and patchlevel.
2005-05-23 20:56:54 +00:00
Ian Romanick 955791f064 Refactor the routines for "calculating" the size of the WARP microcode. The
two routines (one for G200 and one for G400) were replaced with static
    const variables and a single function that returns the correct size.
    The code to generate an error if the allocated WARP region is too small
    was refactored from mga_warp_install_{g200,g400}_microcode to
    mga_wrap_install_microcode.
mga_warp_microcode_size is global to the MGA DRM because it will soon be
    used by code in another file.
2005-05-22 04:36:33 +00:00
Ian Romanick 75cb43ccd7 Forgot to bump the patchlevel and driver date on last commit. 2005-05-21 02:31:08 +00:00
Ian Romanick a686be5bc8 Change the MGA initialization and cleanup a bit. The dev_private structure
is now allocated (and partially filled in) by the new
    mga_driver_preinit function.
This allows the driver to detect the type of card (i.e., G200 class vs.
    G400 class) on its own. The chipset value passed to mga_dma_init is now
    ignored. This same technique is used by the radeon DRM.
As a result of this, mga_driver_pretakedown was converted to
    mga_driver_postcleanup. This routine gets called in some other places
    than might be expected, and it sets the dev_private pointer to NULL.
    That little gem took over an hour to track down. :(
2005-05-21 02:27:51 +00:00
Dave Airlie 4ca48cb4d8 Add i945G pci ids to drm
From: Christopher Allen Wing <wingc@engin.umich.edu> Signed-off-by: Dave
    Airlie <airlied@linux.ie>
2005-05-18 06:35:16 +00:00
Ian Romanick e051cd19c0 Added device_is_agp callback to drm_driver. This function is called by the
platform-specific drm_device_is_agp function. Added implementation of
    this function the the Linux-specific portion of the MGA driver to
    detect PCI G450 cards. Added code to the Linux-specific portion of the
    generic DRM layer to not initialize AGP infrastructure if the card is
    not AGP (this matches what already existed in BSD).
Bumped the driver date and the driver patch-level for MGA.
This mostly fixes bugzilla #3248. The BSD side still needs an
    implementation of mga_driver_device_is_agp.
2005-05-16 17:37:10 +00:00
Dave Airlie bd72c6990f wrap config.h include with defined for KERNEL 2005-05-15 10:19:21 +00:00
Thomas Hellstrom e0fc400b68 VIA: Fix for oops when AGP ring-buffer initialization is called and there
is no AGP memory acquired.
2005-05-08 20:33:04 +00:00
Eric Anholt 2fcf66a02f Clean up some const qualifier cast warnings. 2005-04-26 06:03:39 +00:00
Eric Anholt ec111d70fe Convert BSD code to mostly use bus_dma, the dma abstraction for dealing
with IOMMUs and such. There is one usage of the forbidden vtophys()
    left in drm_scatter.c which will be fixed up soon. This required a KPI
    change for drm_pci_alloc/free() to return/use a drm_dma_handle_t that
    keeps track of os-specific bits, rather than just passing around the
    vaddr/busaddr/size.
Submitted by: Tonnerre Lombard (partially) Tested on: FreeBSD: Rage128
    AGP/PCI Linux: Savage4 AGP/PCI
2005-04-26 05:19:11 +00:00
Eric Anholt 31a06d0bac Use msleep instead of tsleep to drop the DRM device lock and avoid a
sleep-with- mutex held. This probably ought to be an os-independent
    sleep function ala DRM_USLEEP.
2005-04-26 05:11:20 +00:00
Thomas Hellstrom 2b8dc25dc5 VIA: Interrupt handler bugfixes. Bumped patchlevel to 2.6.2. 2005-04-20 10:16:52 +00:00
Thomas Hellstrom a08343e3e0 VIA:
1) Security fix: Stopped possible MMIO access to PCI DMA area for the
    unichrome Pro.
2) Fixed an odd cpu usage problem by padding small AGP DMA submissions.
    Bumped patchlevel.
2005-04-18 08:26:00 +00:00
Thomas Hellstrom cb5f6c22b5 Missing file via_video.c commited. 2005-03-29 09:48:12 +00:00
Adam Jackson 0a5e02c7b5 Add skeletal imagine driver (but don't build it yet). 2005-03-29 01:47:38 +00:00
Thomas Hellstrom 532ccb98b5 Via updates:
New PCI command parser. Moved from via_dma.c to via_verifier.c so functions
    with similar functionality are close to eachother.
Moved video related functions to via_video.c, which might be extended in
    the future, as new video functionality is added.
New device-specific generic IRQ IOCTL, similar to the general VBLANK IOCTL,
    but with support for multiple device IRQ sources and functionality.
Support for Unichrome Pro PM800/CN400 video DMA commands in verifier and
    PCI parser.
Support for Unichrome Pro PM800/CN400 HQV IRQs in the new generic IRQ
    IOCTL.
Bumped minor. New version 2.6.0.
2005-03-28 21:21:42 +00:00
Alan Hourihane 459ef48629 Don't know who set the i915GM PCI ID incorrectly but it should be 0x2592 2005-03-25 13:44:47 +00:00
Dave Airlie 9182891b26 From Xorg CVS realign the i915_drv.h
From: Tungsten Graphics Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-03-25 13:16:38 +00:00
Michel Daenzer ab396776fb Add support for production version of ATI RN50/ES1000. (ATI Technologies
Inc.)
2005-03-18 22:51:43 +00:00
Roland Scheidegger 34563921dd add R200_EMIT_PP_TRI_PERF_CNTL packet to support brilinear filtering on
r200
2005-03-15 22:12:30 +00:00
Thomas Hellstrom d2fd920095 via changes:
1. Initialize futex locks to zero on device init.
2. Remove some stray defines from via_drm.h
3. Prepare via_drm.h for drm client inclusion. The goal is to share a
    common file with common definitions.
4. Sync shared / shared-core via_drm.h
5. Bump minor, because of the futex lock initialization.
2005-03-14 22:50:21 +00:00
Felix Kuehling a396617dbc Command DMA optimizations:
- don't waste DMA memory when small command buffers are flushed
- minimized padding with noops
- slightly simplified faked DMA flushing
2005-03-13 02:16:10 +00:00
Felix Kuehling 95fa851769 Tracked down random lockups related to command DMA that occurred in Quake3
after ~5min: buffer aging was subtly broken. Part of this may have also
    affected vertex DMA buffer aging and client-side texture heap aging,
    though with less fatal consequences. Bumped minor version and driver
    date.
2005-03-07 12:19:49 +00:00
Dave Airlie 32b6823a25 minor pointer cast typo 2005-03-07 09:40:18 +00:00
Felix Kuehling 15995234b4 Added support for command DMA on Savage4-based hardware. Unfortunately
command and vertex DMA don't work at the same time. Command DMA
    performance is superior and works with all vertex formats. Bumped minor
    version and driver date.
2005-03-06 01:41:06 +00:00
Dave Airlie 26f04a1664 add some idct type 3 packets for reference 2005-03-04 03:04:37 +00:00
Felix Kuehling bc54ede0a8 Use wrap counter to extend 16-bit hardware event tags to 32-bit logical
event counters in the SAVAGE_EVENT_EMIT/WAIT ioctls. This is needed for
    reliable client-side texture heap aging. Slightly simplified DMA buffer
    aging while at it. Bumped minor version and driver date.
2005-02-23 16:34:30 +00:00
Thomas Hellstrom f3cf4bc5f2 Fix VIA K8M800 PCI ID. 2005-02-20 00:05:43 +00:00
Eric Anholt 56cdeff231 Fix a couple of gcc warnings in DRM_INFOs. 2005-02-19 22:07:07 +00:00
Michel Daenzer 49e19c8d00 fd.o bug #2576: Add support for ATI RN50/ES1000. (ATI Technologies Inc.) 2005-02-18 20:06:10 +00:00
Eric Anholt 2f7cd38c12 Initialize kbuf to NULL to quiet the compiler about uninit variables
(wasn't an issue). Don't forget to free kbuf if the copyin fails.
2005-02-14 03:22:58 +00:00
Thomas Hellstrom 650c0fe391 Fixed Futex release bug. Bumped driver date and patchlevel. 2005-02-13 23:03:48 +00:00
Roland Scheidegger 732cdc5cef add support for texture micro tiling on radeon/r200. Add support for r100
cube maps (since it also requires a version bump) at the same time.
2005-02-10 19:22:43 +00:00
Eric Anholt 81459d6e50 Close a race which could allow for privilege escalation by users with DRI
privileges on Radeon hardware. Essentially, a malicious program could
    submit a packet containing an offset (possibly in main memory) to be
    rendered from/to, while a separate thread switched that offset in
    userspace rapidly between a valid value and an invalid one.
    radeon_check_and_fixup_offset() would pull the offset in from user
    space, check it, and spit it back out to user space to be copied in
    later by the emit code. It would sometimes catch the bad value, but
    sometimes the malicious program could modify it after the check and get
    an invalid offset rendered from/to.
Fix this by allocating a temporary buffer and copying the data in at once.
    While here, make the cliprects stuff not do the VERIFYAREA_READ and
    COPY_FROM_USER_UNCHECKED gymnastics, avoiding a lock order reversal on
    FreeBSD. Performance impact is negligible -- no difference on r200 to
    ~1% improvement on rv200 in quake3 tests (P4 1Ghz, demofour at
    1024x768, n=4 or 5).
2005-02-08 04:17:14 +00:00
Dave Airlie 300e0866d6 fix agp detection on linux 2005-02-07 10:44:28 +00:00
Eric Anholt 080a547d4d - Implement drm_initmap, and extend it with the resource number to help
FreeBSD. Add drm_get_resource_{start|len} so linux-specific stuff
    doesn't need to be in shared code.
- Fix mach64 build by using __DECONST to work around passing a const
    pointer to useracc, which is unfortunately not marked const.
- Get rid of a lot of maplist code by not having dev->maplist be a pointer,
    and by sticking the link entries directly in drm_local_map_t rather
    than having a separate structure for the linked list.
- Factor out map uninit and removal into its own routine, rather than
    duplicating in both drm_takedown() and drm_rmmap().
- Hook up more driver functions, and correct FreeBSD-specific bits of
    radeon_cp.c, making radeon work.
- Baby steps towards using bus_space as we should.
2005-02-05 08:00:14 +00:00
Thomas Hellstrom 270ca5f3ce Via driver: Add missing drm_poll function to via driver in core. 2005-02-03 10:51:22 +00:00
Eric Anholt 7f7bbdcbed Declare r128_do_cleanup_pageflip static since it's only used here and its
prototype went away.
2005-02-03 01:06:10 +00:00
Eric Anholt ed31275144 Cast user data to correct type in radeon_surface_free's copyin. 2005-02-03 01:05:34 +00:00
Dave Airlie 0d6b7fcb79 cleanup patch from Adrian Bunk <bunk@stusta.de> 2005-02-01 11:08:31 +00:00
Dave Airlie 1dd948f280 make functions static in i915, remove unused functions 2005-02-01 10:43:42 +00:00
Thomas Hellstrom cd9ef39c76 Fixed multiple devices DMA bug. Fixed PCI path FIRE command detection 2005-01-27 22:48:47 +00:00
Dave Airlie 77045dc516 fix incorrect PCI id for ATI radeon 2005-01-27 09:13:42 +00:00
Roland Scheidegger 43c3223de6 (Stephane Marchesin,me) Add radeon framebuffer tiling support to radeon
drm. Add new ioctls to manage surfaces which cover the tiled areas
2005-01-26 17:48:59 +00:00
Roland Scheidegger 408376b203 replace magic number with macro constant RADEON_ZBLOCK16 2005-01-26 14:19:24 +00:00
Felix Kuehling 39d5c831a0 Removed one bogus Savage3D PCI ID. Corrected another one. Restored
numerical ordering.
2005-01-20 23:33:24 +00:00
Adam Jackson 36ec8d82e7 Add a Savage3D PCI ID 2005-01-20 19:05:42 +00:00
Felix Kuehling 858e68fbdc Corrected some confusion of vb_stride and vtx_size
Implemented SAVAGE_CMD_DMA_IDX and SAVAGE_CMD_VB_IDX for ELTs support in
    the _savage_render_stage of the 3D driver
Bumped minor version and driver date
2005-01-20 12:23:25 +00:00
Jose Fonseca d29e2369be Some code commenting concerning the FIFO & DMA engine. 2005-01-17 21:46:32 +00:00
Dave Airlie 0867ce78f6 This table is in radeon_drv.h along with the version number so remove it
from here
2005-01-16 06:41:34 +00:00
Dave Airlie 354dd17d25 The patch makes drmAddBufs/drmMapBufs can handle buffers in video memory
The attached patch adds a new buffer type DRM_FB_BUFFER. It works like AGP
    memory but uses video memory.
From: austinyuan@viatech.com.cn (fd.o bug 1668) Signed-off-by: Dave Airlie
    <airlied@linux.ie>
2005-01-16 05:40:12 +00:00
Felix Kuehling 9514ee39f7 Fixed a bug that prevented the driver from ever emitting triangle strips or
fans. Bumped patchlevel and driver date.
2005-01-16 01:22:09 +00:00
Felix Kuehling ffc51f1f32 Setup MTRRs for frame buffer and aperture manually on Savage3D and
Savage4-based cards. Automatic setup in drm_initmap doesn't work due to
    the weird alignment and size of the aperture.
2005-01-15 16:55:01 +00:00
Felix Kuehling 17d893f567 Only try to find the agp_buffer_map if dma_type is AGP. This is all that's
needed on the DRM side to support PCI Savages. Bumped patch level and
    driver date.
2005-01-10 22:46:02 +00:00
Felix Kuehling d6af902ff7 Improved workaround for Savage3D DMA lockup to emit NOPs only before the
first indexed drawing command of a cmdbuf or if a wait command was
    emitted since the last indexed drawing command.
2005-01-09 19:49:21 +00:00
Felix Kuehling e7ba83bd6f Fixed off-by-one error in savage_bci_wait_fifo_shadow. 2005-01-08 23:28:27 +00:00
Thomas Hellstrom fb6a4d0a7d via updates: moved the verifier state struct to dev_priv. Implemented AGP
alignment check.
2005-01-07 11:37:01 +00:00
Thomas Hellstrom ca2b94cfa2 Updated via DRM with check for stray FIRE commands primitive list. 2005-01-07 08:21:29 +00:00
Alan Hourihane fcece3cf34 Add i915GM support Add resume functionality (must be used with later DDX)
Bump to 1.2
2005-01-06 17:51:32 +00:00
Thomas Hellstrom 50a6ffa878 via DRM: Updated the verifier to check the vertex lists more thorough. This
should hopefully stop it from getting out of sync.
The PCI command parser is still not updated.
2005-01-06 15:53:38 +00:00
Felix Kuehling ae1bc4a6da 3D scissor regs are now managed by the DRM to iterate over clip rects
passed to the cmdbuf ioctl (try xeyes on top of glxgears ;-)
Tightened the texture state check
Bumped Savage DRM version to 2.1.0 so that DRI driver can (theoretically)
    depend on the DRM to manage the scissor registers
2005-01-05 23:45:42 +00:00
Thomas Hellstrom 4818014ab1 Bumped driver date and minor version. 2005-01-05 17:46:34 +00:00
Thomas Hellstrom e34b560191 VIA update:
Release video futexes when context is destroyed (This was previously done
    by the X server).
Added New Unichrome Pro VIDEO DMA commands to the verifier.
Added Quiescent heavyweight lock mode.
2005-01-05 17:44:43 +00:00
Felix Kuehling 094f02c568 Fixed the DMA buffer age test. Should fix occasional "soft" lockups. Bumped
patch level and driver date.
2005-01-05 14:34:12 +00:00
Felix Kuehling 04842e8bcf Completeley rewritten Savage DRM which can be considered secure (modulo
implementation errors). Direct hardware (MMIO, BCI) access is no longer
    needed in the Mesa driver. Bumped version to 2.0.0. Corresponding
    changes to the DDX and Mesa drivers are being committed.
2005-01-01 20:22:58 +00:00
Felix Kuehling ed165a2529 Added a new DRM map type _DRM_CONSISTENT for consistent PCI memory. It uses
drm_pci_alloc/free for allocating/freeing the memory. Only implemented
    in the Linux DRM so far.
2005-01-01 20:03:15 +00:00
Thomas Hellstrom e19fa7ada1 VIA DRM: verifier: Added verbose palette error reporting, and support for
stipple palettes together with rudimentary checks for texture palette
    sizes.
other: Bumped version patchlevel and driver date.
2004-12-31 11:44:27 +00:00
Thomas Hellstrom 590b230119 VIA DRM: Stability enhancements and cleanups in via_dma.c Added explicit
licence notice in via_dma.c
2004-12-31 11:27:57 +00:00
Thomas Hellstrom 02c35ec0a2 via DRM: Tightened the security for some functions of the
DRM_IOCTL_VIA_DMA_INIT IOCTL. Bumped patchlevel and driver date.
XFree86 bug: 2119
2004-12-21 17:13:22 +00:00
Keith Whitwell 47c178da08 Copy HC_ParaType_Auto change to shared-core. Bump version numbers and
dates.
2004-12-20 12:03:02 +00:00
Thomas Hellstrom ae0db704b4 via changes: Fixed typecasting bug in via_dma.c, and possible short-circuit
bug in the cmdbuf_size ioctl. Modified ring-buffer jump code AGAIN, due
    to new oddities discovered on the Unichrome Pro with faster processors.
    Bumped patchlevel and driver date.
2004-12-19 19:13:47 +00:00
Thomas Hellstrom aff0a25485 VIA drm updates:
1. Improved security check of AGP texture adresses.
2. Hopefully last fix of ring-buffer jump oddities.
3. Added ioctl to check available space and command regulator lag in
    ring-buffer. This is needed for 3D application responsiveness.
2004-12-13 13:53:12 +00:00
Roland Scheidegger c4a87c6883 (Stephane Marchesin, me) add hyperz support to radeon drm. Only fast z
clear and z buffer compression are working correctly, hierarchical-z is
    not.
2004-12-08 16:43:00 +00:00
Thomas Hellstrom 1fbfd9eb32 Security and optimization fixes for the via drm:
1. The command verifier was never initialized in the non-core source tree.
2. Check added that the AGP ring buffer has been initialized before
    accepting command buffer.
3. Free space check in the AGP buffer is moved to after command
    verification, which is more optimal in most cases.
2004-12-06 11:19:23 +00:00
Thomas Hellstrom 267e064527 Added 3D functionality to the via command verifier. Modified the via
ring-buffer code somewhat to workaround hardware problems. Bumped via
    minor version number.
2004-12-03 23:03:36 +00:00
Dave Airlie f197110e07 Make 1-bit fields be unsigned (no sign bit :). sparse complains about them:
drivers/char/drm/sis_ds.h:88:12: warning: dubious one-bit signed
    bitfield drivers/char/drm/sis_ds.h:89:16: warning: dubious one-bit
    signed bitfield
Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Dave Airlie
    <airlied@linux.ie>
2004-12-03 10:22:15 +00:00
Thomas Hellstrom 4f8fa60286 Reworked PCI MMIO command buffer parser, and imported code from the Mesa
driver. It can now handle the 3D OpenGL commands from the Mesa
    unichrome driver.
Added vsync frequency detection support. This will be used in the future
    for XvMC and better frame timing.
Bumped minor version number and driver date.
2004-11-27 22:55:31 +00:00
Dave Airlie f0a86288fa patch from bug 1803 - will try and push to kernel soon 2004-11-11 11:09:11 +00:00
Dave Airlie c5bededa51 add some more r300 pci ids 2004-11-07 02:19:58 +00:00
Eric Anholt cb5aaa8987 Convert more drivers for bsd-core, moving the ioctl definitions to shared
code. Remove the "drv" from sisdrv, as it's unnecessary. Use the
    drm_pci functions in i915 instead of per-os implementations of the
    same. Avoid whitespace within fields in drm_pciids.txt (one of the r300
    definitions), since it breaks the bsd pciids script. Tested on sis,
    mga, r128. i915 needs more work.
2004-11-06 23:02:07 +00:00
Jon Smirl 069f53a93b Move radeon i2c include to top of file 2004-11-06 16:55:41 +00:00
Jon Smirl 642a8106d2 Export missing r128 ioctl symbol 2004-11-06 16:51:36 +00:00
Eric Anholt c9202c8965 Commit WIP of BSD conversion to core model. Compiles for r128, radeon, but
doesn't run yet. Moves the ioctl definitions for these two drivers back
    to the shared code -- they aren't OS-specific.
2004-11-06 01:41:47 +00:00
Thomas Hellstrom f08a01c0e2 Fixed bug in via_dma.c. The code didn't check that the lock was held by the
caller. Just that it was held.
2004-11-03 13:37:37 +00:00
Thomas Hellstrom 9409d8231c Reworked the jump-code in via_dma.c. The command regulator now seems to
pause correctly after a jump. Removed the debug message from within the
    interrupt handler of via_irq.c
2004-11-01 20:48:49 +00:00
Keith Whitwell 08758b2fb7 correct historic mis-attribution of copyright 2004-11-01 10:52:18 +00:00
Thomas Hellstrom 8264e2c8aa Some stabilizing work to the DMA ring-buffer code. Temporarily replaced the
rewind jump with a reinitialization. This makes the code stable on
    CLE266 and KM400.
2004-10-30 13:01:48 +00:00
Ville Syrjala d403173005 Fixed off by one errors in clipping. 2004-10-16 11:21:56 +00:00
Ville Syrjala 52fdf10fd7 Fixed bad formatting. 2004-10-16 10:54:58 +00:00
Thomas Hellstrom bbfe18e3bf Via updates. Fixed unlikely but possible uint32_t overflow in ring-buffer
code. bumped patchlevel.
2004-10-12 18:46:26 +00:00
Jon Smirl ad70dc676e Breakout heads into their own data structures. 2004-10-12 03:59:17 +00:00
Jon Smirl ad549c5ae6 Rename fn_tbl to driver. Core driver now uses pci_driver name which
reflects the personality name.
2004-10-10 22:54:55 +00:00
Dave Airlie 3f02a79351 Vladimir requested support so we can at least load r300 microcode for
helping
2D operations.
Ups radeon to version 1.12.0, Vladimir, you might want to add any extra
    pciids...
Approved-by: Dave Airlie <airlied@linux.ie>
2004-10-10 05:52:19 +00:00
Dave Airlie 8727326371 cleanup VIA driver to look a bit like others before kernel merge 2004-10-09 12:42:52 +00:00
Dave Airlie fec94a8274 Lindent the via stuff so I can include it in kernel 2004-10-09 11:12:24 +00:00
Thomas Hellstrom d24194e904 Changed unsigned to uint32_t in some ioctl parameters. Introduced first
rudimentary command verifier for dma buffers. Changed the decoder futex
    ioctl parameters. Bumped the via major version number.
2004-10-08 21:11:02 +00:00
Jon Smirl 61d36f6179 Revert back to drm_order() instead of using kernel get_order(). The
functions are not identical.
2004-10-06 16:27:55 +00:00
Jon Smirl aba12cfc0e janitor-list_for_each-drivers-char-drm-radeon_memc.patch from mm kernel 2004-10-02 19:11:30 +00:00
Jon Smirl 9f9a8f1382 Lindent of core build. Drivers checked for no binary diffs. A few files
weren't Lindent's because their comments didn't convert very well. A
    bunch of other minor clean up with no code implact included.
2004-09-30 21:12:10 +00:00
Jon Smirl 1c0a437fa2 Move things around to reduce public symbols and even out files. Switch to
get_order from drm_order.
2004-09-30 19:26:35 +00:00
Jon Smirl 3aef3841d0 Make fops per driver instead of global, remove default flush, poll, read
functions
2004-09-30 18:13:33 +00:00
Jon Smirl fa6b1d129e First check in for DRM that splits core from personality modules 2004-09-27 19:51:38 +00:00
Jon Smirl 74f063fc9d Create new linux-2.6 build. Move all gpl files into the 2.6 build. If you
edit files for 2.6 be sure and break the link to the 2.4 directory and
    copy the cvs history.
2004-09-24 03:12:17 +00:00
Jon Smirl c158a36c4c 1) switches from class_sysfs to drm sysfs implementation to allow
customization
2) compiles again on 2.4, but doesn't work
2004-09-23 05:39:15 +00:00
Felix Kuehling af326f6f0c Create permanent maps of framebuffer, aperture and MMIO registers. Added
chipset-type information in driver data field of Savage PCI-IDs. Added
    missing PCI-ID 0x8d03 (ProSavageDDR on Pentium boards). Don't require
    AGP.
2004-09-22 22:51:18 +00:00
Jon Smirl 27fc998f7d Remove hotplug reset support from DRM driver. This will be handled by the
VGA driver when it gets written.
2004-09-22 19:13:02 +00:00
Jon Smirl 6f31c42fe9 Remove size restriction on permanent addmap 2004-09-20 19:23:27 +00:00