diff mbox

omapdrm with n900

Message ID 7a0116a5-4d2f-0b6e-e2d0-4747d4488184@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Ujfalusi Jan. 27, 2017, 1:56 p.m. UTC
Tony,

On 01/26/2017 07:17 PM, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [170126 07:08]:
>> * Jarkko Nikula <jarkko.nikula@bitmer.com> [170126 00:47]:
>>> On Thu, Jan 26, 2017 at 09:39:52AM +0200, Tomi Valkeinen wrote:
>>>> On 25/01/17 19:50, Tony Lindgren wrote:
>>>>
>>>>>>> The LCD just stays blank with backlight off as soon as I load
>>>>>>> panel_sony_acx565akm.
>>>>>>
>>>>>> Can you share the kernel logs for both boards? I don't have neither
>>>>>> board, so I probably can't help too much here.
>>>>>
>>>>> Below are the relevant parts for both devices using v4.10-rc5.
>>>>
>>>> The logs look quite similar, and I don't see anything wrong there.
>>>>
>>>> Jarkko, you sent a patch for N900's panel a while ago, do you have the
>>>> LCD working with omapdrm?
>>>>
>>> Yes I have but after probing the panel there has to do blank-unblank
>>> cycle and I think setting the blacklight level too. I was going to check
>>> it when that regression happened but didn't find time to do it yet.
>>
>> I've tried these too, no luck. Maybe I'm using the wrong sequence.
>>
>> Could it be that some of the GPIOs get toggled the wrong way around?
> 
> Sorry Jarkko, you're right. This gets it working:
> 
> # modprobe tsc2005
> # modprobe panel_sony_acx565akm
> # modprobe omapdrm
> # echo 255 > /sys/class/backlight/acx565akm/brightness
> # echo 0 > /sys/class/graphics/fb0/blank
> # echo 1 > /sys/class/graphics/fb0/blank
> # echo 0 > /sys/class/graphics/fb0/blank
> 
> That extra blank/unblank cycle seems a bit user unfriendly?

most likely this will help:




- Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Peter Ujfalusi Jan. 27, 2017, 2:08 p.m. UTC | #1
On 01/27/2017 03:56 PM, Peter Ujfalusi wrote:
>> That extra blank/unblank cycle seems a bit user unfriendly?
> 
> most likely this will help:
> 
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> index 5ab39e0060f2..d5a21a96ea82 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> @@ -839,7 +839,7 @@ static int acx565akm_probe(struct spi_device *spi)
>  	bldev->props.max_brightness = max_brightness;
>  	bldev->props.brightness = brightness;
>  
> -	acx565akm_bl_update_status(bldev);
> +	backlight_update_status(bldev);

No, it will not. At the end they are going to do the same thing.
what does /sys/class/backlight/acx565akm/bl_power and brightness shows
right after the modprobes?

- Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren Jan. 27, 2017, 3:16 p.m. UTC | #2
* Peter Ujfalusi <peter.ujfalusi@ti.com> [170127 06:09]:
> On 01/27/2017 03:56 PM, Peter Ujfalusi wrote:
> >> That extra blank/unblank cycle seems a bit user unfriendly?
> > 
> > most likely this will help:
> > 
> > diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> > index 5ab39e0060f2..d5a21a96ea82 100644
> > --- a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> > +++ b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> > @@ -839,7 +839,7 @@ static int acx565akm_probe(struct spi_device *spi)
> >  	bldev->props.max_brightness = max_brightness;
> >  	bldev->props.brightness = brightness;
> >  
> > -	acx565akm_bl_update_status(bldev);
> > +	backlight_update_status(bldev);
> 
> No, it will not. At the end they are going to do the same thing.
> what does /sys/class/backlight/acx565akm/bl_power and brightness shows
> right after the modprobes?

OK, they are just 0:

# modprobe tsc2005
# modprobe panel_sony_acx565akm
...
# cat /sys/class/backlight/acx565akm/brightness
0
# cat /sys/class/backlight/acx565akm/bl_power
0
# modeprobe omapdrm
...
# cat /sys/class/backlight/acx565akm/brightness
0
# cat /sys/class/backlight/acx565akm/bl_power
0

Then not related to n900, but trying to rmmod omapdrm produces:

# rmmod omapdrm
rmmod: can't unload 'omapdrm': Resource temporarily unavailable

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomi Valkeinen Jan. 31, 2017, 1:37 p.m. UTC | #3
On 27/01/17 17:16, Tony Lindgren wrote:

> Then not related to n900, but trying to rmmod omapdrm produces:
> 
> # rmmod omapdrm
> rmmod: can't unload 'omapdrm': Resource temporarily unavailable

And you don't have any app running which uses DRM? Does lsmod show a ref
to omapdrm? 'cat debugfs/dri/0/clients' does not show anything?

I'm not sure if there are any other reasons why omapdrm would be busy.

 Tomi
Tony Lindgren Jan. 31, 2017, 3:30 p.m. UTC | #4
* Tomi Valkeinen <tomi.valkeinen@ti.com> [170131 05:38]:
> On 27/01/17 17:16, Tony Lindgren wrote:
> 
> > Then not related to n900, but trying to rmmod omapdrm produces:
> > 
> > # rmmod omapdrm
> > rmmod: can't unload 'omapdrm': Resource temporarily unavailable
> 
> And you don't have any app running which uses DRM? Does lsmod show a ref
> to omapdrm? 'cat debugfs/dri/0/clients' does not show anything?
> 
> I'm not sure if there are any other reasons why omapdrm would be busy.

Nothing there it seems:

# cat /sys/kernel/debug/dri/0/clients
             command   pid dev master a   uid      magic

Then lsmod output:

# lsmod | grep drm
omapdrm                65655  1
drm_kms_helper        147599  1 omapdrm
cfbfillrect             3614  1 drm_kms_helper
syscopyarea             3187  2 omapdrm,drm_kms_helper
cfbimgblt               2416  1 drm_kms_helper
sysfillrect             3550  2 omapdrm,drm_kms_helper
sysimgblt               2352  2 omapdrm,drm_kms_helper
fb_sys_fops             1767  2 omapdrm,drm_kms_helper
cfbcopyarea             3187  1 drm_kms_helper
drm                   334071  3 omapdrm,drm_kms_helper
omapdss               231881  3 omapdrm,panel_sony_acx565akm

No idea what is using omapdrm.. I have everything as loadable
modules, this for drm:

$ grep DRM .config | grep -v ^#
CONFIG_DRM=m
CONFIG_DRM_KMS_HELPER=m
CONFIG_DRM_KMS_FB_HELPER=y
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
CONFIG_DRM_OMAP=m
CONFIG_DRM_OMAP_NUM_CRTCS=2
CONFIG_DRM_OMAP_ENCODER_OPA362=m
CONFIG_DRM_OMAP_ENCODER_TFP410=m
CONFIG_DRM_OMAP_ENCODER_TPD12S015=m
CONFIG_DRM_OMAP_CONNECTOR_DVI=m
CONFIG_DRM_OMAP_CONNECTOR_HDMI=m
CONFIG_DRM_OMAP_CONNECTOR_ANALOG_TV=m
CONFIG_DRM_OMAP_PANEL_DPI=m
CONFIG_DRM_OMAP_PANEL_DSI_CM=m
CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM=m
CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02=m
CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01=m
CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1=m
CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1=m
CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11=m
CONFIG_DRM_BRIDGE=y

Regards,

Tony



--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomi Valkeinen Jan. 31, 2017, 3:50 p.m. UTC | #5
On 31/01/17 17:30, Tony Lindgren wrote:
> * Tomi Valkeinen <tomi.valkeinen@ti.com> [170131 05:38]:
>> On 27/01/17 17:16, Tony Lindgren wrote:
>>
>>> Then not related to n900, but trying to rmmod omapdrm produces:
>>>
>>> # rmmod omapdrm
>>> rmmod: can't unload 'omapdrm': Resource temporarily unavailable
>>
>> And you don't have any app running which uses DRM? Does lsmod show a ref
>> to omapdrm? 'cat debugfs/dri/0/clients' does not show anything?
>>
>> I'm not sure if there are any other reasons why omapdrm would be busy.
> 
> Nothing there it seems:
> 
> # cat /sys/kernel/debug/dri/0/clients
>              command   pid dev master a   uid      magic
> 
> Then lsmod output:
> 
> # lsmod | grep drm
> omapdrm                65655  1
> drm_kms_helper        147599  1 omapdrm
> cfbfillrect             3614  1 drm_kms_helper
> syscopyarea             3187  2 omapdrm,drm_kms_helper
> cfbimgblt               2416  1 drm_kms_helper
> sysfillrect             3550  2 omapdrm,drm_kms_helper
> sysimgblt               2352  2 omapdrm,drm_kms_helper
> fb_sys_fops             1767  2 omapdrm,drm_kms_helper
> cfbcopyarea             3187  1 drm_kms_helper
> drm                   334071  3 omapdrm,drm_kms_helper
> omapdss               231881  3 omapdrm,panel_sony_acx565akm
> 
> No idea what is using omapdrm.. I have everything as loadable
> modules, this for drm:
> 
> $ grep DRM .config | grep -v ^#
> CONFIG_DRM=m
> CONFIG_DRM_KMS_HELPER=m
> CONFIG_DRM_KMS_FB_HELPER=y
> CONFIG_DRM_FBDEV_EMULATION=y

