drm: atari: Add a DRM driver for Atari graphics hardware

Supported formats:
  - C[1248],
  - RG16 (both standard DRM (little-endian) and native (big-endian)),
  - XR24.

RG16 and XR24 are only supported with the underlying RGB565 hardware
mode on Falcon, and are subject to hardware restrictions (limited to
e.g. "qvga" and "hvga" modes).

All formats use a shadow buffer (TODO: BE RG16 buffers from ST-RAM).
Initial mode setting works, later mode changes sometimes fail.

Developed and tested on ARAnyM.

Probably this should not be under /tiny ;-)

root@atari:~# modetest -M atari_drm
Encoders:
id	crtc	type	possible crtcs	possible clones
35	34	none	0x00000001	0x00000001

Connectors:
id	encoder	status		name		size (mm)	modes	encoders
31	35	connected	VGA-1          	0x0		9	35
  modes:
	index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot
  #0 vga70 70.72 640 658 758 800 400 411 414 445 25176 flags: nhsync, pvsync, pcsync; type: preferred, driver
  #1 tt-mid 60.33 640 740 880 1000 480 496 526 534 32216 flags: nhsync, nvsync, ncsync; type: driver
  #2 vga 59.94 640 658 758 800 480 491 494 525 25176 flags: nhsync, nvsync, ncsync; type: driver
  #3 st-high 78.51 640 640 768 896 400 414 418 458 32216 flags: nhsync, nvsync, ncsync; type: driver
  #4 tt-low 88.72 320 420 560 680 480 496 526 534 32216 flags: nhsync, nvsync, ncsync; type: driver
  #5 hvga 59.94 320 329 379 400 480 491 494 525 12588 flags: nhsync, nvsync, ncsync; type: driver
  #6 st-mid 165.03 640 656 752 784 200 214 218 249 32216 flags: nhsync, nvsync, ncsync; type: driver
  #7 qvga 60.06 320 329 379 400 240 245 247 262 12588 flags: nhsync, nvsync, dblscan, ncsync; type: driver
  #8 st-low 278.84 320 336 432 464 200 214 218 249 32216 flags: nhsync, nvsync, ncsync; type: driver
  props:
	1 EDID:
		flags: immutable blob
		blobs:

		value:
	2 DPMS:
		flags: enum
		enums: On=0 Standby=1 Suspend=2 Off=3
		value: 0
	5 link-status:
		flags: enum
		enums: Good=0 Bad=1
		value: 0
	6 non-desktop:
		flags: immutable range
		values: 0 1
		value: 0
	4 TILE:
		flags: immutable blob
		blobs:

		value:

CRTCs:
id	fb	pos	size
34	36	(0,0)	(320x240)
  #0 qvga 60.06 320 329 379 400 240 245 247 262 12588 flags: nhsync, nvsync, dblscan, ncsync; type: driver
  props:
	24 VRR_ENABLED:
		flags: range
		values: 0 1
		value: 0
	28 GAMMA_LUT:
		flags: blob
		blobs:

		value:
			000000000000000000000000aaaa0000
			0000aaaa000000000000aaaaaaaa0000
			aaaa000000000000aaaa0000aaaa0000
			aaaa555500000000aaaaaaaaaaaa0000
			555555555555000055555555ffff0000
			5555ffff555500005555ffffffff0000
			ffff555555550000ffff5555ffff0000
			ffffffff55550000ffffffffffff0000
			10001000100000001100110011000000
			12001200120000001300130013000000
			14001400140000001500150015000000
			16001600160000001700170017000000
			18001800180000001900190019000000
			1a001a001a0000001b001b001b000000
			1c001c001c0000001d001d001d000000
			1e001e001e0000001f001f001f000000
			20002000200000002100210021000000
			22002200220000002300230023000000
			24002400240000002500250025000000
			26002600260000002700270027000000
			28002800280000002900290029000000
			2a002a002a0000002b002b002b000000
			2c002c002c0000002d002d002d000000
			2e002e002e0000002f002f002f000000
			30003000300000003100310031000000
			32003200320000003300330033000000
			34003400340000003500350035000000
			36003600360000003700370037000000
			38003800380000003900390039000000
			3a003a003a0000003b003b003b000000
			3c003c003c0000003d003d003d000000
			3e003e003e0000003f003f003f000000
			40004000400000004100410041000000
			42004200420000004300430043000000
			44004400440000004500450045000000
			46004600460000004700470047000000
			48004800480000004900490049000000
			4a004a004a0000004b004b004b000000
			4c004c004c0000004d004d004d000000
			4e004e004e0000004f004f004f000000
			50005000500000005100510051000000
			52005200520000005300530053000000
			54005400540000005500550055000000
			56005600560000005700570057000000
			58005800580000005900590059000000
			5a005a005a0000005b005b005b000000
			5c005c005c0000005d005d005d000000
			5e005e005e0000005f005f005f000000
			60006000600000006100610061000000
			62006200620000006300630063000000
			64006400640000006500650065000000
			66006600660000006700670067000000
			68006800680000006900690069000000
			6a006a006a0000006b006b006b000000
			6c006c006c0000006d006d006d000000
			6e006e006e0000006f006f006f000000
			70007000700000007100710071000000
			72007200720000007300730073000000
			74007400740000007500750075000000
			76007600760000007700770077000000
			78007800780000007900790079000000
			7a007a007a0000007b007b007b000000
			7c007c007c0000007d007d007d000000
			7e007e007e0000007f007f007f000000
			80008000800000008100810081000000
			82008200820000008300830083000000
			84008400840000008500850085000000
			86008600860000008700870087000000
			88008800880000008900890089000000
			8a008a008a0000008b008b008b000000
			8c008c008c0000008d008d008d000000
			8e008e008e0000008f008f008f000000
			90009000900000009100910091000000
			92009200920000009300930093000000
			94009400940000009500950095000000
			96009600960000009700970097000000
			98009800980000009900990099000000
			9a009a009a0000009b009b009b000000
			9c009c009c0000009d009d009d000000
			9e009e009e0000009f009f009f000000
			a000a000a0000000a100a100a1000000
			a200a200a2000000a300a300a3000000
			a400a400a4000000a500a500a5000000
			a600a600a6000000a700a700a7000000
			a800a800a8000000a900a900a9000000
			aa00aa00aa000000ab00ab00ab000000
			ac00ac00ac000000ad00ad00ad000000
			ae00ae00ae000000af00af00af000000
			b000b000b0000000b100b100b1000000
			b200b200b2000000b300b300b3000000
			b400b400b4000000b500b500b5000000
			b600b600b6000000b700b700b7000000
			b800b800b8000000b900b900b9000000
			ba00ba00ba000000bb00bb00bb000000
			bc00bc00bc000000bd00bd00bd000000
			be00be00be000000bf00bf00bf000000
			c000c000c0000000c100c100c1000000
			c200c200c2000000c300c300c3000000
			c400c400c4000000c500c500c5000000
			c600c600c6000000c700c700c7000000
			c800c800c8000000c900c900c9000000
			ca00ca00ca000000cb00cb00cb000000
			cc00cc00cc000000cd00cd00cd000000
			ce00ce00ce000000cf00cf00cf000000
			d000d000d0000000d100d100d1000000
			d200d200d2000000d300d300d3000000
			d400d400d4000000d500d500d5000000
			d600d600d6000000d700d700d7000000
			d800d800d8000000d900d900d9000000
			da00da00da000000db00db00db000000
			dc00dc00dc000000dd00dd00dd000000
			de00de00de000000df00df00df000000
			e000e000e0000000e100e100e1000000
			e200e200e2000000e300e300e3000000
			e400e400e4000000e500e500e5000000
			e600e600e6000000e700e700e7000000
			e800e800e8000000e900e900e9000000
			ea00ea00ea000000eb00eb00eb000000
			ec00ec00ec000000ed00ed00ed000000
			ee00ee00ee000000ef00ef00ef000000
			f000f000f0000000f100f100f1000000
			f200f200f2000000f300f300f3000000
			f400f400f4000000f500f500f5000000
			f600f600f6000000f700f700f7000000
			f800f800f8000000f900f900f9000000
			fa00fa00fa000000fb00fb00fb000000
			fc00fc00fc000000fd00fd00fd000000
			fe00fe00fe000000ff00ff00ff000000
	29 GAMMA_LUT_SIZE:
		flags: immutable range
		values: 0 4294967295
		value: 256

Planes:
id	crtc	fb	CRTC x,y	x,y	gamma size	possible crtcs
32	34	36	0,0		0,0	0       	0x00000001
  formats: C1   C2   C4   C8   RG16 RG16be XR24
  props:
	8 type:
		flags: immutable enum
		enums: Overlay=0 Primary=1 Cursor=2
		value: 1
	30 IN_FORMATS:
		flags: immutable blob
		blobs:

		value:
			00000001000000000000000700000018
			00000001000000382020314320203243
			202034432020384336314752b6314752
			3432525800000000000000000000007f
			00000000000000000000000000000000
		in_formats blob decoded:
			 C1  :  LINEAR
			 C2  :  LINEAR
			 C4  :  LINEAR
			 C8  :  LINEAR
			 RG16:  LINEAR
			 RG16be:  LINEAR
			 XR24:  LINEAR

Frame buffers:
id	size	pitch

root@atari:~#

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
3 files changed