diff options
author | Sebastian Wick <sebastian.wick@redhat.com> | 2023-03-15 16:21:23 +0100 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2023-03-18 17:52:27 +0000 |
commit | 0ed250314007d30cc18aef20908f58128d4044df (patch) | |
tree | 7870d2014dcde02190062c718c2cb3f3c17c496e | |
parent | 214a7d393b014cb12c1b7986e99e92d1eb324ff2 (diff) | |
download | mutter-0ed250314007d30cc18aef20908f58128d4044df.tar.gz |
backends/native: Report correct Gamma support on the KMS properties path
The gamma property blob can be zero to indicate passthrough but Gamma is
still supported in that case.
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2686
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2916>
-rw-r--r-- | src/backends/native/meta-kms-crtc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/backends/native/meta-kms-crtc.c b/src/backends/native/meta-kms-crtc.c index fb795441d..556f85355 100644 --- a/src/backends/native/meta-kms-crtc.c +++ b/src/backends/native/meta-kms-crtc.c @@ -125,14 +125,17 @@ read_crtc_gamma (MetaKmsCrtc *crtc, if (!prop_lut->prop_id || !prop_size->prop_id) return; - blob_id = prop_lut->value; - if (blob_id == 0) - return; - lut_size = prop_size->value; if (lut_size <= 0) return; + crtc_state->gamma.size = lut_size; + crtc_state->gamma.supported = TRUE; + + blob_id = prop_lut->value; + if (blob_id == 0) + return; + fd = meta_kms_impl_device_get_fd (impl_device); blob = drmModeGetPropertyBlob (fd, blob_id); if (!blob) @@ -147,8 +150,6 @@ read_crtc_gamma (MetaKmsCrtc *crtc, drm_lut = blob->data; - crtc_state->gamma.size = lut_size; - crtc_state->gamma.supported = TRUE; crtc_state->gamma.value = meta_gamma_lut_new_sized (drm_lut_size); for (i = 0; i < drm_lut_size; i++) |