mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
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>
This commit is contained in:
committed by
Dom Cobley
parent
6f828ffc3e
commit
f651114aa9
@@ -332,6 +332,8 @@ static int drm_crtc_legacy_gamma_set(struct drm_crtc *crtc,
|
|||||||
replaced = drm_property_replace_blob(&crtc_state->degamma_lut,
|
replaced = drm_property_replace_blob(&crtc_state->degamma_lut,
|
||||||
use_gamma_lut ? NULL : blob);
|
use_gamma_lut ? NULL : blob);
|
||||||
replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
|
replaced |= drm_property_replace_blob(&crtc_state->ctm, NULL);
|
||||||
|
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,
|
replaced |= drm_property_replace_blob(&crtc_state->gamma_lut,
|
||||||
use_gamma_lut ? blob : NULL);
|
use_gamma_lut ? blob : NULL);
|
||||||
crtc_state->color_mgmt_changed |= replaced;
|
crtc_state->color_mgmt_changed |= replaced;
|
||||||
|
|||||||
Reference in New Issue
Block a user