Re: [PATCH] xfree86: use udev to provide device enumeration for kms devices (v4

2012-05-15 Thread Adam Jackson

On 5/14/12 3:42 AM, Dave Airlie wrote:


+struct xf86_platform_device;

  typedef struct _DriverRec {
  int driverVersion;
@@ -325,9 +326,20 @@ typedef struct _DriverRec {
  const struct pci_id_match *supported_devices;
  Bool (*PciProbe) (struct _DriverRec * drv, int entity_num,
struct pci_device * dev, intptr_t match_data);
+#ifdef XSERVER_PLATFORM_BUS
+Bool (*platformProbe) (struct _DriverRec * drv, int entity_num, int flags,
+   struct xf86_platform_device * dev, intptr_t 
match_data);
+#else
+void *platformProbe; /* place holder to non udev-kms support so struct is 
right size */
+#endif
  } DriverRec, *DriverPtr;


Style point: I don't think there's any reason to make this conditional. 
 You've already got the opaque struct decl for xf86_platform_device.


Looks alright to me otherwise.

Reviewd-by: Adam Jackson a...@redhat.com

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] xfree86: use udev to provide device enumeration for kms devices (v4

2012-05-14 Thread James Cloos
Has anyone tested to determine whether this Does The Right Thing
on systems which use mdev (from busybox) instead of udev?

I don't have the resources to test it here.

-JimC
-- 
James Cloos cl...@jhcloos.com OpenPGP: 1024D/ED7DAEA6
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] xfree86: use udev to provide device enumeration for kms devices (v4

2012-05-14 Thread Dave Airlie
On Mon, May 14, 2012 at 4:49 PM, James Cloos cl...@jhcloos.com wrote:
 Has anyone tested to determine whether this Does The Right Thing
 on systems which use mdev (from busybox) instead of udev?

Does mdev claim to be udev, i.e. will the configure checks fail
properly? then it should work fine. also the same applies to input I
suppose.

but I'm guessing that would be up to someone who cares about mdev to
test, I've no idea how to make it work.

Dave.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] xfree86: use udev to provide device enumeration for kms devices (v4

2012-05-14 Thread Mark Kettenis
 From: Dave Airlie airl...@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?
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel