diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-04-02 17:42:34 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-04-03 17:29:44 +0300 |
commit | 36b14ff19433f535ad823b9a0d851aae02355856 (patch) | |
tree | de6c68c1762f0bd91ed31a4fb589ce6c83f16caa | |
parent | 96f3f4df3b92a147cf8ee143179cf51aba2fe018 (diff) |
tests/kms_color: Reuse some already compute values
We already compute the lut_size*entry_size so let's reuse those
when allocating the LUTs.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | tests/kms_color.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/kms_color.c b/tests/kms_color.c index 9d683032..270f89bc 100644 --- a/tests/kms_color.c +++ b/tests/kms_color.c @@ -1080,8 +1080,8 @@ invalid_lut_sizes(data_t *data) size_t degamma_lut_size = data->degamma_lut_size * sizeof(struct drm_color_lut); size_t gamma_lut_size = data->gamma_lut_size * sizeof(struct drm_color_lut); - struct drm_color_lut *degamma_lut = malloc(data->degamma_lut_size * sizeof(struct drm_color_lut) * 2); - struct drm_color_lut *gamma_lut = malloc(data->gamma_lut_size * sizeof(struct drm_color_lut) * 2); + struct drm_color_lut *degamma_lut = malloc(degamma_lut_size * 2); + struct drm_color_lut *gamma_lut = malloc(gamma_lut_size * 2); igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY); |