Commit Graph

65 Commits

Author SHA1 Message Date
Eric Anholt
0bd459488b Move the bailing out due to ATIUploadToScreen() being unfinished up
farther, so that the traces aren't as confusing.
2005-01-27 03:52:49 +00:00
Eric Anholt
a973af4a9a Remove an unused field. 2005-01-27 03:50:48 +00:00
Keith Packard
8813898ef6 Fix R100 text by forcing the 3d engine to idle before executing more 3d
commands. Add docs for the ISYNC_CNTL register, which doesn't quite do
    what we want.
2005-01-25 06:04:21 +00:00
Eric Anholt
33155b4fd3 Finish converting RB2D_DSTCACHE to RB3D_DSTCACHE. Remove an extra pixel
cache flush in the idle function. Init an extra reg for r200, and
    annotate the TCL_BYPASS better. Also, clean up some style nits from the
    last commit.
2005-01-25 03:37:05 +00:00
Keith Packard
3b1f1508b1 Add tracing. Hack Radeon cache registers to use 3D addresses. Works on M6 2005-01-25 02:39:48 +00:00
Eric Anholt
8a1bee8ea9 Silence a warning about uninitialized variable (though it would be). 2005-01-25 01:38:26 +00:00
Eric Anholt
13c6b2f0b6 Add a set of macros for dealing with the repeated code to wait for a while
reading a register/attempting DMA. Now it'll wait for a certain number
    of seconds rather than a certain number of times through the loop
    before deciding that it's timed out and resetting the hardware. Also,
    add more timeout handling, and reset the draw state after resetting the
    engine.
2005-01-20 16:22:04 +00:00
Eric Anholt
dbe45c7159 Use RadeonSwitchTo3D() instead of doing the WAIT_UNTIL ourselves (RST3D()
also does DC_FLUSH, which may be important).
2005-01-20 07:28:02 +00:00
Eric Anholt
fc43c15494 Add R200 XV support, and make R100 (hopefully) use linear filtering instead
of nearest. Also, use RadeonSwitchTo3D instead of doing the WAIT_UNTIL
    ourselves.
2005-01-20 07:09:00 +00:00
Eric Anholt
7775506534 Make R200 PDMA work -- primary queue sizes are now 9 bits, not 8. 2005-01-20 01:09:48 +00:00
Eric Anholt
106703edf6 Back out the previous day's broken R200 "fix" -- the same number of coords
are always emitted. Fix the real problem, which was not enough regs
    being initialized in ati_draw.c. Fix a typo that was resulting in alpha
    coming out as 0 * src or 0 * broken instead of src * 1 or src * mask.
    Assign the blending results to R0, as appears to be necessary. Unbreak
    the dst-alpha-blend-with-no-dst-alpha code. Yow. And set the right DMA
    count for the r200 traps code.
2004-12-22 18:39:41 +00:00
Eric Anholt
fa0677ab43 Fix r200 render (for real this time?) by setting tex1_comp_cnt right for
non-mask rendering. Reenable it. Also, R200TexFormats was used instead
    of R100 in one place. Harmless so far, because the formats were in the
    same order.
2004-12-21 09:51:47 +00:00
Eric Anholt
4b0247b9e0 Whitespace nit. 2004-12-21 09:49:30 +00:00
Eric Anholt
b600fcda38 Fix the R200 Render code. Composite and Trapezoids are now supported just
as well as on R100.
2004-09-20 03:12:00 +00:00
Eric Anholt
90ff3688cd Unbreak the AGP DRI case. That was quite a pile of broken code. 2004-09-19 10:57:31 +00:00
Eric Anholt
ba3b6fd23b Add proper PCI/AGP detection, based on Mike Harris's code for Radeon, but
using the MMIO mirror of the bits instead of config space.
2004-09-14 06:26:54 +00:00
Eric Anholt
80dc84d067 - Fix a segfault on VT switch with DRI. Still dies due to cursor allocation
troubles.
- Move the RemoveBlockAndWakeupHandlers to match
    RegisterBlockAndWakeupHandlers.
- Enable R100 trapezoid "acceleration" when DRI is working, so that it can
    be exposed and worked on.
2004-09-12 23:22:31 +00:00
Eric Anholt
ab50679aab Fix a bad argument missed in the previous commit for ATIDRIDMA* functions. 2004-09-12 23:01:24 +00:00
Eric Anholt
2d069b1d19 Move the RegisterBlockAndWakeupHandlers to before DRI initialization. The
change to use that instead of manual wrapping made the DMA dispatch
    come after the lock had been dropped, causing lots of pain.
