[PATCH v10 05/11] drm: bridge/dw_hdmi:split some phy configuration to platform driver

2014-11-15 Thread Daniel Kurtz
On Fri, Nov 14, 2014 at 7:13 PM, Zubair Lutfullah Kakakhel
 wrote:
>
>
> On 14/11/14 11:08, Andy Yan wrote:
>>
>> On 2014年11月14日 18:55, Zubair Lutfullah Kakakhel wrote:
>>>
>>> On 14/11/14 10:53, Andy Yan wrote:
 Hi ZubairLK:
 Thanks for your review.
 On 2014年11月14日 18:19, Zubair Lutfullah Kakakhel wrote:
> Hi Andy,
>
> Nice work on this patch series. Its getting better and better :).
>
> On 14/11/14 03:27, Andy Yan wrote:
>> hdmi phy clock symbol and transmission termination value
>> can adjust platform specific to get the best SI
>  ^Is this signal integrity?
 yes , SI  is signal integrity, such as eye diagram measurement
> Are these two disjoint features in separate patches?
>
>> also add mode_valid interface for some platform may not support
>> all the display mode
> Sounds like another separate patch to me. :)
 they can seperate
> Also, This series is becoming quite large. With major changes and fixes 
> mixed together.
>
> Patch 3 splits imx-drm.
> Patch 4 moves dw-drm out of imx-drm folder.
> Patch 7 adds binding
> Patch 9 converts to drm bridge.
>
> Can these be placed together easily?
> And in the start. i.e. patch 1, 2, 3, 4,
>
> Then all fixes etc can come afterwards?
>
> It helps when checking histories later as to how a driver was made and 
> how fixes happened.
>
> Especially when file moves happen..
Do you mean we can rearrange the patch series?
put patch 3, 4 ,7, 9 together  one bye one
than followed by the fixes patches  5 ,6, 8, 11 ?
>>> Yes. Rearrange so that the split imx-drm/imx-hdmi and conversion to 
>>> drm-bridge is at the start of the series.
>>> Then the rest are bug fixes and feature additions.
>>   Can I put patch#1(make checkpatch happy) and patch#2 (defer probe) as the 
>> first two patch.
>>   Daniel from Google chromium think it's better to put the two slightly 
>> changes in the front for easy review.

Sorry, I didn't see this conversation before my earlier emails.

I was suggesting to Andy to arrange his patches like this:
 (1) fixes that directly apply to imx-drm as it is today.
 (2) split out the "generic dw_hdmi" parts from imx-hdmi into dw_hdmi.c
 (3) convert dw_hdmi.c to a drm_bridge
 (4) move the dw_hdmi.c bridge implementation to drm/bridge
 (5) modifications to dw_hdmi.c required to support hdmi on rk3288
 (5) add rk3288-hdmi.c to drm/rockchip (at least whenever drm/rockchip lands)

The idea being that we can start landing the patches for (1) even
while we are still debating / reviewing (2)+ upstream.

> Sure.
>
> I am not the maintainer. They have to make the final decision.

imx-drm is still in staging.  I do not see anyone listed explicitly
under MAINTAINERS for drivers/staging/imx-drm, so by default I guess
it falls back to gregkh (drivers/staging/)?
The "Commit" field in git log seems to back this up.

Although, based on Author, I think we also want the opinions of
Philipp Zabel and Russel King.

Thanks,
-djk

>
> ZubairLK


[PATCH v10 05/11] drm: bridge/dw_hdmi:split some phy configuration to platform driver

2014-11-15 Thread Russell King - ARM Linux
On Sat, Nov 15, 2014 at 06:07:50PM +0800, Daniel Kurtz wrote:
> On Fri, Nov 14, 2014 at 7:13 PM, Zubair Lutfullah Kakakhel
>  wrote:
> >
> >
> > On 14/11/14 11:08, Andy Yan wrote:
> >>
> >> On 2014年11月14日 18:55, Zubair Lutfullah Kakakhel wrote:
> >>>
> >>> On 14/11/14 10:53, Andy Yan wrote:
>  Hi ZubairLK:
>  Thanks for your review.
>  On 2014年11月14日 18:19, Zubair Lutfullah Kakakhel wrote:
> > Hi Andy,
> >
> > Nice work on this patch series. Its getting better and better :).
> >
> > On 14/11/14 03:27, Andy Yan wrote:
> >> hdmi phy clock symbol and transmission termination value
> >> can adjust platform specific to get the best SI
> >  ^Is this signal integrity?
>  yes , SI  is signal integrity, such as eye diagram measurement
> > Are these two disjoint features in separate patches?
> >
> >> also add mode_valid interface for some platform may not support
> >> all the display mode
> > Sounds like another separate patch to me. :)
>  they can seperate
> > Also, This series is becoming quite large. With major changes and fixes 
> > mixed together.
> >
> > Patch 3 splits imx-drm.
> > Patch 4 moves dw-drm out of imx-drm folder.
> > Patch 7 adds binding
> > Patch 9 converts to drm bridge.
> >
> > Can these be placed together easily?
> > And in the start. i.e. patch 1, 2, 3, 4,
> >
> > Then all fixes etc can come afterwards?
> >
> > It helps when checking histories later as to how a driver was made and 
> > how fixes happened.
> >
> > Especially when file moves happen..
> Do you mean we can rearrange the patch series?
> put patch 3, 4 ,7, 9 together  one bye one
> than followed by the fixes patches  5 ,6, 8, 11 ?
> >>> Yes. Rearrange so that the split imx-drm/imx-hdmi and conversion to 
> >>> drm-bridge is at the start of the series.
> >>> Then the rest are bug fixes and feature additions.
> >>   Can I put patch#1(make checkpatch happy) and patch#2 (defer probe) as 
> >> the first two patch.
> >>   Daniel from Google chromium think it's better to put the two slightly 
> >> changes in the front for easy review.
> 
> Sorry, I didn't see this conversation before my earlier emails.
> 
> I was suggesting to Andy to arrange his patches like this:
>  (1) fixes that directly apply to imx-drm as it is today.
>  (2) split out the "generic dw_hdmi" parts from imx-hdmi into dw_hdmi.c
>  (3) convert dw_hdmi.c to a drm_bridge
>  (4) move the dw_hdmi.c bridge implementation to drm/bridge
>  (5) modifications to dw_hdmi.c required to support hdmi on rk3288
>  (5) add rk3288-hdmi.c to drm/rockchip (at least whenever drm/rockchip lands)
> 
> The idea being that we can start landing the patches for (1) even
> while we are still debating / reviewing (2)+ upstream.
> 
> > Sure.
> >
> > I am not the maintainer. They have to make the final decision.
> 
> imx-drm is still in staging.  I do not see anyone listed explicitly
> under MAINTAINERS for drivers/staging/imx-drm, so by default I guess
> it falls back to gregkh (drivers/staging/)?
> The "Commit" field in git log seems to back this up.
> 
> Although, based on Author, I think we also want the opinions of
> Philipp Zabel and Russel King.

Once the wranglings on the patch series are complete, I do intend to test
it on the platforms I have - and remember that I do have the ALSA based
audio and CEC bits as well, some of which will probably need a little bit
of re-work.

All in all, I welcome the renaming of this to include a reference to
DesignWare - I've always thought it's a mistake that the HDMI interface
in iMX6 was not named with a "dw" prefix as the docs contain references
to it being a DesignWare IP module.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.


[Bug 85647] Random radeonsi crashes with mesa 10.3.x

2014-11-15 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=85647

--- Comment #27 from Hannu  ---
I built mesa 10.4.0-devel (master) from mesa git.

+linux 3.18.0-rc4

Tested with a 23 minute full screen flash video same as before,
sixth playback of the video crashed.



Mesa 10.3.2 with the bypassed si_dma_copy_tile() as in comment 26 has not
crashed yet

 si_dma_copy_buffer(sctx, dst, src, dst_offset, src_offset,
 src_box->height * src_pitch);
 } else {
+goto fallback;
 si_dma_copy_tile(sctx, dst, dst_level, dst_x, dst_y, dst_z,

-- 
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/20141115/e1d3a0c9/attachment.html>


[PATCH v10 05/11] drm: bridge/dw_hdmi:split some phy configuration to platform driver

2014-11-15 Thread Russell King - ARM Linux
On Sat, Nov 15, 2014 at 10:12:18AM +, Russell King - ARM Linux wrote:
> Once the wranglings on the patch series are complete, I do intend to test
> it on the platforms I have - and remember that I do have the ALSA based
> audio and CEC bits as well, some of which will probably need a little bit
> of re-work.
> 
> All in all, I welcome the renaming of this to include a reference to
> DesignWare - I've always thought it's a mistake that the HDMI interface
> in iMX6 was not named with a "dw" prefix as the docs contain references
> to it being a DesignWare IP module.

One thing I would ask is that the subsequent submissions do not thread
onto the previous submission.

It may seem a good idea (people claim that it allows the previous reviews
to be trivially found) but these people forget an important side effect
from this behaviour - when looking at the message index in a threaded
mail reader (like mutt), each reply to a thread moves the subject line
by three characters to the right.  What this means is that after about
five or six iterations of the submission, there is no longer any subject
line visible.

Moreover, it means that with lesser iterations, it becomes much more
difficult to see /any/ of the review thread structure.

I would suggest that if you do want to "connect" the subsequent
submissions, please use the same reference message for each submission.
In other words, rather than:

v1 0/2
+-> v1 1/2
+-> v1 2/2
+-> v2 0/2
+-> v2 1/2
+-> v2 2/2
+-> v3 0/2
+-> v3 1/2
+-> v3 2/2
...

This is done instead:

v1 0/2
+-> v1 1/2
+-> v1 2/2
+-> v2 0/2
|   +-> v2 1/2
|   +-> v2 2/2
+-> v3 0/2
|   +-> v3 1/2
|   +-> v3 2/2
...

which is a compromise between threading the messages together, and
keeping stopping the thread pushing the subject line completely off
the right hand side of the screen.

In this case, I'd suggest a reference of:
  1415793593-5075-1-git-send-email-andy.yan at rock-chips.com

which is the v8 covering message which started this big thread.

Thanks.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.


[radeonsi, regression] All my Steam games fail to load into the 3D-engine-powered part (SIGPWR and SIGXCPU)

2014-11-15 Thread Kai Wasserbäch
Dear Alex,
I've built your drm-next-3.19-wip branch (commit
be762d181e130d0e6e630f823400e9e1ba3bafd8) and with that kernel and the graphics
stack detailed below, I can't run any of my Steam games anymore. All of them
immediately go into the defunct state, when their 3D engine is powered up (ie. I
get to see the intro/vendor videos but almost nothing after that, including the
main menus). When I attach gdb to a game process, the games stop on a SIGPWR. If
I hit c I usually get a SIGXCPU next, sometimes it's another SIGPWR. But no
matter how often you hit c you always get one of those two signals and the game
is just dead. Normal desktop with 3D acceleration and effects (KDE) is working 
fine.

This is a regression over my previous kernel
(Git:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git:v3.18-rc1
+ <https://bugs.freedesktop.org/attachment.cgi?id=107451> and
<https://bugs.freedesktop.org/attachment.cgi?id=107544>).

I didn't have time to bisect this yet, but maybe you have an idea what might
cause this right away. I'm also not sure if it's a bug in the DRI portion of the
kernel.

Is there anything besides a bisect you would need to debug this?

Cheers,
Kai

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141115/9deedf47/attachment.sig>


[radeonsi, regression] All my Steam games fail to load into the 3D-engine-powered part (SIGPWR and SIGXCPU)

2014-11-15 Thread Kai Wasserbäch
Kai Wasserbäch wrote on 15.11.2014 16:33:
> I've built your drm-next-3.19-wip branch (commit
> be762d181e130d0e6e630f823400e9e1ba3bafd8) and with that kernel and the 
> graphics
> stack detailed below, [...]

Sorry, forgot to include the stack, here we go:

My current stack is (Debian testing as a base):
GPU: Hawaii PRO [Radeon R9 290] (ChipID = 0x67b1)
Mesa: Git:master/a4ffc2a445
libdrm: Git:master/00847fa48b
LLVM: SVN:trunk/r222082 (3.6 devel)
X.Org: 2:1.16.1-1
Firmware: <http://people.freedesktop.org/~agd5f/radeon_ucode/>
# 9e05820da42549ce9c89d147cf1f8e19  hawaii_ce.bin
# c8bab593090fc54f239c8d7596c8d846  hawaii_mc.bin
# 3618dbb955d8a84970e262bb2e6d2a16  hawaii_me.bin
# c000b0fc9ff6582145f66504b0ec9597  hawaii_mec.bin
# 0643ad24b3beff2214cce533e094c1b7  hawaii_pfp.bin
# ba6054b7d78184a74602fd81607e1386  hawaii_rlc.bin
# 11288f635737331b69de9ee82fe04898  hawaii_sdma.bin
# 284429675a5560e0fad42aa982965fc2  hawaii_smc.bin
libclc: Git:master/7f6f5bff1f
DDX: 1:7.5.0-1

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141115/394f582c/attachment.sig>


[Bug 86043] Optimus issue with libdrm 2.4.58

2014-11-15 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=86043

--- Comment #3 from Tobias Klausmann  ---
I dont use the NVIDIA blob, but the nouveau driver...anyhow the intel driver is
working on prime (Optimus) systems if it does not get bugged by
bumblebee/primus with libdrm 2.4.58. Go report a bug against these apps.

-- 
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/20141115/1816b3fe/attachment.html>


[radeonsi, regression] All my Steam games fail to load into the 3D-engine-powered part (SIGPWR and SIGXCPU)

2014-11-15 Thread Andy Furniss
Kai Wasserbäch wrote:
> Dear Alex, I've built your drm-next-3.19-wip branch (commit
> be762d181e130d0e6e630f823400e9e1ba3bafd8) and with that kernel and
> the graphics stack detailed below, I can't run any of my Steam games
> anymore. All of them immediately go into the defunct state, when
> their 3D engine is powered up (ie. I get to see the intro/vendor
> videos but almost nothing after that, including the main menus). When
> I attach gdb to a game process, the games stop on a SIGPWR. If I hit
> c I usually get a SIGXCPU next, sometimes it's another SIGPWR. But
> no matter how often you hit c you always get one of those two signals
> and the game is just dead. Normal desktop with 3D acceleration and
> effects (KDE) is working fine.
>
> This is a regression over my previous kernel
> (Git:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git:v3.18-rc1
>
>
+  and
> ).
>
> I didn't have time to bisect this yet, but maybe you have an idea
> what might cause this right away. I'm also not sure if it's a bug in
> the DRI portion of the kernel.
>
> Is there anything besides a bisect you would need to debug this?

