Boris Brezillon <boris.brezil...@bootlin.com> writes: > From: Boris Brezillon <boris.brezil...@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. > +#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.
signature.asc
Description: PGP signature
_______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit