From: Johannes Thumshirn <hidden> Date: 2017-06-21 08:08:40
Currently the media subsystem has a very creative abuse of the
KERNEL_VERSION macro to encode an arbitrary version triplet for media
drivers and device hardware revisions.
This series introduces a new macro called MEDIA_REVISION which encodes
a version triplet like KERNEL_VERSION does, but clearly has media
centric semantics and doesn't fool someone into thinking specific
parts are defined for a specific kernel version only like in out of
tree drivers.
Johannes Thumshirn (7):
[media] media: introduce MEDIA_REVISION macro
video: fbdev: don't use KERNEL_VERSION macro for MEDIA_REVISION
[media] media: document the use of MEDIA_REVISION instead of
KERNEL_VERSION
[media] cx25821: use MEDIA_REVISION instead of KERNEL_VERSION
[media] media: s3c-camif: Use MEDIA_REVISON instead of KERNEL_VERSION
[media] media: bcm2048: use MEDIA_REVISION isntead of KERNEL_VERSION
staging/atomisp: use MEDIA_VERSION instead of KERNEL_VERSION
Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst | 2 +-
Documentation/media/uapi/mediactl/media-ioc-device-info.rst | 4 ++--
Documentation/media/uapi/v4l/vidioc-querycap.rst | 6 +++---
drivers/media/pci/cx25821/cx25821.h | 2 +-
drivers/media/platform/s3c-camif/camif-core.c | 2 +-
drivers/staging/media/atomisp/include/linux/atomisp.h | 6 +++---
drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
drivers/video/fbdev/matrox/matroxfb_base.c | 3 ++-
include/media/media-device.h | 5 ++---
include/uapi/linux/media.h | 4 +++-
10 files changed, 19 insertions(+), 17 deletions(-)
--
2.12.3
From: Johannes Thumshirn <hidden> Date: 2017-06-21 08:08:42
Currently the media code abuses the KERNEL_VERSION macro to encode a
version triplet.
Introduce a MEDIA_REVISION macro to get rid of the confusing and
creative KERNEL_VERSION usage in the media subsystem.
Signed-off-by: Johannes Thumshirn <redacted>
---
include/uapi/linux/media.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Johannes Thumshirn <hidden> Date: 2017-06-21 08:08:43
Use MEDIA_REVISION instead of KERNEL_VERSION to encode the
CX25821_VERSION_CODE.
Signed-off-by: Johannes Thumshirn <redacted>
---
drivers/media/pci/cx25821/cx25821.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Johannes Thumshirn <hidden> Date: 2017-06-21 08:09:34
Use MEDIA_VERSION instead of KERNEL_VERSION to encode the driver
version of the Atom ISP driver.
Signed-off-by: Johannes Thumshirn <redacted>
---
drivers/staging/media/atomisp/include/linux/atomisp.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Johannes Thumshirn <hidden> Date: 2017-06-21 08:13:24
Update the documentation to introduce the use of MEDIA_REVISON instead
of KERNEL_VERSION for the verison triplets of a media drivers hardware
revision or driver version.
Signed-off-by: Johannes Thumshirn <redacted>
---
Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst | 2 +-
Documentation/media/uapi/mediactl/media-ioc-device-info.rst | 4 ++--
Documentation/media/uapi/v4l/vidioc-querycap.rst | 6 +++---
include/media/media-device.h | 5 ++---
4 files changed, 8 insertions(+), 9 deletions(-)
@@ -56,7 +56,7 @@ returns the information to the application. The ioctl never fails.:ref:`cec-capabilities`.* - __u32-``version``-- CEC Framework API version, formatted with the ``KERNEL_VERSION()``+- CEC Framework API version, formatted with the ``MEDIA_REVISION()`` macro.
@@ -96,7 +96,7 @@ ioctl never fails.-``media_version``-- Media API version, formatted with the ``KERNEL_VERSION()`` macro.+- Media API version, formatted with the ``MEDIA_REVISION()`` macro.- .. row 6
@@ -113,7 +113,7 @@ ioctl never fails.-``driver_version``- Media device driver version, formatted with the-``KERNEL_VERSION()`` macro. Together with the ``driver`` field+``MEDIA_REVISION()`` macro. Together with the ``driver`` field this identifies a particular driver.- .. row 8
@@ -90,13 +90,13 @@ specification the ioctl returns an ``EINVAL`` error code. example, a stable or distribution-modified kernel uses the V4L2 stack from a newer kernel.- The version number is formatted using the ``KERNEL_VERSION()``+ The version number is formatted using the ``MEDIA_REVISION()`` macro:* - :cspan:`2`-``#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))``+``#define MEDIA_REVISION(a,b,c) (((a) << 16) + ((b) << 8) + (c))``-``__u32 version = KERNEL_VERSION(0, 8, 1);``+``__u32 version = MEDIA_REVISION(0, 8, 1);````printf ("Version: %u.%u.%u\\n",``
From: Johannes Thumshirn <hidden> Date: 2017-06-21 08:13:26
Don't use the KERNEL_VERSION() macro for the v4l2 capabilities, use
MEDIA_REVISION instead.
Signed-off-by: Johannes Thumshirn <redacted>
---
drivers/video/fbdev/matrox/matroxfb_base.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Em Wed, 21 Jun 2017 10:08:05 +0200
Johannes Thumshirn [off-list ref] escreveu:
Currently the media subsystem has a very creative abuse of the
KERNEL_VERSION macro to encode an arbitrary version triplet for media
drivers and device hardware revisions.
This series introduces a new macro called MEDIA_REVISION which encodes
a version triplet like KERNEL_VERSION does, but clearly has media
centric semantics and doesn't fool someone into thinking specific
parts are defined for a specific kernel version only like in out of
tree drivers.
Sorry, but I can't see any advantage on it. On the downside, it
includes the media controller header file (media.h) where it
is not needed.
Johannes Thumshirn (7):
[media] media: introduce MEDIA_REVISION macro
video: fbdev: don't use KERNEL_VERSION macro for MEDIA_REVISION
[media] media: document the use of MEDIA_REVISION instead of
KERNEL_VERSION
[media] cx25821: use MEDIA_REVISION instead of KERNEL_VERSION
[media] media: s3c-camif: Use MEDIA_REVISON instead of KERNEL_VERSION
[media] media: bcm2048: use MEDIA_REVISION isntead of KERNEL_VERSION
staging/atomisp: use MEDIA_VERSION instead of KERNEL_VERSION
That's said, some of the above shouldn't be using KERNEL_VERSION
at all. The V4L2 core sets the version already. So, drivers like
cx25821, s3c-camif, bcm2048 and atomisp are likely doing the wrong
thing.
Thanks,
Mauro
From: Johannes Thumshirn <hidden> Date: 2017-06-29 09:43:13
On Sat, Jun 24, 2017 at 05:15:07PM -0300, Mauro Carvalho Chehab wrote:
Sorry, but I can't see any advantage on it. On the downside, it
includes the media controller header file (media.h) where it
is not needed.
My reasoning was the differences in semantics. KERNEL_VERSION() is for
encoding the kernel's version triplet not a API or Hardware or whatever
version. Other subsystems do this as well, for instance in NVMe we have the
NVME_VS() macro which is used to encode the NVMe Spec compliance from a human
readable form to the hardware's u32. Also KERNEL_VERISON() shouldn't have
in-tree users IMHO. Yes there is _one_ other user of it in-tree which is EXT4
and I already talked to Jan Kara about it and we decided to leave it in until
4.20.
Byte,
Johannes
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
From: Stephen Hemminger <stephen@networkplumber.org> Date: 2017-06-29 17:01:17
On Thu, 29 Jun 2017 11:42:59 +0200
Johannes Thumshirn [off-list ref] wrote:
On Sat, Jun 24, 2017 at 05:15:07PM -0300, Mauro Carvalho Chehab wrote:
quoted
Sorry, but I can't see any advantage on it. On the downside, it
includes the media controller header file (media.h) where it
is not needed.
My reasoning was the differences in semantics. KERNEL_VERSION() is for
encoding the kernel's version triplet not a API or Hardware or whatever
version. Other subsystems do this as well, for instance in NVMe we have the
NVME_VS() macro which is used to encode the NVMe Spec compliance from a human
readable form to the hardware's u32. Also KERNEL_VERISON() shouldn't have
in-tree users IMHO. Yes there is _one_ other user of it in-tree which is EXT4
and I already talked to Jan Kara about it and we decided to leave it in until
4.20.
Byte,
Johannes
If you read Linus's comments on version.
Driver version is meaningless and there is a desire to rip it out of all
drivers. The reason is that drivers must always behave the same, i.e you
can't use version to change API/ABI behavior.
Any upstream driver should never use KERNEL_VERSION().
From: Johannes Thumshirn <hidden> Date: 2017-06-30 07:27:35
On Thu, Jun 29, 2017 at 10:01:05AM -0700, Stephen Hemminger wrote:
If you read Linus's comments on version.
Driver version is meaningless and there is a desire to rip it out of all
drivers. The reason is that drivers must always behave the same, i.e you
can't use version to change API/ABI behavior.
Indeed this causes more harm than good. We had support calls regarding the
mlx4 driver because of not incremented MODLE_VERSION()s. If we follow your
and Linus' path we shouldn't just get rid of the KERNEL_VERSION() usage
in media and replace it with a new version, but kill all the versioning
stuff out of media (and others) except for maybe the HW version.
Any upstream driver should never use KERNEL_VERSION().
Exactly my reasoning.
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850