[PATCH] xfree86: use udev to provide device enumeration for kms devices (v4
Mark Kettenis
mark.kettenis at xs4all.nl
Mon May 14 11:21:59 PDT 2012
> From: Dave Airlie <airlied at gmail.com>
> Date: Mon, 14 May 2012 08:42:50 +0100
So the bit below is what effectively defines the interface for the new
platform bus probe? You basically pass the a list of attributes to
the driver probe routine and which then gets to decide whether it
wants to attach based on inspection of those attributes?
(It would really help here if you showed and example of a converted
driver here).
> diff --git a/include/hotplug.h b/include/hotplug.h
> index f3eeea2..59c4ebb 100644
> --- a/include/hotplug.h
> +++ b/include/hotplug.h
> @@ -26,8 +26,42 @@
> #ifndef HOTPLUG_H
> #define HOTPLUG_H
>
> +#include "list.h"
> +
> extern _X_EXPORT void config_pre_init(void);
> extern _X_EXPORT void config_init(void);
> extern _X_EXPORT void config_fini(void);
>
> +struct OdevAttribute {
> + struct xorg_list member;
> + int attrib_id;
> + char *attrib_name;
> +};
So attributes are identified by integers and are string-valued. I
suppose you can always encode numbers as strings. But wuldn't an
OpenFirmware-like propert list make more sense for a generic
"platform" bus interface? Or are you deliberately trying to keep the
list of possible attributes very small?
> +struct OdevAttributes {
> + struct xorg_list list;
> +};
> +
> +struct OdevAttributes *
> +config_odev_allocate_attribute_list(void);
> +
> +void
> +config_odev_free_attribute_list(struct OdevAttributes *attribs);
> +
> +Bool
> +config_odev_add_attribute(struct OdevAttributes *attribs, int attrib,
> + const char *attrib_name);
> +
> +void
> +config_odev_free_attributes(struct OdevAttributes *attribs);
> +
> +#define ODEV_ATTRIB_PATH 1
> +#define ODEV_ATTRIB_SYSPATH 2
> +#define ODEV_ATTRIB_SYSNAME 3
> +#define ODEV_ATTRIB_BUSID 4
So this is the initial set of attributes you think are needed for
udev. Can you document what these attributes actually mean?
More information about the xorg-devel
mailing list