Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 5/8] lib: Add igt_matrix
Date: Wed, 28 Feb 2018 16:57:09 +0200	[thread overview]
Message-ID: <20180228145709.GH5453@intel.com> (raw)
In-Reply-To: <151976719317.21577.16909839422802919294@mail.alporthouse.com>

On Tue, Feb 27, 2018 at 09:33:13PM +0000, Chris Wilson wrote:
> Quoting Ville Syrjala (2018-02-27 21:21:17)
> > +#include "igt_core.h"
> > +#include "igt_matrix.h"
> > +
> > +/**
> > + * SECTION:igt_matrix
> > + * @short_description: Matrix math library
> > + * @title: Matrix
> > + * @include: igt.h
> > + *
> > + * This library contains helper functions for basic matrix math.
> > + * The library operates on #igt_mat4 and #igt_vec4 structures.
> > + */
> > +
> > +/**
> > + * igt_matrix_print:
> > + * @m: the matrix
> > + *
> > + * Print out the matrix elements.
> > + */
> > +void igt_matrix_print(const struct igt_mat4 *m)
> > +{
> > +       for (int row = 0; row < 4; row++) {
> > +               igt_info("|");
> > +               for (int col = 0; col < 4; col++) {
> > +                       igt_info("%4.4f,", m->d[col * 4 + row]);
> 
> #define m(row, col) ((col) * 4 + (row)) ?

Seems like a sensible idea.

> 
> > +               }
> > +               igt_info("|\n");
> > +       }
> > +}
> > +
> > +/**
> > + * igt_matrix_identity:
> > + *
> > + * Returns:
> > + * An identity matrix.
> > + */
> > +struct igt_mat4 igt_matrix_identity(void)
> > +{
> > +       struct igt_mat4 ret = {
> > +               .d[0 * 4 + 0] = 1.0f,
> > +               .d[1 * 4 + 1] = 1.0f,
> > +               .d[2 * 4 + 2] = 1.0f,
> > +               .d[3 * 4 + 3] = 1.0f,
> > +       };
> 
> static ?

Also const I suppose.

I've not actually checked what kind of a job the compiler does when you
return big blobs like this from functions. Should probably look into
that to make sure the resulting code is not totally insane.

> 
> Didn't spot any typos.
> -Chris

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-02-28 14:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 21:21 [igt-dev] [PATCH i-g-t 1/8] lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversion Ville Syrjala
2018-02-27 21:21 ` [igt-dev] [PATCH i-g-t 2/8] lib: Clear packed YUV formats to black Ville Syrjala
2018-02-27 21:21 ` [igt-dev] [PATCH i-g-t 3/8] lib: Don't use dumb buffers for YCbCr Ville Syrjala
2018-02-27 21:21 ` [igt-dev] [PATCH i-g-t 4/8] lib: Clean up format_desc Ville Syrjala
2018-02-28 18:44   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2018-02-27 21:21 ` [igt-dev] [PATCH i-g-t 5/8] lib: Add igt_matrix Ville Syrjala
2018-02-27 21:33   ` Chris Wilson
2018-02-28 14:57     ` Ville Syrjälä [this message]
2018-02-28 15:01       ` Ville Syrjälä
2018-02-28 17:36   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2018-02-27 21:21 ` [igt-dev] [PATCH i-g-t 6/8] lib: Add igt_color_encoding Ville Syrjala
2018-02-27 21:21 ` [igt-dev] [PATCH i-g-t 7/8] lib: Use igt_matrix for ycbcr<->rgb conversion Ville Syrjala
2018-03-02  8:35   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2018-02-27 21:21 ` [igt-dev] [PATCH i-g-t 8/8] lib: Add support for rendering into packed YCbCr framebuffers Ville Syrjala
2018-02-27 21:36   ` Chris Wilson
2018-02-28 14:59     ` Ville Syrjälä
2018-03-01 11:00   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2018-03-02  8:35   ` [igt-dev] [PATCH i-g-t v3 " Ville Syrjala
2018-02-27 23:27 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/8] lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversion Patchwork
2018-02-28 18:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/8] lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversion (rev2) Patchwork
2018-02-28 19:34 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/8] lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversion (rev3) Patchwork
2018-02-28 23:20 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/8] lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversion (rev2) Patchwork
2018-03-01  0:33 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/8] lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversion (rev3) Patchwork
2018-03-01 16:33 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/8] lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversion (rev4) Patchwork
2018-03-02 17:30 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/8] lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversion (rev6) Patchwork
2018-03-02 21:09 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20180228145709.GH5453@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    /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