Re: [Freedreno] [igt-dev] [PATCH igt 1/2] igt: Split out I/O helpers

2021-12-07 Thread Petri Latvala
gt; +/** > + * igt_writen: > + * @fd: the file descriptor > + * @buf: the block with the contents to write > + * @len: the length to write > + * > + * This writes @len bytes from @data to the sysfs file. > + * > + * Returns: > + * -errorno on failure or bytes read on su

Re: [Freedreno] [igt-dev] [PATCH igt 1/2] igt: Split out I/O helpers

2021-12-01 Thread Petri Latvala
ection needs to be explicitly included in the docs. Squash this in: diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml index 189597c6..0dc5a0b7 100644 --- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml +++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml @@ -30,6 +30,7 @@ + -- Petri Latvala

Re: [Freedreno] [PATCH igt v3 0/4] msm: Add tests for gpu fault handling

2021-11-19 Thread Petri Latvala
ugfs: Add helper for writing debugfs files > lib/igt_debugfs: Add helper for detecting debugfs files > msm: Add helper for cmdstream building and submission > msm: Add recovery tests For patches 3+4, in case you're waiting for this: Acked-by: Petri Latvala For the record, msm-

Re: [Freedreno] [PATCH igt v3 2/4] lib/igt_debugfs: Add helper for detecting debugfs files

2021-11-15 Thread Petri Latvala
On Mon, Nov 15, 2021 at 04:30:40PM -0800, Rob Clark wrote: > From: Rob Clark > > Add a helper that can be used with, for ex, igt_require() so that tests > can be skipped if the kernel is too old. > > Signed-off-by: Rob Clark Reviewed-by: Petri Latvala > --- >

Re: [Freedreno] [PATCH igt v2 3/3] msm: Add recovery tests

2021-11-12 Thread Petri Latvala
On Thu, Nov 11, 2021 at 09:35:16AM -0800, Rob Clark wrote: > On Thu, Nov 11, 2021 at 4:13 AM Petri Latvala wrote: > > > > On Wed, Nov 10, 2021 at 11:00:41AM -0800, Rob Clark wrote: > > > On Wed, Nov 10, 2021 at 10:37 AM Rob Clark wrote: > > > > > > >

Re: [Freedreno] [PATCH igt v2 1/3] lib/igt_debugfs: Add helper for writing debugfs files

2021-11-11 Thread Petri Latvala
On Wed, Nov 10, 2021 at 10:42:11AM -0800, Rob Clark wrote: > From: Rob Clark > > Signed-off-by: Rob Clark Reviewed-by: Petri Latvala > --- > v2: Fix headerdoc comments > > lib/igt_debugfs.c | 17 + > lib/igt_debugfs.h | 13 + > 2 f

Re: [Freedreno] [PATCH igt v2 3/3] msm: Add recovery tests

2021-11-11 Thread Petri Latvala
*pipe = NULL; > > + > > + igt_fixture { > > + dev = igt_msm_dev_open(); > > + pipe = igt_msm_pipe_open(dev, 0); > > + scratch_bo = igt_msm_bo_new(dev, 0x1000, MSM_BO_WC); > > + scratch =

Re: [Freedreno] [igt-dev] [PATCH igt 1/3] lib/igt_debugfs: Add helper for writing debugfs files

2021-11-10 Thread Petri Latvala
__igt_debugfs_read(fd, (filename), (buf), sizeof(buf)) > > +/** > + * igt_debugfs_write: > + * @filename: name of the debugfs file > + * @buf: buffer to be written to the debugfs file > + * > + * This is just a convenience wrapper for __igt_debugfs_read. See its &g

Re: [Freedreno] [PATCH igt v3 0/3] Initial igt tests for drm/msm ioctls

2021-09-08 Thread Petri Latvala
t somewhere. > > > > Rob Clark (3): > > drmtest: Add DRIVER_MSM support > > msm: Add helper library > > msm: Add submit ioctl tests > > If there are no more comments on this series, could somebody push it? Ah, I was expecting you to do it yourself. Merged now. -- Petri Latvala

Re: [Freedreno] [PATCH igt v3 3/3] msm: Add submit ioctl tests

2021-08-30 Thread Petri Latvala
107,6 +107,7 @@ test_progs = [ > 'vc4_wait_seqno', > 'vgem_basic', > 'vgem_slow', > + 'msm_submit', Alphabetical order for this please. When more msm-specific tests start appearing, consider an msm subdirectory. Not needed f

Re: [Freedreno] [PATCH igt v3 2/3] msm: Add helper library

2021-08-30 Thread Petri Latvala
e NULL in destructors > > Signed-off-by: Rob Clark Reviewed-by: Petri Latvala > --- > .../igt-gpu-tools/igt-gpu-tools-docs.xml | 1 + > lib/igt_msm.c | 211 ++ > lib/igt_msm.h

Re: [Freedreno] [PATCH igt v2 3/3] msm: Add submit ioctl tests

2021-08-26 Thread Petri Latvala
.submit_idx = 0, > + .size = 4 * 4, /* 4 dwords in cmdbuf */ > + }, > + }; > + struct drm_msm_gem_submit req = { > + .flags = pipe->pipe, > + .queueid

Re: [Freedreno] [PATCH igt v2 2/3] msm: Add helper library

2021-08-26 Thread Petri Latvala
gt; + * @title: msm > + * @include: igt_msm.h > + * > + * This library provides various auxiliary helper functions for writing msm > + * tests. > + */ You need to add to docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml so this gets included, and please add

Re: [Freedreno] [PATCH igt v2 1/3] drmtest: Add DRIVER_MSM support

2021-08-26 Thread Petri Latvala
On Wed, Aug 25, 2021 at 04:31:37PM -0700, Rob Clark wrote: > From: Rob Clark > > Signed-off-by: Rob Clark Reviewed-by: Petri Latvala > --- > lib/drmtest.c | 3 +++ > lib/drmtest.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/lib/drmtest.c b/lib

Re: [Freedreno] [PATCH igt v2 3/3] msm: Add submit ioctl tests

2021-08-26 Thread Petri Latvala
On Thu, Aug 26, 2021 at 08:37:19AM -0700, Rob Clark wrote: > On Wed, Aug 25, 2021 at 10:28 PM Petri Latvala > wrote: > > > > On Wed, Aug 25, 2021 at 04:31:39PM -0700, Rob Clark wrote: > > > From: Rob Clark > > > > > > Add an initial set of tests fo

Re: [Freedreno] [igt-dev] [PATCH igt 2/3] msm: Add helper library

2021-08-25 Thread Petri Latvala
ect to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > + * IN THE SOFTWARE. > + */ > + > +#ifndef IGT_MSM_H > +#define IGT_MSM_H > + > +#include "msm_drm.h" > + > +struct msm_device { > + int fd; > +}; Why do you need this wrapper struct? -- Petri Latvala

Re: [Freedreno] [PATCH igt v2 2/3] msm: Add helper library

2021-08-25 Thread Petri Latvala
; > + > + pipe->dev = dev; > + pipe->pipe = MSM_PIPE_3D0; > + > + /* Note that kerenels prior to v4.15 did not support submitqueues. > + * Mesa maintains support for older kernels, but I do not think > + * that IGT needs to. > + */ > + do_ioctl(dev->fd, DRM_IOCTL_MSM_SUBMITQUEUE_NEW, &req); We try to maintain compatibility with older kernels to around "yay back". If you want to be perfect, this part could produce a skip if submitqueues don't exist, but most often such dancing is not worth the trouble. Letting it fail "normally" on an old kernel is fine, the error message received already points out which ioctl failed. You can remove the uncertainty from this comment, in other words. Also typo, kerenels -> kernels. -- Petri Latvala

Re: [Freedreno] [PATCH igt v2 3/3] msm: Add submit ioctl tests

2021-08-25 Thread Petri Latvala
; + }; > + struct drm_msm_gem_submit req = { > + .flags = pipe->pipe, > + .queueid = pipe->submitqueue_id, > + .nr_cmds= ARRAY_SIZE(cmds), > + .cmds = VOID2U64(cmds), > + .nr_bos = ARRAY_SIZE(bos), > + .bos = VOID2U64(bos), > + }; > + uint32_t *cmdstream = igt_msm_bo_map(a); > + if (dev->gen >= 5) { > + *(cmdstream++) = pm4_pkt7_hdr(CP_NOP, 3); > + } else { > + *(cmdstream++) = pm4_pkt3_hdr(CP_NOP, 3); > + } > + *(cmdstream++) = 0; > + *(cmdstream++) = 0; > + *(cmdstream++) = 0; > + > + do_ioctl(dev->fd, DRM_IOCTL_MSM_GEM_SUBMIT, &req); > + } > + > + igt_fixture { > + igt_msm_bo_free(a); > + igt_msm_bo_free(b); > + igt_msm_pipe_close(pipe); > + igt_msm_dev_close(dev); ... crashes in here. -- Petri Latvala

Re: [Freedreno] [igt-dev] [PATCH igt 2/3] msm: Add helper library

2021-08-25 Thread Petri Latvala
On Wed, Aug 25, 2021 at 08:37:39AM -0700, Rob Clark wrote: > On Wed, Aug 25, 2021 at 1:44 AM Petri Latvala wrote: > > > > On Tue, Aug 24, 2021 at 03:49:31PM -0700, Rob Clark wrote: > > > From: Rob Clark > > > > > > Handle some of the boilerplate for t