Skip to contentSkip to conversation

backlight: drop EARLY_EVENT_BLANK support

PATCH In review Sam Ravnborg 5 participants 11 messages Jul 25, 2019 – Aug 5, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backlight: drop EARLY_EVENT_BLANK support

There was no users left - so drop the code to support EARLY_FB_BLANK. This patch removes the support in backlight,
and drop the notifier in fbmem.

That EARLY_FB_BLANK is not used can be verified that no driver set any of:

    lcd_ops.early_set_power()
    lcd_ops.r_early_set_power()

Noticed while browsing backlight code for other reasons.

Cc Lee Jones <[email protected]>
Cc Daniel Thompson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Michał Mirosław" <[email protected]>
Cc Peter Rosin <[email protected]>
Cc Gerd Hoffmann <[email protected]>

---

Build tested with various architectures, configs.

Lee, Daniel - OK to commit to drm-misc-next where fbdev stuff is maintained today?

Patch needs ack from Bartlomiej first of course.

Sam

 drivers/video/backlight/lcd.c    |  8 --------
 drivers/video/fbdev/core/fbmem.c | 12 +-----------
 include/linux/fb.h               |  4 ----
 include/linux/lcd.h              | 10 ----------
 4 files changed, 1 insertion(+), 33 deletions(-)
drivers/video/backlight/lcd.c +0 -8
index d6b653aa4ee9..78b033358625 100644
@@ -39,14 +39,6 @@ static int fb_notifier_callback(struct notifier_block *self,
 		if (event = FB_EVENT_BLANK) {
 			if (ld->ops->set_power)
 				ld->ops->set_power(ld, *(int *)evdata->data);
-		} else if (event = FB_EARLY_EVENT_BLANK) {
-			if (ld->ops->early_set_power)
-				ld->ops->early_set_power(ld,
-						*(int *)evdata->data);
-		} else if (event = FB_R_EARLY_EVENT_BLANK) {
-			if (ld->ops->r_early_set_power)
-				ld->ops->r_early_set_power(ld,
-						*(int *)evdata->data);
 		} else {
 			if (ld->ops->set_mode)
 				ld->ops->set_mode(ld, evdata->data);
drivers/video/fbdev/core/fbmem.c +1 -11
index 00fe0efeaee9..e6a1c805064f 100644
@@ -1058,7 +1058,7 @@ int
 fb_blank(struct fb_info *info, int blank)
 {	
 	struct fb_event event;
-	int ret = -EINVAL, early_ret;
+	int ret = -EINVAL;
 
  	if (blank > FB_BLANK_POWERDOWN)
  		blank = FB_BLANK_POWERDOWN;
@@ -1066,21 +1066,11 @@ fb_blank(struct fb_info *info, int blank)
 	event.info = info;
 	event.data = &blank;
 
-	early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
-
 	if (info->fbops->fb_blank)
  		ret = info->fbops->fb_blank(blank, info);
 
 	if (!ret)
 		fb_notifier_call_chain(FB_EVENT_BLANK, &event);
-	else {
-		/*
-		 * if fb_blank is failed then revert effects of
-		 * the early blank event.
-		 */
-		if (!early_ret)
-			fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event);
-	}
 
  	return ret;
 }
include/linux/fb.h +0 -4
index 50948e519897..756706b666a1 100644
@@ -135,10 +135,6 @@ struct fb_cursor_user {
 
 /*      A display blank is requested       */
 #define FB_EVENT_BLANK                  0x09
-/*      A hardware display blank early change occurred */
-#define FB_EARLY_EVENT_BLANK		0x10
-/*      A hardware display blank revert early change occurred */
-#define FB_R_EARLY_EVENT_BLANK		0x11
 
 struct fb_event {
 	struct fb_info *info;
include/linux/lcd.h +0 -10
index 851eee8fff25..238fb1dfed98 100644
@@ -41,16 +41,6 @@ struct lcd_ops {
 	/* Get the LCD panel power status (0: full on, 1..3: controller
 	   power on, flat panel power off, 4: full off), see FB_BLANK_XXX */
 	int (*get_power)(struct lcd_device *);
-	/*
-	 * Enable or disable power to the LCD(0: on; 4: off, see FB_BLANK_XXX)
-	 * and this callback would be called proir to fb driver's callback.
-	 *
-	 * P.S. note that if early_set_power is not NULL then early fb notifier
-	 *	would be registered.
-	 */
-	int (*early_set_power)(struct lcd_device *, int power);
-	/* revert the effects of the early blank event. */
-	int (*r_early_set_power)(struct lcd_device *, int power);
 	/* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */
 	int (*set_power)(struct lcd_device *, int power);
 	/* Get the current contrast setting (0-max_contrast) */
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK. This patch removes the support in backlight,
and drop the notifier in fbmem.

That EARLY_FB_BLANK is not used can be verified that no driver set any of:

    lcd_ops.early_set_power()
    lcd_ops.r_early_set_power()

Noticed while browsing backlight code for other reasons.

Ah I didn't grep hard enough, I didn't realize that no one sets the lcd_ops->(r_)early_set_power hooks. Nice find!

Quoted 13 lines
Cc Lee Jones <[email protected]>
Cc Daniel Thompson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Michał Mirosław" <[email protected]>
Cc Peter Rosin <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Quoted 6 lines

---

Build tested with various architectures, configs.

Lee, Daniel - OK to commit to drm-misc-next where fbdev stuff is maintained today?

backlight is separate from fbdev in Lee's own tree, not in drm-misc. I think at least.
-Daniel

Quoted 104 lines

Patch needs ack from Bartlomiej first of course.

Sam

 drivers/video/backlight/lcd.c    |  8 --------
 drivers/video/fbdev/core/fbmem.c | 12 +-----------
 include/linux/fb.h               |  4 ----
 include/linux/lcd.h              | 10 ----------
 4 files changed, 1 insertion(+), 33 deletions(-)
drivers/video/backlight/lcd.c +0 -8
index d6b653aa4ee9..78b033358625 100644
@@ -39,14 +39,6 @@ static int fb_notifier_callback(struct notifier_block *self,
 		if (event = FB_EVENT_BLANK) {
 			if (ld->ops->set_power)
 				ld->ops->set_power(ld, *(int *)evdata->data);
-		} else if (event = FB_EARLY_EVENT_BLANK) {
-			if (ld->ops->early_set_power)
-				ld->ops->early_set_power(ld,
-						*(int *)evdata->data);
-		} else if (event = FB_R_EARLY_EVENT_BLANK) {
-			if (ld->ops->r_early_set_power)
-				ld->ops->r_early_set_power(ld,
-						*(int *)evdata->data);
 		} else {
 			if (ld->ops->set_mode)
 				ld->ops->set_mode(ld, evdata->data);
drivers/video/fbdev/core/fbmem.c +1 -11
index 00fe0efeaee9..e6a1c805064f 100644
@@ -1058,7 +1058,7 @@ int
 fb_blank(struct fb_info *info, int blank)
 {	
 	struct fb_event event;
-	int ret = -EINVAL, early_ret;
+	int ret = -EINVAL;
 
  	if (blank > FB_BLANK_POWERDOWN)
  		blank = FB_BLANK_POWERDOWN;
@@ -1066,21 +1066,11 @@ fb_blank(struct fb_info *info, int blank)
 	event.info = info;
 	event.data = &blank;
 
-	early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
-
 	if (info->fbops->fb_blank)
  		ret = info->fbops->fb_blank(blank, info);
 
 	if (!ret)
 		fb_notifier_call_chain(FB_EVENT_BLANK, &event);
-	else {
-		/*
-		 * if fb_blank is failed then revert effects of
-		 * the early blank event.
-		 */
-		if (!early_ret)
-			fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event);
-	}
 
  	return ret;
 }
include/linux/fb.h +0 -4
index 50948e519897..756706b666a1 100644
@@ -135,10 +135,6 @@ struct fb_cursor_user {
 
 /*      A display blank is requested       */
 #define FB_EVENT_BLANK                  0x09
-/*      A hardware display blank early change occurred */
-#define FB_EARLY_EVENT_BLANK		0x10
-/*      A hardware display blank revert early change occurred */
-#define FB_R_EARLY_EVENT_BLANK		0x11
 
 struct fb_event {
 	struct fb_info *info;
include/linux/lcd.h +0 -10
index 851eee8fff25..238fb1dfed98 100644
@@ -41,16 +41,6 @@ struct lcd_ops {
 	/* Get the LCD panel power status (0: full on, 1..3: controller
 	   power on, flat panel power off, 4: full off), see FB_BLANK_XXX */
 	int (*get_power)(struct lcd_device *);
-	/*
-	 * Enable or disable power to the LCD(0: on; 4: off, see FB_BLANK_XXX)
-	 * and this callback would be called proir to fb driver's callback.
-	 *
-	 * P.S. note that if early_set_power is not NULL then early fb notifier
-	 *	would be registered.
-	 */
-	int (*early_set_power)(struct lcd_device *, int power);
-	/* revert the effects of the early blank event. */
-	int (*r_early_set_power)(struct lcd_device *, int power);
 	/* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */
 	int (*set_power)(struct lcd_device *, int power);
 	/* Get the current contrast setting (0-max_contrast) */
Signature · 1 line
2.20.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#2 lore raw
Quoted 32 lines · Daniel Vetter
Quoted 10 lines · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK. This patch removes the support in backlight,
and drop the notifier in fbmem.

That EARLY_FB_BLANK is not used can be verified that no driver set any of:

    lcd_ops.early_set_power()
    lcd_ops.r_early_set_power()

Noticed while browsing backlight code for other reasons.

Ah I didn't grep hard enough, I didn't realize that no one sets the lcd_ops->(r_)early_set_power hooks. Nice find!

Quoted 15 lines
Cc Lee Jones <[email protected]>
Cc Daniel Thompson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Michał Mirosław" <[email protected]>
Cc Peter Rosin <[email protected]>
Cc Gerd Hoffmann <[email protected]>

---

Quoted 7 lines
Quoted 4 lines

Build tested with various architectures, configs.

Lee, Daniel - OK to commit to drm-misc-next where fbdev stuff is maintained today?

backlight is separate from fbdev in Lee's own tree, not in drm-misc. I think at least.

That's correct. We'll sort that once we have all the Acks.

Quoted 5 lines
Quoted 5 lines
 drivers/video/backlight/lcd.c    |  8 --------
 drivers/video/fbdev/core/fbmem.c | 12 +-----------
 include/linux/fb.h               |  4 ----
 include/linux/lcd.h              | 10 ----------
 4 files changed, 1 insertion(+), 33 deletions(-)
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw

Hi Lee.

Quoted 36 lines · Lee Jones
Quoted 34 lines · Daniel Vetter
Quoted 10 lines · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK. This patch removes the support in backlight,
and drop the notifier in fbmem.

That EARLY_FB_BLANK is not used can be verified that no driver set any of:

    lcd_ops.early_set_power()
    lcd_ops.r_early_set_power()

Noticed while browsing backlight code for other reasons.

Ah I didn't grep hard enough, I didn't realize that no one sets the lcd_ops->(r_)early_set_power hooks. Nice find!

Quoted 17 lines
Cc Lee Jones <[email protected]>
Cc Daniel Thompson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Michał Mirosław" <[email protected]>
Cc Peter Rosin <[email protected]>
Cc Gerd Hoffmann <[email protected]>

---

Build tested with various architectures, configs.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Lee, Daniel - OK to commit to drm-misc-next where fbdev stuff is maintained today?

backlight is separate from fbdev in Lee's own tree, not in drm-misc. I think at least.

That's correct. We'll sort that once we have all the Acks.

We have acks all around now.
OK that I commit this to drm-misc-next?

This is where we maintain fbdev these days. Or you could apply it to your backlight tree.

Both solutins would be fine as the risk of introducing merge conflicts in these code paths are minimal.

Sam

#4 lore raw
Quoted 42 lines · Sam Ravnborg

Hi Lee.

Quoted 39 lines · Lee Jones
Quoted 37 lines · Daniel Vetter
Quoted 10 lines · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK. This patch removes the support in backlight,
and drop the notifier in fbmem.

That EARLY_FB_BLANK is not used can be verified that no driver set any of:

    lcd_ops.early_set_power()
    lcd_ops.r_early_set_power()

Noticed while browsing backlight code for other reasons.

Ah I didn't grep hard enough, I didn't realize that no one sets the lcd_ops->(r_)early_set_power hooks. Nice find!

Quoted 19 lines
Cc Lee Jones <[email protected]>
Cc Daniel Thompson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Michał Mirosław" <[email protected]>
Cc Peter Rosin <[email protected]>
Cc Gerd Hoffmann <[email protected]>

---

Build tested with various architectures, configs.

Lee, Daniel - OK to commit to drm-misc-next where fbdev stuff is maintained today?

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

backlight is separate from fbdev in Lee's own tree, not in drm-misc. I think at least.

That's correct. We'll sort that once we have all the Acks.

We have acks all around now.

I am still missing Daniel T's Ack.

Quoted 7 lines

OK that I commit this to drm-misc-next?

This is where we maintain fbdev these days. Or you could apply it to your backlight tree.

Both solutins would be fine as the risk of introducing merge conflicts in these code paths are minimal.

If that's the case, then I'd be happy to apply it to the Backlight tree.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Acked-by on v1 1/1
#5 lore raw
In reply to Sam Ravnborg
Quoted 1 line · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK.

Why are we using a different noun for the subject and description?

Quoted 10 lines

This patch removes the support in backlight,
and drop the notifier in fbmem.

That EARLY_FB_BLANK is not used can be verified that no driver set any of:

    lcd_ops.early_set_power()
    lcd_ops.r_early_set_power()

Noticed while browsing backlight code for other reasons.

Quoted 13 lines
Cc Lee Jones <[email protected]>
Cc Daniel Thompson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Michał Mirosław" <[email protected]>
Cc Peter Rosin <[email protected]>
Cc Gerd Hoffmann <[email protected]>

Other than the quibble about the description...

Quoted 110 lines

---

Build tested with various architectures, configs.

Lee, Daniel - OK to commit to drm-misc-next where fbdev stuff is maintained today?

Patch needs ack from Bartlomiej first of course.

Sam

 drivers/video/backlight/lcd.c    |  8 --------
 drivers/video/fbdev/core/fbmem.c | 12 +-----------
 include/linux/fb.h               |  4 ----
 include/linux/lcd.h              | 10 ----------
 4 files changed, 1 insertion(+), 33 deletions(-)
drivers/video/backlight/lcd.c +0 -8
index d6b653aa4ee9..78b033358625 100644
@@ -39,14 +39,6 @@ static int fb_notifier_callback(struct notifier_block *self,
 		if (event = FB_EVENT_BLANK) {
 			if (ld->ops->set_power)
 				ld->ops->set_power(ld, *(int *)evdata->data);
-		} else if (event = FB_EARLY_EVENT_BLANK) {
-			if (ld->ops->early_set_power)
-				ld->ops->early_set_power(ld,
-						*(int *)evdata->data);
-		} else if (event = FB_R_EARLY_EVENT_BLANK) {
-			if (ld->ops->r_early_set_power)
-				ld->ops->r_early_set_power(ld,
-						*(int *)evdata->data);
 		} else {
 			if (ld->ops->set_mode)
 				ld->ops->set_mode(ld, evdata->data);
drivers/video/fbdev/core/fbmem.c +1 -11
index 00fe0efeaee9..e6a1c805064f 100644
@@ -1058,7 +1058,7 @@ int
 fb_blank(struct fb_info *info, int blank)
 {	
 	struct fb_event event;
-	int ret = -EINVAL, early_ret;
+	int ret = -EINVAL;
 
  	if (blank > FB_BLANK_POWERDOWN)
  		blank = FB_BLANK_POWERDOWN;
@@ -1066,21 +1066,11 @@ fb_blank(struct fb_info *info, int blank)
 	event.info = info;
 	event.data = &blank;
 
-	early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
-
 	if (info->fbops->fb_blank)
  		ret = info->fbops->fb_blank(blank, info);
 
 	if (!ret)
 		fb_notifier_call_chain(FB_EVENT_BLANK, &event);
-	else {
-		/*
-		 * if fb_blank is failed then revert effects of
-		 * the early blank event.
-		 */
-		if (!early_ret)
-			fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event);
-	}
 
  	return ret;
 }
include/linux/fb.h +0 -4
index 50948e519897..756706b666a1 100644
@@ -135,10 +135,6 @@ struct fb_cursor_user {
 
 /*      A display blank is requested       */
 #define FB_EVENT_BLANK                  0x09
-/*      A hardware display blank early change occurred */
-#define FB_EARLY_EVENT_BLANK		0x10
-/*      A hardware display blank revert early change occurred */
-#define FB_R_EARLY_EVENT_BLANK		0x11
 
 struct fb_event {
 	struct fb_info *info;
include/linux/lcd.h +0 -10
index 851eee8fff25..238fb1dfed98 100644
@@ -41,16 +41,6 @@ struct lcd_ops {
 	/* Get the LCD panel power status (0: full on, 1..3: controller
 	   power on, flat panel power off, 4: full off), see FB_BLANK_XXX */
 	int (*get_power)(struct lcd_device *);
-	/*
-	 * Enable or disable power to the LCD(0: on; 4: off, see FB_BLANK_XXX)
-	 * and this callback would be called proir to fb driver's callback.
-	 *
-	 * P.S. note that if early_set_power is not NULL then early fb notifier
-	 *	would be registered.
-	 */
-	int (*early_set_power)(struct lcd_device *, int power);
-	/* revert the effects of the early blank event. */
-	int (*r_early_set_power)(struct lcd_device *, int power);
 	/* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */
 	int (*set_power)(struct lcd_device *, int power);
 	/* Get the current contrast setting (0-max_contrast) */
Signature · 1 line
2.20.1
#6 lore raw

Hi Daniel.

Quoted 4 lines · Daniel Thompson
Quoted 1 line · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK.

Why are we using a different noun for the subject and description?

I fat-fingered the description.
Will fix when I apply - or send out a v2 if requested.

...

Quoted 15 lines
Quoted 14 lines
Cc Lee Jones <[email protected]>
Cc Daniel Thompson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Michał Mirosław" <[email protected]>
Cc Peter Rosin <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Quoted 3 lines

Other than the quibble about the description...

Thanks,

Sam

#7 lore raw
Quoted 9 lines · Sam Ravnborg

Hi Daniel.

Quoted 4 lines · Daniel Thompson
Quoted 1 line · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK.

Why are we using a different noun for the subject and description?

I fat-fingered the description.
Will fix when I apply - or send out a v2 if requested.

No need to me to see a v2 if that's the only change.

Daniel.

Quoted 25 lines

...

Quoted 15 lines
Quoted 14 lines
Cc Lee Jones <[email protected]>
Cc Daniel Thompson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Michał Mirosław" <[email protected]>
Cc Peter Rosin <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Quoted 3 lines

Other than the quibble about the description...

Thanks,

Sam

Acked-by
#8 lore raw
In reply to Sam Ravnborg
Quoted 10 lines · Sam Ravnborg

Hi Daniel.

Quoted 4 lines · Daniel Thompson
Quoted 1 line · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK.

Why are we using a different noun for the subject and description?

I fat-fingered the description.

Will fix when I apply - or send out a v2 if requested.

Okay, just apply it then:

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#9 lore raw

Hi Lee.

Quoted 8 lines · Lee Jones
Quoted 6 lines · Sam Ravnborg

Hi Daniel.

Quoted 3 lines · Daniel Thompson
Quoted 1 line · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Why are we using a different noun for the subject and description?

I fat-fingered the description.

Will fix when I apply - or send out a v2 if requested.

Okay, just apply it then:

Fixed changelog and applied to drm-misc-next.

Sam

Acked-by on v1 1/1
#10 lore raw
In reply to Sam Ravnborg
Quoted 24 lines · Sam Ravnborg

There was no users left - so drop the code to support EARLY_FB_BLANK. This patch removes the support in backlight,
and drop the notifier in fbmem.

That EARLY_FB_BLANK is not used can be verified that no driver set any of:

    lcd_ops.early_set_power()
    lcd_ops.r_early_set_power()

Noticed while browsing backlight code for other reasons.

Cc Lee Jones <[email protected]>
Cc Daniel Thompson <[email protected]>
Cc Jingoo Han <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Michał Mirosław" <[email protected]>
Cc Peter Rosin <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Quoted 8 lines

---

Build tested with various architectures, configs.

Lee, Daniel - OK to commit to drm-misc-next where fbdev stuff is maintained today?

Patch needs ack from Bartlomiej first of course.

Quoted 86 lines
 drivers/video/backlight/lcd.c    |  8 --------
 drivers/video/fbdev/core/fbmem.c | 12 +-----------
 include/linux/fb.h               |  4 ----
 include/linux/lcd.h              | 10 ----------
 4 files changed, 1 insertion(+), 33 deletions(-)
drivers/video/backlight/lcd.c +0 -8
index d6b653aa4ee9..78b033358625 100644
@@ -39,14 +39,6 @@ static int fb_notifier_callback(struct notifier_block *self,
 		if (event == FB_EVENT_BLANK) {
 			if (ld->ops->set_power)
 				ld->ops->set_power(ld, *(int *)evdata->data);
-		} else if (event == FB_EARLY_EVENT_BLANK) {
-			if (ld->ops->early_set_power)
-				ld->ops->early_set_power(ld,
-						*(int *)evdata->data);
-		} else if (event == FB_R_EARLY_EVENT_BLANK) {
-			if (ld->ops->r_early_set_power)
-				ld->ops->r_early_set_power(ld,
-						*(int *)evdata->data);
 		} else {
 			if (ld->ops->set_mode)
 				ld->ops->set_mode(ld, evdata->data);
drivers/video/fbdev/core/fbmem.c +1 -11
index 00fe0efeaee9..e6a1c805064f 100644
@@ -1058,7 +1058,7 @@ int
 fb_blank(struct fb_info *info, int blank)
 {	
 	struct fb_event event;
-	int ret = -EINVAL, early_ret;
+	int ret = -EINVAL;
 
  	if (blank > FB_BLANK_POWERDOWN)
  		blank = FB_BLANK_POWERDOWN;
@@ -1066,21 +1066,11 @@ fb_blank(struct fb_info *info, int blank)
 	event.info = info;
 	event.data = &blank;
 
-	early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
-
 	if (info->fbops->fb_blank)
  		ret = info->fbops->fb_blank(blank, info);
 
 	if (!ret)
 		fb_notifier_call_chain(FB_EVENT_BLANK, &event);
-	else {
-		/*
-		 * if fb_blank is failed then revert effects of
-		 * the early blank event.
-		 */
-		if (!early_ret)
-			fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event);
-	}
 
  	return ret;
 }
include/linux/fb.h +0 -4
index 50948e519897..756706b666a1 100644
@@ -135,10 +135,6 @@ struct fb_cursor_user {
 
 /*      A display blank is requested       */
 #define FB_EVENT_BLANK                  0x09
-/*      A hardware display blank early change occurred */
-#define FB_EARLY_EVENT_BLANK		0x10
-/*      A hardware display blank revert early change occurred */
-#define FB_R_EARLY_EVENT_BLANK		0x11
 
 struct fb_event {
 	struct fb_info *info;
include/linux/lcd.h +0 -3
index 851eee8fff25..238fb1dfed98 100644
@@ -41,16 +41,6 @@ struct lcd_ops {
 	/* Get the LCD panel power status (0: full on, 1..3: controller
 	   power on, flat panel power off, 4: full off), see FB_BLANK_XXX */
 	int (*get_power)(struct lcd_device *);
-	/*
-	 * Enable or disable power to the LCD(0: on; 4: off, see FB_BLANK_XXX)
-	 * and this callback would be called proir to fb driver's callback.

include/linux/lcd.h struct lcd_ops { · line 46

Quoted 10 lines
include/linux/lcd.h +0 -7
-	 *
-	 * P.S. note that if early_set_power is not NULL then early fb notifier
-	 *	would be registered.
-	 */
-	int (*early_set_power)(struct lcd_device *, int power);
-	/* revert the effects of the early blank event. */
-	int (*r_early_set_power)(struct lcd_device *, int power);
 	/* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */
 	int (*set_power)(struct lcd_device *, int power);
 	/* Get the current contrast setting (0-max_contrast) */

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel