Selecting memory manager for embedded DRM device

2014-02-03 Thread Dmitry Eremin-Solenikov
Hello,

On Mon, Feb 3, 2014 at 7:49 PM, Rob Clark  wrote:
> On Sun, Feb 2, 2014 at 6:50 PM, Dmitry Eremin-Solenikov
>  wrote:
>> Hello,
>>
>> I'm looking onto writing DRM/KMS drivers for few pieces of
>> embedded equipment. I stumbled upon selecting GEM/TTM/whatever
>> for them. Could you please guide me?
>
> The common choices are either:
>
>   * TTM + GEM userspace interface (nouveau and radeon)
>   * or just GEM (intel, and most of the ARM devices)
>
> TTM seems to be mostly advantageous if you need to manage migration
> between VRAM / GART / system RAM.  But it sounds like you are talking
> about a UMA system, so maybe TTM doesn't help you as much.

Thank you for the answer. Indeed I had the feeling that just GEM would be
work for UMA devices. I'm interested about the driver for my second hardware.
It's a separate graphics chip with separate VRAM, no access to system
memory and nearly no advanced capabilities (few 2D accelerations,
but nothing fancy). Would that require TTM, some special setup of GEM
or something completely different?


-- 
With best wishes
Dmitry


Selecting memory manager for embedded DRM device

2014-02-03 Thread Dmitry Eremin-Solenikov
Hello,

I'm looking onto writing DRM/KMS drivers for few pieces of
embedded equipment. I stumbled upon selecting GEM/TTM/whatever
for them. Could you please guide me?

>From my point of view, there are two major cases:

1) Device with embedded/separate VRAM.

2) Device using system memory w/o any restrictions.

Those are embedded devices hanging on memory bus,
so no such things as AGP, aperture exist.

I'm looking for advice on selecting proper MM.

-- 
With best wishes
Dmitry


Oops with Radeon/Uninorth on Maple

2012-05-25 Thread Dmitry Eremin-Solenikov

Hello, colleagues,

I'm trying to enable an AGP slot (again) on my Maple board (dual 
PPC970FX board, with CPC925 (U3H) north bridge).


 For now I'm stuck with a problem: I use radeon card, drm-radeon driver 
with KMS.


If I force drm-radeon to think about a card as about PCI card (by 
commenting corresponding lines in drm_radeon_kms.c), everything works, I 
get framebuffer, working X11, etc. If I enable agpgart-uninorth driver
and RADEON_IS_AGP flag in drm driver, I get an Oops early during the 
bootstrap. Relevant part of the log (I can send full dmesg of normal 
bootstrap or this oops on request, if that would help).


[2.820647] Linux agpgart interface v0.103
[2.824909] agpgart-uninorth :f0:0b.0: Apple U3H chipset
[2.830668] agpgart-uninorth :f0:0b.0: Found device u3, rev 35
[2.843611] agpgart-uninorth :f0:0b.0: configuring for size idx: 64
[2.850638] agpgart-uninorth :f0:0b.0: AGP aperture is 256M @ 0x0
[2.857646] [drm] Initialized drm 1.1.0 20060810
[2.862567] [drm] radeon defaulting to kernel modesetting.
[2.868091] [drm] radeon kernel modesetting enabled.
[2.873222] radeon :f0:10.0: enabling device ( - 0003)
[2.880311] radeon :f0:10.0: enabling bus mastering
[2.885591] [drm] initializing kernel modesetting (RV350 
0x1002:0x4152 0x18BC:0x0416).

[2.893629] [drm] register mmio base: 0xD002
[2.898260] [drm] register mmio size: 65536
[2.947112] [drm] GPU not posted. posting now...
[3.051033] agpgart-uninorth :f0:0b.0: putting AGP V3 device into 
8x mode

[3.058197] radeon :f0:10.0: putting AGP V3 device into 8x mode
[3.064666] radeon :f0:10.0: GTT: 256M 0x - 0x0FFF
[3.070864] [drm] Generation 2 PCI interface, using max accessible memory
[3.077672] radeon :f0:10.0: VRAM: 128M 0xC000 - 
0xC7FF (128M used)

