Commit Graph

33 Commits

Author SHA1 Message Date
ad
a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
bjs
c5051ae798 Don't include i810 hack if DRM_NO_AGP is defined, as it results in
an undefined symbol (agp_i810_borrow) at kernel link time.
2008-03-13 05:35:43 +00:00
drochner
1f41b0e499 -map 64-bit PCI BARs
-integrate some bits from upstream to support i965
from Yorick Hardy per PM
2008-03-04 11:52:38 +00:00
bjs
9edaf4a46f Fix bus_dmamem_free() call to provide 'segs' as the second argument.
While here, add DRM_PCI_DMAADDR macro so that we set handle->busaddr
in a portable way.
Next is the more difficult [annoying] part: use bus_dma(9) with
scatter/gather buffers.
2008-03-02 07:12:15 +00:00
drochner
d9ffad8652 Add a horrible hack to allow the DRM driver to get at the bus_space_handle
allocated by the AGP driver in the case of Intel chipset graphics.
This is different from the patch by Yorick Hardy circulated a while ago
in that it doesn't change the semantics of reference counting within
the (3rd-party) DRM code -- it just bypasses it.
Needless to say that it is uglier, but it eases future updates to
the DRM code because the change there is just 2 LOC.

Imo, a cleaner solution for all that would be to attach "agp" to "vga"
in the intel chipset graphics case, which better reflects how the hardware
is structured. This would still need a hack to the DRM code, but
it would be confined to childs of the "vga" device, without need for
global variables.
Since there is a variety of intel chipsets with AGP and/or builtin
graphics options, this would need a considerable testing effort.
2008-02-22 19:47:06 +00:00
ad
93b4e84394 membar_memory -> membar_sync 2007-12-22 15:33:42 +00:00
ad
7162fade9b Use new style memory barriers. 2007-12-21 10:40:12 +00:00
perry
9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
lukem
afb2a5863e use __KERNEL_RCSID() 2007-12-11 11:17:30 +00:00
bjs
2e1c69e6e8 Bring in some modest fixes from GIT that seemed appropriate to me and did not
break functionality.  I've tested this on a PCIE R423 (X800).

- In drm_drv.c, check that the requested context lock matches the holder
of the lock.

- Unify radeon offset checking.  (r300_cmdbuf.c, radeon_drv.h, radeon_state.c)
[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]

NOTE: There is another AGP fix that I didn't have time to merge
that I thought might help with getting this to work on macppc.
Contact me if you're interested. Hi macallan@! ;)

radeon_cp.c, radeon_drv.h: (GIT id: bb5f2158dbd30dbbffa3881fac75b71d71ecaaf9)
- set the address to access the aperture on the CPU side correctly
[This code relied on the CPU and GPU address for the aperture being the same,
On some r5xx hardware I was playing with I noticed that this isn't always true.
I wonder if this will fix some of those r4xx DRI issues we've seen in the past.]

- Commit the ring after earch partial texture. (radeon_state.c)
(GIT ID: ac8406420ea80ffe5ccaadc1ff0124f95709a23d)
[Commit the ring after each partial texture upload blit.
This makes sure each blit starts as early as possible, which may improve
texture upload performance in some cases.]

If anyone's having any issues in particular--especially those which
can be _teased apart from AGP driver issues--please let me know
and I'll investigate.  Thanks.  There are also tons of fixes for the i915,
but I don't want to change too much at once.
2007-12-07 08:02:48 +00:00
bjs
72127ffc00 drm unbreaking, round 1:
Fix the bus_dma(9) use in drm_pci.c and chnage struct drm_dma_handle_t
to match it.  Remove member dmaaddr from drm_dma_handle_t as well,
as I don't see it used anywhere.  Compile-tested only for now; please
report any problems to me.  Thanks.
2007-12-04 12:51:13 +00:00
bjs
27bbf3c565 Remove #ifdef __OpSys__ sections to make this readable. Add RCS tags.
Nothing done in header files, nor in dev/pci/drm (we might not want to
touch this for the sake of merging) yet.  Compile tested; please let
me know if this broke anything.
2007-11-21 19:22:12 +00:00
bjs
d81bca762e Until I have a chance to further evaluate and re-work the locking here,
change from an adaptive to spin mutex @ IPL_TTY.  This seems to mitigate
or eliminate a lot of locking-related issues (such as a hang when running
glxgears under AIGLX).  Tested by me and Vincent <10.50@free.fr>.

In this code, we have three locks: irq, dma, and device.  If anyone has
any thoughts on how to improve this situation, e.g. by using different
lock types/priorities/soft interrupts/etc. for different locks, please
share them with me.

NOTE: I've had the best results thusfar using Mesa 7.0.2-rc1 (r300 users
could even try the r300 driver code from the master branch) and xorg-server
1.4+patches from GIT.
2007-11-01 13:20:04 +00:00
bjs
acac55ab19 First round of DRM improvements: switch to mutex(9), make use of &
operator consistent in locking macros, use mb(9) for memory barrier ops
(to be replaced with bus_space_barrier(9) at a later date; this is not
necessary for x86 but might be for e.g. mips).


