Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-10-14 Thread Hans Verkuil
On 10/12/2017 10:03 AM, Tomi Valkeinen wrote:
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> On 12/10/17 09:50, Hans Verkuil wrote:
> 
>>> I can't test with a TV, so no CEC for me... But otherwise I think the
>>> series works ok now, and looks ok. So I'll apply, but it's a bit late
>>> for the next merge window, so I'll aim for 4.15 with this.
>>
>> What is the status? Do you need anything from me? I'd like to get this in 
>> for 4.15.
> 
> Thanks for reminding. I think I would've forgotten...
> 
> I sent the pull request, so all should be fine.
> 
> If possible, please test the pull request, preferably with drm-next
> merged (git://people.freedesktop.org/~airlied/linux drm-next), as I
> don't have a CEC capable display.

Tested with drm-next. Works fine!

Great to finally see this merged!

Regards,

Hans


Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-10-12 Thread Tomi Valkeinen

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

On 12/10/17 12:42, Hans Verkuil wrote:
> On 10/12/17 10:03, Tomi Valkeinen wrote:
>>
>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
>> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>>
>> On 12/10/17 09:50, Hans Verkuil wrote:
>>
 I can't test with a TV, so no CEC for me... But otherwise I think the
 series works ok now, and looks ok. So I'll apply, but it's a bit late
 for the next merge window, so I'll aim for 4.15 with this.
>>>
>>> What is the status? Do you need anything from me? I'd like to get this in 
>>> for 4.15.
>>
>> Thanks for reminding. I think I would've forgotten...
>>
>> I sent the pull request, so all should be fine.
>>
>> If possible, please test the pull request, preferably with drm-next
>> merged (git://people.freedesktop.org/~airlied/linux drm-next), as I
>> don't have a CEC capable display.
> 
> I'll try to do that tomorrow or Monday.
> 
> I have one other question for you: does keeping ls_oe_gpio high all the
> time affect this old bug fix:
> 
> https://github.com/myfluxi/xxICSKernel/commit/21189f03d3ec3a74d9949907c828410d7a9a86d5

No, the issue is about the HDMI PHY. The i2c lines are not related.
LS_OE only affects the i2c.

> I don't think so, but I'm not 100% sure. As far as I can see the PHY power
> sequence (OFF, TXON, LDOON) does not change and that seems to be the
> crucial fix according to the commit above.
> 
> I would hate being responsible for lots of burnt-out pandaboards :-)
> 
> There is an alternative solution: when there is no HPD then it is also
> possible to pull the ls_oe_gpio high only when transmitting a CEC message.
> 
> That would obviously require some code changes.
> 
> Sorry for raising this issue so late, but this just came up today in
> internal discussions.

Well, it would be nice to not have LS_OE enabled all the time. But I'm
not sure how much that really matters. I'm sure it uses some power, but
is that even measurable, I have no idea.

 Tomi



Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-10-12 Thread Hans Verkuil
On 10/12/17 10:03, Tomi Valkeinen wrote:
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> On 12/10/17 09:50, Hans Verkuil wrote:
> 
>>> I can't test with a TV, so no CEC for me... But otherwise I think the
>>> series works ok now, and looks ok. So I'll apply, but it's a bit late
>>> for the next merge window, so I'll aim for 4.15 with this.
>>
>> What is the status? Do you need anything from me? I'd like to get this in 
>> for 4.15.
> 
> Thanks for reminding. I think I would've forgotten...
> 
> I sent the pull request, so all should be fine.
> 
> If possible, please test the pull request, preferably with drm-next
> merged (git://people.freedesktop.org/~airlied/linux drm-next), as I
> don't have a CEC capable display.

I'll try to do that tomorrow or Monday.

I have one other question for you: does keeping ls_oe_gpio high all the
time affect this old bug fix:

https://github.com/myfluxi/xxICSKernel/commit/21189f03d3ec3a74d9949907c828410d7a9a86d5

I don't think so, but I'm not 100% sure. As far as I can see the PHY power
sequence (OFF, TXON, LDOON) does not change and that seems to be the
crucial fix according to the commit above.

I would hate being responsible for lots of burnt-out pandaboards :-)

There is an alternative solution: when there is no HPD then it is also
possible to pull the ls_oe_gpio high only when transmitting a CEC message.

That would obviously require some code changes.

Sorry for raising this issue so late, but this just came up today in
internal discussions.

Regards,

Hans


Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-10-12 Thread Tomi Valkeinen

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

On 12/10/17 09:50, Hans Verkuil wrote:

>> I can't test with a TV, so no CEC for me... But otherwise I think the
>> series works ok now, and looks ok. So I'll apply, but it's a bit late
>> for the next merge window, so I'll aim for 4.15 with this.
> 
> What is the status? Do you need anything from me? I'd like to get this in for 
> 4.15.

Thanks for reminding. I think I would've forgotten...

I sent the pull request, so all should be fine.

If possible, please test the pull request, preferably with drm-next
merged (git://people.freedesktop.org/~airlied/linux drm-next), as I
don't have a CEC capable display.

 Tomi



Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-10-12 Thread Hans Verkuil
Hi Tomi,

On 08/22/2017 11:44 AM, Tomi Valkeinen wrote:
> Hi Hans,
> 
>>>
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> On 11/08/17 13:57, Tomi Valkeinen wrote:
>>>
 I'm doing some testing with this series on my panda. One issue I see is
 that when I unload the display modules, I get:

 [   75.180206] platform 58006000.encoder: enabled after unload, idling
 [   75.187896] platform 58001000.dispc: enabled after unload, idling
 [   75.198242] platform 5800.dss: enabled after unload, idling
>>>
>>> This one is caused by hdmi_cec_adap_enable() never getting called with
>>> enable=false when unloading the modules. Should that be called
>>> explicitly in hdmi4_cec_uninit, or is the CEC framework supposed to call it?
>>
>> Nicely found!
>>
>> The cec_delete_adapter() function calls 
>> __cec_s_phys_addr(CEC_PHYS_ADDR_INVALID)
>> which would normally call adap_enable(false), except when the device node was
>> already unregistered, in which case it just returns immediately.
>>
>> The patch below should fix this. Let me know if it works, and I'll post a 
>> proper
>> patch and get that in for 4.14 (and possible backported as well, I'll have to
>> look at that).
> 
> Thanks, this fixes the issue.
> 
> I again saw "HDMICORE: omapdss HDMICORE error: operation stopped when
> reading edid" when I loaded the modules. My panda also froze just now
> when unloading the display modules, and it doesn't react to sysrq.
> 
> After testing a bit without the CEC patches, I saw the above error, so I
> don't think it's related to your patches.
> 
> I can't test with a TV, so no CEC for me... But otherwise I think the
> series works ok now, and looks ok. So I'll apply, but it's a bit late
> for the next merge window, so I'll aim for 4.15 with this.

What is the status? Do you need anything from me? I'd like to get this in for 
4.15.

Regards,

Hans


Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-08-22 Thread Tomi Valkeinen
Hi Hans,

>> 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

On 11/08/17 13:57, Tomi Valkeinen wrote:
>>
>>> I'm doing some testing with this series on my panda. One issue I see is
>>> that when I unload the display modules, I get:
>>>
>>> [   75.180206] platform 58006000.encoder: enabled after unload, idling
>>> [   75.187896] platform 58001000.dispc: enabled after unload, idling
>>> [   75.198242] platform 5800.dss: enabled after unload, idling
>>
>> This one is caused by hdmi_cec_adap_enable() never getting called with
>> enable=false when unloading the modules. Should that be called
>> explicitly in hdmi4_cec_uninit, or is the CEC framework supposed to call it?
> 
> Nicely found!
> 
> The cec_delete_adapter() function calls 
> __cec_s_phys_addr(CEC_PHYS_ADDR_INVALID)
> which would normally call adap_enable(false), except when the device node was
> already unregistered, in which case it just returns immediately.
> 
> The patch below should fix this. Let me know if it works, and I'll post a 
> proper
> patch and get that in for 4.14 (and possible backported as well, I'll have to
> look at that).

Thanks, this fixes the issue.

I again saw "HDMICORE: omapdss HDMICORE error: operation stopped when
reading edid" when I loaded the modules. My panda also froze just now
when unloading the display modules, and it doesn't react to sysrq.

After testing a bit without the CEC patches, I saw the above error, so I
don't think it's related to your patches.

I can't test with a TV, so no CEC for me... But otherwise I think the
series works ok now, and looks ok. So I'll apply, but it's a bit late
for the next merge window, so I'll aim for 4.15 with this.

 Tomi



Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-08-18 Thread Hans Verkuil
On 08/18/17 11:02, Tomi Valkeinen wrote:
> Hi Hans,
> 
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> On 11/08/17 13:57, Tomi Valkeinen wrote:
> 
>> I'm doing some testing with this series on my panda. One issue I see is
>> that when I unload the display modules, I get:
>>
>> [   75.180206] platform 58006000.encoder: enabled after unload, idling
>> [   75.187896] platform 58001000.dispc: enabled after unload, idling
>> [   75.198242] platform 5800.dss: enabled after unload, idling
> 
> This one is caused by hdmi_cec_adap_enable() never getting called with
> enable=false when unloading the modules. Should that be called
> explicitly in hdmi4_cec_uninit, or is the CEC framework supposed to call it?

Nicely found!

The cec_delete_adapter() function calls __cec_s_phys_addr(CEC_PHYS_ADDR_INVALID)
which would normally call adap_enable(false), except when the device node was
already unregistered, in which case it just returns immediately.

The patch below should fix this. Let me know if it works, and I'll post a proper
patch and get that in for 4.14 (and possible backported as well, I'll have to
look at that).

Regards,

Hans

Signed-off-by: Hans Verkuil 
---
diff --git a/drivers/media/cec/cec-adap.c b/drivers/media/cec/cec-adap.c
index bf45977b2823..61dffe165565 100644
--- a/drivers/media/cec/cec-adap.c
+++ b/drivers/media/cec/cec-adap.c
@@ -1390,7 +1390,9 @@ static void cec_claim_log_addrs(struct cec_adapter *adap, 
bool block)
  */
 void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block)
 {
-   if (phys_addr == adap->phys_addr || adap->devnode.unregistered)
+   if (phys_addr == adap->phys_addr)
+   return;
+   if (phys_addr != CEC_PHYS_ADDR_INVALID && adap->devnode.unregistered)
return;

dprintk(1, "new physical address %x.%x.%x.%x\n",


Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-08-18 Thread Tomi Valkeinen
Hi Hans,


Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

On 11/08/17 13:57, Tomi Valkeinen wrote:

> I'm doing some testing with this series on my panda. One issue I see is
> that when I unload the display modules, I get:
> 
> [   75.180206] platform 58006000.encoder: enabled after unload, idling
> [   75.187896] platform 58001000.dispc: enabled after unload, idling
> [   75.198242] platform 5800.dss: enabled after unload, idling

This one is caused by hdmi_cec_adap_enable() never getting called with
enable=false when unloading the modules. Should that be called
explicitly in hdmi4_cec_uninit, or is the CEC framework supposed to call it?

 Tomi



Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-08-17 Thread Hans Verkuil
On 08/17/17 15:03, Tomi Valkeinen wrote:
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> On 11/08/17 13:57, Tomi Valkeinen wrote:
>> Hi Hans,
>>
>> On 02/08/17 11:53, Hans Verkuil wrote:
>>> From: Hans Verkuil 
>>>
>>> This patch series adds CEC support for the omap4. It is based on
>>> the 4.13-rc2 kernel with this patch series applied:
>>>
>>> http://www.spinics.net/lists/dri-devel/msg143440.html
>>>
>>> It is virtually identical to the first patch series posted in
>>> April:
>>>
>>> http://www.spinics.net/lists/dri-devel/msg138950.html
>>>
>>> The only two changes are in the Kconfig due to CEC Kconfig
>>> changes in 4.13 (it now selects CEC_CORE instead of depending on
>>> CEC_CORE) and a final patch was added adding a lost_hotplug op
>>> since for proper CEC support I have to know when the hotplug
>>> signal goes away.
>>>
>>> Tested with my Pandaboard.
>>
>> I'm doing some testing with this series on my panda. One issue I see is
>> that when I unload the display modules, I get:
>>
>> [   75.180206] platform 58006000.encoder: enabled after unload, idling
>> [   75.187896] platform 58001000.dispc: enabled after unload, idling
>> [   75.198242] platform 5800.dss: enabled after unload, idling
>>
>> So I think something is left enabled, most likely in the HDMI driver. I
>> haven't debugged this yet.
>>
>> The first time I loaded the modules I also got "operation stopped when
>> reading edid", but I haven't seen that since. Possibly not related to
>> this series.
> 
> Sorry that I have had very little time to debug this. I rebased the cec code
> on top of the latest omapdrm patches, and tested on AM5 EVM (which is more or
> less equivalent to OMAP5 on the HDMI front). I get the following crash when
> I turn on my monitor, which causes a HPD irq.

I see the issue: in drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c,
tpd_detect() this line:

if (!connected)

should be:

if (!connected && in->ops.hdmi->lost_hotplug)

I did that correctly in connector-hdmi.c, but not in encoder-tpd12s015.c.
And since omap5 doesn't fill in lost_hotplug this crashes.

I'll make a v3 of that patch.

Regards,

Hans

> I'll continue looking at this as soon as I again find time, but I thought I'll
> share what I have at the moment. I've pushed the branch to:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git 4.14/omapdrm-cec
> 
>  Tomi
> 
> [   34.640159] Unable to handle kernel NULL pointer dereference at virtual 
> address 
> [   34.648449] pgd = c0004000
> [   34.651249] [] *pgd=
> [   34.654921] Internal error: Oops: 8007 [#1] PREEMPT SMP ARM
> [   34.660879] Modules linked in: omapdrm drm_kms_helper drm connector_dvi 
> panel_dsi_cm panel_dpi connector_analog_tv connector_hdmi encode
> r_tpd12s015 encoder_tfp410 omapdss omapdss_base snd_soc_omap_hdmi_audio cec 
> cfbfillrect cfbimgblt cfbcopyarea [last unloaded: omapdss_base]
> [   34.685482] CPU: 0 PID: 264 Comm: irq/248-tpd12s0 Not tainted 
> 4.13.0-rc5-00626-gbf51300abae9 #99
> [   34.694314] Hardware name: Generic DRA74X (Flattened Device Tree)
> [   34.700442] task: ed108140 task.stack: ed19
> [   34.705002] PC is at 0x0
> [   34.707561] LR is at tpd_detect+0x3c/0x44 [encoder_tpd12s015]
> [   34.713340] pc : [<>]lr : []psr: 600c0013
> [   34.719642] sp : ed191ee8  ip : ed191e68  fp : ed191efc
> [   34.724897] r10: 0001  r9 : ee2e0200  r8 : c01b45c8
> [   34.730153] r7 : ed10b064  r6 :   r5 : bf1d716c  r4 : 
> [   34.736716] r3 :   r2 :   r1 :   r0 : bf1d716c
> [   34.743283] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment 
> none
> [   34.750458] Control: 10c5387d  Table: ad26406a  DAC: 0051
> [   34.756236] Process irq/248-tpd12s0 (pid: 264, stack limit = 0xed190218)
> [   34.762976] Stack: (0xed191ee8 to 0xed192000)
> [   34.767363] 1ee0:   ed27e610 ed27e6d4 ed191f14 ed191f00 
> bf200388 bf200310
> [   34.775587] 1f00: ed10b040 ee2e0200 ed191f34 ed191f18 c01b433c bf200354 
> ed19 0001
> [   34.783812] 1f20:  ed10b064 ed191f74 ed191f38 c01b4660 c01b4324 
> c01b4318 ed10b040
> [   34.792036] 1f40:  c01b4418 ed191f74 ed1ebc80  ed392500 
> ed19 ed10b040
> [   34.800261] 1f60: ed1ebcb8 ed24fb08 ed191fac ed191f78 c0163e60 c01b4504 
>  c01b44f8
> [   34.808486] 1f80: ed191fac ed392500 c0163d30    
>  
> [   34.816710] 1fa0:  ed191fb0 c0108af0 c0163d3c   
>  
> [   34.824934] 1fc0:       
>  
> [   34.833157] 1fe0:     0013  
>  
> [   34.841376] Backtrace: 
> [   34.843861] [] (tpd_detect [encoder_tpd12s015]) from 
> [] (tpd_hpd_isr+0x40/0x68 

Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-08-17 Thread Tomi Valkeinen

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

On 11/08/17 13:57, Tomi Valkeinen wrote:
> Hi Hans,
> 
> On 02/08/17 11:53, Hans Verkuil wrote:
>> From: Hans Verkuil 
>>
>> This patch series adds CEC support for the omap4. It is based on
>> the 4.13-rc2 kernel with this patch series applied:
>>
>> http://www.spinics.net/lists/dri-devel/msg143440.html
>>
>> It is virtually identical to the first patch series posted in
>> April:
>>
>> http://www.spinics.net/lists/dri-devel/msg138950.html
>>
>> The only two changes are in the Kconfig due to CEC Kconfig
>> changes in 4.13 (it now selects CEC_CORE instead of depending on
>> CEC_CORE) and a final patch was added adding a lost_hotplug op
>> since for proper CEC support I have to know when the hotplug
>> signal goes away.
>>
>> Tested with my Pandaboard.
> 
> I'm doing some testing with this series on my panda. One issue I see is
> that when I unload the display modules, I get:
> 
> [   75.180206] platform 58006000.encoder: enabled after unload, idling
> [   75.187896] platform 58001000.dispc: enabled after unload, idling
> [   75.198242] platform 5800.dss: enabled after unload, idling
> 
> So I think something is left enabled, most likely in the HDMI driver. I
> haven't debugged this yet.
> 
> The first time I loaded the modules I also got "operation stopped when
> reading edid", but I haven't seen that since. Possibly not related to
> this series.

Sorry that I have had very little time to debug this. I rebased the cec code
on top of the latest omapdrm patches, and tested on AM5 EVM (which is more or
less equivalent to OMAP5 on the HDMI front). I get the following crash when
I turn on my monitor, which causes a HPD irq.

I'll continue looking at this as soon as I again find time, but I thought I'll
share what I have at the moment. I've pushed the branch to:

git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git 4.14/omapdrm-cec

 Tomi

[   34.640159] Unable to handle kernel NULL pointer dereference at virtual 
address 
[   34.648449] pgd = c0004000
[   34.651249] [] *pgd=
[   34.654921] Internal error: Oops: 8007 [#1] PREEMPT SMP ARM
[   34.660879] Modules linked in: omapdrm drm_kms_helper drm connector_dvi 
panel_dsi_cm panel_dpi connector_analog_tv connector_hdmi encode
r_tpd12s015 encoder_tfp410 omapdss omapdss_base snd_soc_omap_hdmi_audio cec 
cfbfillrect cfbimgblt cfbcopyarea [last unloaded: omapdss_base]
[   34.685482] CPU: 0 PID: 264 Comm: irq/248-tpd12s0 Not tainted 
4.13.0-rc5-00626-gbf51300abae9 #99
[   34.694314] Hardware name: Generic DRA74X (Flattened Device Tree)
[   34.700442] task: ed108140 task.stack: ed19
[   34.705002] PC is at 0x0
[   34.707561] LR is at tpd_detect+0x3c/0x44 [encoder_tpd12s015]
[   34.713340] pc : [<>]lr : []psr: 600c0013
[   34.719642] sp : ed191ee8  ip : ed191e68  fp : ed191efc
[   34.724897] r10: 0001  r9 : ee2e0200  r8 : c01b45c8
[   34.730153] r7 : ed10b064  r6 :   r5 : bf1d716c  r4 : 
[   34.736716] r3 :   r2 :   r1 :   r0 : bf1d716c
[   34.743283] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   34.750458] Control: 10c5387d  Table: ad26406a  DAC: 0051
[   34.756236] Process irq/248-tpd12s0 (pid: 264, stack limit = 0xed190218)
[   34.762976] Stack: (0xed191ee8 to 0xed192000)
[   34.767363] 1ee0:   ed27e610 ed27e6d4 ed191f14 ed191f00 
bf200388 bf200310
[   34.775587] 1f00: ed10b040 ee2e0200 ed191f34 ed191f18 c01b433c bf200354 
ed19 0001
[   34.783812] 1f20:  ed10b064 ed191f74 ed191f38 c01b4660 c01b4324 
c01b4318 ed10b040
[   34.792036] 1f40:  c01b4418 ed191f74 ed1ebc80  ed392500 
ed19 ed10b040
[   34.800261] 1f60: ed1ebcb8 ed24fb08 ed191fac ed191f78 c0163e60 c01b4504 
 c01b44f8
[   34.808486] 1f80: ed191fac ed392500 c0163d30    
 
[   34.816710] 1fa0:  ed191fb0 c0108af0 c0163d3c   
 
[   34.824934] 1fc0:       
 
[   34.833157] 1fe0:     0013  
 
[   34.841376] Backtrace: 
[   34.843861] [] (tpd_detect [encoder_tpd12s015]) from [] 
(tpd_hpd_isr+0x40/0x68 [encoder_tpd12s015])
[   34.854701]  r5:ed27e6d4 r4:ed27e610
[   34.858310] [] (tpd_hpd_isr [encoder_tpd12s015]) from [] 
(irq_thread_fn+0x24/0x5c)
[   34.867667]  r5:ee2e0200 r4:ed10b040
[   34.871270] [] (irq_thread_fn) from [] 
(irq_thread+0x168/0x254)
[   34.878970]  r7:ed10b064 r6: r5:0001 r4:ed19
[   34.884670] [] (irq_thread) from [] (kthread+0x130/0x174)
[   34.891847]  r10:ed24fb08 r9:ed1ebcb8 r8:ed10b040 r7:ed19 r6:ed392500 
r5:
[   34.899719]  r4:ed1ebc80
[   34.902280] [] (kthread) from [] 
(ret_from_fork+0x14/0x24)
[   34.909544]  

Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-08-12 Thread Hans Verkuil
On 11/08/17 12:57, Tomi Valkeinen wrote:
> Hi Hans,
> 
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> On 02/08/17 11:53, Hans Verkuil wrote:
>> From: Hans Verkuil 
>>
>> This patch series adds CEC support for the omap4. It is based on
>> the 4.13-rc2 kernel with this patch series applied:
>>
>> http://www.spinics.net/lists/dri-devel/msg143440.html
>>
>> It is virtually identical to the first patch series posted in
>> April:
>>
>> http://www.spinics.net/lists/dri-devel/msg138950.html
>>
>> The only two changes are in the Kconfig due to CEC Kconfig
>> changes in 4.13 (it now selects CEC_CORE instead of depending on
>> CEC_CORE) and a final patch was added adding a lost_hotplug op
>> since for proper CEC support I have to know when the hotplug
>> signal goes away.
>>
>> Tested with my Pandaboard.
> 
> I'm doing some testing with this series on my panda. One issue I see is
> that when I unload the display modules, I get:
> 
> [   75.180206] platform 58006000.encoder: enabled after unload, idling
> [   75.187896] platform 58001000.dispc: enabled after unload, idling
> [   75.198242] platform 5800.dss: enabled after unload, idling
> 
> So I think something is left enabled, most likely in the HDMI driver. I
> haven't debugged this yet.
> 
> The first time I loaded the modules I also got "operation stopped when
> reading edid", but I haven't seen that since. Possibly not related to
> this series.
> 
> Are there some simple ways to test the CEC? My buildroot fs has
> cec-compliance, cec-ctl and cec-follower commands. Are you familiar with
> those? Can they be used?

I'm very familiar with them since I wrote them :-)

The latest version of those utilities are maintained here:

https://git.linuxtv.org/v4l-utils.git/

But the ones from buildroot should be fine.

To use:

cec-ctl --playback  # configure the CEC adapter as a playback device
cec-ctl -S  # Detect and show all CEC devices

Note: all cec utilities use /dev/cec0 as the default device node. Use the
-d option to specify another device node.

So assuming you have the panda connected to a CEC-capable TV you should see
the TV in that list.

You can use cec-compliance to check the CEC compliance of devices:

cec-ctl --playback
cec-follower# emulate a CEC playback device follower functionality

In another shell run:

cec-compliance -r0  # Test remote CEC device with logical address 0 (== TV)

Regards,

Hans


Re: [PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-08-11 Thread Tomi Valkeinen
Hi Hans,


Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. 
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

On 02/08/17 11:53, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> This patch series adds CEC support for the omap4. It is based on
> the 4.13-rc2 kernel with this patch series applied:
> 
> http://www.spinics.net/lists/dri-devel/msg143440.html
> 
> It is virtually identical to the first patch series posted in
> April:
> 
> http://www.spinics.net/lists/dri-devel/msg138950.html
> 
> The only two changes are in the Kconfig due to CEC Kconfig
> changes in 4.13 (it now selects CEC_CORE instead of depending on
> CEC_CORE) and a final patch was added adding a lost_hotplug op
> since for proper CEC support I have to know when the hotplug
> signal goes away.
> 
> Tested with my Pandaboard.

I'm doing some testing with this series on my panda. One issue I see is
that when I unload the display modules, I get:

[   75.180206] platform 58006000.encoder: enabled after unload, idling
[   75.187896] platform 58001000.dispc: enabled after unload, idling
[   75.198242] platform 5800.dss: enabled after unload, idling

So I think something is left enabled, most likely in the HDMI driver. I
haven't debugged this yet.

The first time I loaded the modules I also got "operation stopped when
reading edid", but I haven't seen that since. Possibly not related to
this series.

Are there some simple ways to test the CEC? My buildroot fs has
cec-compliance, cec-ctl and cec-follower commands. Are you familiar with
those? Can they be used?

 Tomi



[PATCHv2 0/9] omapdrm: hdmi4: add CEC support

2017-08-02 Thread Hans Verkuil
From: Hans Verkuil 

This patch series adds CEC support for the omap4. It is based on
the 4.13-rc2 kernel with this patch series applied:

http://www.spinics.net/lists/dri-devel/msg143440.html

It is virtually identical to the first patch series posted in
April:

http://www.spinics.net/lists/dri-devel/msg138950.html

The only two changes are in the Kconfig due to CEC Kconfig
changes in 4.13 (it now selects CEC_CORE instead of depending on
CEC_CORE) and a final patch was added adding a lost_hotplug op
since for proper CEC support I have to know when the hotplug
signal goes away.

Tested with my Pandaboard.

The lost_hotplug op is called only when the hotplug is lost,
but I am happy to change it to an op that is called whenever
the hotplug signal changes. Just let me know. I just implemented
the minimal solution that I needed.

Regards,

Hans

Hans Verkuil (9):
  omapdrm: encoder-tpd12s015: keep ls_oe_gpio high
  omapdrm: hdmi.h: extend hdmi_core_data with CEC fields
  omapdrm: hdmi4: make low-level functions available
  omapdrm: hdmi4: prepare irq handling for HDMI CEC support
  omapdrm: hdmi4: move hdmi4_core_powerdown_disable to
hdmi_power_on_core()
  omapdrm: hdmi4: refcount hdmi_power_on/off_core
  omapdrm: hdmi4_cec: add OMAP4 HDMI CEC support
  omapdrm: hdmi4: hook up the HDMI CEC support
  omapdrm: omapdss_hdmi_ops: add lost_hotplug op

 drivers/gpu/drm/omapdrm/displays/connector-hdmi.c  |   8 +-
 .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c   |  18 +-
 drivers/gpu/drm/omapdrm/dss/Kconfig|   8 +
 drivers/gpu/drm/omapdrm/dss/Makefile   |   1 +
 drivers/gpu/drm/omapdrm/dss/hdmi.h |   6 +-
 drivers/gpu/drm/omapdrm/dss/hdmi4.c|  62 +++-
 drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c| 381 +
 drivers/gpu/drm/omapdrm/dss/hdmi4_cec.h|  55 +++
 drivers/gpu/drm/omapdrm/dss/hdmi4_core.c   |   7 +-
 drivers/gpu/drm/omapdrm/dss/hdmi4_core.h   |   4 +
 drivers/gpu/drm/omapdrm/dss/omapdss.h  |   1 +
 11 files changed, 521 insertions(+), 30 deletions(-)
 create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c
 create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi4_cec.h

-- 
2.13.2