[3.086487] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[3.093126] [drm] Driver supports precise vblank timestamp query.
[3.099291] [drm] radeon: irq initialized.
[3.103404] [drm] Detected VRAM RAM=128M, BAR=128M
[3.108214] [drm] RAM width 128bits DDR
[3.112263] [TTM] Zone  kernel: Available graphics memory: 496682 kiB
[3.118732] [TTM] Initializing pool allocator
[3.123346] [drm] radeon: 128M of VRAM memory ready
[3.128256] [drm] radeon: 256M of GTT memory ready.
[3.133295] [drm] radeon: ib pool ready.
[3.137708] [drm] radeon: 1 quad pipes, 1 Z pipes initialized.
[3.144018] radeon :f0:10.0: WB disabled
[3.148326] [drm] fence driver on ring 0 use gpu addr 0x and 
cpu addr 0xd0066000

[3.157474] [drm] Loading R300 Microcode
[3.162480] [drm] radeon: ring at 0x1000
[3.167569] [drm] ring test succeeded in 0 usecs
cpu 0x0: Vector: 200 (Machine Check) at [c0d63aa0]
pc: c00cc07c: .trace_hardirqs_on_caller+0x6c/0x190
lr: c00152f4: .cpu_idle+0x1a4/0x220
sp: c0d63d20
   msr: 90009032
  current = 0xc0c4db30
  paca= 0xc000   softe: 0irq_happened: 0x01
