[PATCH v3 weston 4/5] tests: add test for setting gamma

Daniel Stone daniel at fooishbar.org
Sat Jul 21 12:22:06 UTC 2018


Hi Harsha,

On Thu, 28 Jun 2018 at 14:28, <harsha.manjulamallikarjun at in.bosch.com> wrote:
> +static int
> +gamma_update_event(void *data)
> +{
> +       struct gamma_tobject *obj;
> +       struct output_obj *op_obj;
> +       uint16_t *r, *g, *b;
> +       bool all_tests_complete = true;
> +
> +       obj = (struct gamma_tobject *)data;
> +
> +       wl_list_for_each(op_obj, &obj->output_list, link) {
> +               /*compute Gamma lookup table*/
> +               if (!op_obj->test_complete) {

As a small style point, please make this 'if (op_obj->test_complete)
[newline] continue;'. This removes one level of indentation from the
branch.

> +                       op_obj->gamma += 0.3;
> +                       if (op_obj->gamma > 2.1) {
> +                               op_obj->test_complete = true;
> +                               /*End the test with gamma set to 1*/
> +                               op_obj->gamma = 1.0;
> +                       }
> +                       r = malloc(sizeof(uint16_t) * op_obj->output->gamma_size * 3);
> +                       g = &r[op_obj->output->gamma_size];
> +                       b = &g[op_obj->output->gamma_size];
> +
> +                       compute_gamma_lut(op_obj->gamma, op_obj->output->gamma_size,
> +                                                         r, g, b);
> +
> +                       op_obj->output->set_gamma(op_obj->output, op_obj->output->gamma_size,
> +                                       r, g, b);
> +
> +                       free(r);
> +                       all_tests_complete=false;
> +               }
> +       }

So, I understand this would be a manual test where the user would
visually verify that the gamma is changing in the way they would
expect? I have no problem with that, but it would be nice to see this
documented with an example as to what the user should be seeing with
each step.

Also, lastly, is there a public libweston user for this new API? It
would be nice to have this be configurable.

Cheers,
Daniel


More information about the wayland-devel mailing list