diff mbox

[i-g-t] lib/drmtest: Take DRIVER_ANY into account when opening the DRM device

Message ID 1477555099-2333-1-git-send-email-tomeu.vizoso@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomeu Vizoso Oct. 27, 2016, 7:58 a.m. UTC
__drm_open_driver was changed to bail out on VGEM devices unless they
are explicitly asked for (DRIVER_VGEM). But with that change we lost
support for DRIVER_ANY.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Fixes: 7ce63894854d ("lib: Support opening vGEM device")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/drmtest.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Chris Wilson Oct. 27, 2016, 8:06 a.m. UTC | #1
On Thu, Oct 27, 2016 at 09:58:19AM +0200, Tomeu Vizoso wrote:
> __drm_open_driver was changed to bail out on VGEM devices unless they
> are explicitly asked for (DRIVER_VGEM). But with that change we lost
> support for DRIVER_ANY.
> 
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> Fixes: 7ce63894854d ("lib: Support opening vGEM device")
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  lib/drmtest.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index 5d3aaa836735..786ffa1b1fae 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -269,6 +269,10 @@ int __drm_open_driver(int chipset)
>  		    is_virtio_device(fd))
>  			return fd;
>  
> +		/* Only VGEM-specific tests should be run on VGEM */
> +		if (chipset & DRIVER_ANY && !is_vgem_device(fd))
> +			return fd;
> +

chipset == DRIVER_ANY

Otherwise if we request DRIVER_INTEL, this will return the first hit if
!intel and !vgem.
-Chris
Tomeu Vizoso Oct. 27, 2016, 8:24 a.m. UTC | #2
On 27 October 2016 at 10:06, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Oct 27, 2016 at 09:58:19AM +0200, Tomeu Vizoso wrote:
>> __drm_open_driver was changed to bail out on VGEM devices unless they
>> are explicitly asked for (DRIVER_VGEM). But with that change we lost
>> support for DRIVER_ANY.
>>
>> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>> Fixes: 7ce63894854d ("lib: Support opening vGEM device")
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> ---
>>  lib/drmtest.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/lib/drmtest.c b/lib/drmtest.c
>> index 5d3aaa836735..786ffa1b1fae 100644
>> --- a/lib/drmtest.c
>> +++ b/lib/drmtest.c
>> @@ -269,6 +269,10 @@ int __drm_open_driver(int chipset)
>>                   is_virtio_device(fd))
>>                       return fd;
>>
>> +             /* Only VGEM-specific tests should be run on VGEM */
>> +             if (chipset & DRIVER_ANY && !is_vgem_device(fd))
>> +                     return fd;
>> +
>
> chipset == DRIVER_ANY
>
> Otherwise if we request DRIVER_INTEL, this will return the first hit if
> !intel and !vgem.

Great, thanks.

Tomeu
diff mbox

Patch

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 5d3aaa836735..786ffa1b1fae 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -269,6 +269,10 @@  int __drm_open_driver(int chipset)
 		    is_virtio_device(fd))
 			return fd;
 
+		/* Only VGEM-specific tests should be run on VGEM */
+		if (chipset & DRIVER_ANY && !is_vgem_device(fd))
+			return fd;
+
 		close(fd);
 	}