All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Jani Nikula <jani.nikula@intel.com>,
	Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
	igt-dev@lists.freedesktop.org, 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: Wed, 27 May 2026 17:22:32 +0300	[thread overview]
Message-ID: <ahb-KCRgBiZFb0bH@intel.com> (raw)
In-Reply-To: <20260527132247.oqxnekctlpttxoyc@kamilkon-DESK.igk.intel.com>

On Wed, May 27, 2026 at 03:22:47PM +0200, Kamil Konieczny wrote:
> Hi Jani,
> On 2026-05-26 at 15:07:57 +0300, Jani Nikula wrote:
> > On Tue, 26 May 2026, "Sebastian Brzezinka" <sebastian.brzezinka@intel.com> wrote:
> > > 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.
> > 
> > I obviously disagree with all of that, but *shrug*.
> 
> We could implement separete lib functions for tools but
> that will require duplicate effort.
> 
> The idea with __function is that it should be implemented
> without any igt_assert nor igt_require so tools could use them.
> We could go with function() but then developers could
> later on change behaviour and break a tool.
> 
> Or we could add some suffix to a name? function_safe()?
> 
> Btw why tool/igt_power couldn't just read sysfs? Why does it
> needs to open /dev/dri/card* to get any info? +cc Ville

It opens the device just because lib/igt_power and its
dependencies want the fd.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2026-05-27 14:23 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
2026-05-26 12:07       ` Jani Nikula
2026-05-27 13:22         ` Kamil Konieczny
2026-05-27 14:22           ` Ville Syrjälä [this message]
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=ahb-KCRgBiZFb0bH@intel.com \
    --to=ville.syrjala@linux.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=sebastian.brzezinka@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.