Re: drm/tilcdc: LCD panels clocks initialization and earlier backlight initialization

2013-04-02 Thread Rob Clark
On Tue, Apr 2, 2013 at 4:45 AM, Michal Bachraty
michal.bachr...@streamunlimited.com wrote:
 Hi Rob,

 On Monday, April 01, 2013 09:46:05 Rob Clark wrote:
 On Mon, Apr 1, 2013 at 7:31 AM, Hiremath, Vaibhav hvaib...@ti.com wrote:
  -Original Message-
  From: devicetree-discuss [mailto:devicetree-discuss-
  bounces+hvaibhav=ti@lists.ozlabs.org] On Behalf Of Michal Bachraty
  Sent: Thursday, March 28, 2013 11:02 PM
  To: dri-devel@lists.freedesktop.org; devicetree-
  disc...@lists.ozlabs.org
  Cc: robdcl...@gmail.com; k...@dominion.thruhere.net
  Subject: drm/tilcdc: LCD panels clocks initialization and earlier
  backlight initialization
 
  Hi,
 
  I'm trying to use tilcdc driver for KWH050TG08 LCD panel connected to
  AM335x
  processor (3.9 rc1 kernel). I have prepared DT bindings for that
  (listed
  bellow). I see fb0 device but I have no clocks going from cpu to LCD.
  My
  clocks for LCD seems not properly to be set ...
 
  virt_2500_ck   1   12500
 
  sys_clkin_ck8   19   2500
 
 dpll_disp_ck 0   12500
 
dpll_disp_m2_ck   0   12500
 
   lcd_gclk   0   12500
 
  and tilcdc_crtc is not called. I also set lcd_gclk to 300MHz, but I got
  same
  result. The question is there any way how to properly set clocks for
  LCD?
 
  Not sure  about the LCDC DRM driver, but I just tested clk_set_rate()
  For lcdc_gclk clock and it is working for me. I could able to set
  300MHz freq on my BeagleBone platform, with below code -

 fwiw, tilcdc drm driver won't set clocks until you do modeset, as it
 is setting them based on the requested pixel clock.  As opposed to
 setting it once at boot time.

 Michal, you may want to add 'drm.debug=7' in your bootargs, and send
 the bootlog.  That should set some light about whether it is even
 trying to modeset but failing, or some other issue.


 Yes, here it is:

Hmm, looks like tilcdc_crtc_update_clk() is not getting called.. and
in fact either tilcdc_crtc_mode_set() is not called or bails out early
(maybe _mode_valid() falis?)

I'd perhaps throw a few traces in tilcdc_crtc_mode_set() and see why
that is bailing out..

BR,
-R



 [3.098732] platform audio.11: Driver snd-soc-am33xx-s800 requests probe
 deferral
 [ 3.107280] TCP: cubic registered
 [3.110822] Initializing XFRM netlink socket
 [3.115844] NET: Registered protocol family 10
 [3.123212] NET: Registered protocol family 17
 [3.128064] NET: Registered protocol family 15
 [3.133176] Key type dns_resolver registered
 [3.137846] VFP support v0.3: implementor 41 architecture 3 part 30 variant
 c rev 3
 [3.146087] ThumbEE CPU extension supported.
 [3.150659] Registering SWP/SWPB emulation handler
 [3.160695] registered taskstats version 1
 [3.166007] [drm:tilcdc_drm_init], init
 [3.171117] pinctrl core: add 1 pinmux maps
 [3.175564] pinctrl-single 44e10800.pinmux: found group selector 6 for
 pinmux_lcd_pins
 [3.183957] pinctrl-single 44e10800.pinmux: request pin 59 (44e108ec) for
 lcd_panel.15
 [3.192312] pinctrl-single 44e10800.pinmux: request pin 57 (44e108e4) for
 lcd_panel.15
 [3.200662] pinctrl-single 44e10800.pinmux: request pin 56 (44e108e0) for
 lcd_panel.15
 [3.209010] pinctrl-single 44e10800.pinmux: request pin 58 (44e108e8) for
 lcd_panel.15
 [3.217321] pinctrl-single 44e10800.pinmux: request pin 55 (44e108dc) for
 lcd_panel.15
 [3.225666] pinctrl-single 44e10800.pinmux: request pin 54 (44e108d8) for
 lcd_panel.15
 [3.234012] pinctrl-single 44e10800.pinmux: request pin 53 (44e108d4) for
 lcd_panel.15
 [3.242359] pinctrl-single 44e10800.pinmux: request pin 52 (44e108d0) for
 lcd_panel.15
 [3.250708] pinctrl-single 44e10800.pinmux: request pin 51 (44e108cc) for
 lcd_panel.15
 [3.259052] pinctrl-single 44e10800.pinmux: request pin 50 (44e108c8) for
 lcd_panel.15
 [3.267362] pinctrl-single 44e10800.pinmux: request pin 49 (44e108c4) for
 lcd_panel.15
 [3.275710] pinctrl-single 44e10800.pinmux: request pin 48 (44e108c0) for
 lcd_panel.15
 [3.284057] pinctrl-single 44e10800.pinmux: request pin 47 (44e108bc) for
 lcd_panel.15
 [3.292404] pinctrl-single 44e10800.pinmux: request pin 46 (44e108b8) for
 lcd_panel.15
 [3.300748] pinctrl-single 44e10800.pinmux: request pin 45 (44e108b4) for
 lcd_panel.15
 [3.309091] pinctrl-single 44e10800.pinmux: request pin 44 (44e108b0) for
 lcd_panel.15
 [3.317404] pinctrl-single 44e10800.pinmux: request pin 43 (44e108ac) for
 lcd_panel.15
 [3.325751] pinctrl-single 44e10800.pinmux: request pin 42 (44e108a8) for
 lcd_panel.15
 [3.334098] pinctrl-single 44e10800.pinmux: request pin 41 (44e108a4) for
 lcd_panel.15
 [3.342445] pinctrl-single 44e10800.pinmux: request pin 40 (44e108a0) for
 lcd_panel.15
 [3.350794] pinctrl-single 44e10800.pinmux: 

Re: drm/tilcdc: LCD panels clocks initialization and earlier backlight initialization

2013-04-02 Thread Michal Bachraty
Hi Rob,

On Monday, April 01, 2013 09:46:05 Rob Clark wrote:
 On Mon, Apr 1, 2013 at 7:31 AM, Hiremath, Vaibhav hvaib...@ti.com wrote:
  -Original Message-
  From: devicetree-discuss [mailto:devicetree-discuss-
  bounces+hvaibhav=ti@lists.ozlabs.org] On Behalf Of Michal Bachraty
  Sent: Thursday, March 28, 2013 11:02 PM
  To: dri-devel@lists.freedesktop.org; devicetree-
  disc...@lists.ozlabs.org
  Cc: robdcl...@gmail.com; k...@dominion.thruhere.net
  Subject: drm/tilcdc: LCD panels clocks initialization and earlier
  backlight initialization
  
  Hi,
  
  I'm trying to use tilcdc driver for KWH050TG08 LCD panel connected to
  AM335x
  processor (3.9 rc1 kernel). I have prepared DT bindings for that
  (listed
  bellow). I see fb0 device but I have no clocks going from cpu to LCD.
  My
  clocks for LCD seems not properly to be set ...
  
  virt_2500_ck   1   12500
  
  sys_clkin_ck8   19   2500
  
 dpll_disp_ck 0   12500
 
dpll_disp_m2_ck   0   12500

   lcd_gclk   0   12500
  
  and tilcdc_crtc is not called. I also set lcd_gclk to 300MHz, but I got
  same
  result. The question is there any way how to properly set clocks for
  LCD?
  
  Not sure  about the LCDC DRM driver, but I just tested clk_set_rate()
  For lcdc_gclk clock and it is working for me. I could able to set
  300MHz freq on my BeagleBone platform, with below code -
 
 fwiw, tilcdc drm driver won't set clocks until you do modeset, as it
 is setting them based on the requested pixel clock.  As opposed to
 setting it once at boot time.
 
 Michal, you may want to add 'drm.debug=7' in your bootargs, and send
 the bootlog.  That should set some light about whether it is even
 trying to modeset but failing, or some other issue.
 

Yes, here it is:

