[Nouveau] [libdrm 06/13] nouveau: introduce object to represent the kernel client

Emil Velikov emil.l.velikov at gmail.com
Thu Nov 26 12:46:14 PST 2015


On 26 November 2015 at 07:14, Ben Skeggs <skeggsb at gmail.com> wrote:

> --- a/nouveau/nouveau.c
> +++ b/nouveau/nouveau.c

> +int
> +nouveau_drm_new(int fd, struct nouveau_drm **pdrm)
> +{
> +       struct nouveau_drm *drm;
> +       drmVersionPtr ver;
> +
> +#ifdef DEBUG
> +       debug_init(getenv("NOUVEAU_LIBDRM_DEBUG"));
> +#endif
> +
> +       if (!(drm = *pdrm = calloc(1, sizeof(*drm))))
Similar to previous patch - set *pdrm at a later stage.

> +               return -ENOMEM;
> +       drm->fd = fd;
> +
> +       if (!(ver = drmGetVersion(fd))) {
> +               nouveau_drm_del(pdrm);
> +               return -EINVAL;
> +       }
> +
> +       drm->drm_version = (ver->version_major << 24) |
> +                          (ver->version_minor << 8) |
> +                           ver->version_patchlevel;
> +       drm->lib_version = 0x01000300;
Do we need this - neither mesa nor xf86-video-nouveau use it.

-Emil


More information about the Nouveau mailing list