diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2022-05-16 23:40:32 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2022-05-17 15:11:22 +0200 |
commit | 20ea6adbf199097c4f5f591ffee088340630dae4 (patch) | |
tree | d6719d95e136611a1c25bbf7789652d6d402779d /target/linux/bcm27xx/patches-5.15/950-0562-drm-Check-whether-the-gamma-lut-has-changed-before-u.patch | |
parent | bca05bd072180dc38ef740b37ded9572a6db1981 (diff) | |
download | upstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.gz upstream-20ea6adbf199097c4f5f591ffee088340630dae4.tar.bz2 upstream-20ea6adbf199097c4f5f591ffee088340630dae4.zip |
bcm27xx: add support for linux v5.15
Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B
Signed-off-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.15/950-0562-drm-Check-whether-the-gamma-lut-has-changed-before-u.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.15/950-0562-drm-Check-whether-the-gamma-lut-has-changed-before-u.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.15/950-0562-drm-Check-whether-the-gamma-lut-has-changed-before-u.patch b/target/linux/bcm27xx/patches-5.15/950-0562-drm-Check-whether-the-gamma-lut-has-changed-before-u.patch new file mode 100644 index 0000000000..22ef7b6143 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.15/950-0562-drm-Check-whether-the-gamma-lut-has-changed-before-u.patch @@ -0,0 +1,33 @@ +From 190eaf4f8d95196b1b66c7c356d28643a6355039 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson <dave.stevenson@raspberrypi.com> +Date: Tue, 2 Nov 2021 16:01:36 +0000 +Subject: [PATCH] drm: Check whether the gamma lut has changed before + updating + +drm_crtc_legacy_gamma_set updates the gamma_lut blob unconditionally, +which leads to unnecessary reprogramming of hardware. + +Check whether the blob contents has actually changed before +signalling that it has been updated. + +Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> +--- + drivers/gpu/drm/drm_color_mgmt.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/drm_color_mgmt.c ++++ b/drivers/gpu/drm/drm_color_mgmt.c +@@ -326,8 +326,12 @@ static int drm_crtc_legacy_gamma_set(str + replaced = drm_property_replace_blob(&crtc_state->degamma_lut, + use_gamma_lut ? NULL : blob); + replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL); +- replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, ++ if (!crtc_state->gamma_lut || !crtc_state->gamma_lut->data || ++ memcmp(crtc_state->gamma_lut->data, blob_data, blob->length)) ++ replaced |= drm_property_replace_blob(&crtc_state->gamma_lut, + use_gamma_lut ? blob : NULL); ++ else ++ drm_property_blob_put(blob); + crtc_state->color_mgmt_changed |= replaced; + + ret = drm_atomic_commit(state); |