I also see an issue with current drm-next-3.19-wip branch with pitcairn
and demos line Unigine Valley and Unreal Elemental.

I was running last weeks drm-next-3.19-wip OK with these, so I guess the
issue is near head, though the way other things get merged in etc makes
it a bit hard to see what's new just looking at cgit.

This is what I get in dmesg

[  730.830960] BUG: unable to handle kernel paging request at 
eb0400404000
[  730.830993] IP: [] kfree+0x62/0x1c0
[  730.831013] PGD 0
[  730.831019] Oops:  [#1] PREEMPT SMP
[  730.831034] Modules linked in: radeon fbcon bitblit fbcon_rotate 
fbcon_ccw fbcon_ud fbcon_cw softcursor snd_hda_codec_hdmi font 
snd_hda_codec_realtek tileblit snd_hda_codec_generic i2c_algo_bit 
snd_usb_audio snd_hda_intel drm_kms_helper snd_hda_controller 
snd_usbmidi_lib snd_hda_codec snd_rawmidi ttm snd_seq_device snd_hwdep 
snd_pcm drm snd_timer ata_generic r8169 pata_acpi snd xhci_pci xhci_hcd 
plusb soundcore asus_atk0110 pcspkr acpi_cpufreq usbnet mii k10temp 
i2c_piix4 pata_jmicron
[  730.831247] CPU: 0 PID: 576 Comm: RenderThread 1 Not tainted 
3.18.0-rc4-gbe762d1 #1
[  730.831274] Hardware name: System manufacturer System Product 
Name/M4A89GTD-PRO/USB3, BIOS 145605/04/2010
[  730.831308] task: 8802254e60c0 ti: 8801c69a4000 task.ti: 
8801c69a4000
[  730.831333] RIP: 0010:[]  [] 
kfree+0x62/0x1c0
[  730.831360] RSP: 0018:8801c69a7c98  EFLAGS: 00010286
[  730.831377] RAX: eb0400404000 RBX: c9001010 RCX: 
0100
[  730.831400] RDX: ea00 RSI: 88008a528118 RDI: 
c9001010
[  730.831424] RBP: 8801c69a7cd8 R08: c9001010 R09: 
880224d942e8
[  730.831447] R10: 02d0 R11: 880224d941b8 R12: 
8801bf3c9a80
[  730.831471] R13: a030983c R14: 8801c69a7d00 R15: 
8801c69a7dc8
[  730.831495] FS:  7f3911d62700() GS:88022fc0() 
knlGS:
[  730.831523] CS:  0010 DS:  ES:  CR0: 80050033
[  730.831542] CR2: eb0400404000 CR3: 0001d1de8000 CR4: 
07f0
[  730.832968] Stack:
[  730.834373]  8801c69a7ca8 815379c1 8801c69a7cd8 
8801be8796c0
[  730.835811]  8801bf3c9a80 880224d94000 8801c69a7d00 
8801c69a7dc8
[  730.837257]  8801c69a7d78 a030983c c9001010 
c900
[  730.838699] Call Trace:
[  730.840126]  [] ? _raw_spin_unlock+0x11/0x30
[  730.841597]  [] radeon_gem_va_ioctl+0x4fc/0x610 
[radeon]
[  730.843073]  [] drm_ioctl+0x1ac/0x630 [drm]
[  730.844541]  [] ? preempt_count_add+0x55/0xb0
[  730.846007]  [] ? _raw_spin_unlock_irqrestore+0x13/0x30
[  730.847475]  [] ? __pm_runtime_resume+0x56/0x70
[  730.848947]  [] radeon_drm_ioctl+0x53/0x90 [radeon]
[  730.850423]  [] do_vfs_ioctl+0x2d0/0x4b0
[  730.851885]  [] ? __fget+0x74/0xb0
[  730.853347]  [] SyS_ioctl+0x47/0x90
[  730.854812]  [] system_call_fastpath+0x16/0x1b
[  730.856284] Code: 00 00 00 80 ff 77 00 00 48 01 d8 48 0f 42 15 b6 03 
8c 00 48 01 d0 48 ba 00 00 00 00 00 ea ff ff 48 c1 e8 0c 48 c1 e0 06 48 
01 d0 <48> 8b 10 80 e6 80 0f 85 2f 01 00 00 49 89 c6 49 8b 06 a8 80 0f
[  730.857914] RIP  [] kfree+0x62/0x1c0
[  730.859465]  RSP 
[  730.861021] CR2: eb0400404000
[  730.872919] ---[ end trace c7fce73a27e29045 ]---








[Bug 86301] BUG_ON triggered in nouveau driver on !CONFIG_SMP systems

2014-11-15 Thread bugzilla-dae...@bugzilla.kernel.org
https://bugzilla.kernel.org/show_bug.cgi?id=86301

Pacho Ramos  changed:

   What|Removed |Added

 CC||pachoramos1 at gmail.com

--- Comment #1 from Pacho Ramos  ---
I can confirm this on Gentoo too with kernel 3.17.2

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


[Bug 76490] Hang during boot when DPM is on (R9 270X)

2014-11-15 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=76490

--- Comment #24 from dex+fdobugzilla at dragonslave.de ---
Kernel 3.18.0-rc4 with git://people.freedesktop.org/~agd5f/linux drm-next-3.19
branch atop.

Same as before.

And I noticed I compared with the wrong Link.
The right one is this:

http://www.techpowerup.com/vgabios/152427/msi-r9270x-4096-131205-1.html

I'd love to see if there is perhaps an Firmware Update for this card, but MSI
only provides a tool namend "Live Update" that only works on $evilOS.

-- 
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/20141115/ddf42166/attachment.html>


[radeonsi, regression] All my Steam games fail to load into the 3D-engine-powered part (SIGPWR and SIGXCPU)

2014-11-15 Thread Andy Furniss
Andy Furniss wrote:

>> I didn't have time to bisect this yet, but maybe you have an idea
>> what might cause this right away. I'm also not sure if it's a bug
>> in the DRI portion of the kernel.
>>
>> Is there anything besides a bisect you would need to debug this?

I am just a user - but after some testing maybe it would be better if
you can reproduce on similar kernel to your old one and bisect that.

On drm-next-3.19-wip I only have to go back 4 commits to hit ones I've
been running for weeks (and I am still failing if I reset to there) so
for me at least bisecting this tree isn't really an option - I wouldn't
be testing like for like.

> I also see an issue with current drm-next-3.19-wip branch with
> pitcairn and demos line Unigine Valley and Unreal Elemental.
>
> I was running last weeks drm-next-3.19-wip OK with these, so I guess
> the issue is near head, though the way other things get merged in etc
> makes it a bit hard to see what's new just looking at cgit.

Stable for me is drm-next-3.19-wip at 3.18.0-rc2-gc76c717 failing
current = 3.18.0-rc4-gbe762d1 so it seems to be something in the merge
that took rc-2 to rc-4.




[radeonsi, regression] All my Steam games fail to load into the 3D-engine-powered part (SIGPWR and SIGXCPU)

2014-11-15 Thread Kai Wasserbäch
0, 0x}}
ymm5   {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x8000, 0x0, 0x0, 0x0}, v32_int8 = {0x68, 0x65, 0x63, 0x6b, 0x70,
0x6f, 0x69, 0x6e, 0x0 }, v16_int16 = {0x6568, 0x6b63, 0x6f70,
0x6e69, 0x0 },
  v8_int32 = {0x6b636568, 0x6e696f70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 =
{0x6e696f706b636568, 0x0, 0x0, 0x0}, v2_int128 =
{0x6e696f706b636568, 0x}}
ymm6   {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x8000, 0x0, 0x0, 0x0}, v32_int8 = {0x65, 0x5f, 0x69, 0x6e, 0x74,
0x65, 0x72, 0x72, 0x0 }, v16_int16 = {0x5f65, 0x6e69, 0x6574,
0x7272, 0x0 },
  v8_int32 = {0x6e695f65, 0x72726574, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 =
{0x727265746e695f65, 0x0, 0x0, 0x0}, v2_int128 =
{0x727265746e695f65, 0x}}
ymm7   {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 }, v16_int16 = {0x0
}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {
0x, 0x}}
ymm8   {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 }, v16_int16 = {0x0
}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {
0x, 0x}}
ymm9   {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0xff, 0x0 }, v16_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0xff,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0}, v8_int32 = {0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0},
v4_int64 = {0x0, 0xff, 0x0, 0x0}, v2_int128 =
{0x00ff, 0x}}
ymm10  {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 }, v16_int16 = {0x0
}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {
0x, 0x}}
ymm11  {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x8000, 0x0, 0x0, 0x0}, v32_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0xff, 0x0 }, v16_int16 = {0x0, 0x0, 0x0, 0xff00, 0x0
}, v8_int32 = {0x0,
0xff00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int64 = {0xff00,
0x0, 0x0, 0x0}, v2_int128 = {0xff00,
0x}}
ymm12  {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 }, v16_int16 = {0x0
}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {
0x, 0x}}
ymm13  {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 }, v16_int16 = {0x0
}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {
0x, 0x}}
ymm14  {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 }, v16_int16 = {0x0
}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {
0x, 0x}}
ymm15  {v8_float = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_double =
{0x0, 0x0, 0x0, 0x0}, v32_int8 = {0x0 }, v16_int16 = {0x0
}, v8_int32 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
v4_int64 = {0x0, 0x0, 0x0, 0x0}, v2_int128 = {
0x, 0x}}

Stuff like KDE's desktop effects (renderer settings: OpenGL 3.1, native) or
glxgears don't trigger this bug.

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 648 bytes
Desc: OpenPGP digital signature
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141115/361f4ce4/attachment.sig>


[Bug 73528] Deferred lighting in Second Life causes system hiccups and screen flickering

2014-11-15 Thread bugzilla-dae...@freedesktop.org
https://bugs.freedesktop.org/show_bug.cgi?id=73528

MirceaKitsune  changed:

   What|Removed |Added

   Priority|medium  |high
Version|git |10.3

--- Comment #16 from MirceaKitsune  ---
Okay, I just found an important clue: The issue is not limited to Second Life
alone! I just tried to enable shaders in the open-source racing game Stuntrally
(Vdrift Ogre) and got the exact same problem. The machine would freeze, the
screen would flicker (monitor going in standby), but in this case it would
unfreeze after a few seconds so I managed to turn shaders off.

Additionally, I did more tests in Second Life several days ago, and found
something interesting: If I look at the ground so barely anything is rendered,
the shaders work perfectly well. But if the sky or too much detail come into
view, it only takes a few seconds until the GPU suddenly hiccups and I can
barely re-stabilize the system.

I'm unclear whether this is a coincidence. But when the problem takes place,
the fan on my video card is running at maximum speed, indicating the Radeon DPM
module is stressing the card out. Note that the freezes existed before DPM was
supported by the free driver, and came after a MESA update alone.

