From: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
To: Jani Nikula <jani.nikula@intel.com>,
Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
<igt-dev@lists.freedesktop.org>
Cc: <kamil.konieczny@linux.intel.com>, <krzysztof.karas@intel.com>,
<zbigniew.kempczynski@intel.com>, <x.wang@intel.com>
Subject: Re: [PATCH v4 1/2] lib/drmtest: add __drm_open_driver_path()
Date: Tue, 26 May 2026 13:59:09 +0200 [thread overview]
Message-ID: <DISLAJF1M2CM.34O1ZGNO7XPCJ@intel.com> (raw)
In-Reply-To: <c7f64283b82bdbf091007180335a3eed6a56c4ba@intel.com>
Hi Jani,
On Tue May 26, 2026 at 1:51 PM CEST, Jani Nikula wrote:
> On Tue, 26 May 2026, Sebastian Brzezinka <sebastian.brzezinka@intel.com> wrote:
>> Add __drm_open_driver_path() as a path-based DRM open helper. It opens
>> the given path with O_RDWR, verifies the resulting fd is a DRM device by
>> issuing DRM_IOCTL_VERSION via __get_drm_device_name() before proceeding
>> (returning -1 and closing on failure), logs the opened device path, and
>> populates the xe_device cache when the device is Xe.
>>
>> The __ prefix signals that the function does not throw assertions or
>> igt_require() calls, consistent with the existing __drm_open_driver*
>> family.
>
> FWIW, I think the __ prefix should indicate "implementation detail,
> don't call directly" or something along those lines.
>
> I think it's problematic to encourage tests to call __ prefixed
> functions.
In general I agree with you, but in v3 Kamil comment on this:
```
>>Could you rename it into __drm_open_driver_path?
>>The idea is that all __functions should not throw asserts nor
>>require.
```
So I added an explanation in the comment.
--
Best regards,
Sebastian
next prev parent reply other threads:[~2026-05-26 11:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 11:39 [PATCH v4 0/2] tools/igt_power: fix Xe crash via drmtest path helpers Sebastian Brzezinka
2026-05-28 10:20 ` [PATCH i-g-t " Sebastian Brzezinka
2026-05-26 11:39 ` [PATCH v4 1/2] lib/drmtest: add __drm_open_driver_path() Sebastian Brzezinka
2026-05-28 10:20 ` [PATCH i-g-t " Sebastian Brzezinka
2026-05-26 11:39 ` [PATCH v4 2/2] tools/igt_power: fix crash on Xe devices by initializing xe_device cache Sebastian Brzezinka
2026-05-28 10:20 ` [PATCH i-g-t " Sebastian Brzezinka
2026-05-26 11:51 ` [PATCH v4 1/2] lib/drmtest: add __drm_open_driver_path() Jani Nikula
2026-05-26 11:59 ` Sebastian Brzezinka [this message]
2026-05-26 12:07 ` Jani Nikula
2026-05-27 13:22 ` Kamil Konieczny
2026-05-27 14:22 ` Ville Syrjälä
2026-05-29 13:37 ` Gustavo Sousa
2026-05-28 15:17 ` Kamil Konieczny
2026-05-27 14:32 ` [PATCH v4 0/2] tools/igt_power: fix Xe crash via drmtest path helpers Kamil Konieczny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DISLAJF1M2CM.34O1ZGNO7XPCJ@intel.com \
--to=sebastian.brzezinka@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=krzysztof.karas@intel.com \
--cc=x.wang@intel.com \
--cc=zbigniew.kempczynski@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.