[igt-dev] [PATCH i-g-t] igt_core: Fix docs for SLOW_QUICK

Dixit, Ashutosh ashutosh.dixit at intel.com
Wed Nov 17 20:34:20 UTC 2021


On Wed, 17 Nov 2021 08:44:30 -0800, Dixit, Ashutosh wrote:
>
> On Wed, 17 Nov 2021 02:42:29 -0800, Petri Latvala wrote:
> >
> > The macro is for choosing between two values depending on whether IGT
> > has been told it's running in simulation mode. The parameter names and
> > their documentation was the opposite of what actually happened.
> >
> > The only user, gem_lut_handle, uses the macro correctly, having the
> > "use this value in simulation mode" value as the second parameter.
> >
> > Signed-off-by: Petri Latvala <petri.latvala at intel.com>
> > Cc: Arkadiusz Hiler <arek at hiler.eu>
> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> > ---
> >  lib/igt_core.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/igt_core.h b/lib/igt_core.h
> > index 6b8dbf34..077e1bf3 100644
> > --- a/lib/igt_core.h
> > +++ b/lib/igt_core.h
> > @@ -1170,7 +1170,7 @@ bool igt_run_in_simulation(void);
> >   * Simple macro to select between two values (e.g. number of test rounds or test
> >   * buffer size) depending upon whether i-g-t is run in simulation mode or not.
> >   */
> > -#define SLOW_QUICK(slow,quick) (igt_run_in_simulation() ? (quick) : (slow))
> > +#define SLOW_QUICK(quick,slow) (igt_run_in_simulation() ? (slow) : (quick))
>
> Previous code assumes slow/quick refer to number of iterations whereas this
> patch assumes slow/quick refer to similation speed, correct? It seems to be
> 12 of one, dozen of the other to me. How about:
>
> #define SLOW_QUICK(x, y) (igt_run_in_simulation() ? (y) : (x))
>
> :-)
>
> I prefer the previous interpretation where quick is assumed to be much
> smaller than slow.

Well I guess the "simulation" value can be both less than or more than the
hw value ("keep number of iterations in simulation low" or "increase
timeout in simulation"). Another idea to make this clear:

#define SLOW_QUICK(hw, sim) (igt_run_in_simulation() ? (sim) : (hw))


More information about the igt-dev mailing list