My humble impression is that some shaders either create an infinite loop on the
GPU due to a compilation bug, either they're so unoptimized that they flood the
GPU with data it can't handle. It does seem to be triggered by specific objects
coming into view... but I can't tell if that's because of the model complexity
(high polygon count) or because they contain a "sick" shader which the video
card attempts to render.

Since this has been around for an year, and I gathered a few clues already,
please allow me to set it to "high" priority to bring more awareness. I'm
around and watching this, so I can do more tests... as long as it's nothing
that would risk breaking my system (like changing system drivers).

-- 
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/20141115/97c51262/attachment.html>


[radeonsi, regression] All my Steam games fail to load into the 3D-engine-powered part (SIGPWR and SIGXCPU)

2014-11-15 Thread Andy Furniss
Kai Wasserbäch wrote:
> Kai Wasserbäch wrote on 15.11.2014 16:33:
>> Is there anything besides a bisect you would need to debug this?
>
> Ok, I did a bisection, but that time was wasted for sure. My "first bad 
> commit"
> isn't bad at all. Is there any way to improve that experience? I'm really 
> loathe
> to go through the dozen boots again, just to get another broken bisection.

So you don't have any bads at all on linus kernel?

I agree bisecting kernels is a pain :-)

Of course it's possible our issues aren't the same anyway.



[PATCH V8 03/14] drm/bridge: make bridge registration independent of drm flow

2014-11-15 Thread Ajay Kumar
Currently, third party bridge drivers(ptn3460) are dependent
on the corresponding encoder driver init, since bridge driver
needs a drm_device pointer to finish drm initializations.
The encoder driver passes the drm_device pointer to the
bridge driver. Because of this dependency, third party drivers
like ptn3460 doesn't adhere to the driver model.

In this patch, we reframe the bridge registration framework
so that bridge initialization is split into 2 steps, and
bridge registration happens independent of drm flow:
--Step 1: gather all the bridge settings independent of drm and
  add the bridge onto a global list of bridges.
--Step 2: when the encoder driver is probed, call drm_bridge_attach
  for the corresponding bridge so that the bridge receives
  drm_device pointer and continues with connector and other
  drm initializations.

The old set of bridge helpers are removed, and a set of new helpers
are added to accomplish the 2 step initialization.

The bridge devices register themselves onto global list of bridges
when they get probed by calling "drm_bridge_add".

The parent encoder driver waits till the bridge is available
in the lookup table(by calling "of_drm_find_bridge") and then
continues with its initialization.

The encoder driver should also call "drm_bridge_attach" to pass
on the drm_device to the bridge object.

drm_bridge_attach inturn calls "bridge->funcs->attach" so that
bridge can continue with drm related initializations.

Signed-off-by: Ajay Kumar 
---
 drivers/gpu/drm/Makefile   |2 +-
 drivers/gpu/drm/bridge/ptn3460.c   |   27 +-
 drivers/gpu/drm/drm_bridge.c   |   91 
 drivers/gpu/drm/drm_crtc.c |   65 ---
 drivers/gpu/drm/msm/hdmi/hdmi.c|7 +--
 drivers/gpu/drm/msm/hdmi/hdmi.h|1 +
 drivers/gpu/drm/msm/hdmi/hdmi_bridge.c |7 ++-
 drivers/gpu/drm/sti/sti_hda.c  |   10 +---
 drivers/gpu/drm/sti/sti_hdmi.c |   10 +---
 include/drm/bridge/ptn3460.h   |8 +++
 include/drm/drm_crtc.h |   26 -
 11 files changed, 136 insertions(+), 118 deletions(-)
 create mode 100644 drivers/gpu/drm/drm_bridge.c

diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 9292a76..00f97a5 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -14,7 +14,7 @@ drm-y   :=drm_auth.o drm_bufs.o drm_cache.o \
drm_info.o drm_debugfs.o drm_encoder_slave.o \
drm_trace_points.o drm_global.o drm_prime.o \
drm_rect.o drm_vma_manager.o drm_flip_work.o \
-   drm_modeset_lock.o
+   drm_modeset_lock.o drm_bridge.o

 drm-$(CONFIG_COMPAT) += drm_ioc32.o
 drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c
index a2ddc8d..4a818c1 100644
--- a/drivers/gpu/drm/bridge/ptn3460.c
+++ b/drivers/gpu/drm/bridge/ptn3460.c
@@ -176,24 +176,11 @@ static void ptn3460_post_disable(struct drm_bridge 
*bridge)
 {
 }

-static void ptn3460_bridge_destroy(struct drm_bridge *bridge)
-{
-   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
-
-   drm_bridge_cleanup(bridge);
-   if (gpio_is_valid(ptn_bridge->gpio_pd_n))
-   gpio_free(ptn_bridge->gpio_pd_n);
-   if (gpio_is_valid(ptn_bridge->gpio_rst_n))
-   gpio_free(ptn_bridge->gpio_rst_n);
-   /* Nothing else to free, we've got devm allocated memory */
-}
-
 static struct drm_bridge_funcs ptn3460_bridge_funcs = {
.pre_enable = ptn3460_pre_enable,
.enable = ptn3460_enable,
.disable = ptn3460_disable,
.post_disable = ptn3460_post_disable,
-   .destroy = ptn3460_bridge_destroy,
 };

 static int ptn3460_get_modes(struct drm_connector *connector)
@@ -314,7 +301,7 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder 
*encoder,
}

ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs;
-   ret = drm_bridge_init(dev, &ptn_bridge->bridge);
+   ret = drm_bridge_attach(dev, &ptn_bridge->bridge);
if (ret) {
DRM_ERROR("Failed to initialize bridge with drm\n");
goto err;
@@ -343,3 +330,15 @@ err:
return ret;
 }
 EXPORT_SYMBOL(ptn3460_init);
+
+void ptn3460_destroy(struct drm_bridge *bridge)
+{
+   struct ptn3460_bridge *ptn_bridge = bridge->driver_private;
+
+   if (gpio_is_valid(ptn_bridge->gpio_pd_n))
+   gpio_free(ptn_bridge->gpio_pd_n);
+   if (gpio_is_valid(ptn_bridge->gpio_rst_n))
+   gpio_free(ptn_bridge->gpio_rst_n);
+   /* Nothing else to free, we've got devm allocated memory */
+}
+EXPORT_SYMBOL(ptn3460_destroy);
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
new file mode 100644
index 000..d1187e5
--- /dev/null
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -0,0 +1,91 @@
+/*
+ * C

[PATCH v11 01/12] staging: imx-drm: imx-hdmi: make checkpatch happy

2014-11-15 Thread Daniel Kurtz
On Fri, Nov 14, 2014 at 9:38 PM, Andy Yan  wrote:
> CHECK: Alignment should match open parenthesis
> +   if ((hdmi->vic == 10) || (hdmi->vic == 11) ||
> +   (hdmi->vic == 12) || (hdmi->vic == 13) ||
>
> CHECK: braces {} should be used on all arms of this statement
> +   if (hdmi->hdmi_data.video_mode.mdvi)
> [...]
> +   else {
> [...]
>
> Signed-off-by: Andy Yan 

Reviewed-by: Daniel Kurtz 


>
> ---
>
> Changes in v11: None
> Changes in v10: None
> Changes in v9: None
> Changes in v8: None
> Changes in v7: None
> Changes in v6:
> - rearrange the patch order
>
> Changes in v5: None
> Changes in v4:
> - fix checkpatch CHECK
>
> Changes in v3: None
> Changes in v2: None
>
>  drivers/staging/imx-drm/imx-hdmi.c | 97 
> +++---
>  1 file changed, 48 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/staging/imx-drm/imx-hdmi.c 
> b/drivers/staging/imx-drm/imx-hdmi.c
> index aaec6b2..79daec4 100644
> --- a/drivers/staging/imx-drm/imx-hdmi.c
> +++ b/drivers/staging/imx-drm/imx-hdmi.c
> @@ -163,7 +163,7 @@ static void hdmi_modb(struct imx_hdmi *hdmi, u8 data, u8 
> mask, unsigned reg)
>  }
>
>  static void hdmi_mask_writeb(struct imx_hdmi *hdmi, u8 data, unsigned int 
> reg,
> - u8 shift, u8 mask)
> +u8 shift, u8 mask)
>  {
> hdmi_modb(hdmi, data << shift, mask, reg);
>  }
> @@ -327,7 +327,7 @@ static unsigned int hdmi_compute_cts(unsigned int freq, 
> unsigned long pixel_clk,
>  }
>
>  static void hdmi_set_clk_regenerator(struct imx_hdmi *hdmi,
> -   unsigned long pixel_clk)
> +unsigned long pixel_clk)
>  {
> unsigned int clk_n, clk_cts;
>
> @@ -338,7 +338,7 @@ static void hdmi_set_clk_regenerator(struct imx_hdmi 
> *hdmi,
>
> if (!clk_cts) {
> dev_dbg(hdmi->dev, "%s: pixel clock not supported: %lu\n",
> -__func__, pixel_clk);
> +   __func__, pixel_clk);
> return;
> }
>
> @@ -477,13 +477,11 @@ static void imx_hdmi_update_csc_coeffs(struct imx_hdmi 
> *hdmi)
> u16 coeff_b = (*csc_coeff)[1][i];
> u16 coeff_c = (*csc_coeff)[2][i];
>
> -   hdmi_writeb(hdmi, coeff_a & 0xff,
> -   HDMI_CSC_COEF_A1_LSB + i * 2);
> +   hdmi_writeb(hdmi, coeff_a & 0xff, HDMI_CSC_COEF_A1_LSB + i * 
> 2);
> hdmi_writeb(hdmi, coeff_a >> 8, HDMI_CSC_COEF_A1_MSB + i * 2);
> hdmi_writeb(hdmi, coeff_b & 0xff, HDMI_CSC_COEF_B1_LSB + i * 
> 2);
> hdmi_writeb(hdmi, coeff_b >> 8, HDMI_CSC_COEF_B1_MSB + i * 2);
> -   hdmi_writeb(hdmi, coeff_c & 0xff,
> -   HDMI_CSC_COEF_C1_LSB + i * 2);
> +   hdmi_writeb(hdmi, coeff_c & 0xff, HDMI_CSC_COEF_C1_LSB + i * 
> 2);
> hdmi_writeb(hdmi, coeff_c >> 8, HDMI_CSC_COEF_C1_MSB + i * 2);
> }
>
> @@ -535,21 +533,22 @@ static void hdmi_video_packetize(struct imx_hdmi *hdmi)
> struct hdmi_data_info *hdmi_data = &hdmi->hdmi_data;
> u8 val, vp_conf;
>
> -   if (hdmi_data->enc_out_format == RGB
> -   || hdmi_data->enc_out_format == YCBCR444) {
> -   if (!hdmi_data->enc_color_depth)
> +   if (hdmi_data->enc_out_format == RGB ||
> +   hdmi_data->enc_out_format == YCBCR444) {
> +   if (!hdmi_data->enc_color_depth) {
> output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS;
> -   else if (hdmi_data->enc_color_depth == 8) {
> +   } else if (hdmi_data->enc_color_depth == 8) {
> color_depth = 4;
> output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS;
> -   } else if (hdmi_data->enc_color_depth == 10)
> +   } else if (hdmi_data->enc_color_depth == 10) {
> color_depth = 5;
> -   else if (hdmi_data->enc_color_depth == 12)
> +   } else if (hdmi_data->enc_color_depth == 12) {
> color_depth = 6;
> -   else if (hdmi_data->enc_color_depth == 16)
> +   } else if (hdmi_data->enc_color_depth == 16) {
> color_depth = 7;
> -   else
> +   } else {
> return;
> +   }
> } else if (hdmi_data->enc_out_format == YCBCR422_8BITS) {
> if (!hdmi_data->enc_color_depth ||
> hdmi_data->enc_color_depth == 8)
> @@ -561,8 +560,9 @@ static void hdmi_video_packetize(struct imx_hdmi *hdmi)
> else
> return;
> output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_YCC422;
> -   } else
> +   } else {
> return;
> +   }
>
> /* set the packetizer registers */
> val = ((color_depth << HDMI_VP_PR_CD_COLOR_DEPTH_OFFSET) &
> @@ -623,34 +623,34

[PATCH v11 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi

2014-11-15 Thread Daniel Kurtz
On Fri, Nov 14, 2014 at 9:37 PM, Andy Yan  wrote:

>
> We found Freescale imx6 and Rockchip rk3288 and Ingenic JZ4780
> (Xburst/MIPS)
> use the interface compatible Designware HDMI IP, but they also have some
> lightly differences, such as phy pll configuration, register width(imx hdmi
> register is one byte, but rk3288 is 4 bytes width and can only be accessed
> by word), 4K support(imx6 doesn't support 4k, but rk3288 does), and HDMI2.0
> support.
>
> To reuse the imx-hdmi driver, we make this patch set:
> (1): fix some CodingStyle warning to make checkpatch happy
> (2): split out imx-soc code from imx-hdmi to dw_hdmi-imx.c
> (3): move imx-hdmi to bridge/dw-hdmi, and convert it to a drm_bridge driver
> (4): add rockchip rk3288 platform specific code dw_hdmi-rockchip.c
>
> Changes in v11:
> - rearrange the patch order
> - squash patch  
> - split some modification form patch 
>
> Changes in v10:
> - split generic dw_hdmi.c improvements from patch#11 (add rk3288 support)
> - add more display mode support mpll configuration for rk3288
>
> Changes in v9:
> - move some phy configuration to platform driver
>
> Changes in v8:
> - correct some spelling mistake
> - modify ddc-i2c-bus and interrupt description
> - Add documentation for rockchip dw hdmi
>
> Changes in v7:
> - remove unused variables from structure dw_hdmi
> - remove a wrong modification
> - add copyrights for dw_hdmi-imx.c
>
> Changes in v6:
> - rearrange the patch order
> - move some modification from patch#5
> - move some modification to  patch#6
> - refactor register access without reg_shift
>
> Changes in v5:
> - refactor reg-io-width
>
> Changes in v4:
> - fix checkpatch CHECK
> - defer probe ddc i2c adapter
>
> Changes in v3:
> - split multi-register access to one indepent patch
>
> Changes in v2:
> - use git format -M to generate these patch
>
> Andy Yan (11):
>   staging: imx-drm: imx-hdmi: make checkpatch happy
>   staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter
>   staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi
>   staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw_hdmi
>   dt-bindings: add document for dw_hdmi
>   drm: bridge/dw_hdmi: add support for multi-byte register width access
>   drm: bridge/dw_hdmi: add mode_valid support
>   drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done
>   drm: bridge/dw_hdmi: add function dw_hdmi_phy_enable_spare
>   dt-bindings: Add documentation for rockchip dw hdmi
>   drm: bridge/dw_hdmi: add rockchip rk3288 support
>

Patch 1 & 2 are:

Reviewed-by: Daniel Kurtz 

I think these first two are ready (or will be, after a small nit fix to #2).

Since they are independent of the imx/dw_hdmi split, can we get them
accepted first, to help shrink Andy's patch set?

Thanks,
-djk



>
> Yakir Yang (1):
>   drm: bridge/dw_hdmi: convert dw-hdmi to drm_bridge mode
>
>  .../devicetree/bindings/drm/bridge/dw_hdmi.txt |  40 ++
>  .../devicetree/bindings/video/dw_hdmi-rockchip.txt |  43 ++
>  drivers/gpu/drm/bridge/Kconfig |   5 +
>  drivers/gpu/drm/bridge/Makefile|   1 +
>  .../imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c}| 762
> +
>  .../imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h}|   8 +-
>  drivers/gpu/drm/rockchip/Kconfig   |  10 +
>  drivers/gpu/drm/rockchip/Makefile  |   2 +-
>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c| 355 ++
>  drivers/staging/imx-drm/Kconfig|   1 +
>  drivers/staging/imx-drm/Makefile   |   2 +-
>  drivers/staging/imx-drm/dw_hdmi-imx.c  | 274 
>  include/drm/bridge/dw_hdmi.h   |  60 ++
>  13 files changed, 1138 insertions(+), 425 deletions(-)
>  create mode 100644
> Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt
>  create mode 100644
> Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt
>  rename drivers/{staging/imx-drm/imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c}
> (70%)
>  rename drivers/{staging/imx-drm/imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h}
> (99%)
>  create mode 100644 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
>  create mode 100644 drivers/staging/imx-drm/dw_hdmi-imx.c
>  create mode 100644 include/drm/bridge/dw_hdmi.h
>
> --
> 1.9.1
>
>


-- 
Daniel Kurtz | Software Engineer | djkurtz at google.com | 650.204.0722
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20141115/483edc83/attachment.html>


[PATCH V8 07/14] drm/bridge: ptn3460: probe connector at the end of bridge attach

2014-11-15 Thread Ajay Kumar
Force bridge connector detection at the end of the bridge attach.
This is needed to detect the bridge connector early.

Signed-off-by: Ajay Kumar 
---
 drivers/gpu/drm/bridge/ptn3460.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c
index e6d5ae7..9f800a1 100644
--- a/drivers/gpu/drm/bridge/ptn3460.c
+++ b/drivers/gpu/drm/bridge/ptn3460.c
@@ -281,6 +281,7 @@ int ptn3460_bridge_attach(struct drm_bridge *bridge)
return -ENODEV;
}

+   ptn_bridge->connector.polled = DRM_CONNECTOR_POLL_HPD;
ret = drm_connector_init(bridge->dev, &ptn_bridge->connector,
&ptn3460_connector_funcs, DRM_MODE_CONNECTOR_LVDS);
if (ret) {
@@ -296,6 +297,8 @@ int ptn3460_bridge_attach(struct drm_bridge *bridge)
if (ptn_bridge->panel)
drm_panel_attach(ptn_bridge->panel, &ptn_bridge->connector);

+   drm_helper_hpd_irq_event(ptn_bridge->connector.dev);
+
return ret;
 }

-- 
1.7.9.5



[PATCH V8 13/14] ARM: dts: snow: represent the connection between bridge and panel using videoport and endpoints

2014-11-15 Thread Ajay Kumar
Define videoports and use endpoints to describe the connection between
the encoder, bridge and the panel, instead of using phandles.

Signed-off-by: Ajay Kumar 
---
 arch/arm/boot/dts/exynos5250-snow.dts |   30 --
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5250-snow.dts 
b/arch/arm/boot/dts/exynos5250-snow.dts
index e51fcef..877117f 100644
--- a/arch/arm/boot/dts/exynos5250-snow.dts
+++ b/arch/arm/boot/dts/exynos5250-snow.dts
@@ -254,7 +254,20 @@
powerdown-gpios = <&gpy2 5 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpx1 5 GPIO_ACTIVE_HIGH>;
edid-emulation = <5>;
-   panel = <&panel>;
+
+   ports {
+   port at 0 {
+   bridge_out: endpoint {
+   remote-endpoint = <&panel_in>;
+   };
+   };
+
+   port at 1 {
+   bridge_in: endpoint {
+   remote-endpoint = <&dp_out>;
+   };
+   };
+   };
};
};

