All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Hans Verkuil <hansverk@cisco.com>
Cc: devel@driverdev.osuosl.org, linux-doc@vger.kernel.org,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 01/15] [media] Move mediabus format definition to a more standard place
Date: Tue, 4 Nov 2014 11:45:03 +0100	[thread overview]
Message-ID: <20141104114503.309cb54f@bbrezillon> (raw)
In-Reply-To: <5458A878.3010809@cisco.com>

Hi Hans,

On Tue, 04 Nov 2014 11:20:40 +0100
Hans Verkuil <hansverk@cisco.com> wrote:

> Hi Boris,
> 
> On 11/04/14 10:54, Boris Brezillon wrote:
> > Rename mediabus formats and move the enum into a separate header file so
> > that it can be used by DRM/KMS subsystem without any reference to the V4L2
> > subsystem.
> > 
> > Old V4L2_MBUS_FMT_ definitions are now referencing MEDIA_BUS_FMT_ value.
> 
> I missed earlier that v4l2-mediabus.h contained a struct as well, so it can't be
> deprecated and neither can a #warning be added.
> 
> The best approach, I think, is to use a macro in media-bus-format.h
> that will either define just the MEDIA_BUS value when compiled in the kernel, or
> define both MEDIA_BUS and V4L2_MBUS values when compiled for userspace.
> 
> E.g. something like this:
> 
> #ifdef __KERNEL__
> #define MEDIA_BUS_FMT_ENTRY(name, val) MEDIA_BUS_FMT_ # name = val
> #else
> /* Keep V4L2_MBUS_FMT for backwards compatibility */
> #define MEDIA_BUS_FMT_ENTRY(name, val) \
> 	MEDIA_BUS_FMT_ # name = val, \
> 	V4L2_MBUS_FMT_ # name = val
> #endif

Okay, but this means we keep adding V4L2_MBUS_FMT_ definitions even for
new formats (which definitely doesn't encourage people to move on).
Moreover, we add a V4L2 prefix in what was supposed to be a subsystem
neutral header.

Anyway, these are just nitpicks, and if you prefer this approach
I'll rework my series :-).

> 
> An alternative approach is to have v4l2-mediabus.h include media-bus-format.h,
> put #ifndef __KERNEL__ around the enum v4l2_mbus_pixelcode and add a big comment
> there that applications should use the defines from media-bus-format.h and that
> this enum is frozen (i.e. new values are only added to media-bus-format.h).
> 
> But I think I like the macro idea best.

As you wish, my only intent is to use those bus format definitions in a
DRM driver :-).

Thanks,

Boris


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/15] [media] Move mediabus format definition to a more standard place
Date: Tue, 4 Nov 2014 11:45:03 +0100	[thread overview]
Message-ID: <20141104114503.309cb54f@bbrezillon> (raw)
In-Reply-To: <5458A878.3010809@cisco.com>

Hi Hans,

On Tue, 04 Nov 2014 11:20:40 +0100
Hans Verkuil <hansverk@cisco.com> wrote:

> Hi Boris,
> 
> On 11/04/14 10:54, Boris Brezillon wrote:
> > Rename mediabus formats and move the enum into a separate header file so
> > that it can be used by DRM/KMS subsystem without any reference to the V4L2
> > subsystem.
> > 
> > Old V4L2_MBUS_FMT_ definitions are now referencing MEDIA_BUS_FMT_ value.
> 
> I missed earlier that v4l2-mediabus.h contained a struct as well, so it can't be
> deprecated and neither can a #warning be added.
> 
> The best approach, I think, is to use a macro in media-bus-format.h
> that will either define just the MEDIA_BUS value when compiled in the kernel, or
> define both MEDIA_BUS and V4L2_MBUS values when compiled for userspace.
> 
> E.g. something like this:
> 
> #ifdef __KERNEL__
> #define MEDIA_BUS_FMT_ENTRY(name, val) MEDIA_BUS_FMT_ # name = val
> #else
> /* Keep V4L2_MBUS_FMT for backwards compatibility */
> #define MEDIA_BUS_FMT_ENTRY(name, val) \
> 	MEDIA_BUS_FMT_ # name = val, \
> 	V4L2_MBUS_FMT_ # name = val
> #endif

Okay, but this means we keep adding V4L2_MBUS_FMT_ definitions even for
new formats (which definitely doesn't encourage people to move on).
Moreover, we add a V4L2 prefix in what was supposed to be a subsystem
neutral header.

Anyway, these are just nitpicks, and if you prefer this approach
I'll rework my series :-).

> 
> An alternative approach is to have v4l2-mediabus.h include media-bus-format.h,
> put #ifndef __KERNEL__ around the enum v4l2_mbus_pixelcode and add a big comment
> there that applications should use the defines from media-bus-format.h and that
> this enum is frozen (i.e. new values are only added to media-bus-format.h).
> 
> But I think I like the macro idea best.

As you wish, my only intent is to use those bus format definitions in a
DRM driver :-).

Thanks,

Boris


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Hans Verkuil <hansverk@cisco.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-api@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Subject: Re: [PATCH 01/15] [media] Move mediabus format definition to a more standard place
Date: Tue, 4 Nov 2014 11:45:03 +0100	[thread overview]
Message-ID: <20141104114503.309cb54f@bbrezillon> (raw)
In-Reply-To: <5458A878.3010809@cisco.com>

Hi Hans,

On Tue, 04 Nov 2014 11:20:40 +0100
Hans Verkuil <hansverk@cisco.com> wrote:

> Hi Boris,
> 
> On 11/04/14 10:54, Boris Brezillon wrote:
> > Rename mediabus formats and move the enum into a separate header file so
> > that it can be used by DRM/KMS subsystem without any reference to the V4L2
> > subsystem.
> > 
> > Old V4L2_MBUS_FMT_ definitions are now referencing MEDIA_BUS_FMT_ value.
> 
> I missed earlier that v4l2-mediabus.h contained a struct as well, so it can't be
> deprecated and neither can a #warning be added.
> 
> The best approach, I think, is to use a macro in media-bus-format.h
> that will either define just the MEDIA_BUS value when compiled in the kernel, or
> define both MEDIA_BUS and V4L2_MBUS values when compiled for userspace.
> 
> E.g. something like this:
> 
> #ifdef __KERNEL__
> #define MEDIA_BUS_FMT_ENTRY(name, val) MEDIA_BUS_FMT_ # name = val
> #else
> /* Keep V4L2_MBUS_FMT for backwards compatibility */
> #define MEDIA_BUS_FMT_ENTRY(name, val) \
> 	MEDIA_BUS_FMT_ # name = val, \
> 	V4L2_MBUS_FMT_ # name = val
> #endif

Okay, but this means we keep adding V4L2_MBUS_FMT_ definitions even for
new formats (which definitely doesn't encourage people to move on).
Moreover, we add a V4L2 prefix in what was supposed to be a subsystem
neutral header.

Anyway, these are just nitpicks, and if you prefer this approach
I'll rework my series :-).

> 
> An alternative approach is to have v4l2-mediabus.h include media-bus-format.h,
> put #ifndef __KERNEL__ around the enum v4l2_mbus_pixelcode and add a big comment
> there that applications should use the defines from media-bus-format.h and that
> this enum is frozen (i.e. new values are only added to media-bus-format.h).
> 
> But I think I like the macro idea best.

As you wish, my only intent is to use those bus format definitions in a
DRM driver :-).

Thanks,

Boris


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  parent reply	other threads:[~2014-11-04 10:45 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04  9:54 [PATCH 00/15] [media] Make mediabus format subsystem neutral Boris Brezillon
2014-11-04  9:54 ` Boris Brezillon
2014-11-04  9:54 ` Boris Brezillon
2014-11-04  9:54 ` [PATCH 01/15] [media] Move mediabus format definition to a more standard place Boris Brezillon
2014-11-04  9:54   ` Boris Brezillon
2014-11-04  9:54   ` Boris Brezillon
2014-11-04 10:20   ` Hans Verkuil
2014-11-04 10:20     ` Hans Verkuil
2014-11-04 10:22     ` Hans Verkuil
2014-11-04 10:22       ` Hans Verkuil
2014-11-04 10:45     ` Boris Brezillon [this message]
2014-11-04 10:45       ` Boris Brezillon
2014-11-04 10:45       ` Boris Brezillon
2014-11-04 11:09       ` Hans Verkuil
2014-11-04 11:09         ` Hans Verkuil
2014-11-04 11:09         ` Hans Verkuil
2014-11-05 15:00         ` Sakari Ailus
2014-11-05 15:00           ` Sakari Ailus
2014-11-05 15:00           ` Sakari Ailus
2014-11-05 15:32           ` Boris Brezillon
2014-11-05 15:32             ` Boris Brezillon
2014-11-05 15:32             ` Boris Brezillon
2014-11-04  9:54 ` [PATCH 02/15] [media] v4l: Update subdev-formats doc with new MEDIA_BUS_FMT values Boris Brezillon
2014-11-04  9:54   ` Boris Brezillon
2014-11-04  9:54   ` Boris Brezillon
2014-11-05 14:57   ` Sakari Ailus
2014-11-05 14:57     ` Sakari Ailus
2014-11-05 15:01     ` Boris Brezillon
2014-11-05 15:01       ` Boris Brezillon
2014-11-04  9:54 ` [PATCH 03/15] [media] Make use of the new media_bus_format definitions Boris Brezillon
2014-11-04  9:54   ` Boris Brezillon
2014-11-04  9:54   ` Boris Brezillon
     [not found]   ` <1415094910-15899-4-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-11-05 15:19     ` Sakari Ailus
2014-11-05 15:19       ` Sakari Ailus
2014-11-05 15:19       ` Sakari Ailus
2014-11-04  9:54 ` [PATCH 04/15] [media] i2c: Make use of media_bus_format enum Boris Brezillon
2014-11-04  9:54   ` Boris Brezillon
2014-11-04  9:54   ` Boris Brezillon
2014-11-04  9:55 ` [PATCH 05/15] [media] pci: " Boris Brezillon
2014-11-04  9:55   ` Boris Brezillon
2014-11-04  9:55   ` Boris Brezillon
2014-11-04  9:55 ` [PATCH 07/15] [media] usb: " Boris Brezillon
2014-11-04  9:55   ` Boris Brezillon
2014-11-04  9:55 ` [PATCH 08/15] staging: media: " Boris Brezillon
2014-11-04  9:55   ` Boris Brezillon
2014-11-04  9:55 ` [PATCH 09/15] gpu: ipu-v3: " Boris Brezillon
2014-11-04  9:55   ` Boris Brezillon
     [not found] ` <1415094910-15899-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-11-04  9:55   ` [PATCH 06/15] [media] platform: " Boris Brezillon
2014-11-04  9:55     ` Boris Brezillon
2014-11-04  9:55   ` [PATCH 10/15] [media] v4l: Forbid usage of V4L2_MBUS_FMT definitions inside the kernel Boris Brezillon
2014-11-04  9:55     ` Boris Brezillon
2014-11-04  9:55     ` Boris Brezillon
2014-11-04  9:55   ` [PATCH 15/15] staging: media: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h Boris Brezillon
2014-11-04  9:55     ` Boris Brezillon
2014-11-04  9:55     ` Boris Brezillon
2014-11-04  9:55 ` [PATCH 11/15] [media] Deprecate v4l2_mbus_pixelcode Boris Brezillon
2014-11-04  9:55   ` Boris Brezillon
2014-11-05 15:08   ` Sakari Ailus
2014-11-05 15:08     ` Sakari Ailus
2014-11-05 15:15     ` Boris Brezillon
2014-11-05 15:15       ` Boris Brezillon
2014-11-05 15:15       ` Boris Brezillon
2014-11-05 15:19       ` Hans Verkuil
2014-11-05 15:19         ` Hans Verkuil
2014-11-05 15:30         ` Boris Brezillon
2014-11-05 15:30           ` Boris Brezillon
2014-11-05 15:30           ` Boris Brezillon
2014-11-05 15:34           ` Hans Verkuil
2014-11-05 15:34             ` Hans Verkuil
2014-11-05 15:34             ` Hans Verkuil
2014-11-05 15:22       ` Sakari Ailus
2014-11-05 15:22         ` Sakari Ailus
2014-11-05 15:22         ` Sakari Ailus
2014-11-04  9:55 ` [PATCH 12/15] [media] i2c: Replace v4l2-mediabus.h inclusion with v4l2-mbus.h Boris Brezillon
2014-11-04  9:55   ` Boris Brezillon
2014-11-04  9:55 ` [PATCH 13/15] gpu: ipu-v3: " Boris Brezillon
2014-11-04  9:55   ` Boris Brezillon
2014-11-04  9:55 ` [PATCH 14/15] [media] platform: " Boris Brezillon
2014-11-04  9:55   ` Boris Brezillon

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=20141104114503.309cb54f@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=hans.verkuil@cisco.com \
    --cc=hansverk@cisco.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.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.