Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 08/12] lib/kms: Add igt_crtc_t based CRC wrappers
Date: Wed, 21 Jan 2026 17:09:46 +0200	[thread overview]
Message-ID: <aXDsOuJe7iOV9Cab@intel.com> (raw)
In-Reply-To: <533fc18053baa268f1188aa2dc589c51a522a703@intel.com>

On Wed, Jan 21, 2026 at 11:33:26AM +0200, Jani Nikula wrote:
> On Tue, 20 Jan 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Add wrappers for igt_pipe_crc_new*() that take igt_crtc_t rather
> > than the bare crtc index. Should help eliminate the pipe usage
> > from tests.
> 
> I think the basic idea is good, but a couple of comments inline.
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  lib/igt_kms.c | 14 ++++++++++++++
> >  lib/igt_kms.h |  4 ++++
> >  2 files changed, 18 insertions(+)
> >
> > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > index 74ad82d77dd3..901bbfab5934 100644
> > --- a/lib/igt_kms.c
> > +++ b/lib/igt_kms.c
> > @@ -59,6 +59,7 @@
> >  #include "intel_chipset.h"
> >  #include "igt_debugfs.h"
> >  #include "igt_device.h"
> > +#include "igt_pipe_crc.h"
> >  #include "igt_sysfs.h"
> >  #include "sw_sync.h"
> >  #ifdef HAVE_CHAMELIUM
> > @@ -5299,6 +5300,19 @@ int igt_output_preferred_vrefresh(igt_output_t *output)
> >  		return 60;
> >  }
> >  
> > +igt_pipe_crc_t *igt_crtc_crc_new(igt_crtc_t *crtc, const char *source)
> > +{
> > +	return igt_pipe_crc_new(crtc->display->drm_fd, crtc->crtc_offset,
> > +				source);
> > +}
> > +
> > +igt_pipe_crc_t *igt_crtc_crc_new_nonblock(igt_crtc_t *crtc, const char *source)
> > +{
> > +	return igt_pipe_crc_new_nonblock(crtc->display->drm_fd,
> > +					 crtc->crtc_offset,
> > +					 source);
> > +}
> > +
> >  static const char *igt_crtc_name(igt_crtc_t *crtc)
> >  {
> >  	if (crtc == NULL)
> > diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> > index 71a2f2c4d89c..b291673c2f7f 100644
> > --- a/lib/igt_kms.h
> > +++ b/lib/igt_kms.h
> > @@ -584,6 +584,10 @@ static inline igt_crtc_t *igt_crtc_for_pipe(igt_display_t *display, enum pipe pi
> >  	return &display->pipes[pipe];
> >  }
> >  
> > +typedef struct _igt_pipe_crc igt_pipe_crc_t;
> 
> So this is a dupe typedef, also defined in igt_pipe_crc.h. It works,
> it's probably better than including the other header here, but also a
> bit meh.

Yeah, forward declarations seem be to be painful with typedefs.

> 
> Another idea is naming this based on crtc instead of pipe, even if "crtc
> crc" is a mouthful:
> 
> typedef struct _igt_pipe_crc igt_crtc_crc_t;
> 
> I think it'll work, the types are compatible with the underlying struct
> being the same. So we could (gradually) convert from pipe_crc to
> crtc_crc.

Shrug.

> 
> With the wrappers being in igt_kms.[ch], is the idea that most tests
> could cease to include igt_pipe_crc.h after the conversions?

I expect the tests will need a bunch of other stuff from there
still.

Originally I put the crtc wrappers into igt_pipe_crc.[ch], but
then I needed to add forward declarations and includes for
igt_crtc_t which felt even worse.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2026-01-21 15:09 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 17:16 [PATCH i-g-t 00/12] lib/kms: More pipe->crtc conversion Ville Syrjala
2026-01-20 17:16 ` [PATCH i-g-t 01/12] igt/kms: Nuke igt_pipe_is_prop_changed() and igt_pipe_set_prop_value() Ville Syrjala
2026-01-21  8:50   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 02/12] lib/kms: Rename igt_pipe_obj_*_prop() Ville Syrjala
2026-01-21  8:55   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 03/12] lib/kms: Pass igt_crtc_t to igt_pipe_refresh() Ville Syrjala
2026-01-21  8:57   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 04/12] lib/kms: Don't pass 'display' to igt_fill_pipe_props)_ Ville Syrjala
2026-01-21  8:58   ` Jani Nikula
2026-01-21  8:58   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 05/12] lib/kms: Rename a bunch of crtc functions Ville Syrjala
2026-01-21  9:06   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 06/12] lib/kms: Eliminate some redundant igt_crtc_for_pipe()s Ville Syrjala
2026-01-21  9:45   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 07/12] lib/crc: Convert igt_pipe_crc away from enum pipe Ville Syrjala
2026-01-21  9:21   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 08/12] lib/kms: Add igt_crtc_t based CRC wrappers Ville Syrjala
2026-01-21  9:33   ` Jani Nikula
2026-01-21 15:09     ` Ville Syrjälä [this message]
2026-01-22 10:02       ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 09/12] lib/kms: Use igt_crtc_crc_new() Ville Syrjala
2026-01-21  9:36   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 10/12] lib/kms: Use igt_crtc_crc_new() more Ville Syrjala
2026-01-21  9:38   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 11/12] lib/kms: Use igt_crtc_crc_new_nonblock() more Ville Syrjala
2026-01-21  9:38   ` Jani Nikula
2026-01-20 17:16 ` [PATCH i-g-t 12/12] lib/kms: Use igt_crtc_crc_new() even more Ville Syrjala
2026-01-21  9:39   ` Jani Nikula
2026-01-20 19:58 ` ✓ Xe.CI.BAT: success for lib/kms: More pipe->crtc conversion Patchwork
2026-01-20 20:07 ` ✓ i915.CI.BAT: " Patchwork
2026-01-21  1:58 ` ✓ Xe.CI.Full: " Patchwork
2026-01-21  9:15 ` ✓ i915.CI.Full: " Patchwork

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=aXDsOuJe7iOV9Cab@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox