This series implements HOST_DATA as a blit source enabling text rendering in
xterm under X.org with 2D acceleration.
The series builds up functionality incrementally:
* Patches 1-6: Bug fixes and register implementations
* Patches 7-15: Refactor of ati_2d_blt to decouple from ATIVGAState
* Patch 16: Scissor clipping implementation
* Patches 17-18: HOST_DATA register writes, color expansion, and
accumulator flush
Tested with xterm on X.org using the r128 driver built with
--disable-dri (MMIO mode).
Hardware tests can be found at:
https://codeberg.org/cjab/ati-tests/src/commit/e3e01a74f51f6f7f1fd0b447033036eabe800633/tests/host_data.c
Changes from v7:
- Avoid potential issue with dst_offset calculation (found by Zoltan)
- Remove unnecessary newlines and other small formatting fixes
- Squash patch 15 into patches 13 and 14
- Note: Zoltan's suggestion to embed ATI2DCtx in ATIVGAState will be
revisited in a follow-up series
Changes from v6:
- Reduce churn by adding ctx_ struct and pointer
- Moved extraction of ati_set_dirty helper earlier in the series
- Moved register logging into setup_2d_blt_ctx
- Remove unnecessary comments
Changes from v5:
- Added previously standalone aperture size patch to series
- Introduced ATI2DCtx to hold all blit state (suggested by Zoltan)
- Made refactor patches more granular
- Simplified DP_GUI_MASTER_CNTL bit shifting
- Sorted clipping regs by offsets
- Removed dst_x/y update after blit (confirmed by hardware testing)
Changes from v4:
- Refactored ati_2d_blt to accept src and dst state
- Implemented host_data blits on top of the refactored ati_2d_blt
(suggested by Zoltan)
- Dropped separate field storage for DP_DATATYPE/DP_MIX (per Zoltan)
Changes from v3:
- New patch 1 fixing DP_DATATYPE/MIX register aliasing, this supersedes old
patch 5
- Fix MSB/LSB HOST_DATA bit ordering, it is per-byte rather than per-word
- Fixed a missing break in register write handler
- Squashed and reorganized the dst/scissor helper patches (per Zoltan)
- Simplified register field constants and increment logic (per Zoltan)
- Tested with MorphOS and TVPaint (opaque bitmap fonts now work)
Changes from v2:
- Verified with hardware that clipping default bit latches
- Verified with hardware that pitch/offset default bits latch
(supersedes Zoltan's "ati-vga: Separate default control bit for
source")
- A new approach to HOST_DATA using a 128-bit accumulator instead of a
large buffer
- Fixed a longstanding bug in (DST/SRC)_PITCH reads that zeroed pitch value.
- Removed mask from the DP_GUI_MASTER_CNTL write, all fields are
important
- Created helpers for code shared between ati_2d_blt and
ati_host_data_flush
Changes from v1:
- Split monolithic patch into 7 logical patches as requested
- Integrate HOST_DATA blit into existing ati_2d_blt()
- Add fallback implementation for non-pixman builds
- Remove unnecessary initialization in realize (kept in reset only)
- Fixed DP_GUI_MASTER_CNTL mask to preserve GMC_SRC_SOURCE field
- Implement scissor clipping
Chad Jablonski (18):
ati-vga: Fix framebuffer mapping by using hardware-correct aperture
sizes
ati-vga: Fix DST_PITCH and SRC_PITCH reads
ati-vga: Read aliased values from DP_GUI_MASTER_CNTL
ati-vga: Latch src and dst pitch and offset on master_cntl default
ati-vga: Implement foreground and background color register writes
ati-vga: Add scissor clipping register support
ati-vga: Remove dst_x/y updates after blit
ati-vga: Consolidate dirty region tracking in ati_2d_blt
ati-vga: Remove src and dst stride mutation in ati_2d_blt
ati-vga: Use local variables for register values in ati_2d_blt
ati-vga: Introduce ATI2DCtx struct for 2D blit context
ati-vga: Extract setup_2d_blt_ctx from ati_2d_blt
ati-vga: Split ati_2d_do_blt from ati_2d_blt
ati-vga: Remove ATIVGAState param from ati_2d_do_blt
ati-vga: Move source bounds validation to ati_2d_blt
ati-vga: Implement scissor rectangle clipping for 2D operations
ati-vga: Implement HOST_DATA register writes
ati-vga: Implement HOST_DATA flush to VRAM
hw/display/ati.c | 145 ++++++++++++++-
hw/display/ati_2d.c | 398 ++++++++++++++++++++++++++++--------------
hw/display/ati_dbg.c | 9 +
hw/display/ati_int.h | 25 ++-
hw/display/ati_regs.h | 20 +++
5 files changed, 457 insertions(+), 140 deletions(-)
--
2.52.0