From: Daniel Vetter <daniel@ffwll.ch>
To: "Konduru, Chandra" <chandra.konduru@intel.com>
Cc: "Vetter, Daniel" <daniel.vetter@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"Wood, Thomas" <thomas.wood@intel.com>
Subject: Re: [PATCH i-g-t 2/2] Adding kms_nv12 to test display NV12 feature
Date: Wed, 2 Sep 2015 10:04:05 +0200 [thread overview]
Message-ID: <20150902080405.GA1367@phenom.ffwll.local> (raw)
In-Reply-To: <76A9B330A4D78C4D99CB292C4CC06C0E370AD9B7@fmsmsx101.amr.corp.intel.com>
On Thu, Aug 27, 2015 at 01:51:52AM +0000, Konduru, Chandra wrote:
> > > +static void test_nv12_invalid_fb_params(data_t *d)
> > > +{
> > > + igt_display_t *display = &d->display;
> > > + igt_output_t *output;
> > > + enum pipe pipe;
> > > + int valid_tests = 0;
> > > +
> > > + igt_require(d->display.has_universal_planes);
> > > + igt_require(d->num_scalers);
> > > +
> > > + for_each_connected_output(display, output) {
> > > + struct local_drm_mode_fb_cmd2 f;
> > > + int fd = d->drm_fd;
> > > + drmModeModeInfo *mode;
> > > +
> > > + mode = igt_output_get_mode(output);
> > > + pipe = output->config.pipe;
> > > +
> > > + igt_output_set_pipe(output, pipe);
> > > +
> > > + /* Set up display with plane 1 */
> > > + d->plane1 = igt_output_get_plane(output,
> > IGT_PLANE_PRIMARY);
> > > + igt_plane_set_rotation(d->plane1, IGT_ROTATION_0);
> > > + prepare_crtc(d, output, pipe, d->plane1, mode,
> > COMMIT_LEGACY);
> > > +
> > > + /* use igt helper to create bo and addfb tile-Yf, this should pass
> > */
> > > + d->fb_id1_nv12 = igt_create_fb(d->drm_fd,
> > > + 1920, 1080,
> > > + DRM_FORMAT_NV12,
> > > + LOCAL_I915_FORMAT_MOD_Yf_TILED,
> > > + &d->fb1_nv12);
> > > + igt_assert(d->fb_id1_nv12);
> > > +
> > > + /* now remove fb but keep bo to redo addfb */
> > > + drmModeRmFB(d->drm_fd, d->fb_id1_nv12);
> > > +
> > > + /* redo AddFB */
> > > + memset(&f, 0, sizeof(f));
> > > +
> > > + f.width = d->fb1_nv12.width;
> > > + f.height = d->fb1_nv12.height;
> > > + f.pixel_format = d->fb1_nv12.drm_format;
> > > + f.flags = LOCAL_DRM_MODE_FB_MODIFIERS;
> > > + f.handles[0] = d->fb1_nv12.gem_handle;
> > > + f.pitches[0] = d->fb1_nv12.stride;
> > > + f.modifier[0] = LOCAL_I915_FORMAT_MOD_Yf_TILED;
> > > + f.modifier[1] = LOCAL_I915_FORMAT_MOD_Yf_TILED;
> > > +
> > > + /* test invalid uv start */
> > > + f.handles[1] = d->fb1_nv12.gem_handle;
> > > + f.pitches[1] = d->fb1_nv12.stride;
> > > + f.offsets[1] = 0; /* invalid uv start */
> > > + igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2,
> > &f) != 0);
> >
> > For such simple invalid input paramaters tests the usual approach is to
> > split them out. Also you don't have to do a modeset for addfb (which will
> > speed things up). Essentially each block with an igt_assert should be its
> > own subtest.
> > -Daniel
> >
>
> If each block is split into it's own subtest, if one runs just a subtest
> and without a modeset, I don't know in which state the system is to start
> the test and doing a modeset will start with a known state.
ADDFB ioctl doesn't need any known modeset state at all, and that seems to
be the only ioctl you do. Which means you really don't need to do a
modeset (it's just overhead). See e.g. the other addfb testcases we have
in kms_addfb_basic.c.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-09-02 8:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 1:05 [PATCH i-g-t 0/2] patches for testing nv12 Chandra Konduru
2015-08-20 1:05 ` [PATCH i-g-t 1/2] Prep work for adding NV12 testcase Chandra Konduru
2015-08-20 1:05 ` [PATCH i-g-t 2/2] Adding kms_nv12 to test display NV12 feature Chandra Konduru
2015-08-26 8:45 ` Daniel Vetter
2015-08-27 1:51 ` Konduru, Chandra
2015-09-02 8:04 ` Daniel Vetter [this message]
2015-09-03 18:34 ` Konduru, Chandra
2015-09-05 2:58 ` Chandra Konduru
2015-09-09 23:07 ` Chandra Konduru
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=20150902080405.GA1367@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chandra.konduru@intel.com \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=thomas.wood@intel.com \
/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