Re: [igt-dev] [PATCH i-g-t 3/6] lib/igt_fb: Check for cairo surface success

Deepak Singh Rawat
2018-10-11T15:48:35Z

>
> On Wed, Oct 10, 2018 at 05:21:01PM -0700, Deepak Rawat wrote:
> > For vmwgfx cairo surface creation fails due to stride mismatch, add a
> > igt_require_f() for surface.
>
> Hmm. What kind of pixel format are you using?
>
> It seems to me cairo should be happy with just a 4 byte aligned
> stride. How bad would it be to change vmw_dumb_create() to give
> you that? Having working cairo stuff should make igt_fb much more
> useful for you in general.

I think pixel format was SVGA3D_R5G6B5. For vmwgfx pitch is simply
width * bpp and for only some old length framebuffer, surface creation
was failing. I didn't pursued this in much detail.

Yes I plan to add vmwgfx private ioctl for buffer allocation to igt and
I think that would solve this.

>
> Alternative would to not use dumb buffers I suppose, but then
> we'd need to make sure the igt_fb size calculations are OK for
> vmwgfx. Currently igt_fb assumes Intel hw in the sense that
> linear buffers will get a 64byte aligned stride.
>
> >
> > v2: Check for surface creation failure.
> >
> > Signed-off-by: Deepak Rawat <drawat@vmware.com>
> > ---
> > lib/igt_fb.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > index 335ece69..1bb6d324 100644
> > --- a/lib/igt_fb.c
> > +++ b/lib/igt_fb.c
> > @@ -1433,6 +1433,10 @@ static void create_cairo_surface__gtt(int fd,
> struct igt_fb *fb)
> > cairo_image_surface_create_for_data(ptr,
> > drm_format_to_cairo(fb-
> >drm_format),
> > fb->width, fb->height, fb-
> >strides[0]);
> > + igt_require_f(cairo_surface_status(fb->cairo_surface) ==
> CAIRO_STATUS_SUCCESS,
> > + "Unable to create a cairo surface: %s\n",
> > + cairo_status_to_string(cairo_surface_status(fb-
> >cairo_surface)));
> > +
> > fb->domain = I915_GEM_DOMAIN_GTT;
> >
> > cairo_surface_set_user_data(fb->cairo_surface,
> > --
> > 2.17.1
> >
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.fr
> eedesktop.org%2Fmailman%2Flistinfo%2Figt-
> dev&amp;data=02%7C01%7Cdrawat%40vmware.com%7C55643c7eddb14e60
> aa3c08d62f8b500c%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C63
> 6748672729440089&amp;sdata=pE7NX1LoOz5qhBZhp%2F2wArWHvKdSF0ctx
> TXyNW5%2Fcig%3D&amp;reserved=0
>
> --
> Ville Syrjälä
> Intel