@@ -328,6 +341,12 @@
compatible = "auo,b116xw03";
power-supply = <&fet6>;
backlight = <&backlight>;
+
+   port {
+   panel_in: endpoint {
+   remote-endpoint = <&bridge_out>;
+   };
+   };
};

dp-controller at 145B {
@@ -341,7 +360,14 @@
samsung,link-rate = <0x0a>;
samsung,lane-count = <2>;
samsung,hpd-gpio = <&gpx0 7 0>;
-   bridge = <&ptn3460>;
+
+   ports {
+   port at 0 {
+   dp_out: endpoint {
+   remote-endpoint = <&bridge_in>;
+   };
+   };
+   };
};
 };

-- 
1.7.9.5



[PATCH V8 04/14] drm/bridge: ptn3460: Convert to i2c driver model

2014-11-15 Thread Ajay Kumar
Use drm_bridge helpers to modify the driver to support
i2c driver model.

Signed-off-by: Ajay Kumar 
---
 drivers/gpu/drm/bridge/Kconfig  |2 +
 drivers/gpu/drm/bridge/ptn3460.c|  124 +--
 drivers/gpu/drm/exynos/exynos_dp_core.c |   22 --
 3 files changed, 86 insertions(+), 62 deletions(-)

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index 884923f..4254c2b 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -1,5 +1,7 @@
 config DRM_PTN3460
