On 2018-06-01 06:03 PM, [email protected] wrote:
> From: "Leo (Sunpeng) Li" <[email protected]>
> 
> List color management properties on outputs if there's at least one
> CRTC that supports color management. Otherwise, don't list them at
> all.
> 
> If there's no CRTC attached to the output, and there exists a CRTC
> that supports color management, then list "disabled" properties
> (immutable and NULL-valued).
> 
> Signed-off-by: Leo (Sunpeng) Li <[email protected]>
> 
> [...]
>  
> +     if (cm_prop_index == CM_GAMMA_LUT_SIZE) {
> +             format = 32;
> +             length = 1;
> +             data = crtc ? &crtc->gamma_lut_size : &zero;
> +             range[0] = 0;
> +             range[1] = -1;
> +
> +     } else if (cm_prop_index == CM_DEGAMMA_LUT_SIZE) {
> +     [...]

Better use a switch statement here instead of if with multiple else if.
(Same in patch 5)


> +     /* Always issue a non-pending change. We'll push cm properties
> +      * ourselves.
> +      */
> +     err = RRChangeOutputProperty(output->randr_output, atom,
> +                                  XA_INTEGER, format,
> +                                  PropModeReplace,
> +                                  length, data, FALSE, FALSE);
> +     if (err) {
> +             xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
> +                        "Changing color management property %s failed with 
> %d\n",
> +                        cm_prop_names[cm_prop_index], err);
> +             return err;
> +     }
> +
> +     return 0;
> +}

Could simply always return err here.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to