All of lore.kernel.org
 help / color / mirror / Atom feed
* [Nouveau] [PATCH] drm/nouveau: Adding support to control backlight using bl_power for nva3.
@ 2022-10-29 18:48 ` antoniospg
  0 siblings, 0 replies; 28+ messages in thread
From: antoniospg @ 2022-10-29 18:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: David Airlie, open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS, Ben Skeggs,
	Daniel Vetter

Test plan:

* Turn off:
echo 1 > /sys/class/backlight/nv_backlight/bl_power

* Turn on:
echo 0 > /sys/class/backlight/nv_backlight/bl_power

Signed-off-by: antoniospg <antoniospg100@gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_backlight.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index a2141d3d9b1d..855d0ce9f7fa 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -263,7 +263,16 @@ nva3_set_intensity(struct backlight_device *bd)
 	u32 div, val;
 
 	div = nvif_rd32(device, NV50_PDISP_SOR_PWM_DIV(or));
-	val = (bd->props.brightness * div) / 100;
+
+	switch (bd->props.power) {
+	case FB_BLANK_UNBLANK:
+		val = (bd->props.brightness * div) / 100;
+		break;
+	default:
+		val = 0;
+		break;
+	}
+
 	if (div) {
 		nvif_wr32(device, NV50_PDISP_SOR_PWM_CTL(or),
 			  val |
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [Nouveau] [PATCH] drm/nouveau: Adding support to control backlight using bl_power for nva3.
@ 2022-10-29 18:42 antoniospg
  0 siblings, 0 replies; 28+ messages in thread
From: antoniospg @ 2022-10-29 18:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: David Airlie, open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS, Ben Skeggs,
	Daniel Vetter

Test plan:

* Turn off:
echo 1 > /sys/class/backlight/nv_backlight/bl_power

* Turn on:
echo 0 > /sys/class/backlight/nv_backlight/bl_power

Signed-off-by: antoniospg <antoniospg100@gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_backlight.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index a2141d3d9b1d..855d0ce9f7fa 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -263,7 +263,16 @@ nva3_set_intensity(struct backlight_device *bd)
 	u32 div, val;
 
 	div = nvif_rd32(device, NV50_PDISP_SOR_PWM_DIV(or));
-	val = (bd->props.brightness * div) / 100;
+
+	switch (bd->props.power) {
+	case FB_BLANK_UNBLANK:
+		val = (bd->props.brightness * div) / 100;
+		break;
+	default:
+		val = 0;
+		break;
+	}
+
 	if (div) {
 		nvif_wr32(device, NV50_PDISP_SOR_PWM_CTL(or),
 			  val |
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2023-05-04 12:34 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-29 18:48 [Nouveau] [PATCH] drm/nouveau: Adding support to control backlight using bl_power for nva3 antoniospg
2022-10-29 18:48 ` antoniospg
2022-10-29 18:48 ` antoniospg
2022-10-30 13:05 ` [Nouveau] " Bagas Sanjaya
2022-10-30 13:05   ` Bagas Sanjaya
2022-10-30 13:05   ` Bagas Sanjaya
2022-10-30 20:48 ` [Nouveau] " Sam Ravnborg
2022-10-30 20:48   ` Sam Ravnborg
2022-10-30 20:48   ` Sam Ravnborg
2022-10-31 16:32 ` [Nouveau] [PATCH] drm/nouveau: Add " antoniospg
2022-10-31 16:32   ` antoniospg
2022-10-31 16:32   ` antoniospg
2022-11-01  2:11   ` [Nouveau] " Bagas Sanjaya
2022-11-01  2:11     ` Bagas Sanjaya
2022-11-01  2:11     ` Bagas Sanjaya
2022-11-01 10:41     ` [Nouveau] " Karol Herbst
2022-11-01 10:41       ` Karol Herbst
2022-11-01 10:41       ` Karol Herbst
2022-11-04 22:01   ` [Nouveau] [PATCH v3] " Antonio Gomes
2022-11-04 22:01     ` Antonio Gomes
2022-11-04 22:01     ` Antonio Gomes
2022-11-04 22:04   ` [Nouveau] " Antonio Gomes
2022-11-04 22:04     ` Antonio Gomes
2022-11-04 22:04     ` Antonio Gomes
2022-11-09 17:08     ` [Nouveau] " Karol Herbst
2022-11-09 17:08       ` Karol Herbst
2022-11-09 17:08       ` Karol Herbst
  -- strict thread matches above, loose matches on Subject: below --
2022-10-29 18:42 [Nouveau] [PATCH] drm/nouveau: Adding " antoniospg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.