All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org,
	magnus.damm@gmail.com
Subject: Re: [PATCH/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based format API
Date: Sun, 28 Aug 2011 10:59:00 +0200	[thread overview]
Message-ID: <201108281059.00860.laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <4E57D6B2.40001@gmx.de>

Hi Florian,

Thanks for the review.

On Friday 26 August 2011 19:24:02 Florian Tobias Schandinat wrote:
> On 08/19/2011 09:37 AM, Laurent Pinchart wrote:

[snip]

> > diff --git a/drivers/video/sh_mobile_lcdcfb.c
> > b/drivers/video/sh_mobile_lcdcfb.c index 97ab8ba..ea3f619 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/sh_mobile_lcdcfb.c

[snip]

> > @@ -1099,51 +1154,78 @@ static int sh_mobile_check_var(struct

[snip]

> > +	if (var->format.fourcc > 1) {
> > +		switch (var->format.fourcc) {
> > +		case V4L2_PIX_FMT_NV12:
> > +		case V4L2_PIX_FMT_NV21:
> > +			var->bits_per_pixel = 12;
> > +			break;
> > +		case V4L2_PIX_FMT_RGB565:
> > +		case V4L2_PIX_FMT_NV16:
> > +		case V4L2_PIX_FMT_NV61:
> > +			var->bits_per_pixel = 16;
> > +			break;
> > +		case V4L2_PIX_FMT_BGR24:
> > +		case V4L2_PIX_FMT_NV24:
> > +		case V4L2_PIX_FMT_NV42:
> > +			var->bits_per_pixel = 24;
> > +			break;
> > +		case V4L2_PIX_FMT_BGR32:
> > +			var->bits_per_pixel = 32;
> > +			break;
> > +		default:
> > +			return -EINVAL;
> > +		}
> > +
> > +		memset(var->format.reserved, 0, sizeof(var->format.reserved));
> 
> If we decide to use another of the reserved area this won't have the
> desired behavior as the behavior of this driver will change even if it
> does not support the new field. Probably the best thing is to get the
> desired behavior is zeroing the whole struct and setting the supported
> fields to the actual values. You should check and adjust colorspace here
> as well.

Agreed. I'll fix the patch accordingly.

-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org,
	magnus.damm@gmail.com
Subject: Re: [PATCH/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based format API
Date: Sun, 28 Aug 2011 08:59:00 +0000	[thread overview]
Message-ID: <201108281059.00860.laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <4E57D6B2.40001@gmx.de>

Hi Florian,

Thanks for the review.

On Friday 26 August 2011 19:24:02 Florian Tobias Schandinat wrote:
> On 08/19/2011 09:37 AM, Laurent Pinchart wrote:

[snip]

> > diff --git a/drivers/video/sh_mobile_lcdcfb.c
> > b/drivers/video/sh_mobile_lcdcfb.c index 97ab8ba..ea3f619 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/sh_mobile_lcdcfb.c

[snip]

> > @@ -1099,51 +1154,78 @@ static int sh_mobile_check_var(struct

[snip]

> > +	if (var->format.fourcc > 1) {
> > +		switch (var->format.fourcc) {
> > +		case V4L2_PIX_FMT_NV12:
> > +		case V4L2_PIX_FMT_NV21:
> > +			var->bits_per_pixel = 12;
> > +			break;
> > +		case V4L2_PIX_FMT_RGB565:
> > +		case V4L2_PIX_FMT_NV16:
> > +		case V4L2_PIX_FMT_NV61:
> > +			var->bits_per_pixel = 16;
> > +			break;
> > +		case V4L2_PIX_FMT_BGR24:
> > +		case V4L2_PIX_FMT_NV24:
> > +		case V4L2_PIX_FMT_NV42:
> > +			var->bits_per_pixel = 24;
> > +			break;
> > +		case V4L2_PIX_FMT_BGR32:
> > +			var->bits_per_pixel = 32;
> > +			break;
> > +		default:
> > +			return -EINVAL;
> > +		}
> > +
> > +		memset(var->format.reserved, 0, sizeof(var->format.reserved));
> 
> If we decide to use another of the reserved area this won't have the
> desired behavior as the behavior of this driver will change even if it
> does not support the new field. Probably the best thing is to get the
> desired behavior is zeroing the whole struct and setting the supported
> fields to the actual values. You should check and adjust colorspace here
> as well.

Agreed. I'll fix the patch accordingly.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2011-08-28  8:58 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19  9:37 [PATCH/RFC v2 0/3] fbdev: Add FOURCC-based format configuration API Laurent Pinchart
2011-08-19  9:37 ` Laurent Pinchart
2011-08-19  9:37 ` [PATCH/RFC v2 1/3] " Laurent Pinchart
2011-08-19  9:37   ` Laurent Pinchart
2011-08-26 17:07   ` Florian Tobias Schandinat
2011-08-26 17:07     ` [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration Florian Tobias Schandinat
2011-08-28  8:48     ` [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API Laurent Pinchart
2011-08-28  8:48       ` Laurent Pinchart
2011-08-29  8:13   ` Geert Uytterhoeven
2011-08-29  8:13     ` Geert Uytterhoeven
2011-08-29  8:50     ` Laurent Pinchart
2011-08-29  8:50       ` Laurent Pinchart
2011-08-29  9:36       ` Geert Uytterhoeven
2011-08-29  9:36         ` Geert Uytterhoeven
2011-08-29 10:09         ` Laurent Pinchart
2011-08-29 10:09           ` Laurent Pinchart
2011-08-29 11:04           ` Geert Uytterhoeven
2011-08-29 11:04             ` Geert Uytterhoeven
2011-08-29 11:08             ` Laurent Pinchart
2011-08-29 11:08               ` Laurent Pinchart
2011-08-29 11:20               ` Geert Uytterhoeven
2011-08-29 11:20                 ` Geert Uytterhoeven
2011-08-29 12:55                 ` Laurent Pinchart
2011-08-29 12:55                   ` Laurent Pinchart
2011-08-29 13:09                   ` Geert Uytterhoeven
2011-08-29 13:09                     ` Geert Uytterhoeven
2011-08-29 13:34                     ` Laurent Pinchart
2011-08-29 13:34                       ` Laurent Pinchart
2011-08-29 14:14                       ` Geert Uytterhoeven
2011-08-29 14:14                         ` Geert Uytterhoeven
2011-08-29 14:17                         ` Laurent Pinchart
2011-08-29 14:17                           ` Laurent Pinchart
2011-08-29 14:26                           ` Geert Uytterhoeven
2011-08-29 14:26                             ` Geert Uytterhoeven
2011-08-29 14:32                             ` Laurent Pinchart
2011-08-29 14:32                               ` Laurent Pinchart
2011-08-29 16:41                               ` Florian Tobias Schandinat
2011-08-29 16:41                                 ` [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration Florian Tobias Schandinat
2011-08-30  1:09                                 ` [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API Laurent Pinchart
2011-08-30  1:09                                   ` Laurent Pinchart
2011-08-19  9:37 ` [PATCH/RFC v2 2/3] v4l: Add V4L2_PIX_FMT_NV24 and V4L2_PIX_FMT_NV42 formats Laurent Pinchart
2011-08-19  9:37   ` Laurent Pinchart
2011-08-19  9:37 ` [PATCH/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based format API Laurent Pinchart
2011-08-19  9:37   ` Laurent Pinchart
2011-08-26 17:24   ` Florian Tobias Schandinat
2011-08-26 17:24     ` [PATCH/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based Florian Tobias Schandinat
2011-08-28  8:59     ` Laurent Pinchart [this message]
2011-08-28  8:59       ` [PATCH/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based format API Laurent Pinchart
2011-08-29  0:39   ` Magnus Damm
2011-08-29  0:39     ` [PATCH/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based Magnus Damm
2011-08-29  8:30     ` [PATCH/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based format API Laurent Pinchart
2011-08-29  8:30       ` Laurent Pinchart

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=201108281059.00860.laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=magnus.damm@gmail.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.