diff mbox

[i-g-t,1/2] lib: Remove i915ism when checking that debugfs is mounted

Message ID 20170302100826.740-1-tomeu.vizoso@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomeu Vizoso March 2, 2017, 10:08 a.m. UTC
Instead of checking for "i915_error_state" within dri/N/, check for
"name".

This allows more tests to run against drivers other than i915.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
 lib/igt_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chris Wilson March 2, 2017, 10:12 a.m. UTC | #1
On Thu, Mar 02, 2017 at 11:08:25AM +0100, Tomeu Vizoso wrote:
> Instead of checking for "i915_error_state" within dri/N/, check for
> "name".
> 
> This allows more tests to run against drivers other than i915.

Bleh. Sadly many users are expecting to have the i915 directory. Please
kill the singleton and convert users to request which device debugfs
they want.
-Chris
Tomeu Vizoso March 2, 2017, 1:39 p.m. UTC | #2
On 2 March 2017 at 11:12, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Mar 02, 2017 at 11:08:25AM +0100, Tomeu Vizoso wrote:
>> Instead of checking for "i915_error_state" within dri/N/, check for
>> "name".
>>
>> This allows more tests to run against drivers other than i915.
>
> Bleh. Sadly many users are expecting to have the i915 directory. Please
> kill the singleton and convert users to request which device debugfs
> they want.

Are you sure this is needed? If a test opened the device with
DRIVER_INTEL, it cannot happen that the debugfs dir is present but the
i915-specific files aren't.

Regards,

Tomeu

> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson March 2, 2017, 1:46 p.m. UTC | #3
On Thu, Mar 02, 2017 at 02:39:16PM +0100, Tomeu Vizoso wrote:
> On 2 March 2017 at 11:12, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On Thu, Mar 02, 2017 at 11:08:25AM +0100, Tomeu Vizoso wrote:
> >> Instead of checking for "i915_error_state" within dri/N/, check for
> >> "name".
> >>
> >> This allows more tests to run against drivers other than i915.
> >
> > Bleh. Sadly many users are expecting to have the i915 directory. Please
> > kill the singleton and convert users to request which device debugfs
> > they want.
> 
> Are you sure this is needed? If a test opened the device with
> DRIVER_INTEL, it cannot happen that the debugfs dir is present but the
> i915-specific files aren't.

Opening by DRIVER_INTEL does not mean that the first name is i915. I am
suggesting that we transition away from assuming that we only want to
open i915's debugfs by opening the exact debugfs dir. (i.e. find the
minor index for the desired device, then open that path.)
-Chris
Tomeu Vizoso March 2, 2017, 2:05 p.m. UTC | #4
On 2 March 2017 at 14:46, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Mar 02, 2017 at 02:39:16PM +0100, Tomeu Vizoso wrote:
>> On 2 March 2017 at 11:12, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> > On Thu, Mar 02, 2017 at 11:08:25AM +0100, Tomeu Vizoso wrote:
>> >> Instead of checking for "i915_error_state" within dri/N/, check for
>> >> "name".
>> >>
>> >> This allows more tests to run against drivers other than i915.
>> >
>> > Bleh. Sadly many users are expecting to have the i915 directory. Please
>> > kill the singleton and convert users to request which device debugfs
>> > they want.
>>
>> Are you sure this is needed? If a test opened the device with
>> DRIVER_INTEL, it cannot happen that the debugfs dir is present but the
>> i915-specific files aren't.
>
> Opening by DRIVER_INTEL does not mean that the first name is i915. I am
> suggesting that we transition away from assuming that we only want to
> open i915's debugfs by opening the exact debugfs dir. (i.e. find the
> minor index for the desired device, then open that path.)

Got it now, thanks for the explanation.

Regards,

Tomeu

> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index e64d001b71cf..3f4f32da5b4a 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -139,7 +139,7 @@  static bool __igt_debugfs_init(igt_debugfs_t *debugfs)
 	strcpy(debugfs->root, igt_debugfs_mount());
 	for (n = 0; n < 16; n++) {
 		int len = sprintf(debugfs->dri_path, "%s/dri/%d", debugfs->root, n);
-		sprintf(debugfs->dri_path + len, "/i915_error_state");
+		sprintf(debugfs->dri_path + len, "/name");
 		if (stat(debugfs->dri_path, &st) == 0) {
 			debugfs->dri_path[len] = '\0';
 			return true;