2004-09-12 22:21:12 +00:00
Eric Anholt
27b5a65f05 Reset the CCE/CP on engine reset, and make the ATIDRIDMA functions take a
more useful argument.
2004-09-12 20:31:39 +00:00
Eric Anholt
fcd52d276f Add missing kaa.h include for kaaInitTrapOffsets. 2004-09-12 20:19:15 +00:00
Eric Anholt
b5d406e8c8 Fix handling of is_agp. is_agp is whether the card is actually AGP, while
using_agp should say whether AGP is being used as part of DMA/DRI.
2004-09-12 20:02:10 +00:00
Eric Anholt
7cab70d1cb Improve error handling, especially in the DRI case. Do some FatalErrors
instead of ErrorFs for things that are really bad, and put limits on
    some loops. Now, sometimes instead of hanging the entire system, we
    (mostly-) cleanly drop to console when the card has hung.
2004-09-12 19:52:51 +00:00
Eric Anholt
0cd662ea80 - Add disabled WIP trapezoid code for R128 and R100. The R128 rendering is
not doing an add of 1 per triangle like I hoped, and instead seems to
    be saturating all the pixels or something. The R100 acceleration
    renders pretty well, with some gaps. Note that both are slower than
    software due to lack of DMA to submit vertices.
- Mostly fix R128 and Radeon transform support, including supporting
    bilinear filtering on R128. Subpixel offsets are still probably an
    issue (reported by rendercheck), but I want to make 100% sure about my
    understanding of the protocol before changing everybody, including fb.
- Add support for dst formats without alpha to R128 Composite.
- Remove the R128 Blend code, which has long outlived its usefulness. (I
    kept it around for one reason: It could be useful for the w/h > 1024
    case with no mask and a non-src op. That seems pretty infrequent and
    not worth the trouble).
2004-09-11 09:28:19 +00:00
Keith Packard
c57944cd9a Check for mmio before restoring crtc/crtc2 pitch registers 2004-07-24 17:02:49 +00:00
Keith Packard
9565d9e0cf Correct pitch so that accelerator can run on 1400x1050 screens. Add a few
more register sets for cursors.
2004-07-22 18:17:59 +00:00
Eric Anholt
8853f93318 Add support for a8b8g8r8 and x8b8g8r8 pictures, which showed up frequently
with metacity usage.
2004-07-19 12:07:01 +00:00
Eric Anholt
adf4b38f49 Breakage in last commit to this file: pCurPriv->area isn't set up until
Enable, these days.
2004-07-19 11:42:49 +00:00
Eric Anholt
d2e74e419d Set the right number of texture coordinates for r200 Render support (still
disabled, needs to be tested).
2004-07-19 11:19:12 +00:00
Eric Anholt
cefcb7f123 - Add Radeon picture transform support.
- On R128, don't refer to an old Composite's mask transform when the
    current Composite doesn't have a mask.
- Staticize some global variables in r128_composite.c.
2004-07-19 11:16:13 +00:00
Eric Anholt
9fe216a458 Use the offscreen memory manager as much as possible to do the reservation
of memory at startup. Do some drive-by cleanups while I'm here
    (sorry!).
2004-07-19 07:53:54 +00:00
Eric Anholt
e2bb9f38cd Add support for transforms of textures on R128. 2004-07-19 07:20:01 +00:00
Eric Anholt
7c466d64c3 Clean up Rage 128 composite code. Now it composites more operations
correctly and is simpler.
2004-07-03 10:23:03 +00:00
Keith Packard
7ff67f2872 Separate out off-screen allocation from Init. Fix Enable to update
off-screen addresses. Wrap RandR to update off-screen addresses.
Set off_screen_base and memory_size fields correctly.
2004-06-28 00:48:51 +00:00
Keith Packard
5b75aae2cf Add ARGB cursor support for Radeon cards. 2004-06-26 04:13:03 +00:00
Eric Anholt
4ffde8a6b3 - Pass the right pixel mask (all ones) in to PrepareSolid in the
solid-fill-based composite acceleration.
- Use a real pixmap when doing an UploadToScratch (For pDrawable->type ==
    DRAWABLE_WINDOW, you need to get the backing pixmap).