[3.098732] platform audio.11: Driver snd-soc-am33xx-s800 requests probe 
deferral
[3.107280] TCP: cubic registered
[3.110822] Initializing XFRM netlink socket
[3.115844] NET: Registered protocol family 10
[3.123212] NET: Registered protocol family 17
[3.128064] NET: Registered protocol family 15
[3.133176] Key type dns_resolver registered
[3.137846] VFP support v0.3: implementor 41 architecture 3 part 30 variant 
c rev 3
[3.146087] ThumbEE CPU extension supported.
[3.150659] Registering SWP/SWPB emulation handler
[3.160695] registered taskstats version 1
[3.166007] [drm:tilcdc_drm_init], init
[3.171117] pinctrl core: add 1 pinmux maps
[3.175564] pinctrl-single 44e10800.pinmux: found group selector 6 for 
pinmux_lcd_pins
[3.183957] pinctrl-single 44e10800.pinmux: request pin 59 (44e108ec) for 
lcd_panel.15
[3.192312] pinctrl-single 44e10800.pinmux: request pin 57 (44e108e4) for 
lcd_panel.15
[3.200662] pinctrl-single 44e10800.pinmux: request pin 56 (44e108e0) for 
lcd_panel.15
[3.209010] pinctrl-single 44e10800.pinmux: request pin 58 (44e108e8) for 
lcd_panel.15
[3.217321] pinctrl-single 44e10800.pinmux: request pin 55 (44e108dc) for 
lcd_panel.15
[3.225666] pinctrl-single 44e10800.pinmux: request pin 54 (44e108d8) for 
lcd_panel.15
[3.234012] pinctrl-single 44e10800.pinmux: request pin 53 (44e108d4) for 
lcd_panel.15
[3.242359] pinctrl-single 44e10800.pinmux: request pin 52 (44e108d0) for 
lcd_panel.15
[3.250708] pinctrl-single 44e10800.pinmux: request pin 51 (44e108cc) for 
lcd_panel.15
[3.259052] pinctrl-single 44e10800.pinmux: request pin 50 (44e108c8) for 
lcd_panel.15
[3.267362] pinctrl-single 44e10800.pinmux: request pin 49 (44e108c4) for 
lcd_panel.15
[3.275710] pinctrl-single 44e10800.pinmux: request pin 48 (44e108c0) for 
lcd_panel.15
[3.284057] pinctrl-single 44e10800.pinmux: request pin 47 (44e108bc) for 
lcd_panel.15
[3.292404] pinctrl-single 44e10800.pinmux: request pin 46 (44e108b8) for 
lcd_panel.15
[3.300748] pinctrl-single 44e10800.pinmux: request pin 45 (44e108b4) for 
lcd_panel.15
[3.309091] pinctrl-single 44e10800.pinmux: request pin 44 (44e108b0) for 
lcd_panel.15
[3.317404] pinctrl-single 44e10800.pinmux: request pin 43 (44e108ac) for 
lcd_panel.15
[3.325751] pinctrl-single 44e10800.pinmux: request pin 42 (44e108a8) for 
lcd_panel.15
[3.334098] pinctrl-single 44e10800.pinmux: request pin 41 (44e108a4) for 
lcd_panel.15
[3.342445] pinctrl-single 44e10800.pinmux: request pin 40 (44e108a0) for 
lcd_panel.15
[3.350794] pinctrl-single 44e10800.pinmux: enabling pinmux_lcd_pins 
function6
[3.358477] panel lcd_panel.15: obtain a copy of previously claimed pinctrl
[3.366365] [drm:drm_platform_init], 
[3.370270] [drm:drm_get_platform_dev], 
[3.374940] [drm:drm_get_minor], 
[3.381143] [drm:drm_get_minor], new minor assigned 64
[3.386558] [drm:drm_get_minor], 
[3.391333] 

Re: drm/tilcdc: LCD panels clocks initialization and earlier backlight initialization

2013-04-01 Thread Rob Clark
On Mon, Apr 1, 2013 at 7:31 AM, Hiremath, Vaibhav hvaib...@ti.com wrote:

 -Original Message-
 From: devicetree-discuss [mailto:devicetree-discuss-
 bounces+hvaibhav=ti@lists.ozlabs.org] On Behalf Of Michal Bachraty
 Sent: Thursday, March 28, 2013 11:02 PM
 To: dri-devel@lists.freedesktop.org; devicetree-
 disc...@lists.ozlabs.org
 Cc: robdcl...@gmail.com; k...@dominion.thruhere.net
 Subject: drm/tilcdc: LCD panels clocks initialization and earlier
 backlight initialization

 Hi,

 I'm trying to use tilcdc driver for KWH050TG08 LCD panel connected to
 AM335x
 processor (3.9 rc1 kernel). I have prepared DT bindings for that
 (listed
 bellow). I see fb0 device but I have no clocks going from cpu to LCD.
 My
 clocks for LCD seems not properly to be set ...

 virt_2500_ck   1   12500
 sys_clkin_ck8   19   2500
dpll_disp_ck 0   12500
   dpll_disp_m2_ck   0   12500
  lcd_gclk   0   12500

 and tilcdc_crtc is not called. I also set lcd_gclk to 300MHz, but I got
 same
 result. The question is there any way how to properly set clocks for
 LCD?

 Not sure  about the LCDC DRM driver, but I just tested clk_set_rate()
 For lcdc_gclk clock and it is working for me. I could able to set
 300MHz freq on my BeagleBone platform, with below code -


