[cairo] [PATCH 36/72] drm: cleaned up device probing / initialization

Chris Wilson chris at chris-wilson.co.uk
Tue Dec 29 08:01:13 PST 2015


On Tue, Dec 29, 2015 at 10:17:14AM +0100, Enrico Weigelt, metux IT consult wrote:
> +    /* using switch statements, so the compiler has better chance for optimizations */
> +    switch (vendor_id)

However, we share pci ids between projects as:

/*
 * A pci_device_id struct {
 *      __u32 vendor, device;
 *      __u32 subvendor, subdevice;
 *      __u32 class, class_mask;
 *      kernel_ulong_t driver_data;
 * };
 * Don't use C99 here because "class" is reserved and we want to
 * give userspace flexibility.
 */

so iterating over a table is a lot more amenable to plugging in the
common chipset identifiers.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list