Re: [PATCH libdrm 4/5] xf86drm: introduce drmGetDevice[s]2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/12/16 05:35 AM, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov@xxxxxxxxxxxxx>
> 
> Relative to the original version, here one can provide a flags bitmask.
> Currently only DRM_DEVICE_IGNORE_PCI_REVISION is supported.
> 
> Implementation detail:
> If it's set, we will only parse the separate sysfs files and we won't
> touch the config one. The latter awakes the device (causing delays)
> which is the core reason why this API was introduced.
> 
> Cc: Michel Dänzer <michel@xxxxxxxxxxx>
> Cc: Nicolai Hähnle <nhaehnle@xxxxxxxxx>
> Cc: Mauro Santos <registo.mailling@xxxxxxxxx>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98502
> Signed-off-by: Emil Velikov <emil.velikov@xxxxxxxxxxxxx>
> ---
> Michel, Nicolai any naming suggestions or input in general will be
> appreciated.

It all looks good to me in general, thanks for doing this! I just have
a couple of minor suggestions for this patch which might make the code
clearer, feel free to take them or leave them. Either way, patches 3-5
are

Reviewed-by: Michel Dänzer <michel.daenzer@xxxxxxx>


> @@ -2963,7 +2964,7 @@ static int parse_separate_sysfs_files(int maj, int min,
>      FILE *fp;
>      int ret;
>  
> -    for (unsigned i = 0; i < ARRAY_SIZE(attrs); i++) {
> +    for (unsigned i = (0 + !!ignore_revision); i < ARRAY_SIZE(attrs); i++) {

    for (unsigned i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) {


> diff --git a/xf86drm.h b/xf86drm.h
> index 4da6bd3..1c6ed36 100644
> --- a/xf86drm.h
> +++ b/xf86drm.h
> @@ -801,6 +801,10 @@ extern void drmFreeDevice(drmDevicePtr *device);
>  extern int drmGetDevices(drmDevicePtr devices[], int max_devices);
>  extern void drmFreeDevices(drmDevicePtr devices[], int count);
>  
> +#define DRM_DEVICE_IGNORE_PCI_REVISION 0x0001

#define DRM_DEVICE_IGNORE_PCI_REVISION (1 << 0)

to make it clearer that flags will be separate bits, not enumeration values.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux