Message ID | 20240731122311.1143153-3-tzimmermann@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm: Use backlight power constants | expand |
On Wed, 31 Jul 2024, Thomas Zimmermann <tzimmermann@suse.de> wrote: > Replace FB_BLANK_ constants with their counterparts from the > backlight subsystem. The values are identical, so there's no > change in functionality or semantics. > > Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> > Cc: Jani Nikula <jani.nikula@linux.intel.com> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> > Cc: Tvrtko Ursulin <tursulin@ursulin.net> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Do you want us to take this via drm-intel-next, or all together via drm-misc? Either is fine. > --- > drivers/gpu/drm/i915/display/intel_backlight.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c > index 071668bfe5d1..6f678c039ed8 100644 > --- a/drivers/gpu/drm/i915/display/intel_backlight.c > +++ b/drivers/gpu/drm/i915/display/intel_backlight.c > @@ -455,7 +455,7 @@ void intel_backlight_disable(const struct drm_connector_state *old_conn_state) > mutex_lock(&i915->display.backlight.lock); > > if (panel->backlight.device) > - panel->backlight.device->props.power = FB_BLANK_POWERDOWN; > + panel->backlight.device->props.power = BACKLIGHT_POWER_OFF; > panel->backlight.enabled = false; > panel->backlight.funcs->disable(old_conn_state, 0); > > @@ -773,7 +773,7 @@ static void __intel_backlight_enable(const struct intel_crtc_state *crtc_state, > panel->backlight.funcs->enable(crtc_state, conn_state, panel->backlight.level); > panel->backlight.enabled = true; > if (panel->backlight.device) > - panel->backlight.device->props.power = FB_BLANK_UNBLANK; > + panel->backlight.device->props.power = BACKLIGHT_POWER_ON; > } > > void intel_backlight_enable(const struct intel_crtc_state *crtc_state, > @@ -870,12 +870,12 @@ static int intel_backlight_device_update_status(struct backlight_device *bd) > */ > if (panel->backlight.enabled) { > if (panel->backlight.power) { > - bool enable = bd->props.power == FB_BLANK_UNBLANK && > + bool enable = bd->props.power == BACKLIGHT_POWER_ON && > bd->props.brightness != 0; > panel->backlight.power(connector, enable); > } > } else { > - bd->props.power = FB_BLANK_POWERDOWN; > + bd->props.power = BACKLIGHT_POWER_OFF; > } > > drm_modeset_unlock(&i915->drm.mode_config.connection_mutex); > @@ -945,9 +945,9 @@ int intel_backlight_device_register(struct intel_connector *connector) > props.max_brightness); > > if (panel->backlight.enabled) > - props.power = FB_BLANK_UNBLANK; > + props.power = BACKLIGHT_POWER_ON; > else > - props.power = FB_BLANK_POWERDOWN; > + props.power = BACKLIGHT_POWER_OFF; > > name = kstrdup_const("intel_backlight", GFP_KERNEL); > if (!name)
Hi Am 31.07.24 um 14:56 schrieb Jani Nikula: > On Wed, 31 Jul 2024, Thomas Zimmermann <tzimmermann@suse.de> wrote: >> Replace FB_BLANK_ constants with their counterparts from the >> backlight subsystem. The values are identical, so there's no >> change in functionality or semantics. >> >> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> >> Cc: Jani Nikula <jani.nikula@linux.intel.com> >> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> >> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> >> Cc: Tvrtko Ursulin <tursulin@ursulin.net> > Reviewed-by: Jani Nikula <jani.nikula@intel.com> Thanks. > > Do you want us to take this via drm-intel-next, or all together via > drm-misc? Either is fine. drm-intel-next is fine. Best regards Thomas > >> --- >> drivers/gpu/drm/i915/display/intel_backlight.c | 12 ++++++------ >> 1 file changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c >> index 071668bfe5d1..6f678c039ed8 100644 >> --- a/drivers/gpu/drm/i915/display/intel_backlight.c >> +++ b/drivers/gpu/drm/i915/display/intel_backlight.c >> @@ -455,7 +455,7 @@ void intel_backlight_disable(const struct drm_connector_state *old_conn_state) >> mutex_lock(&i915->display.backlight.lock); >> >> if (panel->backlight.device) >> - panel->backlight.device->props.power = FB_BLANK_POWERDOWN; >> + panel->backlight.device->props.power = BACKLIGHT_POWER_OFF; >> panel->backlight.enabled = false; >> panel->backlight.funcs->disable(old_conn_state, 0); >> >> @@ -773,7 +773,7 @@ static void __intel_backlight_enable(const struct intel_crtc_state *crtc_state, >> panel->backlight.funcs->enable(crtc_state, conn_state, panel->backlight.level); >> panel->backlight.enabled = true; >> if (panel->backlight.device) >> - panel->backlight.device->props.power = FB_BLANK_UNBLANK; >> + panel->backlight.device->props.power = BACKLIGHT_POWER_ON; >> } >> >> void intel_backlight_enable(const struct intel_crtc_state *crtc_state, >> @@ -870,12 +870,12 @@ static int intel_backlight_device_update_status(struct backlight_device *bd) >> */ >> if (panel->backlight.enabled) { >> if (panel->backlight.power) { >> - bool enable = bd->props.power == FB_BLANK_UNBLANK && >> + bool enable = bd->props.power == BACKLIGHT_POWER_ON && >> bd->props.brightness != 0; >> panel->backlight.power(connector, enable); >> } >> } else { >> - bd->props.power = FB_BLANK_POWERDOWN; >> + bd->props.power = BACKLIGHT_POWER_OFF; >> } >> >> drm_modeset_unlock(&i915->drm.mode_config.connection_mutex); >> @@ -945,9 +945,9 @@ int intel_backlight_device_register(struct intel_connector *connector) >> props.max_brightness); >> >> if (panel->backlight.enabled) >> - props.power = FB_BLANK_UNBLANK; >> + props.power = BACKLIGHT_POWER_ON; >> else >> - props.power = FB_BLANK_POWERDOWN; >> + props.power = BACKLIGHT_POWER_OFF; >> >> name = kstrdup_const("intel_backlight", GFP_KERNEL); >> if (!name)
On Wed, 31 Jul 2024, Thomas Zimmermann <tzimmermann@suse.de> wrote: > Hi > > Am 31.07.24 um 14:56 schrieb Jani Nikula: >> On Wed, 31 Jul 2024, Thomas Zimmermann <tzimmermann@suse.de> wrote: >>> Replace FB_BLANK_ constants with their counterparts from the >>> backlight subsystem. The values are identical, so there's no >>> change in functionality or semantics. >>> >>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> >>> Cc: Jani Nikula <jani.nikula@linux.intel.com> >>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> >>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> >>> Cc: Tvrtko Ursulin <tursulin@ursulin.net> >> Reviewed-by: Jani Nikula <jani.nikula@intel.com> > > Thanks. > >> >> Do you want us to take this via drm-intel-next, or all together via >> drm-misc? Either is fine. > > drm-intel-next is fine. Pushed to drm-intel-next, thanks for the patch. BR, Jani.
diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c index 071668bfe5d1..6f678c039ed8 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_backlight.c @@ -455,7 +455,7 @@ void intel_backlight_disable(const struct drm_connector_state *old_conn_state) mutex_lock(&i915->display.backlight.lock); if (panel->backlight.device) - panel->backlight.device->props.power = FB_BLANK_POWERDOWN; + panel->backlight.device->props.power = BACKLIGHT_POWER_OFF; panel->backlight.enabled = false; panel->backlight.funcs->disable(old_conn_state, 0); @@ -773,7 +773,7 @@ static void __intel_backlight_enable(const struct intel_crtc_state *crtc_state, panel->backlight.funcs->enable(crtc_state, conn_state, panel->backlight.level); panel->backlight.enabled = true; if (panel->backlight.device) - panel->backlight.device->props.power = FB_BLANK_UNBLANK; + panel->backlight.device->props.power = BACKLIGHT_POWER_ON; } void intel_backlight_enable(const struct intel_crtc_state *crtc_state, @@ -870,12 +870,12 @@ static int intel_backlight_device_update_status(struct backlight_device *bd) */ if (panel->backlight.enabled) { if (panel->backlight.power) { - bool enable = bd->props.power == FB_BLANK_UNBLANK && + bool enable = bd->props.power == BACKLIGHT_POWER_ON && bd->props.brightness != 0; panel->backlight.power(connector, enable); } } else { - bd->props.power = FB_BLANK_POWERDOWN; + bd->props.power = BACKLIGHT_POWER_OFF; } drm_modeset_unlock(&i915->drm.mode_config.connection_mutex); @@ -945,9 +945,9 @@ int intel_backlight_device_register(struct intel_connector *connector) props.max_brightness); if (panel->backlight.enabled) - props.power = FB_BLANK_UNBLANK; + props.power = BACKLIGHT_POWER_ON; else - props.power = FB_BLANK_POWERDOWN; + props.power = BACKLIGHT_POWER_OFF; name = kstrdup_const("intel_backlight", GFP_KERNEL); if (!name)
Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality or semantics. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> --- drivers/gpu/drm/i915/display/intel_backlight.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)