pid   = 0, comm = swapper/0
enter ? for help
[c0d63db0] c00152f4 .cpu_idle+0x1a4/0x220
[c0d63e50] c0008fb8 .rest_init+0xe8/0x110
[c0d63ee0] c0ba2998 .start_kernel+0x3e4/0x408
[c0d63f90] c0007558 .start_here_common+0x20/0x48
0:mon x
[  843.783295] Oops: Machine check, sig: 7 [#1]
[  843.787589] SMP NR_CPUS=4 Maple
[  843.790768] Modules linked in:
[  843.793855] NIP: c00cc07c LR: c00152f4 CTR: 
c0023eac

[  843.800920] REGS: c0d63aa0 TRAP: 0200   Not tainted  (3.4.0+)
[  843.807376] MSR: 90009032 SF,HV,EE,ME,IR,DR,RI  CR: 
2422  XER: 0006

[  843.815412] SOFTE: 0
[  843.817607] TASK = c0c4db30[0] 'swapper/0' THREAD: 
c0d6 CPU: 0
[  843.825035] GPR00:  c0d63d20 c0d63280 
c00152f4
[  843.833169] GPR04:  c0099d10 0001 
0002
[  843.841302] GPR08: 0100 c0e828e8 0140 

[  843.849436] GPR12: 4482 c000  

[  843.857570] GPR16: 00ff8750 00cdc890 010001e0 

[  843.865702] GPR20:   1dcd6500 

[  843.873835] GPR24:  00ec7b00 90009032 
c0d7b178
[  843.881979] GPR28: c0d7b278 0008 c0c970f8 
c00152f4

[  843.890314] NIP [c00cc07c] .trace_hardirqs_on_caller+0x6c/0x190
[  843.896942] LR [c00152f4] .cpu_idle+0x1a4/0x220
[  843.902181] Call Trace:
[  843.904640] [c0d63d20] [c0d63db0] 
init_thread_union+0x3db0/0x4000 (unreliable)

[  843.913317] [c0d63db0] [c00152f4] .cpu_idle+0x1a4/0x220
[  

Oops with Radeon/Uninorth on Maple

2012-05-24 Thread Dmitry Eremin-Solenikov
Hello, colleagues,

I'm trying to enable an AGP slot (again) on my Maple board (dual 
PPC970FX board, with CPC925 (U3H) north bridge).

  For now I'm stuck with a problem: I use radeon card, drm-radeon driver 
with KMS.

If I force drm-radeon to think about a card as about PCI card (by 
commenting corresponding lines in drm_radeon_kms.c), everything works, I 
get framebuffer, working X11, etc. If I enable agpgart-uninorth driver
and RADEON_IS_AGP flag in drm driver, I get an Oops early during the 
bootstrap. Relevant part of the log (I can send full dmesg of normal 
bootstrap or this oops on request, if that would help).

[2.820647] Linux agpgart interface v0.103
[2.824909] agpgart-uninorth :f0:0b.0: Apple U3H chipset
[2.830668] agpgart-uninorth :f0:0b.0: Found device u3, rev 35
[2.843611] agpgart-uninorth :f0:0b.0: configuring for size idx: 64
[2.850638] agpgart-uninorth :f0:0b.0: AGP aperture is 256M @ 0x0
[2.857646] [drm] Initialized drm 1.1.0 20060810
[2.862567] [drm] radeon defaulting to kernel modesetting.
[2.868091] [drm] radeon kernel modesetting enabled.
[2.873222] radeon :f0:10.0: enabling device ( -> 0003)
[2.880311] radeon :f0:10.0: enabling bus mastering
[2.885591] [drm] initializing kernel modesetting (RV350 
0x1002:0x4152 0x18BC:0x0416).
[2.893629] [drm] register mmio base: 0xD002
[2.898260] [drm] register mmio size: 65536
[2.947112] [drm] GPU not posted. posting now...
[3.051033] agpgart-uninorth :f0:0b.0: putting AGP V3 device into 
8x mode
[3.058197] radeon :f0:10.0: putting AGP V3 device into 8x mode
[3.064666] radeon :f0:10.0: GTT: 256M 0x - 0x0FFF
[3.070864] [drm] Generation 2 PCI interface, using max accessible memory
[3.077672] radeon :f0:10.0: VRAM: 128M 0xC000 - 
0xC7FF (128M used)
[3.086487] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[3.093126] [drm] Driver supports precise vblank timestamp query.
[3.099291] [drm] radeon: irq initialized.
[3.103404] [drm] Detected VRAM RAM=128M, BAR=128M
[3.108214] [drm] RAM width 128bits DDR
[3.112263] [TTM] Zone  kernel: Available graphics memory: 496682 kiB
[3.118732] [TTM] Initializing pool allocator
[3.123346] [drm] radeon: 128M of VRAM memory ready
[3.128256] [drm] radeon: 256M of GTT memory ready.
[3.133295] [drm] radeon: ib pool ready.
[3.137708] [drm] radeon: 1 quad pipes, 1 Z pipes initialized.
[3.144018] radeon :f0:10.0: WB disabled
[3.148326] [drm] fence driver on ring 0 use gpu addr 0x and 
cpu addr 0xd0066000
[3.157474] [drm] Loading R300 Microcode
[3.162480] [drm] radeon: ring at 0x1000
[3.167569] [drm] ring test succeeded in 0 usecs
cpu 0x0: Vector: 200 (Machine Check) at [c0d63aa0]
 pc: c00cc07c: .trace_hardirqs_on_caller+0x6c/0x190
 lr: c00152f4: .cpu_idle+0x1a4/0x220
 sp: c0d63d20
msr: 90009032
   current = 0xc0c4db30
   paca= 0xc000   softe: 0irq_happened: 0x01
 pid   = 0, comm = swapper/0
enter ? for help
[c0d63db0] c00152f4 .cpu_idle+0x1a4/0x220
[c0d63e50] c0008fb8 .rest_init+0xe8/0x110
[c0d63ee0] c0ba2998 .start_kernel+0x3e4/0x408
[c0d63f90] c0007558 .start_here_common+0x20/0x48
0:mon> x
[  843.783295] Oops: Machine check, sig: 7 [#1]
[  843.787589] SMP NR_CPUS=4 Maple
[  843.790768] Modules linked in:
[  843.793855] NIP: c00cc07c LR: c00152f4 CTR: 
c0023eac
[  843.800920] REGS: c0d63aa0 TRAP: 0200   Not tainted  (3.4.0+)
[  843.807376] MSR: 90009032   CR: 
2422  XER: 0006
[  843.815412] SOFTE: 0
[  843.817607] TASK = c0c4db30[0] 'swapper/0' THREAD: 
c0d6 CPU: 0
[  843.825035] GPR00:  c0d63d20 c0d63280 
c00152f4
[  843.833169] GPR04:  c0099d10 0001 
0002
[  843.841302] GPR08: 0100 c0e828e8 0140 

[  843.849436] GPR12: 4482 c000  

[  843.857570] GPR16: 00ff8750 00cdc890 010001e0 

[  843.865702] GPR20:   1dcd6500 

[  843.873835] GPR24:  00ec7b00 90009032 
c0d7b178
[  843.881979] GPR28: c0d7b278 0008 c0c970f8 
c00152f4
[  843.890314] NIP [c00cc07c] .trace_hardirqs_on_caller+0x6c/0x190
[  843.896942] LR [c00152f4] .cpu_idle+0x1a4/0x220
[  843.902181] Call Trace:
[  843.904640] [c0d63d20] [c0d63db0] 
init_thread_union+0x3db0/0x4000 (unreliable)
[  843.913317] [c0d63db0] [c00152f4] .cpu_idle+0x1a4/0x220
[