[RFC xserver v5 07/14] modesetting: Use atomic modesetting to configure output/CRTCs

Adam Jackson ajax at nwnk.net
Tue Nov 7 14:54:44 UTC 2017


On Mon, 2017-11-06 at 16:30 -0500, Louis-Francis Ratté-Boulianne wrote:

> @@ -1718,13 +1867,28 @@ drmmode_output_get_modes(xf86OutputPtr output)
>      drmmode_ptr drmmode = drmmode_output->drmmode;
>      int i;
>      DisplayModePtr Modes = NULL, Mode;
> -    drmModePropertyPtr props;
>      xf86MonPtr mon = NULL;
> +#ifdef GLAMOR_HAS_DRM_ATOMIC
> +    drmModeObjectPropertiesPtr props;
> +    uint32_t id;
> +#else
> +    drmModePropertyPtr props;
> +#endif
>  
>      if (!koutput)
>          return NULL;
> 
> +#ifdef GLAMOR_HAS_DRM_ATOMIC
> +    props = drmModeObjectGetProperties(drmmode->fd,
> +                                       drmmode_output->mode_output->connector_id,
> +                                       DRM_MODE_OBJECT_CONNECTOR);
> +    id = drmmode_prop_get_value(&drmmode_output->props_connector[DRMMODE_CONNECTOR_EDID],
> +                                props, 0);
> +    if (id)
> +        drmmode_output->edid_blob = drmModeGetPropertyBlob(drmmode->fd, id);
> +#else
>      /* look for an EDID property */
> +
>      for (i = 0; i < koutput->count_props; i++) {
>          props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
>          if (props && (props->flags & DRM_MODE_PROP_BLOB)) {


This conflicts with the changes added in:

commit f44935cdb7321af242ce9f242975f096807b97f7
Author: Daniel Martin <consume.noise at gmail.com>
Date:   Mon Oct 23 10:31:21 2017 +0200

    modesetting: Use helper to fetch drmModeProperty(Blob)s


That commit also phrases this as "delete then fetch"; what you've added
will keep the old EDID blob even if it's gone away, which seems wrong.

> @@ -2215,6 +2396,17 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
>      /* work out the possible clones later */
>      output->possible_clones = 0;
>  
> +#ifdef GLAMOR_HAS_DRM_ATOMIC
> +    if (!drmmode_prop_info_copy(drmmode_output->props_connector, connector_props,
> +                                DRMMODE_CONNECTOR__COUNT, 0)) {
> +        goto out_free_encoders;
> +    }
> +    props = drmModeObjectGetProperties(drmmode->fd,
> +                                       drmmode_output->output_id,
> +                                       DRM_MODE_OBJECT_CONNECTOR);
> +    drmmode_prop_info_update(drmmode, drmmode_output->props_connector,
> +                             DRMMODE_CONNECTOR__COUNT, props);
> +#else
>      for (i = 0; i < koutput->count_props; i++) {
>          props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
>          if (props && (props->flags & DRM_MODE_PROP_ENUM)) {

This has a similar conflict.

- ajax


More information about the xorg-devel mailing list