drm: shmobile: Use backlight helper
Subsystems (2)
PATCH 1/1 drm: shmobile: Use backlight helper
backlight_properties.fb_blank is deprecated. The states it represents are handled by other properties; but instead of accessing those properties directly, drivers should use the helpers provided by backlight.h.
Instead of retrieving the backlight brightness in struct backlight_properties manually, and then checking whether the backlight should be on at all, use backlight_get_brightness() which does all this and insulates this from future changes.
--- drivers/gpu/drm/shmobile/shmob_drm_backlight.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/shmobile/shmob_drm_backlight.c +1 -5
@@ -18,11 +18,7 @@ static int shmob_drm_backlight_update(struct backlight_device *bdev)struct shmob_drm_connector *scon =bl_get_data (bdev);struct shmob_drm_device *sdev = scon->connector.dev->dev_private;const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; -int brightness = bdev->props.brightness; - -if (bdev->props.power !=FB_BLANK_UNBLANK || - bdev->props.state &BL_CORE_SUSPENDED ) - brightness =0 ; +int brightness =backlight_get_brightness (bdev);return bdata->set_brightness (brightness); }
base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
Signature · 1 line
2.30.2
Quoted 4 lines · Stephen Kitt
backlight_properties.fb_blank is deprecated. The states it represents are handled by other properties; but instead of accessing those properties directly, drivers should use the helpers provided by
backlight.h.
Apologies for the misleading boilerplate, this patch came about as a result of cleaning up fb_blank usage but doesn't involve fb_blank itself.
Quoted 38 lines
Instead of retrieving the backlight brightness in struct
backlight_propertiesmanually, and then checking whether the backlight should be on at all, usebacklight_get_brightness()which does all this and insulates this from future changes.Signed-off-by Stephen Kitt <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Kieran Bingham <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>--- drivers/gpu/drm/shmobile/shmob_drm_backlight.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/shmobile/shmob_drm_backlight.cindexf6628a5ee95f..794573badfe8100644 ---a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c+++b/drivers/gpu/drm/shmobile/shmob_drm_backlight.c@@ -18,11 +18,7 @@ static intshmob_drm_backlight_update(struct backlight_device *bdev)structshmob_drm_connector*scon =bl_get_data(bdev); structshmob_drm_device*sdev =scon->connector.dev->dev_private; const structshmob_drm_backlight_data*bdata =&sdev->pdata->backlight;drivers/gpu/drm/shmobile/shmob_drm_backlight.c +1
-5-int brightness = bdev->props.brightness; - -if (bdev->props.power !=FB_BLANK_UNBLANK || - bdev->props.state &BL_CORE_SUSPENDED ) - brightness =0 ; +int brightness =backlight_get_brightness (bdev);return bdata->set_brightness (brightness); }base-commit:
f2906aa863381afb0015a9eb7fefad885d4e5a56Signature · 1 line
2.30.2
Hi Stephen,
Quoted 8 lines · Stephen Kitt
Quoted 4 lines · Stephen Kitt
backlight_properties.fb_blank is deprecated. The states it represents are handled by other properties; but instead of accessing those properties directly, drivers should use the helpers provided by
backlight.h.Apologies for the misleading boilerplate, this patch came about as a result of cleaning up
fb_blankusage but doesn't involvefb_blankitself.
No worries. Would you like to submit a v2 with a better commit message ? The patch otherwise looks good to me.
Quoted 35 lines
Quoted 35 lines
Instead of retrieving the backlight brightness in struct
backlight_propertiesmanually, and then checking whether the backlight should be on at all, usebacklight_get_brightness()which does all this and insulates this from future changes.Signed-off-by Stephen Kitt <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Kieran Bingham <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>--- drivers/gpu/drm/shmobile/shmob_drm_backlight.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/shmobile/shmob_drm_backlight.cindexf6628a5ee95f..794573badfe8100644 ---a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c+++b/drivers/gpu/drm/shmobile/shmob_drm_backlight.c@@ -18,11 +18,7 @@ static intshmob_drm_backlight_update(struct backlight_device *bdev)structshmob_drm_connector*scon =bl_get_data(bdev); structshmob_drm_device*sdev =scon->connector.dev->dev_private; const structshmob_drm_backlight_data*bdata =&sdev->pdata->backlight;drivers/gpu/drm/shmobile/shmob_drm_backlight.c +1
-5-int brightness = bdev->props.brightness; - -if (bdev->props.power !=FB_BLANK_UNBLANK || - bdev->props.state &BL_CORE_SUSPENDED ) - brightness =0 ; +int brightness =backlight_get_brightness (bdev);return bdata->set_brightness (brightness); }base-commit:
f2906aa863381afb0015a9eb7fefad885d4e5a56
Signature · 3 lines
Regards, Laurent Pinchart
Hi Laurent,
Quoted 7 lines · Laurent Pinchart
Quoted 6 lines · Stephen Kitt
Quoted 4 lines · Stephen Kitt
backlight_properties.fb_blank is deprecated. The states it represents are handled by other properties; but instead of accessing those properties directly, drivers should use the helpers provided by
backlight.h.
Quoted 6 lines
Quoted 3 lines
Apologies for the misleading boilerplate, this patch came about as a result of cleaning up
fb_blankusage but doesn't involvefb_blankitself.No worries. Would you like to submit a v2 with a better commit message ? The patch otherwise looks good to me.
Yes, I’ll do that.
Thanks,
Stephen