All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 3/8] lib/fb: Handle planar formats in igt_calc_fb_size and create_bo_for_fb
Date: Fri, 26 Jan 2018 15:10:29 +0200	[thread overview]
Message-ID: <1516972229.2602.11.camel@intel.com> (raw)
In-Reply-To: <03202d62-ecef-b0c6-7b35-9996b0eac641@linux.intel.com>

On Fri, 2018-01-26 at 13:01 +0100, Maarten Lankhorst wrote:
> Op 26-01-18 om 11:24 schreef Mika Kahola:
> > 
> > On Fri, 2018-01-26 at 11:20 +0100, Maarten Lankhorst wrote:
> > > 
> > > Op 26-01-18 om 10:00 schreef Mika Kahola:
> > > > 
> > > > On Tue, 2018-01-23 at 13:56 +0100, Maarten Lankhorst wrote:
> > > > > 
> > > > > By adding support for planar formats to igt_calc_fb_size and
> > > > > create_bo_for_fb,
> > > > > we can calculate dimensions and create backing storage for
> > > > > planar
> > > > > framebuffers.
> > > > > 
> > > > > This is required for adding support to create planar
> > > > > framebuffers
> > > > > in
> > > > > the next patch.
> > > > > 
> > > > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.int
> > > > > el.c
> > > > > om>
> > > > > ---
> > > > >  lib/igt_fb.c | 168
> > > > > +++++++++++++++++++++++++++++++++++++++++++
> > > > > ----
> > > > > ------------
> > > > >  1 file changed, 123 insertions(+), 45 deletions(-)
> > > > > 
> > > > > diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> > > > > index da07d1a9e21f..6a331f06724b 100644
> > > > > --- a/lib/igt_fb.c
> > > > > +++ b/lib/igt_fb.c
> > > > > @@ -54,14 +54,16 @@
> > > > >   */
> > > > >  
> > > > >  /* drm fourcc/cairo format maps */
> > > > > -#define DF(did, cid, _bpp, _depth)	\
> > > > > -	{ DRM_FORMAT_##did, CAIRO_FORMAT_##cid, # did, _bpp,
> > > > > _depth
> > > > > }
> > > > > +#define DF(did, cid, ...)	\
> > > > > +	{ DRM_FORMAT_##did, CAIRO_FORMAT_##cid, # did,
> > > > > __VA_ARGS__ }
> > > > >  static struct format_desc_struct {
> > > > >  	uint32_t drm_id;
> > > > >  	cairo_format_t cairo_id;
> > > > >  	const char *name;
> > > > >  	int bpp;
> > > > >  	int depth;
> > > > > +	int planes;
> > > > > +	int plane_bpp[4];
> > > > should we define a max value for this instead of hardcoded one?
> > > 4 planes is the maximum ever. Alpha, R, G and B.
> > Yes, but even so I'm not really a fan of harcoded values.
> Only the array definitions use those values. There aren't even planar
> formats that support > 4 planes,
> and uapi/drm/drm_mode.h also uses 4 everywhere. It's fine unless we
> everextend the kernel api to support
> more than 4 planes, but this is very unlikely since the hw doesn't
> even exist. I think it's fine to hardcode this. All users use
> ARRAY_SIZE or sizeof as appropriate, so it won't matter much.
What I was after on my comment was that when you are browsing through
the patch or the file itself, you don't realize that easily what is
meant with these hardcoded values. You have to stop for a second to
think and then you figure it out. The comment was all about enhancing
readability. For loops, maybe we could use ARRAY_SIZE() here too?

> 
> ~Maarten
-- 
Mika Kahola - Intel OTC

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-01-26 13:10 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23 12:56 [igt-dev] [PATCH i-g-t 0/8] lib/igt_fb: Add support for the NV12 format Maarten Lankhorst
2018-01-23 12:56 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_fb: Add igt_put_cairo_ctx as counter to igt_get_cairo_ctx Maarten Lankhorst
2018-01-23 15:50   ` Ville Syrjälä
2018-01-24 12:26     ` Maarten Lankhorst
2018-01-25 11:43       ` Mika Kahola
2018-01-29 17:01         ` Maarten Lankhorst
2018-01-31 17:03   ` Ville Syrjälä
2018-01-23 12:56 ` [igt-dev] [PATCH i-g-t 2/8] lib/igt_fb: Pass format to igt_calc_fb_size Maarten Lankhorst
2018-01-25 11:51   ` Mika Kahola
2018-01-23 12:56 ` [igt-dev] [PATCH i-g-t 3/8] lib/fb: Handle planar formats in igt_calc_fb_size and create_bo_for_fb Maarten Lankhorst
2018-01-26  9:00   ` Mika Kahola
2018-01-26 10:20     ` Maarten Lankhorst
2018-01-26 10:24       ` Mika Kahola
2018-01-26 12:01         ` Maarten Lankhorst
2018-01-26 13:10           ` Mika Kahola [this message]
2018-02-01 14:39   ` Ville Syrjälä
2018-01-23 12:56 ` [igt-dev] [PATCH i-g-t 4/8] lib/intel_batchbuffer: Add delta argument to igt_blitter_fast_copy__raw Maarten Lankhorst
2018-01-26  9:02   ` Mika Kahola
2018-01-29 12:10   ` [igt-dev] [PATCH i-g-t] lib/intel_batchbuffer: Add delta argument to igt_blitter_fast_copy__raw, v2 Maarten Lankhorst
2018-01-23 12:56 ` [igt-dev] [PATCH i-g-t 5/8] lib/intel_batchbuffer: Add src/dst delta arguments to igt_blitter_fast_copy too Maarten Lankhorst
2018-01-26  9:04   ` Mika Kahola
2018-01-23 12:56 ` [igt-dev] [PATCH i-g-t 6/8] lib/fb: Add support for creating planar framebuffers Maarten Lankhorst
2018-01-23 14:50   ` [igt-dev] [PATCH i-g-t] lib/fb: Add support for creating planar framebuffers, v2 Maarten Lankhorst
2018-01-24 10:53     ` [igt-dev] [PATCH i-g-t] lib/fb: Add support for creating planar framebuffers, v3 Maarten Lankhorst
2018-01-29  8:44       ` Mika Kahola
2018-01-23 12:56 ` [igt-dev] [PATCH i-g-t 7/8] tests/kms_render: Copy all planes when copying fb Maarten Lankhorst
2018-01-26 13:56   ` Mika Kahola
2018-02-28 15:40     ` Arkadiusz Hiler
2018-02-28 15:43       ` Maarten Lankhorst
2018-02-28 15:43       ` Arkadiusz Hiler
2018-01-23 12:56 ` [igt-dev] [PATCH i-g-t 8/8] lib/igt_fb: Add support for NV12 format through conversion Maarten Lankhorst
2018-01-31 13:45   ` Mika Kahola
2018-01-31 14:32     ` Ville Syrjälä
2018-01-31 15:09       ` Maarten Lankhorst
2018-01-31 16:52       ` [igt-dev] [PATCH i-g-t] lib/igt_fb: Add support for NV12 format through conversion, v2 Maarten Lankhorst
2018-02-01 14:23         ` Ville Syrjälä
2018-02-01 14:43           ` Maarten Lankhorst
2018-01-23 14:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_fb: Add support for the NV12 format Patchwork
2018-01-23 15:41 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb: Add support for the NV12 format. (rev2) Patchwork
2018-01-23 19:47 ` [igt-dev] ✗ Fi.CI.IGT: failure for lib/igt_fb: Add support for the NV12 format Patchwork
2018-01-23 22:30 ` [igt-dev] ✗ Fi.CI.IGT: failure for lib/igt_fb: Add support for the NV12 format. (rev2) Patchwork
2018-01-24 12:16 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb: Add support for the NV12 format. (rev3) Patchwork
2018-01-24 15:57 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-01-29 12:37 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb: Add support for the NV12 format. (rev4) Patchwork
2018-01-29 17:29 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-01-31 17:15 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_fb: Add support for the NV12 format. (rev5) Patchwork
2018-01-31 18:55 ` [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=1516972229.2602.11.camel@intel.com \
    --to=mika.kahola@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=maarten.lankhorst@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 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.