msm: mdss: check cmd_pending before turning off the clocks

We currently send the commands for backlight update through sysfs nodes.
The implementation turns on the clocks for these nodes to allow command
update during ulps state. However, clk off does not wait for operation
complete. In loaded system, this can lead to crash if commands are not sent
within timeframe window.  This change holds the command pending status
before turning off the clock to make sure that clocks are available before
sending any command.

Bug: 15725268

Change-Id: I9baf0ca423f5a09088ac29e416857f244970d33c
4 files changed