[Piglit] [PATCH] AMD_performance_monitor: add VC4 specific tests
Boris Brezillon
boris.brezillon at bootlin.com
Mon Feb 12 09:08:49 UTC 2018
On Fri, 09 Feb 2018 21:12:20 +0000
Eric Anholt <eric at anholt.net> wrote:
> Boris Brezillon <boris.brezillon at bootlin.com> writes:
>
> > From: Boris Brezillon <boris.brezillon at free-electrons.com>
> >
> > This adds a specific test for the VC4 GPU.
> > Right now, it only checks that FEP-valid-quads and
> > QPU-total-clk-cycles-waiting-TMU are consistent after executing well
> > know operations (draw a rectangle or a texture).
> >
> > More tests will be added over time.
>
> I'd still like to put together some tests of state management (to catch
> things like the flushing bugs we had in the first revs), but this seems
> like a good start.
Ok. I think I'll need more inputs on how you want to test that.
>
> > +#define FEP_VALID_QUADS_REF_VAL 6440
> > +
> > +static void draw_rect(const struct perfmon_test *test)
> > +{
> > + piglit_draw_rect(-1, -1, 3, 3);
> > +}
> > +
> > +static void draw_tex(const struct perfmon_test *test)
> > +{
> > + GLuint tex;
> > +
> > + tex = piglit_rgbw_texture(GL_RGBA, 64, 64, false, true,
> > + GL_UNSIGNED_BYTE);
> > + verify(piglit_check_gl_error(GL_NO_ERROR));
> > +
> > + glEnable(GL_TEXTURE_2D);
> > + glBindTexture(GL_TEXTURE_2D, tex);
> > + piglit_draw_rect_tex(-1, -1, 2, 2, 0, 0, 1, 1);
> > + glDisable(GL_TEXTURE_2D);
> > + glDeleteTextures(1, &tex);
> > +}
> > +
> > +static bool fep_valid_quads_check_res(uint64_t res)
> > +{
> > + return res == FEP_VALID_QUADS_REF_VAL;
>
> We should probably have the number of valid quads either be some math
> based on the config.window_width/height, or explicitly set the
> window_width/height so it's not dependent on whatever defaults the
> framework chooses.
>
> The valid quads is a pretty magic value because we're drawing this:
>
> +---+
> | /|
> | / |
> |/ |
> +---+
>
> so some of the 2x2 quads get drawn twice along the middle edge between
> the tris. If we drew the triangle outside of the window:
>
> +---+---+
> | | /
> | | /
> | |/
> +---/
> | /
> | /
> |/
> +
>
> with piglit_draw_rect(-1, -2, 4, 4), then I don't think any of the quads
> would be drawn twice, and the magic REF_VAL would become
> align(window_width, 2) * align(window_height, 2) / 4.
Okay, I'll try that.
--
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
More information about the Piglit
mailing list