Re: OMAP3 dmtimer / pwm-bl flicker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 14, 2017 at 7:47 AM, Adam Ford <aford173@xxxxxxxxx> wrote:
> On Wed, Jun 14, 2017 at 6:16 AM, Tony Lindgren <tony@xxxxxxxxxxx> wrote:
>> * Adam Ford <aford173@xxxxxxxxx> [170614 03:53]:
>>> I have a DM3730 with the dmtimer (timer10) controlling the pwm
>>> backlight for my LCD.
>>>
>>> pwms = <&pwm10 0 5000000 0>;
>>> brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
>>> default-brightness-level = <7>;
>>>
>>> If I cat /dev/urandom > /dev/fb0 to setup a test pattern then start to
>>> change the brightness in user-space, there is a momentary flicker on
>>> the backlight when the backlight changes intensity.  Screens that are
>>> predominantly black are not as noticeable.
>>>
>>> We also have a Win CE implementation on the same board which does not
>>> do this, so I believe it to be software related and not hardware.  Has
>>> anyone else noticed this?  If so, might you have any suggestions to
>>> reducing this?  I checked 4.9.y and 4.11.y and both seem to exhibit
>>> the same behavior.  I don't have other pwm options, so I cannot
>>> determine if this is a problem with dmtimer or the pwm-bl driver.
>>
>> Maybe some issue changing the timer rate? Could it be that we're
>> missing stopping of the dmtimer in the pwm driver during the rate
>> change?
>>
>
> I think we do stop the timer during the chage.
>
> Looking at the code in pwm_omap_dmtimer_config:
>
> /*
> * We MUST stop the associated dual-mode timer before attempting to
> * write its registers, but calls to omap_dm_timer_start/stop must
> * be balanced so check if timer is active before calling timer_stop.
> */
> timer_active = pm_runtime_active(&omap->dm_timer_pdev->dev);
>
> if (timer_active)
> omap->pdata->stop(omap->dm_timer);
>
> [ Change a bunch of stuff]
>
> /* If config was called while timer was running it must be reenabled. */
> if (timer_active)
> pwm_omap_dmtimer_start(omap);
>
> I am wondering if we need to somehow sync the stop with the pwm when
> the duty cycle is in the off position so it doesn't stay on while we
> change the registers.  I am not really sure how to go about that. Some
> LED's may be active high while others are active low.
>

Reading the DM3730 Technical Reference manual, it reads:  The timer
counter register (GPTi.TCRR) can be loaded when stopped or on-the-fly
(while counting).

I removed the protection code (what shown above) around the changing
of the registers, and the flicker went away.  I am hoping Neil might
have some comment on this.   If removing this is deemed acceptable, I
can push a patch, but I don't want to arbitrarily assume it would
work.


> adam
>
>> Regards,
>>
>> Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux