[Bug 73420] [HAWAII] X.org fails to start due to atombios stucking (Sapphire r9 290x Tri-X)
https://bugs.freedesktop.org/show_bug.cgi?id=73420 --- Comment #8 from Luzipher --- With newest stuff from git (xf86-video-ati, mesa, llvm, glamor) I now get X up and running - in llvmpipe software mode. It still stalls the system for at least one occurance of the 5s loop on X startup. dmesg shows 9 of the "atombios stuck for more than 5s" messages currently. Snippet from Xorg.0.log (startx) [ 7148.888] (==) RADEON(0): DPMS enabled [ 7148.888] (==) RADEON(0): Silken mouse enabled [ 7148.888] (II) RADEON(0): RandR 1.2 enabled, ignore the following RandR disabled message. [ 7163.924] (--) RandR disabled [ 7163.928] (II) AIGLX: Screen 0 is not DRI2 capable [ 7163.928] (EE) AIGLX: reverting to software rendering [ 7163.995] (II) AIGLX: Loaded and initialized swrast [ 7163.995] (II) GLX: Initialized DRISWRAST GL provider for screen 0 [ 7179.061] (II) RADEON(0): Setting screen physical size to 169 x 127 [ 7179.096] (II) config/udev: Adding input device Power Button (/dev/input/event1) [ 7179.096] (**) Power Button: Applying InputClass "evdev keyboard catchall" Snippet from dmesg (same time): [ 7140.354544] type=1006 audit(1390711184.643:8): pid=4169 uid=0 old auid=4294967295 new auid=1000 old ses=4294967295 new ses=7 res=1 [ 7147.830641] [drm:atom_op_jump] *ERROR* atombios stuck in loop for more than 5secs aborting [ 7147.830643] [drm:atom_execute_table_locked] *ERROR* atombios stuck executing D368 (len 116, WS 0, PS 0) @ 0xD3D1 [ 7152.840265] [drm:atom_op_jump] *ERROR* atombios stuck in loop for more than 5secs aborting [ 7152.840267] [drm:atom_execute_table_locked] *ERROR* atombios stuck executing D368 (len 116, WS 0, PS 0) @ 0xD3D1 [ 7157.849874] [drm:atom_op_jump] *ERROR* atombios stuck in loop for more than 5secs aborting [ 7157.849876] [drm:atom_execute_table_locked] *ERROR* atombios stuck executing D368 (len 116, WS 0, PS 0) @ 0xD3D1 [ 7162.932450] [drm:atom_op_jump] *ERROR* atombios stuck in loop for more than 5secs aborting [ 7162.932453] [drm:atom_execute_table_locked] *ERROR* atombios stuck executing D368 (len 116, WS 0, PS 0) @ 0xD3D1 [ 7167.950130] [drm:atom_op_jump] *ERROR* atombios stuck in loop for more than 5secs aborting [ 7167.950132] [drm:atom_execute_table_locked] *ERROR* atombios stuck executing D368 (len 116, WS 0, PS 0) @ 0xD3D1 [ 7172.965693] [drm:atom_op_jump] *ERROR* atombios stuck in loop for more than 5secs aborting [ 7172.965696] [drm:atom_execute_table_locked] *ERROR* atombios stuck executing D368 (len 116, WS 0, PS 0) @ 0xD3D1 [ 7178.257075] [drm:atom_op_jump] *ERROR* atombios stuck in loop for more than 5secs aborting [ 7178.257078] [drm:atom_execute_table_locked] *ERROR* atombios stuck executing D368 (len 116, WS 0, PS 0) @ 0xD3D1 [ 7307.075602] [drm:atom_op_jump] *ERROR* atombios stuck in loop for more than 5secs aborting [ 7307.075604] [drm:atom_execute_table_locked] *ERROR* atombios stuck executing D368 (len 116, WS 0, PS 0) @ 0xD3D1 [ 7329.660921] [drm:atom_op_jump] *ERROR* atombios stuck in loop for more than 5secs aborting [ 7329.660924] [drm:atom_execute_table_locked] *ERROR* atombios stuck executing D368 (len 116, WS 0, PS 0) @ 0xD3D1 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/632b6d99/attachment.html>
[Bug 73625] rv730 agp unstable while uvd video playback with SB
https://bugs.freedesktop.org/show_bug.cgi?id=73625 --- Comment #22 from Roman Elshin --- (In reply to comment #17) > It seems to me that uvd is stable with R600_DEBUG=nosb and current mesa (it > is only necessary workaround). I mean stable behaviour - if it able to play > some movie it always play it, or if it hang gpu on other it always hang it > there. There are some low resolution (1024x560, 1024x600) h264 movies that with R600_DEBUG=nosb hang GPU, but strange thing - uvd work with R600_DEBUG=sb with it! -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/f842e804/attachment.html>
[Bug 74068] New: UVD2.2 hang gpu on some WMV3 media
https://bugs.freedesktop.org/show_bug.cgi?id=74068 Priority: medium Bug ID: 74068 Assignee: dri-devel at lists.freedesktop.org Summary: UVD2.2 hang gpu on some WMV3 media Severity: normal Classification: Unclassified OS: All Reporter: roman.elshin at gmail.com Hardware: Other Status: NEW Version: unspecified Component: Drivers/Gallium/r600 Product: Mesa With this video: ID : 2 Format : VC-1 Format profile : MP at HL Codec ID : WMV3 Codec ID/Info: Windows Media Video 9 Codec ID/Hint: WMV3 Description of the codec : Windows Media Video 9 - Professional Duration : 1mn 59s Bit rate mode: Constant Bit rate : 8 000 Kbps Width: 1 440 pixels Height : 1 080 pixels Display aspect ratio : 4:3 Frame rate : 23.976 fps Bit depth: 8 bits Scan type: Progressive Compression mode : Lossy Bits/(Pixel*Frame) : 0.215 http://d-h.st/Uri uvd hang gpu on rv740 (rv730 agp the same). -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/050ca5ea/attachment.html>
[Intel-gfx] [PATCH v2] drm/i915: fix dp/sdvo i2c cleanup
On Sun, Jan 26, 2014 at 1:51 AM, Imre Deak wrote: > On Sat, 2014-01-25 at 21:37 +0100, Daniel Vetter wrote: >> On Fri, Jan 24, 2014 at 02:47:33PM +0200, Imre Deak wrote: >> > Atm we try to remove the connector's i2c sysfs entry too late in the >> > encoder's destroy callback. By that time the kobject used as the parent >> > for all connector sysfs entries is already removed when we do an early >> > removal of all connector sysfs entries in intel_modeset_cleanup(). Fix >> > this by adding an early_destroy encoder callback, where we remove the >> > encoder's i2c adapter. >> > >> > v2: >> > - add missing static to function, use existing sdvo cast helper, >> > s/intel_sdvo/sdvo/ (Chris) >> > >> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70523 >> > >> > Signed-off-by: Imre Deak >> >> This looks fishy ... sysfs should all be reference-counted, so I'm >> confused what's going on here. Also I think this smells a bit like it's >> going overall in the wrong direction - essentially with sysfs we can't >> really force-remove stuff but have to wait until the refcount drops to 0. >> Or at least that's how I think it works, I'd need to blow through a pile >> of time to figure this all out. > > Hm, I haven't thought about refcounting :) Now, I agree that should > normally allow for removing a parent and child device in both order. > > What happens and why we can't remove first the parent then the child: > > In > > intel_dp_init_connector()-> > intel_dp_i2c_init() > > we set the i2c adapter.dev.parent = intel_connector->base.kdev; > > device_register will then add the i2c sysfs entry to the connector sysfs > dir. Refcounting here looks ok, both the parent connector kobject and > its sysfs dir entry gets a reference from the child. > > During module cleanup, we call > > intel_modeset_cleanup()-> > drm_sysfs_connector_remove() > device_unregister(connector->kdev) > > which is the i2c adapter's parent kdev. Then: > > device_del()-> > kobject_del()-> > sysfs_remove_dir() > > will remove all entries recursively in the connector's sysfs dir, along > with all the i2c sysfs entries. Afterwards the intel encoder->destroy() > callback calls i2c_del_adapter()->device_unregister()->device_del() and > that will try to remove its own sysfs attributes, namely the power sysfs > group, but won't find it since it was removed above and give a WARN. > > Note that the parent's recursive removal happens regardless of its > kobject's or sysfs entry's refcount. The kobject itself will be put > after device_del() in put_device() and only destroyed after the i2c > adapter releases the refcount it holds on it. I admit it feels strange > that the sysfs entries are removed before the last reference on the > kobject is dropped, not sure if it's by design or an overlook.. I have no idea either how exactly this is supposed to work, and I quick scan through Documentation/ didn't point me into a useful direction either. Adding Greg (and more mailing lists) for insight. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
[Bug 58667] VM-related crashes on CAYMAN
https://bugs.freedesktop.org/show_bug.cgi?id=58667 --- Comment #47 from udo --- Over here, with 3.12.6 and these $ cat /etc/environment LIBGL_DRIVERS_PATH=/opt/xorg/lib/dri/ RADEON_VA=0 R600_DEBUG=nodma all appears stable. (git llvm, libclc, mesa, etc) -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/12ef0636/attachment.html>
[Bug 66963] Rv6xx dpm problems
https://bugs.freedesktop.org/show_bug.cgi?id=66963 --- Comment #189 from Sergey --- (In reply to comment #188) > (In reply to comment #183) > > You might also try my 3.14 branch: > > http://cgit.freedesktop.org/~agd5f/linux/log/?h=drm-next-3.14 > > Not sure if there are any important changes in this branch, but so far it > looks more stable for me. I haven't seen hangs while video was played, > though the week before i got them almost daily. And have seen hand during > start up only once for last week. > > I might be just very lucky this week. Still don't see hangs, but noticed but FPS is very low on this branch. Half Life is like a slideshow, though works fine with vanilla kernel. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/e1b883a0/attachment.html>
[Intel-gfx] [PATCH v2] drm/i915: fix dp/sdvo i2c cleanup
On Sun, 2014-01-26 at 10:21 +0100, Daniel Vetter wrote: > On Sun, Jan 26, 2014 at 1:51 AM, Imre Deak wrote: > > On Sat, 2014-01-25 at 21:37 +0100, Daniel Vetter wrote: > >> On Fri, Jan 24, 2014 at 02:47:33PM +0200, Imre Deak wrote: > >> > Atm we try to remove the connector's i2c sysfs entry too late in the > >> > encoder's destroy callback. By that time the kobject used as the parent > >> > for all connector sysfs entries is already removed when we do an early > >> > removal of all connector sysfs entries in intel_modeset_cleanup(). Fix > >> > this by adding an early_destroy encoder callback, where we remove the > >> > encoder's i2c adapter. > >> > > >> > v2: > >> > - add missing static to function, use existing sdvo cast helper, > >> > s/intel_sdvo/sdvo/ (Chris) > >> > > >> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70523 > >> > > >> > Signed-off-by: Imre Deak > >> > >> This looks fishy ... sysfs should all be reference-counted, so I'm > >> confused what's going on here. Also I think this smells a bit like it's > >> going overall in the wrong direction - essentially with sysfs we can't > >> really force-remove stuff but have to wait until the refcount drops to 0. > >> Or at least that's how I think it works, I'd need to blow through a pile > >> of time to figure this all out. > > > > Hm, I haven't thought about refcounting :) Now, I agree that should > > normally allow for removing a parent and child device in both order. > > > > What happens and why we can't remove first the parent then the child: > > > > In > > > > intel_dp_init_connector()-> > > intel_dp_i2c_init() > > > > we set the i2c adapter.dev.parent = intel_connector->base.kdev; > > > > device_register will then add the i2c sysfs entry to the connector sysfs > > dir. Refcounting here looks ok, both the parent connector kobject and > > its sysfs dir entry gets a reference from the child. > > > > During module cleanup, we call > > > > intel_modeset_cleanup()-> > > drm_sysfs_connector_remove() > > device_unregister(connector->kdev) > > > > which is the i2c adapter's parent kdev. Then: > > > > device_del()-> > > kobject_del()-> > > sysfs_remove_dir() > > > > will remove all entries recursively in the connector's sysfs dir, along > > with all the i2c sysfs entries. Afterwards the intel encoder->destroy() > > callback calls i2c_del_adapter()->device_unregister()->device_del() and > > that will try to remove its own sysfs attributes, namely the power sysfs > > group, but won't find it since it was removed above and give a WARN. > > > > Note that the parent's recursive removal happens regardless of its > > kobject's or sysfs entry's refcount. The kobject itself will be put > > after device_del() in put_device() and only destroyed after the i2c > > adapter releases the refcount it holds on it. I admit it feels strange > > that the sysfs entries are removed before the last reference on the > > kobject is dropped, not sure if it's by design or an overlook.. > > I have no idea either how exactly this is supposed to work, and I > quick scan through Documentation/ didn't point me into a useful > direction either. > > Adding Greg (and more mailing lists) for insight. Attached the corresponding dmesg. Also one more thought. Imo whether or not it's a valid thing to delete first a parent device and only then its child device, in this case we don't have a reason to do so. We created first the connector device (parent) and then the i2c adapter device (child) and the cleanup should happen in reverse order. This is so regardless of what order the corresponding kobjects get destroyed based on their refcounts. --Imre -- next part -- [ 7516.461543] WARNING: CPU: 1 PID: 4976 at fs/sysfs/group.c:215 sysfs_remove_group+0x5e/0xc0() [ 7516.461555] sysfs group 81d11960 not found for kobject 'i2c-6' name 'power' [ 7516.461566] Modules linked in: tun ccm fuse snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_page_alloc snd_seq_dummy snd_seq_oss arc4 snd_seq_midi iwldvm mac80211 snd_rawmidi i915(-) serio_raw snd_seq_midi_event snd_seq iwlwifi snd_seq_device btusb bnep rfcomm snd_timer bluetooth cfbfillrect thinkpad_acpi cfg80211 cfbimgblt tpm_tis tpm i2c_algo_bit cfbcopyarea snd lpc_ich drm_kms_helper rfkill drm mfd_core intel_smartconnect wmi soundcore vfat fat usbhid [last unloaded: snd_hda_intel] [ 7516.461739] CPU: 1 PID: 4976 Comm: rmmod Not tainted 3.13.0-rc8+ #38 [ 7516.461763] Hardware name: LENOVO 3460CC6/3460CC6, BIOS G6ET93WW (2.53 ) 02/04/2013 [ 7516.461788] 0009 8800d36f5b90 816fd5bc 8800d36f5bd8 [ 7516.461830] 8800d36f5bc8 81057bcc 81d11960 [ 7516.461860] 8800d494a1b8 8800d494a1a8 8800d494a290 8800d36f5c28 [ 7516.461890] Call Trace: [ 7516.461908] [] dump_stack+0x4e/0x7a [ 7516.461931] [] warn_slowpath_common+0x8c/0xc0 [ 7516.461953] [] warn_slowp
[Bug 58667] VM-related crashes on CAYMAN
https://bugs.freedesktop.org/show_bug.cgi?id=58667 Thomas Rohloff changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |WORKSFORME --- Comment #48 from Thomas Rohloff --- (In reply to comment #45) > Is this still an issue with the latest kernel and Mesa? Sorry for the delay. It seems to be fixed. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/0c14c208/attachment.html>
[Bug 58354] [bisected] r600g: use DMA engine for VM page table updates on cayman locks in Unigine Tropics
https://bugs.freedesktop.org/show_bug.cgi?id=58354 Bug 58354 depends on bug 58667, which changed state. Bug 58667 Summary: VM-related crashes on CAYMAN https://bugs.freedesktop.org/show_bug.cgi?id=58667 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |WORKSFORME -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/dfc079f4/attachment.html>
[Bug 73848] [Radeon] Blank screen after boot with kernel 3.12.x, xorg 1.15
https://bugs.freedesktop.org/show_bug.cgi?id=73848 --- Comment #10 from Marti Raudsepp --- Also this bug doesn't occur on the same hardware with a fresh installation on kernel 3.12.8, it's something specific to my system configuration. Any ideas? -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/f6eedfdb/attachment-0001.html>
[Bug 64819] GPU fault detected flood at A8-5600K Trinity 7560D
https://bugs.freedesktop.org/show_bug.cgi?id=64819 Marek Ol??k changed: What|Removed |Added Component|Drivers/DRI/Radeon |Drivers/Gallium/r600 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/d03b87fe/attachment.html>
[Bug 67849] continuos reboots
https://bugs.freedesktop.org/show_bug.cgi?id=67849 Marek Ol??k changed: What|Removed |Added Component|Drivers/DRI/Radeon |Drivers/Gallium/r600 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/5cfc53d0/attachment.html>
[Bug 67169] Black screen after waking from sleep
https://bugs.freedesktop.org/show_bug.cgi?id=67169 Marek Ol??k changed: What|Removed |Added Product|Mesa|DRI Version|9.1 |unspecified Component|Drivers/DRI/Radeon |DRM/Radeon -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/54ec7fd6/attachment.html>
[Bug 66632] Very low FPS when video memory is full (GART & ram <-> vram swapping)
https://bugs.freedesktop.org/show_bug.cgi?id=66632 Marek Ol??k changed: What|Removed |Added Version|7.0 |git Component|Drivers/DRI/Radeon |Drivers/Gallium/r600 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/bd73d89a/attachment.html>
[Bug 73739] RV630 flickering on "Wargame European Escalation"
https://bugs.freedesktop.org/show_bug.cgi?id=73739 Marek Ol??k changed: What|Removed |Added Component|Drivers/DRI/R600|Drivers/Gallium/r600 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/2591c38e/attachment.html>
[Bug 73528] Deferred lighting in Second Life causes system hiccups and screen flickering
https://bugs.freedesktop.org/show_bug.cgi?id=73528 Marek Ol??k changed: What|Removed |Added Component|Drivers/DRI/R600|Drivers/Gallium/r600 -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/d1025ff8/attachment.html>
[Bug 69301] no screen on update from 3.12.0
https://bugzilla.kernel.org/show_bug.cgi?id=69301 --- Comment #7 from Jan Outhuis --- No. Same happens as before: radeon.dpm enabled gives a deadstop early in the bootprocess (hardware reboot required); radeon.dpm=0 finishes the bootprocess, but no screen on tty7. On Fri, 2014-01-24 at 15:08 +, bugzilla-daemon at bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=69301 > > --- Comment #6 from Alex Deucher --- > Does reverting: > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4573388c92ee60b4ed72b8d95b73df861189988c > help? > -- You are receiving this mail because: You are watching the assignee of the bug.
[Bug 66963] Rv6xx dpm problems
https://bugs.freedesktop.org/show_bug.cgi?id=66963 --- Comment #190 from Jaime Velasco Juan --- (In reply to comment #189) > (In reply to comment #188) > > (In reply to comment #183) > > > You might also try my 3.14 branch: > > > http://cgit.freedesktop.org/~agd5f/linux/log/?h=drm-next-3.14 > > > > Not sure if there are any important changes in this branch, but so far it > > looks more stable for me. I haven't seen hangs while video was played, > > though the week before i got them almost daily. And have seen hand during > > start up only once for last week. > > > > I might be just very lucky this week. > > Still don't see hangs, but noticed but FPS is very low on this branch. Half > Life is like a slideshow, though works fine with vanilla kernel. Are you sure you have acceleration enabled, the behaviour you describe matches what I found when started testing that branch (grep dmesg for "*ERROR* radeon: ring 3 test failed (0xCAFEDEAD)"). If you have that problem you could test the patch I sent in comment 175 ( attachment 91835), It will skip initialization of the DMA ring and enable acceleration again. I've been using it for several weeks, no hangs yet, works like a charm. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/2e1195d4/attachment-0001.html>
[Bug 73947] [DPM] Cape Verde PRO - GPU lockup when dpm is enabled
https://bugs.freedesktop.org/show_bug.cgi?id=73947 --- Comment #5 from Alexander Tsoy --- Created attachment 92823 --> https://bugs.freedesktop.org/attachment.cgi?id=92823&action=edit lspci-vvvnn.log Looks like a hardware related problem. fglrx is also failing for me. According to lspci, x16 PCI Express port is capable to provide only 25W, which is not enough for CAPE VERDE. Also additional x8 PCI-E lines which is shared between this port and the neighbour x8 port are not active. The motherboard is Supermicro H8SCM. LnkCap:Port #0, Speed 5GT/s, Width x8, ASPM L0s L1, Latency L0 <1us, L1 <8us ClockPM- Surprise- LLActRep+ BwNot+ SltCap:AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surprise- Slot #7, PowerLimit 25.000W; Interlock- NoCompl+ -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/5c8b0bc4/attachment.html>
[Bug 73947] [DPM] Cape Verde PRO - GPU lockup when dpm is enabled
https://bugs.freedesktop.org/show_bug.cgi?id=73947 Alexander Tsoy changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/462fd346/attachment.html>
[Bug 66963] Rv6xx dpm problems
https://bugs.freedesktop.org/show_bug.cgi?id=66963 --- Comment #191 from Sergey --- (In reply to comment #190) > Are you sure you have acceleration enabled, the behaviour you describe > matches what I found when started testing that branch (grep dmesg for > "*ERROR* radeon: ring 3 test failed (0xCAFEDEAD)"). Looks like you are right. I have the same error. Thanks. Will try your patch. -- You are receiving this mail because: You are the assignee for the bug. -- next part -- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20140126/7671eca7/attachment.html>
[PATCH] drm/doc: Clarify the dumb object interfaces
Hi Daniel, Thank you for the patch. On Friday 24 January 2014 17:58:40 Daniel Vetter wrote: > - This is _not_ a generic interface to create gem objects, but just an > interface to make early boot services (like boot splash) with a > generic KMS userspace driver possible. Hence it's better to move > the documentation for this from the GEM section to the KMS section, > next to the creation of framebuffer objects. > > - Make it really clear that the returned handle isn't necessarily a > GEM object (it can also be e.g. a TTM handle when running on top of > vmwgfx). > > - Add a paragraph to make it clear that this is just for unaccelarated > userspace - gpu drivers need to have their own buffer object > creation ioctl which is hardware specific. > > v2: Clarify that the documentation doesn't just apply to GEM-based > drivers only but is now generally valid, as suggested by David. > > v3: Polish the intro sentence a bit and one s/objects/handles/ for > clarification, both suggested by Laurent. > > v4: More text polish from Laurent's review. > > Cc: David Herrmann > Cc: Laurent Pinchart > Signed-off-by: Daniel Vetter Acked-by: Laurent Pinchart > --- > Documentation/DocBook/drm.tmpl | 131 -- > 1 file changed, 71 insertions(+), 60 deletions(-) > > diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl > index ed1d6d289022..67cfe184749c 100644 > --- a/Documentation/DocBook/drm.tmpl > +++ b/Documentation/DocBook/drm.tmpl > @@ -830,62 +830,6 @@ char *date; > > > > -Dumb GEM Objects > - > - The GEM API doesn't standardize GEM objects creation and leaves > it to - driver-specific ioctls. While not an issue for > full-fledged graphics - stacks that include device-specific > userspace components (in libdrm for - instance), this limit makes > DRM-based early boot graphics unnecessarily - complex. > - > - > - Dumb GEM objects partly alleviate the problem by providing a > standard - API to create dumb buffers suitable for scanout, which > can then be used - to create KMS frame buffers. > - > - > - To support dumb GEM objects drivers must implement the > - dumb_create, > - dumb_destroy and > - dumb_map_offset operations. > - > - > - > -int (*dumb_create)(struct drm_file *file_priv, struct > drm_device *dev, - struct drm_mode_create_dumb > *args); - > - The dumb_create operation creates a > GEM - object suitable for scanout based on the width, height > and depth - from the struct > drm_mode_create_dumb - argument. It > fills the argument's handle, - > pitch and size - > fields with a handle for the newly created GEM object and its line > - pitch and size in bytes. > - > - > - > -int (*dumb_destroy)(struct drm_file *file_priv, > struct drm_device *dev, - uint32_t handle); > - > - The dumb_destroy operation destroys > a dumb - GEM object created by > dumb_create. - > - > - > -int (*dumb_map_offset)(struct drm_file *file_priv, > struct drm_device *dev, - uint32_t handle, uint64_t > *offset); - > - The dumb_map_offset operation > associates an - mmap fake offset with the GEM object given by > the handle and returns - it. Drivers must use the > - drm_gem_create_mmap_offset function to > - associate the fake offset as described in > - . > - > - > - > - > - > Memory Coherency > >When mapped to the device or used in a command buffer, backing > pages @@ -968,9 +912,11 @@ int max_width, max_height; > Frame buffers rely on the underneath memory manager for low-level > memory operations. When creating a frame buffer applications pass a memory > handle (or a list of memory handles for multi-planar formats) through - >the drm_mode_fb_cmd2 argument. This document - > assumes that the driver uses GEM, those handles thus reference GEM - > objects. > + the drm_mode_fb_cmd2 argument. For drivers using > + GEM as their userspace buffer management interface this would be a GEM > + handle. Drivers are however free to use their own backing storage > object > + handles, e.g. vmwgfx directly exposes special TTM handles to userspace > + and so expects TTM handles in the create ioctl and not GEM handles. > > > Drivers must first validate the requested frame buffer parameters > passed @@ -992,7 +938,7 @@ int max_width, max_he
[Intel-gfx] [PATCH v2] drm/i915: fix dp/sdvo i2c cleanup
On Sun, Jan 26, 2014 at 01:11:15PM +0200, Imre Deak wrote: > On Sun, 2014-01-26 at 10:21 +0100, Daniel Vetter wrote: > > On Sun, Jan 26, 2014 at 1:51 AM, Imre Deak wrote: > > > On Sat, 2014-01-25 at 21:37 +0100, Daniel Vetter wrote: > > >> On Fri, Jan 24, 2014 at 02:47:33PM +0200, Imre Deak wrote: > > >> > Atm we try to remove the connector's i2c sysfs entry too late in the > > >> > encoder's destroy callback. By that time the kobject used as the parent > > >> > for all connector sysfs entries is already removed when we do an early > > >> > removal of all connector sysfs entries in intel_modeset_cleanup(). Fix > > >> > this by adding an early_destroy encoder callback, where we remove the > > >> > encoder's i2c adapter. > > >> > > > >> > v2: > > >> > - add missing static to function, use existing sdvo cast helper, > > >> > s/intel_sdvo/sdvo/ (Chris) > > >> > > > >> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70523 > > >> > > > >> > Signed-off-by: Imre Deak > > >> > > >> This looks fishy ... sysfs should all be reference-counted, so I'm > > >> confused what's going on here. Also I think this smells a bit like it's > > >> going overall in the wrong direction - essentially with sysfs we can't > > >> really force-remove stuff but have to wait until the refcount drops to 0. > > >> Or at least that's how I think it works, I'd need to blow through a pile > > >> of time to figure this all out. > > > > > > Hm, I haven't thought about refcounting :) Now, I agree that should > > > normally allow for removing a parent and child device in both order. > > > > > > What happens and why we can't remove first the parent then the child: > > > > > > In > > > > > > intel_dp_init_connector()-> > > > intel_dp_i2c_init() > > > > > > we set the i2c adapter.dev.parent = intel_connector->base.kdev; > > > > > > device_register will then add the i2c sysfs entry to the connector sysfs > > > dir. Refcounting here looks ok, both the parent connector kobject and > > > its sysfs dir entry gets a reference from the child. > > > > > > During module cleanup, we call > > > > > > intel_modeset_cleanup()-> > > > drm_sysfs_connector_remove() > > > device_unregister(connector->kdev) > > > > > > which is the i2c adapter's parent kdev. Then: > > > > > > device_del()-> > > > kobject_del()-> > > > sysfs_remove_dir() > > > > > > will remove all entries recursively in the connector's sysfs dir, along > > > with all the i2c sysfs entries. Afterwards the intel encoder->destroy() > > > callback calls i2c_del_adapter()->device_unregister()->device_del() and > > > that will try to remove its own sysfs attributes, namely the power sysfs > > > group, but won't find it since it was removed above and give a WARN. > > > > > > Note that the parent's recursive removal happens regardless of its > > > kobject's or sysfs entry's refcount. The kobject itself will be put > > > after device_del() in put_device() and only destroyed after the i2c > > > adapter releases the refcount it holds on it. I admit it feels strange > > > that the sysfs entries are removed before the last reference on the > > > kobject is dropped, not sure if it's by design or an overlook.. > > > > I have no idea either how exactly this is supposed to work, and I > > quick scan through Documentation/ didn't point me into a useful > > direction either. > > > > Adding Greg (and more mailing lists) for insight. > > Attached the corresponding dmesg. > > Also one more thought. Imo whether or not it's a valid thing to delete > first a parent device and only then its child device, in this case we > don't have a reason to do so. We created first the connector device > (parent) and then the i2c adapter device (child) and the cleanup should > happen in reverse order. This is so regardless of what order the > corresponding kobjects get destroyed based on their refcounts. The kernel used to not complain if you removed a parent before the child, but now it does. As you already have all of the needed information, just switch the removal and then all should be fine. thanks, greg k-h
[PATCH 1/4] drm/i2c: tda998x: add a function for dynamic audio input switch
When both I2S and S/PDIF are wired from the audio device to the TDA998x, the user or some internal mechanism may choose to do audio streaming via either inputs. This patch adds an exported function in the TDA998x driver which initializes the audio input parameters according to the audio subsystem. The audio format values in the encoder configuration interface are changed to non null values so that the value 0 is used in the audio function to indicate that audio streaming is stopped. Signed-off-by: Jean-Francois Moine --- drivers/gpu/drm/i2c/tda998x_drv.c | 43 ++- include/drm/i2c/tda998x.h | 7 +-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index e5bbaf2..186c751 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -34,6 +34,7 @@ struct tda998x_priv { struct i2c_client *hdmi; uint16_t rev; uint8_t current_page; + u8 audio_active; int dpms; bool is_hdmi_sink; u8 vip_cntrl_0; @@ -729,6 +730,38 @@ tda998x_configure_audio(struct tda998x_priv *priv, tda998x_write_aif(priv, p); } +/* tda998x codec interface */ +void tda998x_audio_update(struct i2c_client *client, + int format, + int port) +{ + struct tda998x_priv *priv = i2c_get_clientdata(client); + struct tda998x_encoder_params *p = &priv->params; + + /* if the audio output is active, it may be a second start or a stop */ + if (format == 0 || priv->audio_active) { + if (format == 0) { + priv->audio_active = 0; + reg_write(priv, REG_ENA_AP, 0); + } + return; + } + + p->audio_cfg = port; + + /* don't restart audio if same input format */ + if (format == p->audio_format) { + priv->audio_active = 1; + reg_write(priv, REG_ENA_AP, p->audio_cfg); + return; + } + p->audio_format = format; + priv->audio_active = 1; + + tda998x_configure_audio(priv, &priv->encoder->crtc->hwmode, p); +} +EXPORT_SYMBOL_GPL(tda998x_audio_update); + /* DRM encoder functions */ static void @@ -751,6 +784,9 @@ tda998x_encoder_set_config(struct drm_encoder *encoder, void *params) (p->mirr_f ? VIP_CNTRL_2_MIRR_F : 0); priv->params = *p; + + if (p->audio_cfg) + priv->audio_active = 1; } static void @@ -1001,7 +1037,7 @@ tda998x_encoder_mode_set(struct drm_encoder *encoder, tda998x_write_avi(priv, adj_mode); - if (priv->params.audio_cfg) + if (priv->audio_active) tda998x_configure_audio(priv, adj_mode, &priv->params); } } @@ -1233,10 +1269,15 @@ tda998x_encoder_init(struct i2c_client *client, if (!priv) return -ENOMEM; + i2c_set_clientdata(client, priv); + priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(2) | VIP_CNTRL_0_SWAP_B(3); priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(0) | VIP_CNTRL_1_SWAP_D(1); priv->vip_cntrl_2 = VIP_CNTRL_2_SWAP_E(4) | VIP_CNTRL_2_SWAP_F(5); + priv->params.audio_frame[1] = 1;/* channels - 1 */ + priv->params.audio_sample_rate = 48000; /* 48kHz */ + priv->current_page = 0xff; priv->hdmi = client; priv->cec = i2c_new_dummy(client->adapter, 0x34); diff --git a/include/drm/i2c/tda998x.h b/include/drm/i2c/tda998x.h index f3bb25c..0459931 100644 --- a/include/drm/i2c/tda998x.h +++ b/include/drm/i2c/tda998x.h @@ -19,11 +19,14 @@ struct tda998x_encoder_params { u8 audio_frame[6]; enum { - AFMT_SPDIF, - AFMT_I2S + AFMT_I2S = 1, + AFMT_SPDIF } audio_format; unsigned audio_sample_rate; }; +void tda998x_audio_update(struct i2c_client *client, + int format, + int port); #endif -- 1.8.5.3
[PATCH 2/4] ASoC: tda998x: add a codec driver for TDA998x
This patch adds a CODEC driver for the NXP TDA998x HDMI transmitter. The CODEC handles both I2S and S/PDIF input and does dynamic input switch in the TDA998x I2C driver on audio streaming start/stop. Signed-off-by: Jean-Francois Moine --- sound/soc/codecs/Kconfig | 7 ++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/tda998x.c | 227 + 3 files changed, 236 insertions(+) create mode 100644 sound/soc/codecs/tda998x.c diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index b33b45d..7cec76e 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -71,6 +71,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_STA529 if I2C select SND_SOC_STAC9766 if SND_SOC_AC97_BUS select SND_SOC_TAS5086 if I2C + select SND_SOC_TDA998X if I2C select SND_SOC_TLV320AIC23 if I2C select SND_SOC_TLV320AIC26 if SPI_MASTER select SND_SOC_TLV320AIC32X4 if I2C @@ -352,6 +353,12 @@ config SND_SOC_STAC9766 config SND_SOC_TAS5086 tristate +config SND_SOC_TDA998X + tristate + depends on OF + default y if DRM_I2C_NXP_TDA998X=y + default m if DRM_I2C_NXP_TDA998X=m + config SND_SOC_TLV320AIC23 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index bc12676..a53d09e 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -62,6 +62,7 @@ snd-soc-sta32x-objs := sta32x.o snd-soc-sta529-objs := sta529.o snd-soc-stac9766-objs := stac9766.o snd-soc-tas5086-objs := tas5086.o +snd-soc-tda998x-objs := tda998x.o snd-soc-tlv320aic23-objs := tlv320aic23.o snd-soc-tlv320aic26-objs := tlv320aic26.o snd-soc-tlv320aic3x-objs := tlv320aic3x.o @@ -192,6 +193,7 @@ obj-$(CONFIG_SND_SOC_STA32X) += snd-soc-sta32x.o obj-$(CONFIG_SND_SOC_STA529) += snd-soc-sta529.o obj-$(CONFIG_SND_SOC_STAC9766) += snd-soc-stac9766.o obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o +obj-$(CONFIG_SND_SOC_TDA998X) += snd-soc-tda998x.o obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o diff --git a/sound/soc/codecs/tda998x.c b/sound/soc/codecs/tda998x.c new file mode 100644 index 000..d724f7d --- /dev/null +++ b/sound/soc/codecs/tda998x.c @@ -0,0 +1,227 @@ +/* + * ALSA SoC TDA998X driver + * + * This driver is used by the NXP TDA998x HDMI transmitter. + * + * Copyright (C) 2014 Jean-Francois Moine + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include + +#define TDA998X_FORMATS(SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S20_3LE | \ + SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE) + +struct tda_priv { + struct i2c_client *i2c_client; + struct snd_soc_codec *codec; + u8 ports[2]; + int dai_id; + u8 *eld; +}; + +static void tda_get_encoder(struct tda_priv *priv) +{ + struct snd_soc_codec *codec = priv->codec; + struct device_node *np; + struct i2c_client *i2c_client; + static const struct of_device_id tda_dt[] = { + { .compatible = "nxp,tda998x" }, + { }, + }; + + /* search the tda998x device */ + np = of_find_matching_node_and_match(NULL, tda_dt, NULL); + if (!np || !of_device_is_available(np)) { + dev_err(codec->dev, "No tda998x in DT\n"); + return; + } + i2c_client = of_find_i2c_device_by_node(np); + of_node_put(np); + if (!i2c_client) { + dev_err(codec->dev, "no tda998x i2c client\n"); + return; + } + if (!i2c_get_clientdata(i2c_client)) { + dev_err(codec->dev, "tda998x not initialized\n"); + return; + } + + priv->i2c_client = i2c_client; +} + +static int tda_start_stop(struct tda_priv *priv, + int start) +{ + int format, port; + + if (!priv->i2c_client) { + tda_get_encoder(priv); + if (!priv->i2c_client) + return -EINVAL; + } + + /* give the audio input type and ports to the HDMI encoder */ + format = start ? priv->dai_id : 0; + switch (format) { + case AFMT_I2S: + port = priv->ports[0]; + break; + default: + case AFMT_SPDIF: + port = priv->ports[1]; + break; + } + tda998x_audio_update(priv->i2c_client, format, port); + return 0; +} + +static int tda_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct tda_priv *
[PATCH v2 1/5] drm/i2c: tda998x: add a function for dynamic audio input switch
When both I2S and S/PDIF are wired from the audio device to the TDA998x, the user or some internal mechanism may choose to do audio streaming via either inputs. This patch adds an exported function in the TDA998x driver which initializes the audio input parameters according to the audio subsystem. The audio format values in the encoder configuration interface are changed to non null values so that the value 0 is used in the audio function to indicate that audio streaming is stopped. As the audio clock depends on the input type, it is set so. Then, the configuration value audio_clk_cfg is now ignored. Signed-off-by: Jean-Francois Moine --- drivers/gpu/drm/i2c/tda998x_drv.c | 48 --- include/drm/i2c/tda998x.h | 7 -- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 2f97290..2643be4 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -35,6 +35,7 @@ struct tda998x_priv { struct i2c_client *hdmi; uint16_t rev; uint8_t current_page; + u8 audio_active; int dpms; bool is_hdmi_sink; u8 vip_cntrl_0; @@ -640,12 +641,11 @@ static void tda998x_configure_audio(struct tda998x_priv *priv, struct drm_display_mode *mode, struct tda998x_encoder_params *p) { - uint8_t buf[6], clksel_aip, clksel_fs, cts_n, adiv; + uint8_t buf[6], clksel_aip, clksel_fs, cts_n, adiv, aclk; uint32_t n; /* Enable audio ports */ reg_write(priv, REG_ENA_AP, p->audio_cfg); - reg_write(priv, REG_ENA_ACLK, p->audio_clk_cfg); /* Set audio input source */ switch (p->audio_format) { @@ -654,6 +654,7 @@ tda998x_configure_audio(struct tda998x_priv *priv, clksel_aip = AIP_CLKSEL_AIP_SPDIF; clksel_fs = AIP_CLKSEL_FS_FS64SPDIF; cts_n = CTS_N_M(3) | CTS_N_K(3); + aclk = 0; /* no clock */ break; case AFMT_I2S: @@ -661,6 +662,7 @@ tda998x_configure_audio(struct tda998x_priv *priv, clksel_aip = AIP_CLKSEL_AIP_I2S; clksel_fs = AIP_CLKSEL_FS_ACLK; cts_n = CTS_N_M(3) | CTS_N_K(3); + aclk = 1; /* clock enable */ break; default: @@ -672,6 +674,7 @@ tda998x_configure_audio(struct tda998x_priv *priv, reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_LAYOUT | AIP_CNTRL_0_ACR_MAN); /* auto CTS */ reg_write(priv, REG_CTS_N, cts_n); + reg_write(priv, REG_ENA_ACLK, aclk); /* * Audio input somehow depends on HDMI line rate which is @@ -728,6 +731,37 @@ tda998x_configure_audio(struct tda998x_priv *priv, tda998x_write_aif(priv, p); } +/* tda998x codec interface */ +void tda998x_audio_update(struct i2c_client *client, + int format, + int port) +{ + struct tda998x_priv *priv = i2c_get_clientdata(client); + struct tda998x_encoder_params *p = &priv->params; + + /* if the audio output is active, it may be a second start or a stop */ + if (format == 0 || priv->audio_active) { + if (format == 0) { + priv->audio_active = 0; + reg_write(priv, REG_ENA_AP, 0); + } + return; + } + priv->audio_active = 1; + + p->audio_cfg = port; + + /* don't restart audio if same input format */ + if (format == p->audio_format) { + reg_write(priv, REG_ENA_AP, p->audio_cfg); + return; + } + p->audio_format = format; + + tda998x_configure_audio(priv, &priv->encoder->crtc->hwmode, p); +} +EXPORT_SYMBOL_GPL(tda998x_audio_update); + /* DRM encoder functions */ static void @@ -750,6 +784,9 @@ tda998x_encoder_set_config(struct drm_encoder *encoder, void *params) (p->mirr_f ? VIP_CNTRL_2_MIRR_F : 0); priv->params = *p; + + if (p->audio_cfg) + priv->audio_active = 1; } static void @@ -999,7 +1036,7 @@ tda998x_encoder_mode_set(struct drm_encoder *encoder, tda998x_write_avi(priv, adjusted_mode); - if (priv->params.audio_cfg) + if (priv->audio_active) tda998x_configure_audio(priv, adjusted_mode, &priv->params); } @@ -1239,10 +1276,15 @@ tda998x_encoder_init(struct i2c_client *client, if (!priv) return -ENOMEM; + i2c_set_clientdata(client, priv); + priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(2) | VIP_CNTRL_0_SWAP_B(3); priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(0) | VIP_CNTRL_1_SWAP_D(1); priv->vip_cntrl_2 = VIP_CNTRL_2_SWAP_E(4) | VIP_
[PATCH v2 2/5] ASoC: tda998x: add a codec driver for TDA998x
This patch adds a CODEC driver for the NXP TDA998x HDMI transmitter. The CODEC handles both I2S and S/PDIF input and does dynamic input switch in the TDA998x I2C driver on audio streaming start/stop. Signed-off-by: Jean-Francois Moine --- sound/soc/codecs/Kconfig | 6 ++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/tda998x.c | 237 + 3 files changed, 245 insertions(+) create mode 100644 sound/soc/codecs/tda998x.c diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index b33b45d..747e387 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -352,6 +352,12 @@ config SND_SOC_STAC9766 config SND_SOC_TAS5086 tristate +config SND_SOC_TDA998X + tristate + depends on OF + default y if DRM_I2C_NXP_TDA998X=y + default m if DRM_I2C_NXP_TDA998X=m + config SND_SOC_TLV320AIC23 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index bc12676..a53d09e 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -62,6 +62,7 @@ snd-soc-sta32x-objs := sta32x.o snd-soc-sta529-objs := sta529.o snd-soc-stac9766-objs := stac9766.o snd-soc-tas5086-objs := tas5086.o +snd-soc-tda998x-objs := tda998x.o snd-soc-tlv320aic23-objs := tlv320aic23.o snd-soc-tlv320aic26-objs := tlv320aic26.o snd-soc-tlv320aic3x-objs := tlv320aic3x.o @@ -192,6 +193,7 @@ obj-$(CONFIG_SND_SOC_STA32X) += snd-soc-sta32x.o obj-$(CONFIG_SND_SOC_STA529) += snd-soc-sta529.o obj-$(CONFIG_SND_SOC_STAC9766) += snd-soc-stac9766.o obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o +obj-$(CONFIG_SND_SOC_TDA998X) += snd-soc-tda998x.o obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o diff --git a/sound/soc/codecs/tda998x.c b/sound/soc/codecs/tda998x.c new file mode 100644 index 000..585cdb6 --- /dev/null +++ b/sound/soc/codecs/tda998x.c @@ -0,0 +1,237 @@ +/* + * ALSA SoC TDA998X driver + * + * This driver is used by the NXP TDA998x HDMI transmitter. + * + * Copyright (C) 2014 Jean-Francois Moine + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include + +#define TDA998X_FORMATS(SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S20_3LE | \ + SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE) + +struct tda_priv { + struct i2c_client *i2c_client; + struct snd_soc_codec *codec; + u8 ports[2]; + int dai_id; + u8 *eld; +}; + +static void tda_get_encoder(struct tda_priv *priv) +{ + struct snd_soc_codec *codec = priv->codec; + struct device_node *np; + struct i2c_client *i2c_client; + static const struct of_device_id tda_dt[] = { + { .compatible = "nxp,tda998x" }, + { }, + }; + + /* search the tda998x device */ + np = of_find_matching_node_and_match(NULL, tda_dt, NULL); + if (!np || !of_device_is_available(np)) { + dev_err(codec->dev, "No tda998x in DT\n"); + return; + } + i2c_client = of_find_i2c_device_by_node(np); + of_node_put(np); + if (!i2c_client) { + dev_err(codec->dev, "no tda998x i2c client\n"); + return; + } + if (!i2c_get_clientdata(i2c_client)) { + dev_err(codec->dev, "tda998x not initialized\n"); + return; + } + + priv->i2c_client = i2c_client; +} + +static int tda_start_stop(struct tda_priv *priv) +{ + int port; + + if (!priv->i2c_client) { + tda_get_encoder(priv); + if (!priv->i2c_client) + return -EINVAL; + } + + /* give the audio parameters to the HDMI encoder */ + if (priv->dai_id == AFMT_I2S) + port = priv->ports[0]; + else + port = priv->ports[1]; + tda998x_audio_update(priv->i2c_client, priv->dai_id, port); + return 0; +} + +static int tda_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct tda_priv *priv = snd_soc_codec_get_drvdata(dai->codec); + + /* memorize the used DAI */ + priv->dai_id = dai->id; + + /* start the TDA998x audio */ + return tda_start_stop(priv); +} + +static void tda_shutdown(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct tda_priv *priv = snd_soc_codec_get_drvdata(dai->codec); + + priv->dai_id = 0; /* streaming stop */ + tda_start_stop(priv); +} + +static const struct snd_soc_dai_ops tda_ops = {
[PATCH v3 1/5] drm/i2c: tda998x: add a function for dynamic audio input switch
When both I2S and S/PDIF are wired from the audio device to the TDA998x, the user or some internal mechanism may choose to do audio streaming via either inputs. This patch adds an exported function in the TDA998x driver which initializes the audio input parameters according to the audio subsystem. The audio format values in the encoder configuration interface are changed to non null values so that the value 0 is used in the audio function to indicate that audio streaming is stopped. As the audio clock depends on the input type, it is set so. Then, the configuration value audio_clk_cfg is now ignored. Signed-off-by: Jean-Francois Moine --- drivers/gpu/drm/i2c/tda998x_drv.c | 48 --- include/drm/i2c/tda998x.h | 7 -- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 2f97290..2643be4 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -35,6 +35,7 @@ struct tda998x_priv { struct i2c_client *hdmi; uint16_t rev; uint8_t current_page; + u8 audio_active; int dpms; bool is_hdmi_sink; u8 vip_cntrl_0; @@ -640,12 +641,11 @@ static void tda998x_configure_audio(struct tda998x_priv *priv, struct drm_display_mode *mode, struct tda998x_encoder_params *p) { - uint8_t buf[6], clksel_aip, clksel_fs, cts_n, adiv; + uint8_t buf[6], clksel_aip, clksel_fs, cts_n, adiv, aclk; uint32_t n; /* Enable audio ports */ reg_write(priv, REG_ENA_AP, p->audio_cfg); - reg_write(priv, REG_ENA_ACLK, p->audio_clk_cfg); /* Set audio input source */ switch (p->audio_format) { @@ -654,6 +654,7 @@ tda998x_configure_audio(struct tda998x_priv *priv, clksel_aip = AIP_CLKSEL_AIP_SPDIF; clksel_fs = AIP_CLKSEL_FS_FS64SPDIF; cts_n = CTS_N_M(3) | CTS_N_K(3); + aclk = 0; /* no clock */ break; case AFMT_I2S: @@ -661,6 +662,7 @@ tda998x_configure_audio(struct tda998x_priv *priv, clksel_aip = AIP_CLKSEL_AIP_I2S; clksel_fs = AIP_CLKSEL_FS_ACLK; cts_n = CTS_N_M(3) | CTS_N_K(3); + aclk = 1; /* clock enable */ break; default: @@ -672,6 +674,7 @@ tda998x_configure_audio(struct tda998x_priv *priv, reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_LAYOUT | AIP_CNTRL_0_ACR_MAN); /* auto CTS */ reg_write(priv, REG_CTS_N, cts_n); + reg_write(priv, REG_ENA_ACLK, aclk); /* * Audio input somehow depends on HDMI line rate which is @@ -728,6 +731,37 @@ tda998x_configure_audio(struct tda998x_priv *priv, tda998x_write_aif(priv, p); } +/* tda998x codec interface */ +void tda998x_audio_update(struct i2c_client *client, + int format, + int port) +{ + struct tda998x_priv *priv = i2c_get_clientdata(client); + struct tda998x_encoder_params *p = &priv->params; + + /* if the audio output is active, it may be a second start or a stop */ + if (format == 0 || priv->audio_active) { + if (format == 0) { + priv->audio_active = 0; + reg_write(priv, REG_ENA_AP, 0); + } + return; + } + priv->audio_active = 1; + + p->audio_cfg = port; + + /* don't restart audio if same input format */ + if (format == p->audio_format) { + reg_write(priv, REG_ENA_AP, p->audio_cfg); + return; + } + p->audio_format = format; + + tda998x_configure_audio(priv, &priv->encoder->crtc->hwmode, p); +} +EXPORT_SYMBOL_GPL(tda998x_audio_update); + /* DRM encoder functions */ static void @@ -750,6 +784,9 @@ tda998x_encoder_set_config(struct drm_encoder *encoder, void *params) (p->mirr_f ? VIP_CNTRL_2_MIRR_F : 0); priv->params = *p; + + if (p->audio_cfg) + priv->audio_active = 1; } static void @@ -999,7 +1036,7 @@ tda998x_encoder_mode_set(struct drm_encoder *encoder, tda998x_write_avi(priv, adjusted_mode); - if (priv->params.audio_cfg) + if (priv->audio_active) tda998x_configure_audio(priv, adjusted_mode, &priv->params); } @@ -1239,10 +1276,15 @@ tda998x_encoder_init(struct i2c_client *client, if (!priv) return -ENOMEM; + i2c_set_clientdata(client, priv); + priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(2) | VIP_CNTRL_0_SWAP_B(3); priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(0) | VIP_CNTRL_1_SWAP_D(1); priv->vip_cntrl_2 = VIP_CNTRL_2_SWAP_E(4) | VIP_
[PATCH v3 2/5] ASoC: tda998x: add a codec driver for the TDA998x
This patch adds a CODEC driver for the NXP TDA998x HDMI transmitter. The CODEC handles both I2S and S/PDIF input and does dynamic input switch in the TDA998x I2C driver on start/stop audio streaming. This driver is DT only and it is loaded from its DT description as a subnode in the TDA998x node. Signed-off-by: Jean-Francois Moine --- drivers/gpu/drm/i2c/tda998x_drv.c | 4 + sound/soc/codecs/Kconfig | 6 ++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/tda998x.c| 216 ++ 4 files changed, 228 insertions(+) create mode 100644 sound/soc/codecs/tda998x.c diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 2643be4..68f0b7b 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -1387,6 +1388,9 @@ tda998x_encoder_init(struct i2c_client *client, priv->vip_cntrl_2 = video; } + /* load the optional CODEC */ + of_platform_populate(np, NULL, NULL, &client->dev); + return 0; fail: diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index b33b45d..747e387 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -352,6 +352,12 @@ config SND_SOC_STAC9766 config SND_SOC_TAS5086 tristate +config SND_SOC_TDA998X + tristate + depends on OF + default y if DRM_I2C_NXP_TDA998X=y + default m if DRM_I2C_NXP_TDA998X=m + config SND_SOC_TLV320AIC23 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index bc12676..a53d09e 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -62,6 +62,7 @@ snd-soc-sta32x-objs := sta32x.o snd-soc-sta529-objs := sta529.o snd-soc-stac9766-objs := stac9766.o snd-soc-tas5086-objs := tas5086.o +snd-soc-tda998x-objs := tda998x.o snd-soc-tlv320aic23-objs := tlv320aic23.o snd-soc-tlv320aic26-objs := tlv320aic26.o snd-soc-tlv320aic3x-objs := tlv320aic3x.o @@ -192,6 +193,7 @@ obj-$(CONFIG_SND_SOC_STA32X) += snd-soc-sta32x.o obj-$(CONFIG_SND_SOC_STA529) += snd-soc-sta529.o obj-$(CONFIG_SND_SOC_STAC9766) += snd-soc-stac9766.o obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o +obj-$(CONFIG_SND_SOC_TDA998X) += snd-soc-tda998x.o obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o obj-$(CONFIG_SND_SOC_TLV320AIC26) += snd-soc-tlv320aic26.o obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o diff --git a/sound/soc/codecs/tda998x.c b/sound/soc/codecs/tda998x.c new file mode 100644 index 000..34d7086 --- /dev/null +++ b/sound/soc/codecs/tda998x.c @@ -0,0 +1,216 @@ +/* + * ALSA SoC TDA998X driver + * + * This driver is used by the NXP TDA998x HDMI transmitter. + * + * Copyright (C) 2014 Jean-Francois Moine + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include + +#define TDA998X_FORMATS(SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S20_3LE | \ + SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE) + +struct tda_priv { + struct i2c_client *i2c_client; + struct snd_soc_codec *codec; + u8 ports[2]; + int dai_id; + u8 *eld; +}; + +static int tda_get_encoder(struct tda_priv *priv) +{ + struct snd_soc_codec *codec = priv->codec; + struct device_node *np; + + /* get the parent tda998x device */ + np = of_get_parent(codec->dev->of_node); + if (!np || !of_device_is_compatible(np, "nxp,tda998x")) { + dev_err(codec->dev, "no or bad parent!\n"); + return -EINVAL; + } + priv->i2c_client = of_find_i2c_device_by_node(np); + of_node_put(np); + return 0; +} + +static int tda_start_stop(struct tda_priv *priv) +{ + int port; + + /* give the audio parameters to the HDMI encoder */ + if (priv->dai_id == AFMT_I2S) + port = priv->ports[0]; + else + port = priv->ports[1]; + tda998x_audio_update(priv->i2c_client, priv->dai_id, port); + return 0; +} + +static int tda_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct tda_priv *priv = snd_soc_codec_get_drvdata(dai->codec); + + /* memorize the used DAI */ + priv->dai_id = dai->id; + + /* start the TDA998x audio */ + return tda_start_stop(priv); +} + +static void tda_shutdown(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct tda_priv *priv = snd_soc_codec_get_drvdata(dai->codec); + + priv->dai_id = 0; /* streaming stop */ + tda_s