More to come.  Try it out!  It's a lot more stable now just with the
mutex(9) changes.
2007-10-19 20:53:47 +00:00
ad
a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
rmind
084180cb58 drm_do_addbufs_pci: Fix the mess of malloc()s and free()s, which
do not accept NULL arguments.
Found via CID: 4439
2007-04-04 00:30:58 +00:00
jmcneill
4ce279101e In drm_remove_magic, free the magic entry when it is found instead of
attempting to free a NULL reference in the error case. From Yorick Hardy.
2007-03-29 11:31:06 +00:00
jmcneill
11827f045a Introduce options DRM_NO_AGP and DRM_NO_MTRR, so I can run this on
platforms that don't provide these services.

In drm_mmap, don't wrap the return value with atop() if we're on macppc.

While we're here, fix:
	pci_intr_establish(&dev->pa.pa_pc, ...);
to:
	pci_intr_establish(dev->pa.pa_pc, ...);

The former doesn't even compile on macppc, and I'm amazed that it works at
all anywhere else.
2007-03-28 11:29:36 +00:00
dogcow
1aec633c29 caddr_t -> char *, even though it's in #ifdef __FreeBSD__ sections, just
so grep -r won't show it any more.
2007-03-23 20:01:45 +00:00
drochner
f67e2cbf66 Free ressources more agressively.
(The natural place for this would be on each close, but we don't have
a driver entry point for this.)
from Yorick Hardy
2007-03-23 11:06:31 +00:00
xtraeme
3cd917fe6c Use void * rather than caddr_t to fix the build. 2007-03-22 23:35:00 +00:00
jmcneill
7126d77514 Newline after foodrm0 at vga0 message. 2007-03-22 15:14:20 +00:00
jmcneill
4683f1b535 Pass a proper vaddr to uvm_mmap. 2007-03-21 22:24:57 +00:00
jmcneill
ccbe7856ca Initialize extra AGP resource slots. 2007-03-21 22:16:45 +00:00
jmcneill
0f6e823d07 In drm_ioremap, provide extra slots for mapping AGP memory space; it's not
reasonable to assume that these regions will show up in a VGA BAR.
2007-03-21 22:15:59 +00:00
drochner
cd09748288 remove a debug printf which I had left in accidentally,
print the standard "dv_xname: interrupting at ..." line instead
2007-03-21 17:45:18 +00:00
drochner
d414de4f1a since no boundary restrictions apply, a zero boundary argument to
bus_dmamem_alloc() is the right thing
2007-03-21 17:15:53 +00:00
drochner
7a0663bdb7 revert previous - it doesn't work on i386 at least 2007-03-21 17:01:56 +00:00
jmcneill
ad0dc10411 Try not to free NULL pointers. 2007-03-21 04:52:14 +00:00
xtraeme
feef686ef0 Fix previous, use %zd. 2007-03-21 03:22:16 +00:00
macallan
fb308a7a59 - pass a sane boundary parameter to bus_dmamem_alloc
- sprinkle aprint_error()
2007-03-21 03:10:31 +00:00
macallan
ea7f3505eb we return addresses, not page numbers in *mmap() methods 2007-03-21 02:11:44 +00:00
drochner
2d9e04fc35 Import DRM drivers, brought into shape by Yorick Hardy, posted to tech-x11.
Minor modifications by me:
-use an mi device major number
-(coarsly) divided into pci card specific and less specific parts, moved
 the latter to dev/drm
-renamed autoconf attributes to reflect this
Todo:
-adapt all card frontends but i915 to drm include file location
-review the mtrr change
-make the change to agp_i810.c coexist with the fix for buggy VESA
 BIOSes which is commented out temporarily
-RCS IDs etc style stuff
-LKM support (rescan support for vga)
-test
2007-03-20 18:05:25 +00:00