Skip to contentSkip to conversation

drm/mgag200: Fix gamma lut not initialized.

PATCH Superseded Jocelyn Falempe 3 participants 5 messages May 10, 2023

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jocelyn Falempe

author reviewer
#0 lore raw

PATCH 1/1 drm/mgag200: Fix gamma lut not initialized.

When mgag200 switched from simple KMS to regular atomic helpers, the initialization of the gamma settings was lost.
This leads to a black screen, if the bios/uefi doesn't use the same pixel color depth.

Fixes 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers")
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/mgag200/mgag200_mode.c +5 -0
index 461da1409fdf..911d46741e40 100644
@@ -819,6 +819,11 @@ static void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc,
 	else if (mdev->type == G200_EV)
 		mgag200_g200ev_set_hiprilvl(mdev);
 
+	if (crtc_state->gamma_lut)
+		mgag200_crtc_set_gamma(mdev, format, crtc_state->gamma_lut->data);
+	else
+		mgag200_crtc_set_gamma_linear(mdev, format);
+
 	mgag200_enable_display(mdev);
 
 	if (mdev->type == G200_WB || mdev->type == G200_EW3)

base-commit: 1baf9127c482a3a58aef81d92ae751798e2db202

Signature · 1 line
2.39.2
#1 lore raw
FYI: kernel test robot notices the stable kernel rule is not satisfied.

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

Rule: 'Cc: [email protected]' or 'commit <sha1> upstream.'
Subject: [PATCH] drm/mgag200: Fix gamma lut not initialized.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Jocelyn Falempe

Hi,

oh great! Thank you for fixing this bug. And sorry that I broke it.

Am 10.05.23 um 10:54 schrieb Jocelyn Falempe:

Quoted 9 lines

When mgag200 switched from simple KMS to regular atomic helpers, the initialization of the gamma settings was lost.
This leads to a black screen, if the bios/uefi doesn't use the same pixel color depth.

Fixes 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers")

Also needs:

Cc <[email protected]> # v6.1+

In terms of what it does:

but the patch is apparently for against an old version. (v6.1?) The code in mgag200_crtc_helper_atomic_enable has changed quite a bit.

Best regards
Thomas

Quoted 22 lines
---
  drivers/gpu/drm/mgag200/mgag200_mode.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/gpu/drm/mgag200/mgag200_mode.c +5 -0
index 461da1409fdf..911d46741e40 100644
@@ -819,6 +819,11 @@ static void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc,
  	else if (mdev->type == G200_EV)
  		mgag200_g200ev_set_hiprilvl(mdev);
 
+	if (crtc_state->gamma_lut)
+		mgag200_crtc_set_gamma(mdev, format, crtc_state->gamma_lut->data);
+	else
+		mgag200_crtc_set_gamma_linear(mdev, format);
+
  	mgag200_enable_display(mdev);
 
  	if (mdev->type == G200_WB || mdev->type == G200_EW3)

base-commit: 1baf9127c482a3a58aef81d92ae751798e2db202

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
author reviewer
#3 lore raw
Quoted 10 lines · Thomas Zimmermann

Hi,

oh great! Thank you for fixing this bug. And sorry that I broke it.

Am 10.05.23 um 10:54 schrieb Jocelyn Falempe:

Quoted 5 lines

When mgag200 switched from simple KMS to regular atomic helpers, the initialization of the gamma settings was lost.
This leads to a black screen, if the bios/uefi doesn't use the same pixel color depth.

Quoted 8 lines
Quoted 4 lines
Fixes 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers")

Also needs:

Cc <[email protected]> # v6.1+

Should I send a v2 with this added ?

Quoted 6 lines

In terms of what it does:

but the patch is apparently for against an old version. (v6.1?) The code in mgag200_crtc_helper_atomic_enable has changed quite a bit.

Yes, I based it on the culprit commit 1baf9127c482, but it applies cleanly with git am -3 on top of v6.3

Quoted 27 lines

Best regards
Thomas

Quoted 22 lines

---
  drivers/gpu/drm/mgag200/mgag200_mode.c | 5 +++++

  1 file changed, 5 insertions(+)
drivers/gpu/drm/mgag200/mgag200_mode.c +5 -0
index 461da1409fdf..911d46741e40 100644
@@ -819,6 +819,11 @@ static void 
 mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc,
       else if (mdev->type == G200_EV)
           mgag200_g200ev_set_hiprilvl(mdev);
+    if (crtc_state->gamma_lut)
+        mgag200_crtc_set_gamma(mdev, format, 
 crtc_state->gamma_lut->data);
+    else
+        mgag200_crtc_set_gamma_linear(mdev, format);
+
       mgag200_enable_display(mdev);
       if (mdev->type == G200_WB || mdev->type == G200_EW3)

base-commit: 1baf9127c482a3a58aef81d92ae751798e2db202

Signature · 1 line
Jocelyn
#4 lore raw

Hi

Am 10.05.23 um 11:29 schrieb Jocelyn Falempe:

Quoted 16 lines · Thomas Zimmermann
Quoted 15 lines

Hi,

oh great! Thank you for fixing this bug. And sorry that I broke it.

Am 10.05.23 um 10:54 schrieb Jocelyn Falempe:

Quoted 9 lines

When mgag200 switched from simple KMS to regular atomic helpers, the initialization of the gamma settings was lost.
This leads to a black screen, if the bios/uefi doesn't use the same pixel color depth.

Fixes 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers")
Quoted 5 lines
Quoted 3 lines

Also needs:

Cc <[email protected]> # v6.1+

Should I send a v2 with this added ?

Yes, please.

Quoted 8 lines
Quoted 6 lines

In terms of what it does:

but the patch is apparently for against an old version. (v6.1?) The code in mgag200_crtc_helper_atomic_enable has changed quite a bit.

Yes, I based it on the culprit commit 1baf9127c482, but it applies cleanly with git am -3 on top of v6.3

Rather send a patch against drm-misc-fixes and let backporters sort it out. That's current practice AFAIK. You could also reply to your v2 patch mail with a link to the v1 patch.

Best regards
Thomas

Quoted 29 lines
Quoted 28 lines

Best regards
Thomas

Quoted 22 lines

---
  drivers/gpu/drm/mgag200/mgag200_mode.c | 5 +++++

  1 file changed, 5 insertions(+)
drivers/gpu/drm/mgag200/mgag200_mode.c +5 -0
index 461da1409fdf..911d46741e40 100644
@@ -819,6 +819,11 @@ static void 
 mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc,
       else if (mdev->type == G200_EV)
           mgag200_g200ev_set_hiprilvl(mdev);
+    if (crtc_state->gamma_lut)
+        mgag200_crtc_set_gamma(mdev, format, 
 crtc_state->gamma_lut->data);
+    else
+        mgag200_crtc_set_gamma_linear(mdev, format);
+
       mgag200_enable_display(mdev);
       if (mdev->type == G200_WB || mdev->type == G200_EW3)

base-commit: 1baf9127c482a3a58aef81d92ae751798e2db202

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)