tristate "PTN3460 DP/LVDS bridge"
depends on DRM
+   depends on OF && I2C
select DRM_KMS_HELPER
---help---
+ ptn3460 eDP-LVDS bridge chip driver.
diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c
index 4a818c1..7adeb60 100644
--- a/drivers/gpu/drm/bridge/ptn3460.c
+++ b/drivers/gpu/drm/bridge/ptn3460.c
@@ -36,7 +36,6 @@
 struct ptn3460_bridge {
struct drm_connector connector;
struct i2c_client *client;
-   struct drm_encoder *encoder;
struct drm_bridge bridge;
struct edid *edid;
int gpio_pd_n;
@@ -176,13 +175,6 @@ static void ptn3460_post_disable(struct drm_bridge *bridge)
 {
 }

-static struct drm_bridge_funcs ptn3460_bridge_funcs = {
-   .pre_enable = ptn3460_pre_enable,
-   .enable = ptn3460_enable,
-   .disable = ptn3460_disable,
-   .post_disable = ptn3460_post_disable,
-};
-
 static int ptn3460_get_modes(struct drm_connector *connector)
 {
struct ptn3460_bridge *ptn_bridge;
@@ -227,7 +219,7 @@ static struct drm_encoder *ptn3460_best_encoder(struct 
drm_connector *connector)
 {
struct ptn3460_bridge *ptn_bridge = connector_to_ptn3460(connector);

-   return ptn_bridge->encoder;
+   return ptn_bridge->bridge.encoder;
 }

 static struct drm_connector_helper_funcs ptn3460_connector_helper_funcs = {
@@ -253,31 +245,66 @@ static struct drm_connector_funcs ptn3460_connector_funcs 
= {
.destroy = ptn3460_connector_destroy,
 };

-int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder,
-   struct i2c_client *client, struct device_node *node)
+int ptn3460_bridge_attach(struct drm_bridge *bridge)
 {
+   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
int ret;
+
+   if (!bridge->encoder) {
+   DRM_ERROR("Parent encoder object not found");
+   return -ENODEV;
+   }
+
+   ret = drm_connector_init(bridge->dev, &ptn_bridge->connector,
+   &ptn3460_connector_funcs, DRM_MODE_CONNECTOR_LVDS);
+   if (ret) {
+   DRM_ERROR("Failed to initialize connector with drm\n");
+   return ret;
+   }
+   drm_connector_helper_add(&ptn_bridge->connector,
+   &ptn3460_connector_helper_funcs);
+   drm_connector_register(&ptn_bridge->connector);
+   drm_mode_connector_attach_encoder(&ptn_bridge->connector,
+   bridge->encoder);
+
+   return ret;
+}
+
+static struct drm_bridge_funcs ptn3460_bridge_funcs = {
+   .pre_enable = ptn3460_pre_enable,
+   .enable = ptn3460_enable,
+   .disable = ptn3460_disable,
+   .post_disable = ptn3460_post_disable,
+   .attach = ptn3460_bridge_attach,
+};
+
+static int ptn3460_probe(struct i2c_client *client,
+   const struct i2c_device_id *id)
+{
+   struct device *dev = &client->dev;
struct ptn3460_bridge *ptn_bridge;
+   int ret;

-   ptn_bridge = devm_kzalloc(dev->dev, sizeof(*ptn_bridge), GFP_KERNEL);
+   ptn_bridge = devm_kzalloc(dev, sizeof(*ptn_bridge), GFP_KERNEL);
if (!ptn_bridge) {
return -ENOMEM;
}

ptn_bridge->client = client;
-   ptn_bridge->encoder = encoder;
-   ptn_bridge->gpio_pd_n = of_get_named_gpio(node, "powerdown-gpio", 0);
+   ptn_bridge->gpio_pd_n = of_get_named_gpio(dev->of_node,
+   "powerdown-gpio", 0);
if (gpio_is_valid(ptn_bridge->gpio_pd_n)) {
ret = gpio_request_one(ptn_bridge->gpio_pd_n,
GPIOF_OUT_INIT_HIGH, "PTN3460_PD_N");
if (ret) {
-   dev_err(&client->dev,
-   "Request powerdown-gpio failed (%d)\n", ret);
+   dev_err(dev, "Request powerdown-gpio failed (%d)\n",
+   ret);
return ret;
}
}

-   ptn_bridge->gpio_rst_n = of_get_named_gpio(node, "reset-gpio", 0);
+   ptn_bridge->gpio_rst_n = of_get_named_gpio(dev->of_node,
+   "reset-gpio", 0);
if (gpio_is_valid(ptn_bridge->gpio_rst_n)) {
/*
 * Request

[PATCH V8 05/14] drm/exynos: dp: support drm_bridge

2014-11-15 Thread Ajay Kumar
Modify driver to support drm_bridge.

Signed-off-by: Ajay Kumar 
---
 .../devicetree/bindings/video/exynos_dp.txt|   12 +++
 drivers/gpu/drm/exynos/exynos_dp_core.c|   37 
 drivers/gpu/drm/exynos/exynos_dp_core.h|1 +
 3 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/video/exynos_dp.txt 
b/Documentation/devicetree/bindings/video/exynos_dp.txt
index 53dbccf..7a3a9cd 100644
--- a/Documentation/devicetree/bindings/video/exynos_dp.txt
+++ b/Documentation/devicetree/bindings/video/exynos_dp.txt
@@ -66,6 +66,10 @@ Optional properties for dp-controller:
Hotplug detect GPIO.
Indicates which GPIO should be used for hotplug
detection
+   -video interfaces: Device node can contain video interface port
+   nodes according to [1].
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt

 Example:

@@ -105,4 +109,12 @@ Board Specific portion:
vsync-len = <6>;
};
};
+
+   ports {
+   port at 0 {
+   dp_out: endpoint {
+   remote-endpoint = <&bridge_in>;
+   };
+   };
+   };
};
diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c 
b/drivers/gpu/drm/exynos/exynos_dp_core.c
index 5025b70..d30c748 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -989,9 +990,19 @@ static struct drm_connector_helper_funcs 
exynos_dp_connector_helper_funcs = {
 };

 /* returns the number of bridges attached */
-static int exynos_drm_attach_lcd_bridge(struct drm_device *dev,
+static int exynos_drm_attach_lcd_bridge(struct exynos_dp_device *dp,
struct drm_encoder *encoder)
 {
+   int ret;
+
+   encoder->bridge = dp->bridge;
+   dp->bridge->encoder = encoder;
+   ret = drm_bridge_attach(encoder->dev, dp->bridge);
+   if (ret) {
+   DRM_ERROR("Failed to attach bridge to drm\n");
+   return ret;
+   }
+
return 0;
 }

@@ -1005,9 +1016,11 @@ static int exynos_dp_create_connector(struct 
exynos_drm_display *display,
dp->encoder = encoder;

/* Pre-empt DP connector creation if there's a bridge */
-   ret = exynos_drm_attach_lcd_bridge(dp->drm_dev, encoder);
-   if (ret)
-   return 0;
+   if (dp->bridge) {
+   ret = exynos_drm_attach_lcd_bridge(dp, encoder);
+   if (!ret)
+   return 0;
+   }

connector->polled = DRM_CONNECTOR_POLL_HPD;

@@ -1259,7 +1272,7 @@ static int exynos_dp_bind(struct device *dev, struct 
device *master, void *data)
if (ret)
return ret;

-   if (!dp->panel) {
+   if (!dp->panel && !dp->bridge) {
ret = exynos_dp_dt_parse_panel(dp);
if (ret)
return ret;
@@ -1345,7 +1358,7 @@ static const struct component_ops exynos_dp_ops = {
 static int exynos_dp_probe(struct platform_device *pdev)
 {
struct device *dev = &pdev->dev;
-   struct device_node *panel_node;
+   struct device_node *panel_node, *bridge_node, *endpoint;
struct exynos_dp_device *dp;
int ret;

@@ -1367,6 +1380,18 @@ static int exynos_dp_probe(struct platform_device *pdev)
return -EPROBE_DEFER;
}

+   endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+   if (endpoint) {
+   bridge_node = of_graph_get_remote_port_parent(endpoint);
+   if (bridge_node) {
+   dp->bridge = of_drm_find_bridge(bridge_node);
+   of_node_put(bridge_node);
+   if (!dp->bridge)
+   return -EPROBE_DEFER;
+   } else
+   return -EPROBE_DEFER;
+   }
+
exynos_dp_display.ctx = dp;

ret = component_add(&pdev->dev, &exynos_dp_ops);
diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.h 
b/drivers/gpu/drm/exynos/exynos_dp_core.h
index a1aee69..3b0ba93 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.h
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.h
@@ -150,6 +150,7 @@ struct exynos_dp_device {
struct drm_connectorconnector;
struct drm_encoder  *encoder;
struct drm_panel*panel;
+   struct drm_bridge   *bridge;
struct clk  *clock;
unsigned intirq;
void __iomem*reg_base;
-- 
1.7.9.5



[PATCH V8 11/14] Documentation: bridge: Add documentation for ps8622 DT properties

2014-11-15 Thread Ajay Kumar
Add documentation for DT properties supported by ps8622/ps8625
eDP-LVDS converter.

Signed-off-by: Ajay Kumar 
---
 .../devicetree/bindings/video/bridge/ps8622.txt|   31 
 1 file changed, 31 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/bridge/ps8622.txt

diff --git a/Documentation/devicetree/bindings/video/bridge/ps8622.txt 
b/Documentation/devicetree/bindings/video/bridge/ps8622.txt
new file mode 100644
index 000..c989c38
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/bridge/ps8622.txt
@@ -0,0 +1,31 @@
+ps8622-bridge bindings
+
+Required properties:
+   - compatible: "parade,ps8622" or "parade,ps8625"
+   - reg: first i2c address of the bridge
+   - sleep-gpios: OF device-tree gpio specification for PD_ pin.
+   - reset-gpios: OF device-tree gpio specification for RST_ pin.
+
+Optional properties:
+   - lane-count: number of DP lanes to use
+   - use-external-pwm: backlight will be controlled by an external PWM
+   - video interfaces: Device node can contain video interface port
+   nodes for panel according to [1].
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+   lvds-bridge at 48 {
+   compatible = "parade,ps8622";
+   reg = <0x48>;
+   sleep-gpios = <&gpc3 6 1 0 0>;
+   reset-gpios = <&gpc3 1 1 0 0>;
+   lane-count = <1>;
+   ports {
+   port at 0 {
+   bridge_out: endpoint {
+   remote-endpoint = <&panel_in>;
+   };
+   };
+   };
+   };
-- 
1.7.9.5



[PATCH V8 14/14] ARM: dts: peach-pit: represent the connection between bridge and panel using videoport and endpoints

2014-11-15 Thread Ajay Kumar
Define videoports and use endpoints to describe the connection between
the encoder, bridge and the panel, instead of using phandles.

Signed-off-by: Ajay Kumar 
---
 arch/arm/boot/dts/exynos5420-peach-pit.dts |   31 ++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts 
b/arch/arm/boot/dts/exynos5420-peach-pit.dts
index 82cdb74..9d06aef 100644
--- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts
@@ -107,6 +107,12 @@
compatible = "auo,b116xw03";
power-supply = <&tps65090_fet6>;
backlight = <&backlight>;
+
+   port {
+   panel_in: endpoint {
+   remote-endpoint = <&bridge_out>;
+   };
+   };
};
 };

@@ -126,7 +132,14 @@
samsung,link-rate = <0x06>;
samsung,lane-count = <2>;
samsung,hpd-gpio = <&gpx2 6 0>;
-   bridge = <&ps8625>;
+
+   ports {
+   port at 0 {
+   dp_out: endpoint {
+   remote-endpoint = <&bridge_in>;
+   };
+   };
+   };
 };

 &fimd {
@@ -504,8 +517,22 @@
sleep-gpios = <&gpx3 5 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpy7 7 GPIO_ACTIVE_HIGH>;
lane-count = <2>;
-   panel = <&panel>;
use-external-pwm;
+
+   ports {
+   port at 0 {
+   bridge_out: endpoint {
+   remote-endpoint = <&panel_in>;
+   };
+   };
+
+   port at 1 {
+   bridge_in: endpoint {
+   remote-endpoint = <&dp_out>;
+   };
+   };
+   };
+
};
 };

-- 
1.7.9.5



[PATCH v11 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi

2014-11-15 Thread Daniel Kurtz
On Fri, Nov 14, 2014 at 9:37 PM, Andy Yan  wrote:
>
> We found Freescale imx6 and Rockchip rk3288 and Ingenic JZ4780 (Xburst/MIPS)
> use the interface compatible Designware HDMI IP, but they also have some
> lightly differences, such as phy pll configuration, register width(imx hdmi
> register is one byte, but rk3288 is 4 bytes width and can only be accessed
> by word), 4K support(imx6 doesn't support 4k, but rk3288 does), and HDMI2.0
> support.
>
> To reuse the imx-hdmi driver, we make this patch set:
> (1): fix some CodingStyle warning to make checkpatch happy
> (2): split out imx-soc code from imx-hdmi to dw_hdmi-imx.c
> (3): move imx-hdmi to bridge/dw-hdmi, and convert it to a drm_bridge driver
> (4): add rockchip rk3288 platform specific code dw_hdmi-rockchip.c
>
> Changes in v11:
> - rearrange the patch order
> - squash patch  
> - split some modification form patch 
>
> Changes in v10:
> - split generic dw_hdmi.c improvements from patch#11 (add rk3288 support)
> - add more display mode support mpll configuration for rk3288
>
> Changes in v9:
> - move some phy configuration to platform driver
>
> Changes in v8:
> - correct some spelling mistake
> - modify ddc-i2c-bus and interrupt description
> - Add documentation for rockchip dw hdmi
>
> Changes in v7:
> - remove unused variables from structure dw_hdmi
> - remove a wrong modification
> - add copyrights for dw_hdmi-imx.c
>
> Changes in v6:
> - rearrange the patch order
> - move some modification from patch#5
> - move some modification to  patch#6
> - refactor register access without reg_shift
>
> Changes in v5:
> - refactor reg-io-width
>
> Changes in v4:
> - fix checkpatch CHECK
> - defer probe ddc i2c adapter
>
> Changes in v3:
> - split multi-register access to one indepent patch
>
> Changes in v2:
> - use git format -M to generate these patch
>
> Andy Yan (11):
>   staging: imx-drm: imx-hdmi: make checkpatch happy
>   staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter
>   staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi
>   staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw_hdmi
>   dt-bindings: add document for dw_hdmi
>   drm: bridge/dw_hdmi: add support for multi-byte register width access
>   drm: bridge/dw_hdmi: add mode_valid support
>   drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done
>   drm: bridge/dw_hdmi: add function dw_hdmi_phy_enable_spare
>   dt-bindings: Add documentation for rockchip dw hdmi
>   drm: bridge/dw_hdmi: add rockchip rk3288 support
>
> Yakir Yang (1):
>   drm: bridge/dw_hdmi: convert dw-hdmi to drm_bridge mode

Patch 1 & 2 are:

Reviewed-by: Daniel Kurtz 

I think these first two are ready (or will be, after a small nit fix to #2).

Since they are independent of the imx/dw_hdmi split, can we get them
accepted first, to help shrink Andy's patch set?

Thanks,
-djk

>
>  .../devicetree/bindings/drm/bridge/dw_hdmi.txt |  40 ++
>  .../devicetree/bindings/video/dw_hdmi-rockchip.txt |  43 ++
>  drivers/gpu/drm/bridge/Kconfig |   5 +
>  drivers/gpu/drm/bridge/Makefile|   1 +
>  .../imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c}| 762 
> +
>  .../imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h}|   8 +-
>  drivers/gpu/drm/rockchip/Kconfig   |  10 +
>  drivers/gpu/drm/rockchip/Makefile  |   2 +-
>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c| 355 ++
>  drivers/staging/imx-drm/Kconfig|   1 +
>  drivers/staging/imx-drm/Makefile   |   2 +-
>  drivers/staging/imx-drm/dw_hdmi-imx.c  | 274 
>  include/drm/bridge/dw_hdmi.h   |  60 ++
>  13 files changed, 1138 insertions(+), 425 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt
>  create mode 100644 
> Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt
>  rename drivers/{staging/imx-drm/imx-hdmi.c => gpu/drm/bridge/dw_hdmi.c} (70%)
>  rename drivers/{staging/imx-drm/imx-hdmi.h => gpu/drm/bridge/dw_hdmi.h} (99%)
>  create mode 100644 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
>  create mode 100644 drivers/staging/imx-drm/dw_hdmi-imx.c
>  create mode 100644 include/drm/bridge/dw_hdmi.h
>
> --
> 1.9.1
>



-- 
Daniel Kurtz | Software Engineer | djkurtz at google.com | 650.204.0722


[PATCH V8 00/14] drm/exynos: few patches to enhance bridge chip support

2014-11-15 Thread Ajay Kumar
This series is based on master branch of Linus tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Changes since V2:
-- Address comments from Jingoo Han for ps8622 driver
-- Address comments from Daniel, Rob and Thierry regarding
   bridge chaining
-- Address comments from Thierry regarding the names for
   new drm_panel functions

Changes since V3:
-- Remove hotplug based initialization of exynos_dp
-- Make exynos_dp work directly with drm_panel, remove
   dependency on panel_binder
-- Minor cleanups in panel_binder and panel_lvds driver

Changes since V4:
-- Use gpiod interface for panel-lvds and ps8622 drivers.
-- Address comments from Javier.
-- Fix compilation issues when PANEL_BINDER is selected as module.
-- Split Documentation patches from driver patches.
-- Rebase on top of the tree.

Changes since V5:
-- Modify bridge drivers to support driver model.
-- Drop the concept of bridge chain(sincle there are no 2 real bridges)
   Hence drop bridge-panel_binder layer.
-- Drop panel-lvds driver and accomodate the required changes in
   panel-simple driver.
-- Use gpiod interface in ptn3460 driver.
-- Address all comments by Thierry Reding for V5 series.
-- Address comments from Sean Paul for exynos_dp_commit issue.

Changes since V6:
-- Panel patches were seperated and they are merged already.
-- Fix few issues with ptn3460, before modifying the bridge core.
-- Modify drm_bridge as per Thierry's comments for V6 series.
-- Add drm_bridge changes minimally without breaking existing code.
-- Add new features for ptn3460, step-by-step.
-- Address comments from Thierry and Andreas for ptn3460 and ps8622.
-- Split documentation patches from driver patches.

Changes since V7:
-- Address comments from Tomi and Laurent:
-- Use videoports and endpoints to represent the connection 
between
   encoder, bridge and the panel, instead of using phandles.
-- Address comments from Daniel:
-- Make the patch description more descriptive.
-- remove device pointer from drm_bridge, and just use
   device_node instead.
-- don't pass encoder pointer to bridge_attach.
-- Address comments from Sean Paul:
-- Remove bridge from mode_config, and pull out drm_bridge
   functions from drm_crtc.c to drm_bridge.c

Note: This patchset creates the following Kconfig ambiguity.
  Any pointers to fix the same are welcome.

drivers/video/fbdev/Kconfig:5:error: recursive dependency detected!
drivers/video/fbdev/Kconfig:5:  symbol FB is selected by DRM_KMS_FB_HELPER
drivers/gpu/drm/Kconfig:34: symbol DRM_KMS_FB_HELPER depends on 
DRM_KMS_HELPER
drivers/gpu/drm/Kconfig:28: symbol DRM_KMS_HELPER is selected by DRM_PTN3460
drivers/gpu/drm/bridge/Kconfig:1:   symbol DRM_PTN3460 depends on I2C
drivers/i2c/Kconfig:7:  symbol I2C is selected by FB_DDC
drivers/video/fbdev/Kconfig:59: symbol FB_DDC is selected by FB_CYBER2000_DDC
drivers/video/fbdev/Kconfig:374:symbol FB_CYBER2000_DDC depends on 
FB_CYBER2000
drivers/video/fbdev/Kconfig:362:symbol FB_CYBER2000 depends on FB

Ajay Kumar (13):
  [PATCH V8 1/14] drm/bridge: ptn3460: Few trivial cleanups
  [PATCH V8 2/14] drm/bridge: do not pass drm_bridge_funcs to drm_bridge_init
  [PATCH V8 3/14] drm/bridge: make bridge registration independent of drm flow
  [PATCH V8 4/14] drm/bridge: ptn3460: Convert to i2c driver model
  [PATCH V8 5/14] drm/exynos: dp: support drm_bridge
  [PATCH V8 6/14] drm/bridge: ptn3460: support drm_panel
  [PATCH V8 7/14] drm/bridge: ptn3460: probe connector at the end of bridge 
attach
  [PATCH V8 8/14] drm/bridge: ptn3460: use gpiod interface
  [PATCH V8 9/14] Documentation: drm: bridge: move to video/bridge
  [PATCH V8 10/14] Documentation: devicetree: Add vendor prefix for parade
  [PATCH V8 11/14] Documentation: bridge: Add documentation for ps8622 DT 
properties
  [PATCH V8 13/14] ARM: dts: snow: represent the connection between bridge and 
panel
using videoport and endpoints
  [PATCH V8 14/14] ARM: dts: peach-pit: represent the connection between bridge 
and
panel using videoport and endpoints

Vincent Palatin (1):
  [PATCH V8 12/14] drm/bridge: Add i2c based driver for ps8622/ps8625 bridge

 .../devicetree/bindings/drm/bridge/ptn3460.txt |   27 -
 .../devicetree/bindings/vendor-prefixes.txt|1 +
 .../devicetree/bindings/video/bridge/ps8622.txt|   31 +
 .../devicetree/bindings/video/bridge/ptn3460.txt   |   39 ++
 .../devicetree/bindings/video/exynos_dp.txt|   12 +
 arch/arm/boot/dts/exynos5250-snow.dts  |   30 +-
 arch/arm/boot/dts/exynos5420-peach-pit.dts |   31 +-
 drivers/gpu/drm/Makef

[PATCH V8 02/14] drm/bridge: do not pass drm_bridge_funcs to drm_bridge_init

2014-11-15 Thread Ajay Kumar
Assign the pointer to bridge ops structure(drm_bridge_funcs) in
the bridge driver itself, instead of passing it to drm_bridge_init.

This will allow bridge driver developer to pack bridge private
information inside the bridge object and pass only the drm-relevant
information to drm_bridge_init.

Signed-off-by: Ajay Kumar 
---
 drivers/gpu/drm/bridge/ptn3460.c   |3 ++-
 drivers/gpu/drm/drm_crtc.c |5 +
 drivers/gpu/drm/msm/hdmi/hdmi_bridge.c |3 ++-
 drivers/gpu/drm/sti/sti_hda.c  |3 ++-
 drivers/gpu/drm/sti/sti_hdmi.c |3 ++-
 include/drm/drm_crtc.h |3 +--
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c
index 4db38e1..a2ddc8d 100644
--- a/drivers/gpu/drm/bridge/ptn3460.c
+++ b/drivers/gpu/drm/bridge/ptn3460.c
@@ -313,7 +313,8 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder 
*encoder,
goto err;
}

-   ret = drm_bridge_init(dev, &ptn_bridge->bridge, &ptn3460_bridge_funcs);
+   ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs;
+   ret = drm_bridge_init(dev, &ptn_bridge->bridge);
if (ret) {
DRM_ERROR("Failed to initialize bridge with drm\n");
goto err;
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index e79c8d3..408c053 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1011,7 +1011,6 @@ EXPORT_SYMBOL(drm_connector_unplug_all);
  * drm_bridge_init - initialize a drm transcoder/bridge
  * @dev: drm device
  * @bridge: transcoder/bridge to set up
- * @funcs: bridge function table
  *
  * Initialises a preallocated bridge. Bridges should be
  * subclassed as part of driver connector objects.
@@ -1019,8 +1018,7 @@ EXPORT_SYMBOL(drm_connector_unplug_all);
  * Returns:
  * Zero on success, error code on failure.
  */
-int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge,
-   const struct drm_bridge_funcs *funcs)
+int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge)
 {
int ret;

@@ -1031,7 +1029,6 @@ int drm_bridge_init(struct drm_device *dev, struct 
drm_bridge *bridge,
goto out;

bridge->dev = dev;
-   bridge->funcs = funcs;

list_add_tail(&bridge->head, &dev->mode_config.bridge_list);
dev->mode_config.num_bridge++;
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c 
b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
index f6cf745..0309539 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
@@ -221,8 +221,9 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi)
hdmi_bridge->hdmi = hdmi_reference(hdmi);

bridge = &hdmi_bridge->base;
+   bridge->funcs = &hdmi_bridge_funcs;

-   drm_bridge_init(hdmi->dev, bridge, &hdmi_bridge_funcs);
+   drm_bridge_init(hdmi->dev, bridge);

return bridge;

diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index 2ae9a9b..6cf145d 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -664,7 +664,8 @@ static int sti_hda_bind(struct device *dev, struct device 
*master, void *data)
return -ENOMEM;

bridge->driver_private = hda;
-   drm_bridge_init(drm_dev, bridge, &sti_hda_bridge_funcs);
+   bridge->funcs = &sti_hda_bridge_funcs;
+   drm_bridge_init(drm_dev, bridge);

encoder->bridge = bridge;
connector->encoder = encoder;
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index b22968c..285f723 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -628,7 +628,8 @@ static int sti_hdmi_bind(struct device *dev, struct device 
*master, void *data)
return -ENOMEM;

bridge->driver_private = hdmi;
-   drm_bridge_init(drm_dev, bridge, &sti_hdmi_bridge_funcs);
+   bridge->funcs = &sti_hdmi_bridge_funcs;
+   drm_bridge_init(drm_dev, bridge);

encoder->bridge = bridge;
connector->encoder = encoder;
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index c40070a..5a3bce17 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -912,8 +912,7 @@ extern unsigned int drm_connector_index(struct 
drm_connector *connector);
 /* helper to unplug all connectors from sysfs for device */
 extern void drm_connector_unplug_all(struct drm_device *dev);

-extern int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge,
-  const struct drm_bridge_funcs *funcs);
+extern int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge);
 extern void drm_bridge_cleanup(struct drm_bridge *bridge);

 extern int drm_encoder_init(struct drm_device *dev,
-- 
1.7.9.5



[PATCH V8 12/14] drm/bridge: Add i2c based driver for ps8622/ps8625 bridge

2014-11-15 Thread Ajay Kumar
From: Vincent Palatin 

This patch adds drm_bridge driver for parade DisplayPort
to LVDS bridge chip.

Signed-off-by: Vincent Palatin 
Signed-off-by: Andrew Bresticker 
Signed-off-by: Sean Paul 
Signed-off-by: Rahul Sharma 
Signed-off-by: Ajay Kumar 
---
 drivers/gpu/drm/bridge/Kconfig  |9 +
 drivers/gpu/drm/bridge/Makefile |1 +
 drivers/gpu/drm/bridge/ps8622.c |  684 +++
 3 files changed, 694 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/ps8622.c

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index 8b426e2..d06eda3 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -6,3 +6,12 @@ config DRM_PTN3460
select DRM_PANEL
---help---
  ptn3460 eDP-LVDS bridge chip driver.
+
+config DRM_PS8622
+   tristate "Parade eDP/LVDS bridge"
+   depends on OF && I2C
+   select DRM_PANEL
+   select BACKLIGHT_LCD_SUPPORT
+   select BACKLIGHT_CLASS_DEVICE
+   ---help---
+ parade eDP-LVDS bridge chip driver.
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index b4733e1..105da3e 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -1,3 +1,4 @@
 ccflags-y := -Iinclude/drm

+obj-$(CONFIG_DRM_PS8622) += ps8622.o
 obj-$(CONFIG_DRM_PTN3460) += ptn3460.o
diff --git a/drivers/gpu/drm/bridge/ps8622.c b/drivers/gpu/drm/bridge/ps8622.c
new file mode 100644
index 000..5474a39
--- /dev/null
+++ b/drivers/gpu/drm/bridge/ps8622.c
@@ -0,0 +1,684 @@
+/*
+ * Parade PS8622 eDP/LVDS bridge driver
+ *
+ * Copyright (C) 2014 Google, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "drmP.h"
+#include "drm_crtc.h"
+#include "drm_crtc_helper.h"
+
+/* Brightness scale on the Parade chip */
+#define PS8622_MAX_BRIGHTNESS 0xff
+
+/* Timings taken from the version 1.7 datasheet for the PS8622/PS8625 */
+#define PS8622_POWER_RISE_T1_MIN_US 10
+#define PS8622_POWER_RISE_T1_MAX_US 1
+#define PS8622_RST_HIGH_T2_MIN_US 3000
+#define PS8622_RST_HIGH_T2_MAX_US 3
+#define PS8622_PWMO_END_T12_MS 200
+#define PS8622_POWER_FALL_T16_MAX_US 1
+#define PS8622_POWER_OFF_T17_MS 500
+
+#if ((PS8622_RST_HIGH_T2_MIN_US + PS8622_POWER_RISE_T1_MAX_US) > \
+   (PS8622_RST_HIGH_T2_MAX_US + PS8622_POWER_RISE_T1_MIN_US))
+#error "T2.min + T1.max must be less than T2.max + T1.min"
+#endif
+
+struct ps8622_bridge {
+   struct drm_connector connector;
+   struct i2c_client *client;
+   struct drm_bridge bridge;
+   struct drm_panel *panel;
+   struct regulator *v12;
+   struct backlight_device *bl;
+
+   struct gpio_desc *gpio_slp;
+   struct gpio_desc *gpio_rst;
+
+   u32 max_lane_count;
+   u32 lane_count;
+
+   bool enabled;
+};
+
+static inline struct ps8622_bridge *
+   bridge_to_ps8622(struct drm_bridge *bridge)
+{
+   return container_of(bridge, struct ps8622_bridge, bridge);
+}
+
+static inline struct ps8622_bridge *
+   connector_to_ps8622(struct drm_connector *connector)
+{
+   return container_of(connector, struct ps8622_bridge, connector);
+}
+
+static int ps8622_set(struct i2c_client *client, u8 page, u8 reg, u8 val)
+{
+   int ret;
+   struct i2c_adapter *adap = client->adapter;
+   struct i2c_msg msg;
+   u8 data[] = {reg, val};
+
+   msg.addr = client->addr + page;
+   msg.flags = 0;
+   msg.len = sizeof(data);
+   msg.buf = data;
+
+   ret = i2c_transfer(adap, &msg, 1);
+   if (ret != 1)
+   pr_warn("PS8622 I2C write (0x%02x,0x%02x,0x%02x) failed: %d\n",
+   client->addr + page, reg, val, ret);
+   return !(ret == 1);
+}
+
+static int ps8622_send_config(struct ps8622_bridge *ps8622)
+{
+   struct i2c_client *cl = ps8622->client;
+   int err = 0;
+
+   /* HPD low */
+   err = ps8622_set(cl, 0x02, 0xa1, 0x01);
+   if (err)
+   goto error;
+
+   /* SW setting: [1:0] SW output 1.2V voltage is lower to 96% */
+   err = ps8622_set(cl, 0x04, 0x14, 0x01);
+   if (err)
+   goto error;
+
+   /* RCO SS setting: [5:4] = b01 0.5%, b10 1%, b11 1.5% */
+   err = ps8622_set(cl, 0x04, 0xe3, 0x20);
+   if (err)
+   goto error;
+
+   /* [7] RCO SS enable */
+   err = ps8622_set(cl, 0x04, 0xe2, 0x80);
+   if (err)
+

[PATCH] drivers: Change calls to mdelay to msleep in order to stop CPU busy looping in mdfld_dsi_pkg_sender.c

2014-11-15 Thread Nicholas Krause
Changes the calls of mdelay to msleep in the driver file mdfld_dsi_pkg_sender.c
in order to prevent CPU busy looping in order to save CPU cycles as this is
considered bad form over sleeping the CPU for high resolution timer function
calls as this driver needs in order to function properly.

Signed-off-by: Nicholas Krause 
---
 drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c 
b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
index 87885d8..77c656a 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
@@ -335,13 +335,11 @@ static int send_pkg_prepare(struct mdfld_dsi_pkg_sender 
*sender, u8 data_type,

/*wait for 120 milliseconds in case exit_sleep_mode just be sent*/
if (unlikely(cmd == DCS_ENTER_SLEEP_MODE)) {
-   /*TODO: replace it with msleep later*/
-   mdelay(120);
+   msleep(120);
}

if (unlikely(cmd == DCS_EXIT_SLEEP_MODE)) {
-   /*TODO: replace it with msleep later*/
-   mdelay(120);
+   msleep(120);
}
return 0;
 }
@@ -364,15 +362,12 @@ static int send_pkg_done(struct mdfld_dsi_pkg_sender 
*sender, u8 data_type,
/*update panel status*/
if (unlikely(cmd == DCS_ENTER_SLEEP_MODE)) {
sender->panel_mode |= MDFLD_DSI_PANEL_MODE_SLEEP;
-   /*TODO: replace it with msleep later*/
-   mdelay(120);
+   msleep(120);
} else if (unlikely(cmd == DCS_EXIT_SLEEP_MODE)) {
sender->panel_mode &= ~MDFLD_DSI_PANEL_MODE_SLEEP;
-   /*TODO: replace it with msleep later*/
-   mdelay(120);
+   msleep(120);
} else if (unlikely(cmd == DCS_SOFT_RESET)) {
-   /*TODO: replace it with msleep later*/
-   mdelay(5);
+   msleep(5);
}

sender->status = MDFLD_DSI_PKG_SENDER_FREE;
-- 
1.9.1



[PATCH v11 02/12] staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter

2014-11-15 Thread Daniel Kurtz
On Fri, Nov 14, 2014 at 9:39 PM, Andy Yan  wrote:
> drm driver may probe before the i2c bus, so the driver should
> defer probing until it is available
>
> Signed-off-by: Andy Yan 
>
> ---
>
> Changes in v11: None
> Changes in v10: None
> Changes in v9: None
> Changes in v8: None
> Changes in v7: None
> Changes in v6: None
> Changes in v5: None
> Changes in v4:
> - defer probe ddc i2c adapter
>
> Changes in v3: None
> Changes in v2: None
>
>  drivers/staging/imx-drm/imx-hdmi.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/imx-drm/imx-hdmi.c 
> b/drivers/staging/imx-drm/imx-hdmi.c
> index 79daec4..c2b035a 100644
> --- a/drivers/staging/imx-drm/imx-hdmi.c
> +++ b/drivers/staging/imx-drm/imx-hdmi.c
> @@ -1611,8 +1611,11 @@ static int imx_hdmi_bind(struct device *dev, struct 
> device *master, void *data)
> ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
> if (ddc_node) {
> hdmi->ddc = of_find_i2c_adapter_by_node(ddc_node);
> -   if (!hdmi->ddc)
> +   if (!hdmi->ddc) {
> dev_dbg(hdmi->dev, "failed to read ddc node\n");
> +   of_node_put(ddc_node);
> +   return -EPROBE_DEFER;
> +   }

Nit:  You could move "of_node_put()" above "if (!hdmi->ddc)", and not
need it in two places.

Either way, this one is:
Reviewed-by: Daniel Kurtz 

>
> of_node_put(ddc_node);
> } else {
> --
> 1.9.1
>



-- 
Daniel Kurtz | Software Engineer | djkurtz at google.com | 650.204.0722


[PATCH V8 01/14] drm/bridge: ptn3460: Few trivial cleanups

2014-11-15 Thread Ajay Kumar
This patch does the following changes:
-- Use usleep_range instead of udelay.
-- Remove driver_private member from ptn3460 structure.
-- Make all possible functions and structures static.
-- Use dev_err for non-DRM errors.
-- Arrange header files alphabetically.
-- s/edid/EDID in all error messages.

Signed-off-by: Ajay Kumar 
---
 drivers/gpu/drm/bridge/ptn3460.c |   95 +++---
 1 file changed, 48 insertions(+), 47 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c
index d466696..4db38e1 100644
--- a/drivers/gpu/drm/bridge/ptn3460.c
+++ b/drivers/gpu/drm/bridge/ptn3460.c
@@ -13,19 +13,19 @@
  * GNU General Public License for more details.
  */

+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 

-#include "drmP.h"
-#include "drm_edid.h"
+#include "bridge/ptn3460.h"
+
 #include "drm_crtc.h"
 #include "drm_crtc_helper.h"
-
-#include "bridge/ptn3460.h"
+#include "drm_edid.h"
+#include "drmP.h"

 #define PTN3460_EDID_ADDR  0x0
 #define PTN3460_EDID_EMULATION_ADDR0x84
@@ -37,7 +37,7 @@ struct ptn3460_bridge {
struct drm_connector connector;
struct i2c_client *client;
struct drm_encoder *encoder;
-   struct drm_bridge *bridge;
+   struct drm_bridge bridge;
struct edid *edid;
int gpio_pd_n;
int gpio_rst_n;
@@ -45,6 +45,18 @@ struct ptn3460_bridge {
bool enabled;
 };

+static inline struct ptn3460_bridge *
+   bridge_to_ptn3460(struct drm_bridge *bridge)
+{
+   return container_of(bridge, struct ptn3460_bridge, bridge);
+}
+
+static inline struct ptn3460_bridge *
+   connector_to_ptn3460(struct drm_connector *connector)
+{
+   return container_of(connector, struct ptn3460_bridge, connector);
+}
+
 static int ptn3460_read_bytes(struct ptn3460_bridge *ptn_bridge, char addr,
u8 *buf, int len)
 {
@@ -92,7 +104,7 @@ static int ptn3460_select_edid(struct ptn3460_bridge 
*ptn_bridge)
ret = ptn3460_write_byte(ptn_bridge, PTN3460_EDID_SRAM_LOAD_ADDR,
ptn_bridge->edid_emulation);
if (ret) {
-   DRM_ERROR("Failed to transfer edid to sram, ret=%d\n", ret);
+   DRM_ERROR("Failed to transfer EDID to sram, ret=%d\n", ret);
return ret;
}

@@ -102,7 +114,7 @@ static int ptn3460_select_edid(struct ptn3460_bridge 
*ptn_bridge)

ret = ptn3460_write_byte(ptn_bridge, PTN3460_EDID_EMULATION_ADDR, val);
if (ret) {
-   DRM_ERROR("Failed to write edid value, ret=%d\n", ret);
+   DRM_ERROR("Failed to write EDID value, ret=%d\n", ret);
return ret;
}

@@ -111,7 +123,7 @@ static int ptn3460_select_edid(struct ptn3460_bridge 
*ptn_bridge)

 static void ptn3460_pre_enable(struct drm_bridge *bridge)
 {
-   struct ptn3460_bridge *ptn_bridge = bridge->driver_private;
+   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
int ret;

if (ptn_bridge->enabled)
@@ -122,7 +134,7 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)

if (gpio_is_valid(ptn_bridge->gpio_rst_n)) {
gpio_set_value(ptn_bridge->gpio_rst_n, 0);
-   udelay(10);
+   usleep_range(10, 20);
gpio_set_value(ptn_bridge->gpio_rst_n, 1);
}

@@ -135,7 +147,7 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)

ret = ptn3460_select_edid(ptn_bridge);
if (ret)
-   DRM_ERROR("Select edid failed ret=%d\n", ret);
+   DRM_ERROR("Select EDID failed ret=%d\n", ret);

ptn_bridge->enabled = true;
 }
@@ -146,7 +158,7 @@ static void ptn3460_enable(struct drm_bridge *bridge)

 static void ptn3460_disable(struct drm_bridge *bridge)
 {
-   struct ptn3460_bridge *ptn_bridge = bridge->driver_private;
+   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);

if (!ptn_bridge->enabled)
return;
@@ -164,9 +176,9 @@ static void ptn3460_post_disable(struct drm_bridge *bridge)
 {
 }

-void ptn3460_bridge_destroy(struct drm_bridge *bridge)
+static void ptn3460_bridge_destroy(struct drm_bridge *bridge)
 {
-   struct ptn3460_bridge *ptn_bridge = bridge->driver_private;
+   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);

drm_bridge_cleanup(bridge);
if (gpio_is_valid(ptn_bridge->gpio_pd_n))
@@ -176,7 +188,7 @@ void ptn3460_bridge_destroy(struct drm_bridge *bridge)
/* Nothing else to free, we've got devm allocated memory */
 }

-struct drm_bridge_funcs ptn3460_bridge_funcs = {
+static struct drm_bridge_funcs ptn3460_bridge_funcs = {
.pre_enable = ptn3460_pre_enable,
.enable = ptn3460_enable,
.disable = ptn3460_disable,
@@ -184,24 +196,24 @@ struct drm_bridge_funcs ptn3460_bridge_func

[PATCH V8 06/14] drm/bridge: ptn3460: support drm_panel

2014-11-15 Thread Ajay Kumar
Add drm_panel calls to the driver to make the panel and
bridge work together in tandem.

Signed-off-by: Ajay Kumar 
---
 .../devicetree/bindings/drm/bridge/ptn3460.txt |   12 ++
 drivers/gpu/drm/bridge/Kconfig |1 +
 drivers/gpu/drm/bridge/ptn3460.c   |   42 
 3 files changed, 55 insertions(+)

diff --git a/Documentation/devicetree/bindings/drm/bridge/ptn3460.txt 
b/Documentation/devicetree/bindings/drm/bridge/ptn3460.txt
index 52b93b2..663fe6c 100644
--- a/Documentation/devicetree/bindings/drm/bridge/ptn3460.txt
+++ b/Documentation/devicetree/bindings/drm/bridge/ptn3460.txt
@@ -17,6 +17,11 @@ Required properties:
|   6   |  1600x900  | ChiMei M215HGE   |
+---++--+

+   - video interfaces: Device node can contain video interface port
+   nodes for panel according to [1].
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
 Example:
lvds-bridge at 20 {
compatible = "nxp,ptn3460";
@@ -24,4 +29,11 @@ Example:
powerdown-gpio = <&gpy2 5 1 0 0>;
reset-gpio = <&gpx1 5 1 0 0>;
edid-emulation = <5>;
+   ports {
+   port at 0 {
+   bridge_out: endpoint {
+   remote-endpoint = <&panel_in>;
+   };
+   };
+   };
};
diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index 4254c2b..8b426e2 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -3,5 +3,6 @@ config DRM_PTN3460
depends on DRM
depends on OF && I2C
select DRM_KMS_HELPER
+   select DRM_PANEL
---help---
  ptn3460 eDP-LVDS bridge chip driver.
diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c
index 7adeb60..e6d5ae7 100644
--- a/drivers/gpu/drm/bridge/ptn3460.c
+++ b/drivers/gpu/drm/bridge/ptn3460.c
@@ -19,6 +19,9 @@
 #include 
 #include 
 #include 
+#include 
+
+#include 

 #include "bridge/ptn3460.h"

@@ -38,6 +41,7 @@ struct ptn3460_bridge {
struct i2c_client *client;
struct drm_bridge bridge;
struct edid *edid;
+   struct drm_panel *panel;
int gpio_pd_n;
int gpio_rst_n;
u32 edid_emulation;
@@ -137,6 +141,11 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)
gpio_set_value(ptn_bridge->gpio_rst_n, 1);
}

+   if (drm_panel_prepare(ptn_bridge->panel)) {
+   DRM_ERROR("failed to prepare panel\n");
+   return;
+   }
+
/*
 * There's a bug in the PTN chip where it falsely asserts hotplug before
 * it is fully functional. We're forced to wait for the maximum start up
@@ -153,6 +162,12 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)

 static void ptn3460_enable(struct drm_bridge *bridge)
 {
+   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
+
+   if (drm_panel_enable(ptn_bridge->panel)) {
+   DRM_ERROR("failed to enable panel\n");
+   return;
+   }
 }

 static void ptn3460_disable(struct drm_bridge *bridge)
@@ -164,6 +179,11 @@ static void ptn3460_disable(struct drm_bridge *bridge)

ptn_bridge->enabled = false;

+   if (drm_panel_disable(ptn_bridge->panel)) {
+   DRM_ERROR("failed to disable panel\n");
+   return;
+   }
+
if (gpio_is_valid(ptn_bridge->gpio_rst_n))
gpio_set_value(ptn_bridge->gpio_rst_n, 1);

@@ -173,6 +193,12 @@ static void ptn3460_disable(struct drm_bridge *bridge)

 static void ptn3460_post_disable(struct drm_bridge *bridge)
 {
+   struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
+
+   if (drm_panel_unprepare(ptn_bridge->panel)) {
+   DRM_ERROR("failed to unprepare panel\n");
+   return;
+   }
 }

 static int ptn3460_get_modes(struct drm_connector *connector)
@@ -267,6 +293,9 @@ int ptn3460_bridge_attach(struct drm_bridge *bridge)
drm_mode_connector_attach_encoder(&ptn_bridge->connector,
bridge->encoder);

+   if (ptn_bridge->panel)
+   drm_panel_attach(ptn_bridge->panel, &ptn_bridge->connector);
+
return ret;
 }

@@ -283,6 +312,7 @@ static int ptn3460_probe(struct i2c_client *client,
 {
struct device *dev = &client->dev;
struct ptn3460_bridge *ptn_bridge;
+   struct device_node *endpoint, *panel_node;
int ret;

ptn_bridge = devm_kzalloc(dev, sizeof(*ptn_bridge), GFP_KERNEL);
@@ -290,6 +320,17 @@ static int ptn3460_probe(struct i2c_client *client,
return -ENOMEM;
}

+   endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+   if (endpoint) {
+  

[PATCH V8 08/14] drm/bridge: ptn3460: use gpiod interface

2014-11-15 Thread Ajay Kumar
Modify driver to support gpiod interface.

Signed-off-by: Ajay Kumar 
---
 drivers/gpu/drm/bridge/ptn3460.c |   88 --
 1 file changed, 36 insertions(+), 52 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c
index 9f800a1..826833e 100644
--- a/drivers/gpu/drm/bridge/ptn3460.c
+++ b/drivers/gpu/drm/bridge/ptn3460.c
@@ -42,8 +42,8 @@ struct ptn3460_bridge {
struct drm_bridge bridge;
struct edid *edid;
struct drm_panel *panel;
-   int gpio_pd_n;
-   int gpio_rst_n;
+   struct gpio_desc *gpio_pd_n;
+   struct gpio_desc *gpio_rst_n;
u32 edid_emulation;
bool enabled;
 };
@@ -132,14 +132,11 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)
if (ptn_bridge->enabled)
return;

-   if (gpio_is_valid(ptn_bridge->gpio_pd_n))
-   gpio_set_value(ptn_bridge->gpio_pd_n, 1);
+   gpiod_set_value(ptn_bridge->gpio_pd_n, 1);

-   if (gpio_is_valid(ptn_bridge->gpio_rst_n)) {
-   gpio_set_value(ptn_bridge->gpio_rst_n, 0);
-   usleep_range(10, 20);
-   gpio_set_value(ptn_bridge->gpio_rst_n, 1);
-   }
+   gpiod_set_value(ptn_bridge->gpio_rst_n, 0);
+   usleep_range(10, 20);
+   gpiod_set_value(ptn_bridge->gpio_rst_n, 1);

if (drm_panel_prepare(ptn_bridge->panel)) {
DRM_ERROR("failed to prepare panel\n");
@@ -184,11 +181,8 @@ static void ptn3460_disable(struct drm_bridge *bridge)
return;
}

-   if (gpio_is_valid(ptn_bridge->gpio_rst_n))
-   gpio_set_value(ptn_bridge->gpio_rst_n, 1);
-
-   if (gpio_is_valid(ptn_bridge->gpio_pd_n))
-   gpio_set_value(ptn_bridge->gpio_pd_n, 0);
+   gpiod_set_value(ptn_bridge->gpio_rst_n, 1);
+   gpiod_set_value(ptn_bridge->gpio_pd_n, 0);
 }

 static void ptn3460_post_disable(struct drm_bridge *bridge)
@@ -335,39 +329,41 @@ static int ptn3460_probe(struct i2c_client *client,
}

ptn_bridge->client = client;
-   ptn_bridge->gpio_pd_n = of_get_named_gpio(dev->of_node,
-   "powerdown-gpio", 0);
-   if (gpio_is_valid(ptn_bridge->gpio_pd_n)) {
-   ret = gpio_request_one(ptn_bridge->gpio_pd_n,
-   GPIOF_OUT_INIT_HIGH, "PTN3460_PD_N");
-   if (ret) {
-   dev_err(dev, "Request powerdown-gpio failed (%d)\n",
-   ret);
-   return ret;
-   }
+
+   ptn_bridge->gpio_pd_n = devm_gpiod_get(&client->dev, "powerdown");
+   if (IS_ERR(ptn_bridge->gpio_pd_n)) {
+   ret = PTR_ERR(ptn_bridge->gpio_pd_n);
+   dev_err(dev, "cannot get gpio_pd_n %d\n", ret);
+   return ret;
}

-   ptn_bridge->gpio_rst_n = of_get_named_gpio(dev->of_node,
-   "reset-gpio", 0);
-   if (gpio_is_valid(ptn_bridge->gpio_rst_n)) {
-   /*
-* Request the reset pin low to avoid the bridge being
-* initialized prematurely
-*/
-   ret = gpio_request_one(ptn_bridge->gpio_rst_n,
-   GPIOF_OUT_INIT_LOW, "PTN3460_RST_N");
-   if (ret) {
-   dev_err(dev, "Request reset-gpio failed (%d)\n", ret);
-   gpio_free(ptn_bridge->gpio_pd_n);
-   return ret;
-   }
+   ret = gpiod_direction_output(ptn_bridge->gpio_pd_n, 1);
+   if (ret) {
+   DRM_ERROR("cannot configure gpio_pd_n\n");
+   return ret;
+   }
+
+   ptn_bridge->gpio_rst_n = devm_gpiod_get(&client->dev, "reset");
+   if (IS_ERR(ptn_bridge->gpio_rst_n)) {
+   ret = PTR_ERR(ptn_bridge->gpio_rst_n);
+   DRM_ERROR("cannot get gpio_rst_n %d\n", ret);
+   return ret;
+   }
+   /*
+* Request the reset pin low to avoid the bridge being
+* initialized prematurely
+*/
+   ret = gpiod_direction_output(ptn_bridge->gpio_rst_n, 0);
+   if (ret) {
+   DRM_ERROR("cannot configure gpio_rst_n\n");
+   return ret;
}

ret = of_property_read_u32(dev->of_node, "edid-emulation",
&ptn_bridge->edid_emulation);
if (ret) {
dev_err(dev, "Can't read EDID emulation value\n");
-   goto err;
+   return ret;
}

ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs;
@@ -375,19 +371,12 @@ static int ptn3460_probe(struct i2c_client *client,
ret = drm_bridge_add(&ptn_bridge->bridge);
if (ret) {
DRM_ERROR("Failed to add bridge\n");
-   goto err;
+   return ret;
}

i2c_set_clientd

[PATCH V8 09/14] Documentation: drm: bridge: move to video/bridge

2014-11-15 Thread Ajay Kumar
Move drm/bridge documentation to video/bridge.
Also, add proper documentation for gpios used by ptn3460.

Signed-off-by: Ajay Kumar 
---
 .../devicetree/bindings/drm/bridge/ptn3460.txt |   39 
 .../devicetree/bindings/video/bridge/ptn3460.txt   |   39 
 2 files changed, 39 insertions(+), 39 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/drm/bridge/ptn3460.txt
 create mode 100644 Documentation/devicetree/bindings/video/bridge/ptn3460.txt

diff --git a/Documentation/devicetree/bindings/drm/bridge/ptn3460.txt 
b/Documentation/devicetree/bindings/drm/bridge/ptn3460.txt
deleted file mode 100644
index 663fe6c..000
--- a/Documentation/devicetree/bindings/drm/bridge/ptn3460.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-ptn3460 bridge bindings
-
-Required properties:
-   - compatible: "nxp,ptn3460"
-   - reg: i2c address of the bridge
-   - powerdown-gpio: OF device-tree gpio specification
-   - reset-gpio: OF device-tree gpio specification
-   - edid-emulation: The EDID emulation entry to use
-   +---++--+
-   | Value | Resolution | Description  |
-   |   0   |  1024x768  | NXP Generic  |
-   |   1   |  1920x1080 | NXP Generic  |
-   |   2   |  1920x1080 | NXP Generic  |
-   |   3   |  1600x900  | Samsung LTM200KT |
-   |   4   |  1920x1080 | Samsung LTM230HT |
-   |   5   |  1366x768  | NXP Generic  |
-   |   6   |  1600x900  | ChiMei M215HGE   |
-   +---++--+
-
-   - video interfaces: Device node can contain video interface port
-   nodes for panel according to [1].
-
-[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
-
-Example:
-   lvds-bridge at 20 {
-   compatible = "nxp,ptn3460";
-   reg = <0x20>;
-   powerdown-gpio = <&gpy2 5 1 0 0>;
-   reset-gpio = <&gpx1 5 1 0 0>;
-   edid-emulation = <5>;
-   ports {
-   port at 0 {
-   bridge_out: endpoint {
-   remote-endpoint = <&panel_in>;
-   };
-   };
-   };
-   };
diff --git a/Documentation/devicetree/bindings/video/bridge/ptn3460.txt 
b/Documentation/devicetree/bindings/video/bridge/ptn3460.txt
new file mode 100644
index 000..361971b
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/bridge/ptn3460.txt
@@ -0,0 +1,39 @@
+ptn3460 bridge bindings
+
+Required properties:
+   - compatible: "nxp,ptn3460"
+   - reg: i2c address of the bridge
+   - powerdown-gpio: OF device-tree gpio specification  for PD_N pin.
+   - reset-gpio: OF device-tree gpio specification for RST_N pin.
+   - edid-emulation: The EDID emulation entry to use
+   +---++--+
+   | Value | Resolution | Description  |
+   |   0   |  1024x768  | NXP Generic  |
+   |   1   |  1920x1080 | NXP Generic  |
+   |   2   |  1920x1080 | NXP Generic  |
+   |   3   |  1600x900  | Samsung LTM200KT |
+   |   4   |  1920x1080 | Samsung LTM230HT |
+   |   5   |  1366x768  | NXP Generic  |
+   |   6   |  1600x900  | ChiMei M215HGE   |
+   +---++--+
+
+   - video interfaces: Device node can contain video interface port
+   nodes for panel according to [1].
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+   lvds-bridge at 20 {
+   compatible = "nxp,ptn3460";
+   reg = <0x20>;
+   powerdown-gpio = <&gpy2 5 1 0 0>;
+   reset-gpio = <&gpx1 5 1 0 0>;
+   edid-emulation = <5>;
+   ports {
+   port at 0 {
+   bridge_out: endpoint {
+   remote-endpoint = <&panel_in>;
+   };
+   };
+   };
+   };
-- 
1.7.9.5



[PATCH V8 10/14] Documentation: devicetree: Add vendor prefix for parade

2014-11-15 Thread Ajay Kumar
ps8622 eDP-LVDS converter bridge chip is from parade technologies

Signed-off-by: Ajay Kumar 
---
 .../devicetree/bindings/vendor-prefixes.txt|1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 723999d..0be1508 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -110,6 +110,7 @@ nxp NXP Semiconductors
 onnn   ON Semiconductor Corp.
 opencores  OpenCores.org
 panasonic  Panasonic Corporation
+parade Parade Technologies Inc.
 phytec PHYTEC Messtechnik GmbH
 picochip   Picochip Ltd
 plathome   Plat'Home Co., Ltd.
-- 
1.7.9.5