From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: igt-dev@lists.freedesktop.org, eben@raspberrypi.org,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [igt-dev] [PATCH v7 02/14] fb: Use an igt_fb for the cairo shadow buffer
Date: Mon, 1 Oct 2018 16:55:22 +0300 [thread overview]
Message-ID: <20181001135522.GH9144@intel.com> (raw)
In-Reply-To: <20181001104712.crtapjpb3beklium@ahiler-desk1.fi.intel.com>
On Mon, Oct 01, 2018 at 01:47:12PM +0300, Arkadiusz Hiler wrote:
> On Tue, Sep 25, 2018 at 10:51:24AM +0200, Maxime Ripard wrote:
> > On Wed, Sep 19, 2018 at 04:21:38PM +0300, Ville Syrjälä wrote:
> > > On Tue, Sep 11, 2018 at 10:47:29AM +0200, Maxime Ripard wrote:
> > > > In the case where an igt_fb user wants to get a cairo surface out of that
> > > > framebuffer, if the format of that framebuffer cannot be imported as-is in
> > > > Cairo, the current code will do an anonymous mapping to create a shadow
> > > > buffer where an RGB24 copy of that buffer will be created.
> > > >
> > > > However, making that shadow buffer into an igt_fb itself will help us do
> > > > further improvements on the conversion code.
> > > >
> > > > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> > > > ---
> > > > lib/igt_fb.c | 28 +++++++++++++++++-----------
> > > > 1 file changed, 17 insertions(+), 11 deletions(-)
> > > >
> > > > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > > > index 542c62610412..dd180c6c8016 100644
> > > > --- a/lib/igt_fb.c
> > > > +++ b/lib/igt_fb.c
> > > > @@ -1381,12 +1381,12 @@ static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
> > > >
> > > > struct fb_convert_blit_upload {
> > > > int fd;
> > > > +
> > > > struct igt_fb *fb;
> > > > + uint8_t *ptr;
> > > >
> > > > - struct {
> > > > - uint8_t *map;
> > > > - unsigned stride, size;
> > > > - } rgb24;
> > > > + struct igt_fb shadow_fb;
> > > > + uint8_t *shadow_ptr;
> > >
> > > We seem to be pairing fb and ptr a lot. I wonder if we should suck the
> > > the ptr into the fb struct. But maybe someone wants to map the same
> > > thing multiple times? Not sure.
> >
> > Is it something you want me to change then?
> >
> > > > struct fb_blit_linear linear;
> > > > };
> > > > @@ -1780,7 +1780,8 @@ static void destroy_cairo_surface__convert(void *arg)
> > > > fb->drm_format);
> > > > }
> > > >
> > > > - munmap(blit->rgb24.map, blit->rgb24.size);
> > > > + igt_fb_unmap_buffer(&blit->shadow_fb, blit->shadow_ptr);
> > > > + igt_remove_fb(blit->fd, &blit->shadow_fb);
> > > >
> > > > if (blit->linear.handle)
> > > > free_linear_mapping(blit->fd, blit->fb, &blit->linear);
> > > > @@ -1795,14 +1796,19 @@ static void destroy_cairo_surface__convert(void *arg)
> > > > static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
> > > > {
> > > > struct fb_convert_blit_upload *blit = malloc(sizeof(*blit));
> > > > + int shadow_id;
> > > > +
> > > > igt_assert(blit);
> > > >
> > > > blit->fd = fd;
> > > > blit->fb = fb;
> > > > - blit->rgb24.stride = ALIGN(fb->width * 4, 16);
> > > > - blit->rgb24.size = ALIGN(blit->rgb24.stride * fb->height, sysconf(_SC_PAGESIZE));
> > > > - blit->rgb24.map = mmap(NULL, blit->rgb24.size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
> > > > - igt_assert(blit->rgb24.map != MAP_FAILED);
> > > > +
> > > > + shadow_id = igt_create_fb(fd, fb->width, fb->height, DRM_FORMAT_RGB888,
> > > > + LOCAL_DRM_FORMAT_MOD_NONE, &blit->shadow_fb);
> > > > + igt_assert(shadow_id > 0);
> > >
> > > We can't actually expect addfb to work for RGB888.
> >
> > Because the driver might not support it?
> >
> > > That thing is not supported by most hardware. Since my series adding
> > > fb_init() etc. hasn't gotten reviewed I guess we'll just need to
> > > populate the igt_fb by hand here, or something.
> >
> > At this point, I have to ask: is there any actual will to have this
> > patch merged at some point?
> >
> > This series is just a long history of either being ignored, dealing
> > with the i915-specific changes that got in and are breaking the other
> > users, or huge reworks for i915-specific uses cases I have no way to
> > test.
> >
> > If the current idea is back to igt is for i915 solely, then there's no
> > point in wasting time on this.
>
> Sorry for wasting your time up to this point. If you will ever feel
> blocked, please do contact me or Petri.
>
> Seeing some comments here and there, as well as reviewed-bys I was
> wrongly assuming that this is progressing. This is my failure here, and
> getting to v7 should have alarmed me. I am truly sorry.
>
> Back to the topic - yes your contributions are welcome.
>
> I really like the idea, that instead of manually fiddling with rgb24 we
> could deal with a proper igt_fb here, because it makes life easier later.
>
> @Ville: We have your fb_init() merged now, so we can use it here, so it
> should be hardware-that-does-not-support-rgb888-proof. And it's not like
> we should have blocked here in the first place, as all the hardware we
> run on seems to support it, and it could be reworked later on.
Practically nothing supports 24bpp.
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-10-01 13:55 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-11 8:47 [igt-dev] [PATCH v7 00/14] chamelium: Test the plane formats Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 01/14] fb: Add buffer map/unmap functions Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 02/14] fb: Use an igt_fb for the cairo shadow buffer Maxime Ripard
2018-09-19 13:21 ` Ville Syrjälä
2018-09-25 8:51 ` Maxime Ripard
2018-10-01 10:47 ` Arkadiusz Hiler
2018-10-01 13:55 ` Ville Syrjälä [this message]
2018-10-01 14:10 ` Arkadiusz Hiler
2018-10-02 14:56 ` Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 03/14] fb: convert: Remove swizzle from the arguments Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 04/14] fb: Create common function to convert frame formats Maxime Ripard
2018-09-19 13:03 ` Ville Syrjälä
2018-09-25 7:51 ` Maxime Ripard
2018-09-25 12:20 ` Ville Syrjälä
2018-09-11 8:47 ` [igt-dev] [PATCH v7 05/14] fb: Add format conversion routine Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 06/14] fb: Fix ARGB8888 color depth Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 07/14] fb: Add support for conversions through pixman Maxime Ripard
2018-10-01 9:26 ` Petri Latvala
2018-10-02 14:57 ` Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 08/14] fb: Add depth lookup function Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 09/14] fb: Add more formats Maxime Ripard
2018-09-19 13:14 ` Ville Syrjälä
2018-09-25 7:49 ` Maxime Ripard
2018-09-25 12:18 ` Ville Syrjälä
2018-09-11 8:47 ` [igt-dev] [PATCH v7 10/14] chamelium: Split CRC test function in two Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 11/14] chamelium: Change our pattern for a custom one if needed Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 12/14] chamelium: Add format support Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 13/14] chamelium: Add format subtests Maxime Ripard
2018-09-11 8:47 ` [igt-dev] [PATCH v7 14/14] tests: Add chamelium formats subtests to vc4 test lists Maxime Ripard
2018-09-12 8:12 ` [igt-dev] ✗ Fi.CI.BAT: failure for chamelium: Test the plane formats (rev6) Patchwork
2018-09-19 12:45 ` [igt-dev] [PATCH v7 00/14] chamelium: Test the plane formats Maxime Ripard
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=20181001135522.GH9144@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=arkadiusz.hiler@intel.com \
--cc=eben@raspberrypi.org \
--cc=igt-dev@lists.freedesktop.org \
--cc=paul.kocialkowski@bootlin.com \
--cc=thomas.petazzoni@bootlin.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;
as well as URLs for NNTP newsgroup(s).