fwiw, tilcdc drm driver won't set clocks until you do modeset, as it
is setting them based on the requested pixel clock.  As opposed to
setting it once at boot time.

Michal, you may want to add 'drm.debug=7' in your bootargs, and send
the bootlog.  That should set some light about whether it is even
trying to modeset but failing, or some other issue.

BR,
-R


 diff --git a/arch/arm/mach-omap2/board-generic.c 
 b/arch/arm/mach-omap2/board-generic.c
 index e54a480..443fb26 100644
 --- a/arch/arm/mach-omap2/board-generic.c
 +++ b/arch/arm/mach-omap2/board-generic.c
 @@ -11,6 +11,7 @@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 +#include linux/clk-private.h
  #include linux/io.h
  #include linux/of_irq.h
  #include linux/of_platform.h
 @@ -37,6 +38,8 @@ static struct of_device_id omap_dt_match_table[] __initdata 
 = {

  static void __init omap_generic_init(void)
  {
 +   struct clk *clk;
 +
 omap_sdrc_init(NULL, NULL);

 of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
 @@ -49,6 +52,15 @@ static void __init omap_generic_init(void)
 omap4_panda_display_init_of();
 else if (of_machine_is_compatible(ti,omap4-sdp))
 omap_4430sdp_display_init_of();
 +
 +   clk = clk_get(NULL, lcd_gclk);
 +   if (IS_ERR(clk))
 +   printk(Can not get lcd_gclk clock\n);
 +
 +   printk(%s:%d gclk_rate - %lu\n, __func__, __LINE__, 
 clk_get_rate(clk));
 +   clk_set_rate(clk, 3);
 +   printk(%s:%d clk_rate - %lu\n, __func__, __LINE__, 
 clk_get_rate(clk));
 +   clk_put(clk);
  }

  #ifdef CONFIG_SOC_OMAP2420


 Thanks,
 Vaibhav
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


RE: drm/tilcdc: LCD panels clocks initialization and earlier backlight initialization

2013-04-01 Thread Hiremath, Vaibhav

 -Original Message-
 From: devicetree-discuss [mailto:devicetree-discuss-
 bounces+hvaibhav=ti@lists.ozlabs.org] On Behalf Of Michal Bachraty
 Sent: Thursday, March 28, 2013 11:02 PM
 To: dri-devel@lists.freedesktop.org; devicetree-
 disc...@lists.ozlabs.org
 Cc: robdcl...@gmail.com; k...@dominion.thruhere.net
 Subject: drm/tilcdc: LCD panels clocks initialization and earlier
 backlight initialization
 
 Hi,
 
 I'm trying to use tilcdc driver for KWH050TG08 LCD panel connected to
 AM335x
 processor (3.9 rc1 kernel). I have prepared DT bindings for that
 (listed
 bellow). I see fb0 device but I have no clocks going from cpu to LCD.
 My
 clocks for LCD seems not properly to be set ...
 
 virt_2500_ck   1   12500
 sys_clkin_ck8   19   2500
dpll_disp_ck 0   12500
   dpll_disp_m2_ck   0   12500
  lcd_gclk   0   12500
 
 and tilcdc_crtc is not called. I also set lcd_gclk to 300MHz, but I got
 same
 result. The question is there any way how to properly set clocks for
 LCD?
 
Not sure  about the LCDC DRM driver, but I just tested clk_set_rate()
For lcdc_gclk clock and it is working for me. I could able to set
300MHz freq on my BeagleBone platform, with below code -


diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index e54a480..443fb26 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -11,6 +11,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include linux/clk-private.h
 #include linux/io.h
 #include linux/of_irq.h
 #include linux/of_platform.h
@@ -37,6 +38,8 @@ static struct of_device_id omap_dt_match_table[] __initdata = 
{

 static void __init omap_generic_init(void)
 {
+   struct clk *clk;
+
omap_sdrc_init(NULL, NULL);

of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
@@ -49,6 +52,15 @@ static void __init omap_generic_init(void)
omap4_panda_display_init_of();
else if (of_machine_is_compatible(ti,omap4-sdp))
omap_4430sdp_display_init_of();
+
+   clk = clk_get(NULL, lcd_gclk);
+   if (IS_ERR(clk))
+   printk(Can not get lcd_gclk clock\n);
+
+   printk(%s:%d gclk_rate - %lu\n, __func__, __LINE__, 
clk_get_rate(clk));
+   clk_set_rate(clk, 3);
+   printk(%s:%d clk_rate - %lu\n, __func__, __LINE__, clk_get_rate(clk));
+   clk_put(clk);
 }

 #ifdef CONFIG_SOC_OMAP2420


Thanks,
Vaibhav
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel