diff mbox series

[v2] drm/mgag200: Fix gamma lut not initialized.

Message ID 20230510131034.284078-1-jfalempe@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v2] drm/mgag200: Fix gamma lut not initialized. | expand

Commit Message

Jocelyn Falempe May 10, 2023, 1:10 p.m. UTC
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.

v2: rebase on top of drm-misc-fixes, and add Cc stable tag.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2171155
Fixes: 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers")
Cc: <stable@vger.kernel.org>
Tested-by: Phil Oester <kernel@linuxace.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 5 +++++
 1 file changed, 5 insertions(+)


base-commit: a26cc2934331b57b5a7164bff344f0a2ec245fc0

Comments

Thomas Zimmermann May 11, 2023, 12:26 p.m. UTC | #1
Hi

Am 10.05.23 um 15:10 schrieb Jocelyn Falempe:
> 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.
> 
> v2: rebase on top of drm-misc-fixes, and add Cc stable tag.

Looks good. Please add the patch to drm-misc-fixes.

Best regards
Thomas

> 
> Link: https://bugzilla.redhat.com/show_bug.cgi?id=2171155
> Fixes: 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers")
> Cc: <stable@vger.kernel.org>
> Tested-by: Phil Oester <kernel@linuxace.com>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
> ---
>   drivers/gpu/drm/mgag200/mgag200_mode.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
> index 0a5aaf78172a..576c4c838a33 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_mode.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
> @@ -640,6 +640,11 @@ void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_
>   	if (funcs->pixpllc_atomic_update)
>   		funcs->pixpllc_atomic_update(crtc, old_state);
>   
> +	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 (funcs->enable_vidrst)
> 
> base-commit: a26cc2934331b57b5a7164bff344f0a2ec245fc0
Jocelyn Falempe May 11, 2023, 1:31 p.m. UTC | #2
On 11/05/2023 14:26, Thomas Zimmermann wrote:
> Hi
> 
> Am 10.05.23 um 15:10 schrieb Jocelyn Falempe:
>> 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.
>>
>> v2: rebase on top of drm-misc-fixes, and add Cc stable tag.
> 
> Looks good. Please add the patch to drm-misc-fixes.
Applied to drm-misc-fixes

Thanks
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 0a5aaf78172a..576c4c838a33 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -640,6 +640,11 @@  void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_
 	if (funcs->pixpllc_atomic_update)
 		funcs->pixpllc_atomic_update(crtc, old_state);
 
+	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 (funcs->enable_vidrst)