drm/ast: Add Atomic gamma lut support for aspeed
authorJocelyn Falempe <jfalempe@redhat.com>
Fri, 30 Sep 2022 09:47:54 +0000 (11:47 +0200)
committerJocelyn Falempe <jfalempe@redhat.com>
Wed, 5 Oct 2022 15:52:26 +0000 (17:52 +0200)
commitce7fcf7003865a63983545fd8f84c04deb1b5dfd
tree5178593a83116da4f3feca673411283b291369fe
parent562d2dd8702806c636ba81c43b23394b29c60acc
drm/ast: Add Atomic gamma lut support for aspeed

The current ast driver only supports legacy gamma interface.
This also fixes a Gnome3/Wayland error which incorrectly adds
gamma to atomic commit:
"Page flip discarded: CRTC property (GAMMA_LUT) not found"

I only tested remotely, so I wasn't able to check that it had
an effect on the VGA output. But when activating "Night Light"
in Gnome, ast_crtc_load_lut() is called.

v2: use the same functions as mgag200.
    handle 16bits color mode.

v3: Check gamma_lut size in atomic check.

v4: revert 16bits mode, v1 was correct.
    make sure gamma table are set when primary plane format
    changes.
    remove rgb888 format that is not used.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220930094754.745626-1-jfalempe@redhat.com
drivers/gpu/drm/ast/ast_mode.c