Oh, right. You have fbdev enabled, and probably you have
CONFIG_FRAMEBUFFER_CONSOLE enabled. fbconsole takes a ref.

There are directions on how to unbind the console manually from the fb
in Documentation/fb/fbcon.txt.

I never have fbcon enabled, so it didn't occur to me right away...

 Tomi
Tony Lindgren Jan. 31, 2017, 4:16 p.m. UTC | #6
* Tomi Valkeinen <tomi.valkeinen@ti.com> [170131 07:51]:
> On 31/01/17 17:30, Tony Lindgren wrote:
> > * Tomi Valkeinen <tomi.valkeinen@ti.com> [170131 05:38]:
> >> On 27/01/17 17:16, Tony Lindgren wrote:
> >>
> >>> Then not related to n900, but trying to rmmod omapdrm produces:
> >>>
> >>> # rmmod omapdrm
> >>> rmmod: can't unload 'omapdrm': Resource temporarily unavailable
> >>
> >> And you don't have any app running which uses DRM? Does lsmod show a ref
> >> to omapdrm? 'cat debugfs/dri/0/clients' does not show anything?
> >>
> >> I'm not sure if there are any other reasons why omapdrm would be busy.
> > 
> > Nothing there it seems:
> > 
> > # cat /sys/kernel/debug/dri/0/clients
> >              command   pid dev master a   uid      magic
> > 
> > Then lsmod output:
> > 
> > # lsmod | grep drm
> > omapdrm                65655  1
> > drm_kms_helper        147599  1 omapdrm
> > cfbfillrect             3614  1 drm_kms_helper
> > syscopyarea             3187  2 omapdrm,drm_kms_helper
> > cfbimgblt               2416  1 drm_kms_helper
> > sysfillrect             3550  2 omapdrm,drm_kms_helper
> > sysimgblt               2352  2 omapdrm,drm_kms_helper
> > fb_sys_fops             1767  2 omapdrm,drm_kms_helper
> > cfbcopyarea             3187  1 drm_kms_helper
> > drm                   334071  3 omapdrm,drm_kms_helper
> > omapdss               231881  3 omapdrm,panel_sony_acx565akm
> > 
> > No idea what is using omapdrm.. I have everything as loadable
> > modules, this for drm:
> > 
> > $ grep DRM .config | grep -v ^#
> > CONFIG_DRM=m
> > CONFIG_DRM_KMS_HELPER=m
> > CONFIG_DRM_KMS_FB_HELPER=y
> > CONFIG_DRM_FBDEV_EMULATION=y
> 
> Oh, right. You have fbdev enabled, and probably you have
> CONFIG_FRAMEBUFFER_CONSOLE enabled. fbconsole takes a ref.
> 
> There are directions on how to unbind the console manually from the fb
> in Documentation/fb/fbcon.txt.
> 
> I never have fbcon enabled, so it didn't occur to me right away...

Oh OK yeah doing this allows rmmod omapdrm:

binds=$(ls /sys/class/vtconsole/*/bind)
for bind in $binds; do
	echo 0 > $bind
done

Thanks!

Tony


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
index 5ab39e0060f2..d5a21a96ea82 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
@@ -839,7 +839,7 @@  static int acx565akm_probe(struct spi_device *spi)
 	bldev->props.max_brightness = max_brightness;
 	bldev->props.brightness = brightness;
 
-	acx565akm_bl_update_status(bldev);
+	backlight_update_status(bldev);
 
 
 	ddata->vm = acx565akm_panel_vm;