- Pass back the x/y offsets from kaaGetOffscreenPixmap unconditionally,
    because they'll be used in the scratch case.
- Turn on the Render acceleration for Rage 128 and Radeon 100-series at
    last!
2004-06-10 19:22:58 +00:00
Eric Anholt
c3bc6dd551 Align scratch area offsets to the offscreen byte alignment. 2004-06-10 09:50:59 +00:00
Eric Anholt
cf3f95d216 Oops, testers reported that the last patch actually didn't work (conflicts
occurred), so the R300 PDMA doesn't work. Disable.
2004-06-10 08:37:28 +00:00
Eric Anholt
0b7647ee35 Bug #242: Fix setup of R300 cards, by providing R300 CP code from
volodya-project and initializing PDMA.
2004-06-10 05:57:31 +00:00
Eric Anholt
cade317d31 Overhaul of the ATI driver:
- Add monochrome hardware cursor support.
- Try to auto-detect AGP support for DRI on Radeons. And fail. Detect it
    properly on R128.
- Set up card for pseudo-DMA if possible. Convert 2D rendering code to
    prepare DMA packets only. Use generic code to decode DMA packets to
    MMIO if PDMA is unavailable. Add WIP code to support "real" DMA without
    DRM support.
- Dispatch pending DMA commands when the server sleeps. Otherwise some
    things, such as typing in an xterm, wouldn't show up for a time.
- Fix Radeon Composite acceleration in many ways, and add Rage 128
    Composite acceleration. Disable them both due to still-not-understood
    issues they have. They fail with In, Out, AtopReverse, and Xor, and
    text rendering is strange.
- Add textured XV support for R100 and Rage 128. No brightness/sat
    controls, but it does support multiple ports, and cooperates with
    Composite.
- Add WIP code for hostdata uploads.
- Many cleanups and fixes.
2004-05-17 20:18:02 +00:00
Eric Anholt
2ec70aa701 Disable GLX visuals code on !GLXEXT, and remove a useless prototype. 2004-01-25 05:31:24 +00:00
Eric Anholt
01e9cc858a - Add glx visuals code based on XFree86's Radeon driver.
- Reserve areas for back/depth/span when USING_DRI && GLXEXT. This would be
    better in a TransitionTo3d, but we'd need to work with the offscreen
    memory manager for that.
- Misc. fixes to ati_dri.c for DRI+GLX. Needs more work still.
2004-01-25 01:30:33 +00:00
Eric Anholt
f2bedd17af Oops, turn fallback output back off. 2004-01-25 01:16:19 +00:00
Eric Anholt
26c5a8dfdd Whitespace cleanup. 2004-01-25 01:04:12 +00:00
Eric Anholt
6c97b277d9 Support 1x1 repeat sources in R128's Blend. 2004-01-11 00:10:34 +00:00
Eric Anholt
9270256565 Change PCI ID information field to be one of r128, r100, r200, r300. This
is all the information we need so far. Put that information into atic,
    and use it correctly in the code (unlike before).
2004-01-09 08:43:48 +00:00
Eric Anholt
6d8001f468 Compile fixes for non-DRI case and for non-C99 compiler. 2004-01-08 20:18:13 +00:00
Eric Anholt
b27729ec88 - Add a new UploadToScratch kaa hook for putting the data for a single
pixmap into temporary offscreen storage. Subsequent UploadToScratch may
    clobber the data of previous ones. This allows hardware acceleration of
    composite operations on glyphs.
- Add a new UploadToScreen kaa hook for doing the actual moving of data to
    framebuffer. This would allow us to do things like hostdata blits or
    memcpy to agp and then blit.
- Add an UploadToScreen on ATI which is just memcpy, but which will be
    replaced with a hostdata blit soon.
- Add UploadToScratch on ATI and reserve 64k of scratch space. This
    provided a 3x speedup of rgb24text on my Radeon.
2004-01-08 08:16:24 +00:00
Eric Anholt
5a2c23f8a1 Speed things up slightly by removing Z values from emitted vertices and by
emitting as a tri fan rather than a tri list. A rect list would save an
    additional vertex (out of 4) per rectangle, but there's no measurable
    speed difference and the tri fan may be useful when transforms come
    into play.
2004-01-07 02:30:29 +00:00
Eric Anholt
34d1529731 - Correctly set the texture coordinate set source for the second texture
unit.
- Re-enable Radeon's Composite accel now that fonts work again.
2004-01-04 20:47:30 +00:00