From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Petri Latvala <petri.latvala@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png()
Date: Fri, 22 Sep 2017 15:05:44 +0300 [thread overview]
Message-ID: <20170922120544.GM4914@intel.com> (raw)
In-Reply-To: <20170922095259.aj5mfj6ymuqo5l6x@platvala-desk.ger.corp.intel.com>
On Fri, Sep 22, 2017 at 12:52:59PM +0300, Petri Latvala wrote:
> On Thu, Sep 21, 2017 at 05:39:30PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Raw usage of cairo_image_surface_create_from_png() doesn't work
> > since it doesn't know about IGT_DATADIR and IGT_SRCDIR. Let's extract
> > the helper from igt_paint_image() that uses igt_fopen_data() +
> > cairo_image_surface_create_from_png_stream() and call it
> > igt_cairo_image_surface_create_from_png_file().
>
>
> s/from_png_file/from_png/
Argh, still one left. My brain kept subconsciously adding the _file()
(to match the _stream() I suppose). In fact at one point I was scratching
my head for quite a while wondering why it wasn't compiling...
>
>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Thanks for fixing this.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92248
> (Not sure if this patch fixes it yet or if CI switch to make install -deployment is also needed)
Hmm. The asserts I see there seem to be about display commits failing.
> kms_plane_fitting doesn't seem to have a separate bug report.
I'm pretty sure such a bug report did exist in the past. But I
wasn't able to find it either. I guess it was closed for some reason.
>
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Thanks.
>
>
>
>
>
>
> > ---
> > lib/igt_fb.c | 21 ++++++++++++++-------
> > lib/igt_fb.h | 1 +
> > 2 files changed, 15 insertions(+), 7 deletions(-)
> >
> > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > index 95434a699dcf..d4eaed71acef 100644
> > --- a/lib/igt_fb.c
> > +++ b/lib/igt_fb.c
> > @@ -583,6 +583,18 @@ stdio_read_func(void *closure, unsigned char* data, unsigned int size)
> > return CAIRO_STATUS_SUCCESS;
> > }
> >
> > +cairo_surface_t *igt_cairo_image_surface_create_from_png(const char *filename)
> > +{
> > + cairo_surface_t *image;
> > + FILE *f;
> > +
> > + f = igt_fopen_data(filename);
> > + image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
> > + fclose(f);
> > +
> > + return image;
> > +}
> > +
> > /**
> > * igt_paint_image:
> > * @cr: cairo drawing context
> > @@ -601,11 +613,8 @@ void igt_paint_image(cairo_t *cr, const char *filename,
> > cairo_surface_t *image;
> > int img_width, img_height;
> > double scale_x, scale_y;
> > - FILE* f;
> > -
> > - f = igt_fopen_data(filename);
> >
> > - image = cairo_image_surface_create_from_png_stream(&stdio_read_func, f);
> > + image = igt_cairo_image_surface_create_from_png(filename);
> > igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
> >
> > img_width = cairo_image_surface_get_width(image);
> > @@ -624,8 +633,6 @@ void igt_paint_image(cairo_t *cr, const char *filename,
> > cairo_surface_destroy(image);
> >
> > cairo_restore(cr);
> > -
> > - fclose(f);
> > }
> >
> > /**
> > @@ -877,7 +884,7 @@ unsigned int igt_create_image_fb(int fd, int width, int height,
> > uint32_t fb_id;
> > cairo_t *cr;
> >
> > - image = cairo_image_surface_create_from_png(filename);
> > + image = igt_cairo_image_surface_create_from_png(filename);
> > igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
> > if (width == 0)
> > width = cairo_image_surface_get_width(image);
> > diff --git a/lib/igt_fb.h b/lib/igt_fb.h
> > index a193a1e7572d..3f549036abc5 100644
> > --- a/lib/igt_fb.h
> > +++ b/lib/igt_fb.h
> > @@ -136,6 +136,7 @@ uint64_t igt_fb_tiling_to_mod(uint64_t tiling);
> >
> > /* cairo-based painting */
> > cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb);
> > +cairo_surface_t *igt_cairo_image_surface_create_from_png(const char *filename);
> > cairo_t *igt_get_cairo_ctx(int fd, struct igt_fb *fb);
> > void igt_paint_color(cairo_t *cr, int x, int y, int w, int h,
> > double r, double g, double b);
> > --
> > 2.13.5
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-09-22 12:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 14:39 [PATCH i-g-t 1/6] lib/igt_kms: Don't assert on non-existent plane Ville Syrjala
2017-09-21 14:39 ` [PATCH i-g-t 2/6] tests/kms_mmio_vs_cs_flip: Reduce blit width Ville Syrjala
2017-09-21 14:39 ` [PATCH i-g-t 3/6] lib/igt_fb: Add igt_cairo_image_surface_create_from_png() Ville Syrjala
2017-09-22 9:52 ` Petri Latvala
2017-09-22 12:05 ` Ville Syrjälä [this message]
2017-09-22 12:33 ` Petri Latvala
2017-09-21 14:39 ` [PATCH i-g-t 4/6] tests/kms_panel_fitting: Use igt_cairo_image_surface_create_from_png_file() Ville Syrjala
2017-09-22 9:53 ` Petri Latvala
2017-09-21 14:39 ` [PATCH i-g-t 5/6] tests/kms_panel_fitting: Skip sprite test if we exceed sprite scaling limits Ville Syrjala
2017-09-27 11:34 ` Petri Latvala
2017-09-21 14:39 ` [PATCH i-g-t 6/6] tests/kms_draw_crc: Skip tests for unsupported formats Ville Syrjala
2017-09-27 11:38 ` Petri Latvala
2017-09-21 16:20 ` ✗ Fi.CI.BAT: warning for series starting with [1/6] lib/igt_kms: Don't assert on non-existent plane Patchwork
2017-09-22 15:53 ` ✓ Fi.CI.BAT: success " Patchwork
2017-09-22 21:41 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-27 11:53 ` [PATCH i-g-t 1/6] " Petri Latvala
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=20170922120544.GM4914@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=petri.latvala@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.