Commit 2783a90d authored by spiiroin's avatar spiiroin

[display] Retry failing brightness adjustments. Fixes JB#47450

Display brightness control logic has been written with framebuffer
interface in mind and consequently devices utilizing drm/dri are
suffering from diagnostic logging noise from incorrectly timed
adjustment attempts and outright failures to set desired brightness.

Store desired and successfully activated brightness levels separately
to ease adjustment failure handling and avoiding unwanted brightness
pumping for example during compositor switchovers.

Adjust display state machine so that it performs brightness level
checkups during unblank also in states relevant for drm/dri logic.

If brightness adjustment fails after unblank, retry periodically.

Reduce amount of repetitive diagnostic noise caused by differing
timing requirements between framebuffer and drm/dri interfaces.
Signed-off-by: spiiroin's avatarSimo Piiroinen <>
parent 48fce82c
......@@ -1749,9 +1749,14 @@ gboolean mce_write_number_string_to_file(output_state_t *output, const gulong nu
if( fflush(output->file) == EOF ) {
mce_log(LL_WARN,"%s: can't flush %s: %m", output->context, output->path);
mce_log(output->reported_errno != errno ? LL_WARN : LL_DEBUG,
"%s: can't flush %s: %m", output->context, output->path);
output->reported_errno = errno;
status = FALSE;
else {
output->reported_errno = 0;
......@@ -74,6 +74,9 @@ typedef struct {
/** TRUE if missing path configuration error has already been
* written for this file */
gboolean invalid_config_reported;
/** For suppressing reporting of repeated errors */
int reported_errno;
} output_state_t;
typedef struct mce_io_mon_t mce_io_mon_t;
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment