From: Maxime Ripard <maxime.ripard@bootlin.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
eben@raspberrypi.org, igt-dev@lists.freedesktop.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [igt-dev] [PATCH v6 03/13] fb: Create common function to convert frame formats
Date: Thu, 6 Sep 2018 13:41:29 +0200 [thread overview]
Message-ID: <20180906114129.6ewtxz5qaehbig4j@flea> (raw)
In-Reply-To: <20180831134110.GY5565@intel.com>
[-- Attachment #1.1: Type: text/plain, Size: 2305 bytes --]
On Fri, Aug 31, 2018 at 04:41:10PM +0300, Ville Syrjälä wrote:
> On Fri, Aug 31, 2018 at 03:12:12PM +0200, Maxime Ripard wrote:
> > The current code to convert between two buffer formats is quite tied to the
> > cairo surface infrastructure. Since we'll want to reuse it, make that
> > function more generic by introducing a common structure that passes all the
> > arguments and a common function that will call the right functions we
> > needed.
> >
> > Reviewed-by: Eric Anholt <eric@anholt.net>
> > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> > ---
> > lib/igt_fb.c | 243 ++++++++++++++++++++++++++++++++--------------------
> > 1 file changed, 153 insertions(+), 90 deletions(-)
> >
> > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > index 4061fedec0c1..1914233786a5 100644
> > --- a/lib/igt_fb.c
> > +++ b/lib/igt_fb.c
> > @@ -1384,6 +1384,24 @@ struct fb_convert_blit_upload {
> > struct fb_blit_linear linear;
> > };
> >
> > +struct fb_convert_buf {
> > + void *ptr;
> > + unsigned int stride;
> > + unsigned int size;
> > + uint32_t fmt;
> > + enum igt_color_encoding color_encoding;
> > + enum igt_color_range color_range;
> > + uint32_t offsets[4];
> > +};
>
> I wonder if we can just use igt_fb for that instead of duplicating most
> of it?
After looking into it again, now I remember why I didn't do what you
suggested. In the case where you are in the YUYV path, with a "shadow"
buffer being used to perform the cairo operations on top of an YUV
buffer, you end up with conversions in create_cairo_surface__convert
and destroy_cairo_surface__convert, getting a fb_convert_blit_upload
structure as an argument.
That structure however is used to convert one buffer to the shadow
buffer, or the other way around at destroy time. However, a single
igt_fb is allocated for that structure, which makes it impossible to
assign the second fb in that particular case. All the informations
needed to perform the conversion are stored in multiple structures
(fb_convert_blit_upload.linear, fb_convert_blit_upload.blit, and the
actual igt_fb instance) that we need to aggregate to find the correct
conversion parameters.
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-09-06 11:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 13:12 [igt-dev] [PATCH v6 00/13] chamelium: Test the plane formats Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 01/13] fb: Add buffer map/unmap functions Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 02/13] fb: convert: Remove swizzle from the arguments Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 03/13] fb: Create common function to convert frame formats Maxime Ripard
2018-08-31 13:41 ` Ville Syrjälä
2018-09-05 13:16 ` Maxime Ripard
2018-09-06 11:41 ` Maxime Ripard [this message]
2018-09-06 12:11 ` Ville Syrjälä
2018-09-06 12:49 ` Maxime Ripard
2018-09-06 13:30 ` Ville Syrjälä
2018-08-31 13:12 ` [igt-dev] [PATCH v6 04/13] fb: Add format conversion routine Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 05/13] fb: Fix ARGB8888 color depth Maxime Ripard
2018-08-31 13:42 ` Ville Syrjälä
2018-09-05 9:35 ` Maxime Ripard
2018-09-05 10:14 ` Ville Syrjälä
2018-09-05 13:19 ` Maxime Ripard
2018-09-05 13:37 ` Ville Syrjälä
2018-09-06 7:22 ` Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 06/13] fb: Add support for conversions through pixman Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 07/13] fb: Add depth lookup function Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 08/13] fb: Add more formats Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 09/13] chamelium: Split CRC test function in two Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 10/13] chamelium: Change our pattern for a custom one if needed Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 11/13] chamelium: Add format support Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 12/13] chamelium: Add format subtests Maxime Ripard
2018-08-31 13:12 ` [igt-dev] [PATCH v6 13/13] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
2018-09-03 8:33 ` [igt-dev] ✓ Fi.CI.BAT: success for chamelium: Test the plane formats (rev5) Patchwork
2018-09-03 9:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
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=20180906114129.6ewtxz5qaehbig4j@flea \
--to=maxime.ripard@bootlin.com \
--cc=eben@raspberrypi.org \
--cc=igt-dev@lists.freedesktop.org \
--cc=paul.kocialkowski@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=ville.syrjala@linux.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