Hi Pekka,

On 9 February 2018 at 13:07, Pekka Paalanen <ppaala...@gmail.com> wrote:
> +       i = find_crtc_for_connector(b, resources, connector);
> +       if (i < 0) {
> +               weston_log("No usable crtc/encoder pair for connector.\n");
> +               return -1;
> +       }
> +
> +       crtc_id = resources->crtcs[i];
> +
> +       props = drmModeObjectGetProperties(b->drm.fd, crtc_id,
> +                                          DRM_MODE_OBJECT_CRTC);
> +       if (!props) {
> +               weston_log("failed to get CRTC properties\n");
> +               return -1;
> +       }
> +       drm_property_info_populate(b, crtc_props, output->props_crtc,
> +                                  WDRM_CRTC__COUNT, props);
> +       drmModeFreeObjectProperties(props);
> +
> +       output->crtc_id = crtc_id;
> +       output->pipe = i;
> +
> +       output->scanout_plane =
> +               drm_output_find_special_plane(b, output,
> +                                             WDRM_PLANE_TYPE_PRIMARY);
> +       if (!output->scanout_plane) {
> +               weston_log("Failed to find primary plane for output %s\n",
> +                          output->base.name);
> +               output->crtc_id = 0;
> +               return -1;
> +       }

First nitpick: this leaves output->pipe set. Probably best to just
init crtc_id and pipe at the very top, then undo both in a goto err.

Cheers,
Daniel
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to