Re: Sound issues with the 5.10.x kernel (alsa)

2021-03-28 Thread Stefan Wahren
Hi, Am 28.03.21 um 07:58 schrieb Ryutaroh Matsumoto: >> I think the root cause of this issue is that both vc4.ko and snd_bcm2835.ko >> try to provide ALSA sinks to HDMI audio outputs from RPi. >> Why do the two drivers provide the same functionality for the same device? >> It seems nonsense. >>

Re: Sound issues with the 5.10.x kernel (alsa)

2021-02-08 Thread Stefan Wahren
Hi Diederik, Am 08.02.21 um 12:47 schrieb Diederik de Haas: > Hi, > > This is basically me forwarding the bug I reported on Debian's BTS: > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978025 > > TL;DR: I have a RPi 3B+ running pure Debian Bullseye arm64 (~from > raspi.debian.net), named

Re: [PATCH 1/2] staging: vchiq: Fix bulk userdata handling

2021-01-04 Thread Stefan Wahren
da4f316a ("staging: vchiq: fix __user annotations") > > Signed-off-by: Phil Elwell Tested-by: Stefan Wahren ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [staging] aad378845d: WARNING:held_lock_freed

2020-04-15 Thread Stefan Wahren
s://github.com/0day-ci/linux/commits/Stefan-Wahren/staging-bcm2835-camera-Clean-up-driver/20200329-225704 > > > in testcase: boot > > on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 8G > > caused below changes (please refer t

[PATCH 5/9] staging: bcm2835-camera: Move encode component setup in its own function

2020-03-29 Thread Stefan Wahren
The function mmal_setup_components has to many indention levels. So move the setup code for encode component in its own function. Signed-off-by: Stefan Wahren --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 185 ++--- 1 file changed, 91 insertions(+), 94 deletions

[PATCH 3/9] staging: bcm2835-camera: Make struct indentation consistent

2020-03-29 Thread Stefan Wahren
The indentation of struct members wasn't consistent over the whole driver. Signed-off-by: Stefan Wahren --- .../vc04_services/bcm2835-camera/bcm2835-camera.h | 60 +++--- .../vc04_services/bcm2835-camera/controls.c| 4 +- .../vc04_services/bcm2835-camera/mmal-common.h

[PATCH 6/9] staging: bcm2835-camera: Move video component setup in its own function

2020-03-29 Thread Stefan Wahren
The function mmal_setup_components has to many indention levels. So move the setup code for video component in its own function. Signed-off-by: Stefan Wahren --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 88 -- 1 file changed, 48 insertions(+), 40 deletions

[PATCH 0/9] staging: bcm2835-camera: Clean up driver

2020-03-29 Thread Stefan Wahren
Except of patch 2 all these patches tries to clean up the bcm2835-camera driver. Stefan Wahren (9): staging: bcm2835-camera: Drop PREVIEW_LAYER staging: bcm2835-camera: Activate V4L2_EXPOSURE_METERING_MATRIX handling staging: bcm2835-camera: Make struct indentation consistent staging

[PATCH 4/9] staging: bcm2835-camera: Simplify set_framerate_params

2020-03-29 Thread Stefan Wahren
This simplifies set_framerate_params and avoids the multiple assignment in one line by moving the fps_high handling out of the if statement. Signed-off-by: Stefan Wahren --- drivers/staging/vc04_services/bcm2835-camera/controls.c | 15 ++- 1 file changed, 6 insertions(+), 9

[PATCH 8/9] staging: bcm2835-camera: reduce multiline statements

2020-03-29 Thread Stefan Wahren
There are a lot of multiline statements which can be reduced. Signed-off-by: Stefan Wahren --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 57 +- .../vc04_services/bcm2835-camera/controls.c| 3 +- 2 files changed, 23 insertions(+), 37 deletions(-) diff

[PATCH 9/9] staging: bcm2835-camera: reduce indentation in ctrl_set_image_effect

2020-03-29 Thread Stefan Wahren
We can reduce the indentation in the loop by using continue in case the effect doesn't match. Signed-off-by: Stefan Wahren --- .../vc04_services/bcm2835-camera/controls.c| 63 +++--- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/drivers/staging

[PATCH 1/9] staging: bcm2835-camera: Drop PREVIEW_LAYER

2020-03-29 Thread Stefan Wahren
This define is used only once. So drop the define and init the layer directly. Signed-off-by: Stefan Wahren --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 2 +- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h | 2 -- 2 files changed, 1 insertion(+), 3

[PATCH 2/9] staging: bcm2835-camera: Activate V4L2_EXPOSURE_METERING_MATRIX handling

2020-03-29 Thread Stefan Wahren
I don't see any reason to keep this TODO, so activate the V4L2_EXPOSURE_METERING_MATRIX handling. Signed-off-by: Stefan Wahren --- drivers/staging/vc04_services/bcm2835-camera/controls.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging

[PATCH 7/9] staging: bcm2835-camera: return early in mmal_setup_components

2020-03-29 Thread Stefan Wahren
We can reduce the indentation in mmal_setup_components further by returning early in error case. Signed-off-by: Stefan Wahren --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 60 +++--- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/drivers/staging

[PATCH 1/2] staging: bcm2835-camera: Drop unused ignore_errors flag

2020-03-12 Thread Stefan Wahren
The struct bm2835_mmal_v4l2_ctrl contains an ignore_errors flag which was always set to false. So drop the unused flag. Signed-off-by: Stefan Wahren --- .../vc04_services/bcm2835-camera/controls.c| 34 +- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git

[PATCH 0/2] staging: bcm2835-camera: Improve bm2835_mmal_v4l2_ctrl

2020-03-12 Thread Stefan Wahren
These 2 patches improves the V4L2 controls in the bcm2835 camera driver. Stefan Wahren (2): staging: bcm2835-camera: Drop unused ignore_errors flag staging: bcm2835-camera: Use designators to init V4L2 controls .../vc04_services/bcm2835-camera/controls.c| 458

[PATCH 2/2] staging: bcm2835-camera: Use designators to init V4L2 controls

2020-03-12 Thread Stefan Wahren
The initializer lists for the V4L2 controls are hard to read. So improve this by using designators. Signed-off-by: Stefan Wahren --- .../vc04_services/bcm2835-camera/controls.c| 424 ++--- 1 file changed, 277 insertions(+), 147 deletions(-) diff --git a/drivers/staging

Re: [PATCH 0/3] staging: vchiq: Fix vchiq_read return value in case of error

2019-11-21 Thread Stefan Wahren
Hi Marcelo, [add Nicolas and Phil] Am 20.11.19 um 16:36 schrieb Marcelo Diop-Gonzalez: > This is a proposed fix of an issue regarding the handling of positive > return values from copy_to_user() in vchiq_read(). It looks like the > struct dump_context passed to the vchiq_dump() function keeps

Re: [PATCH] staging: vc04: Fix Kconfig indentation

2019-11-20 Thread Stefan Wahren
Am 20.11.19 um 14:38 schrieb Krzysztof Kozlowski: > Adjust indentation from spaces to tab (+optional two spaces) as in > coding style with command like: > $ sed -e 's/^/\t/' -i */Kconfig > > Signed-off-by: Krzysztof Kozlowski Acked-by

Re: [PATCH 2/2] staging: vchiq: Remove global bcm*_drvdata

2019-11-13 Thread Stefan Wahren
Hello Marcelo, Am 11.11.19 um 18:14 schrieb Marcelo Diop-Gonzalez: > Moving the DT node check to vchiq_platform_init() > removes the need for these. this comment does match to your changes. Also i'm missing a why this is necessary. > > Signed-off-by: Marcelo Diop-Gonzalez > --- >

Re: [PATCH resend] staging: vc04_services: replace g_free_fragments_mutex with spinlock

2019-11-02 Thread Stefan Wahren
Hi Davidlohr, Am 01.11.19 um 19:29 schrieb Davidlohr Bueso: > There is no need to be using a semaphore, or a sleeping lock > in the first place: critical region is extremely short, does not > call into any blocking calls and furthermore lock and unlocking > operations occur in the same context. >

Re: [PATCH 1/2] staging: vc04_services: fix lines ending with open parenthesis

2019-10-13 Thread Stefan Wahren
Hi Jules, Am 13.10.19 um 20:34 schrieb Jules Irenge: > Fix lines ending with open parenthesis. Issue detected by checkpatch tool. > In the process, change driver functions name in the multiple files from: > vchiq_mmal_port_parameter_set to vmp_prmtr_set > vchiq_mmal_component_disable to

Re: [PATCH] staging: vhciq_core: replace snprintf with scnprintf

2019-09-11 Thread Stefan Wahren
Hi Rohit, On 11.09.19 15:51, Rohit Sarkar wrote: > When the number of bytes to be printed exceeds the limit snprintf > returns the number of bytes that would have been printed (if there was > no truncation). This might cause issues, hence use scnprintf which > returns the actual number of bytes

Re: [PATCH v2 15/34] staging/vc04_services: convert put_page() to put_user_page*()

2019-08-12 Thread Stefan Wahren
version, as described in commit fc1d8e7cca2d > ("mm: introduce put_user_page*(), placeholder versions"). > > Acked-by: Greg Kroah-Hartman > > Cc: Eric Anholt > Cc: Stefan Wahren > Cc: Greg Kroah-Hartman > Cc: Mihaela Muraru > Cc: Suniel Mahesh > Cc: Al V

Re: [PATCH v2 -next] staging: vc04_services: fix used-but-set-variable warning

2019-07-26 Thread Stefan Wahren
Hi Yue, Am 26.07.19 um 11:26 schrieb YueHaibing: > Fix gcc used-but-set-variable warning: just a nit. It is call "unused-but-set-variable" Acked-by: Stefan Wahren > > drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c: In function > vchiq_release_inter

[PATCH V2 26/29] staging: bcm2835-camera: Fix stride on RGB3/BGR3 formats

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson RGB3/BGR3 end up being 3 bytes per pixel, which meant that the alignment code ended up trying to align using bitmasking with a mask of 96. That doesn't work, so switch to an arithmetic alignment for those formats. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren

[PATCH V2 28/29] staging: bcm2835-camera: Set the field value within each buffer

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fixes a v4l2-compliance failure v4l2-test-buffers.cpp(415): g_field() == V4L2_FIELD_ANY The driver only ever produces progresive frames, so field should always be set to V4L2_FIELD_NONE. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil

[PATCH V2 25/29] staging: mmal-vchiq: Avoid use of bool in structures

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fixes up a checkpatch error "Avoid using bool structure members because of possible alignment issues". Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging/vc04_services/bcm2

[PATCH V2 29/29] staging: bcm2835-camera: Correct ctrl min/max/step/def to 64bit

2019-06-29 Thread Stefan Wahren
-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging/vc04_services/bcm2835-camera/controls.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera

[PATCH V2 27/29] staging: bcm2835-camera: Add sanity checks for queue_setup/CREATE_BUFS

2019-06-29 Thread Stefan Wahren
in the REQBUFS case where it provides the buffer properties. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../vc04_services/bcm2835-camera/bcm2835-camera.c| 16 1 file changed, 16 insertions

[PATCH V2 19/29] staging: bcm2835-camera: Unify header inclusion defines

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Most of the headers use ifndef FOO_H, whilst mmal-parameters.h used ifndef __FOO_H. Revise mmal-parameters.h to drop the underscores and make the headers all consistent. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro

[PATCH V2 20/29] staging: bcm2835-camera: Fix multiple assignments should be avoided

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Clear checkpatch complaints of "multiple assignments should be avoided" Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 5 +++

[PATCH V2 17/29] staging: bcm2835-camera: Set sequence number correctly

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Set the sequence number in vb2_v4l2_buffer mainly so the latest v4l2-ctl reports the frame rate correctly. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging/vc04_services/bcm2835-camera

[PATCH V2 18/29] staging: bcm2835-camera: Add multiple inclusion protection to headers

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson mmal-common.h and mmal-msg.h didn't have the normal ifndef FOO / define FOO / endif protection to stop it being included multiple times. Add it. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab

[PATCH V2 24/29] staging: bcm2835-camera: Remove/amend some obsolete comments

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Remove a todo which has been done. Remove a template line that was redundant. Make a comment clearer as to the non-obvious meaning of a field. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers

[PATCH V2 21/29] staging: bcm2835-camera: Fix up mmal-parameters.h

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fixes up all the checkpatch error "line over 80 characters" in mmal-parameters.h Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../vc04_services/bcm2835-camera/mmal-paramete

[PATCH V2 16/29] staging: bcm2835-camera: Handle empty EOS buffers whilst streaming

2019-06-29 Thread Stefan Wahren
and returned an error up the stack. Handle the condition correctly by returning it to the component if streaming, or returning with an error if stopping streaming. Fixes: 938416707071 ("staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping") Signed-off-by: Dave Stevenson Signed-off-by: Ste

[PATCH V2 23/29] staging: bcm2835-camera: Correct V4L2_CID_COLORFX_CBCR behaviour

2019-06-29 Thread Stefan Wahren
ed value") Reported-by: Colin Ian King Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging/vc04_services/bcm2835-camera/controls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dr

[PATCH V2 22/29] staging: bcm2835-camera: Use enums for max value in controls

2019-06-29 Thread Stefan Wahren
these with the appropriate enum. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../vc04_services/bcm2835-camera/controls.c| 37 -- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/drivers

[PATCH V2 09/29] staging: bcm2835-camera: Reduce length of enum names

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson We have numerous lines over 80 chars, or oddly split. Many of these are due to using long enum names such as MMAL_COMPONENT_CAMERA. Reduce the length of these enum names. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro

[PATCH V2 00/29] staging: bcm2835-camera: Improvements

2019-06-29 Thread Stefan Wahren
This is an attempt to help Dave Stevenson to get all the fixes and improvements of the bcm2835-camera driver into mainline. Mostly i only polished the commit logs for upstream. The series based on the latest bugfix V2 of staging: bcm2835-camera: Restore return behavior of ctrl_set_bitrate().

[PATCH V2 13/29] staging: bcm2835-camera: Fix open parenthesis alignment

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fix checkpatch "Alignment should match open parenthesis" errors. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 9 .../vc0

[PATCH V2 05/29] staging: bcm2835-camera: Return early on errors

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fix several instances where it is easier to return early on error conditions than handle it as an else clause. As requested by Mauro. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../vc04_services

[PATCH V2 03/29] staging: bcm2835-camera: Do not bulk receive from service thread

2019-06-29 Thread Stefan Wahren
. Add a workqueue to schedule the call vchi_bulk_queue_receive in an alternate context to avoid the lock up. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../vc04_services/bcm2835-camera/mmal-vchiq.c | 101

[PATCH V2 10/29] staging: bcm2835-camera: Fix multiple line dereference errors

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fix checkpatch errors "Avoid multiple line dereference" Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 11 --- 1 fi

[PATCH V2 01/29] staging: bcm2835-camera: Check the error for REPEAT_SEQ_HEADER

2019-06-29 Thread Stefan Wahren
2013, so the chances of having a firmware that still has that issue is so close to zero that the workaround can be removed. Link: https://github.com/raspberrypi/linux/pull/2782/ Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab

[PATCH V2 04/29] staging: bcm2835-camera: Correctly denote key frames in encoded data

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Forward MMAL key frame flags to the V4L2 buffers. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 +++ 1 file changed, 3 insertions

[PATCH V2 12/29] staging: bcm2835-camera: Fix missing lines between items

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fix checkpatch errors for missing blank lines after variable or structure declarations. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h

[PATCH V2 11/29] staging: bcm2835-camera: Fix brace style issues.

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fix mismatched or missing brace issues flagged by checkpatch. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 ++- drivers/staging

[PATCH V2 15/29] staging: bcm2835-camera: Remove check of the number of buffers supplied

2019-06-29 Thread Stefan Wahren
therefore there is no need for that check, and indeed it is wrong as there is no need to submit all the buffers before starting streaming. Fixes: 938416707071 ("staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping") Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Ac

[PATCH V2 06/29] staging: bcm2835-camera: Remove dead email addresses

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson None of the listed author email addresses were valid. Keep list of authors and the companies they represented. Update my email address. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- drivers/staging

[PATCH V2 02/29] staging: bcm2835-camera: Replace spinlock protecting context_map with mutex

2019-06-29 Thread Stefan Wahren
e new node, but this is not valid whilst in an atomic context due to the spinlock. There is no need for this to be a spinlock as a standard mutex is sufficient. Fixes: 950fd867c635 ("staging: bcm2835-camera: Replace open-coded idr with a struct idr.") Signed-off-by: Dave Stevenson Signed-off-by:

[PATCH V2 14/29] staging: bcm2835-camera: Ensure all buffers are returned on disable

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson With the recent change to match MMAL and V4L2 buffers there is a need to wait for all MMAL buffers to be returned during stop_streaming. Fixes: 938416707071 ("staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping") Signed-off-by: Dave Stevenson Signed-off-

[PATCH V2 08/29] staging: bcm2835-camera: Fix spacing around operators

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fix checkpatch warnings over spaces around operators. Many were around operations that can be replaced with the BIT(x) macro, so replace with that where appropriate. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro

[PATCH V2 07/29] staging: bcm2835-camera: Fix comment style violations.

2019-06-29 Thread Stefan Wahren
From: Dave Stevenson Fix comment style violations in the header files. Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../vc04_services/bcm2835-camera/mmal-msg-format.h | 95 --- .../vc04_services/bcm2835

Re: [PATCH 00/31] staging: bcm2835-camera: Improvements

2019-06-29 Thread Stefan Wahren
Hi Dave, Am 28.06.19 um 19:29 schrieb Dave Stevenson: > Hi Stefan > > Could you try running > v4l2-ctl -v width=640,height=480,pixelformat=YU12 > before running v4l2-compliance? The default format is JPEG, and I just > wonder if there is an issue lurking in the compression side. yes, this is

Re: [PATCH 00/31] staging: bcm2835-camera: Improvements

2019-06-28 Thread Stefan Wahren
Hi Hans, Am 28.06.19 um 10:06 schrieb Hans Verkuil: > Hi Stefan, > > On 6/27/19 8:55 PM, Stefan Wahren wrote: >> This is an attempt to help Dave Stevenson to get all the fixes and >> improvements of the bcm2835-camera driver into mainline. >> >> Mostly i only poli

[PATCH 27/31] staging: mmal-vchiq: Avoid use of bool in structures

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fixes up a checkpatch error "Avoid using bool structure members because of possible alignment issues". Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 12 ++-- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h

[PATCH 30/31] staging: bcm2835-camera: Set the field value within ach buffer

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fixes a v4l2-compliance failure v4l2-test-buffers.cpp(415): g_field() == V4L2_FIELD_ANY The driver only ever produces progresive frames, so field should always be set to V4L2_FIELD_NONE. Signed-off-by: Dave Stevenson ---

[PATCH 28/31] staging: bcm2835-camera: Fix stride on RGB3/BGR3 formats

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson RGB3/BGR3 end up being 3 bytes per pixel, which meant that the alignment code ended up trying to align using bitmasking with a mask of 96. That doesn't work, so switch to an arithmetic alignment for those formats. Signed-off-by: Dave Stevenson ---

[PATCH 31/31] staging: bcm2835-camera: Correct ctrl min/max/step/def to 64bit

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson The V4L2 control API was expanded to take 64 bit values in commit 0ba2aeb6dab (Apr 16 2014), but as this driver wasn't in the mainline kernel at that point this was overlooked. Update to use 64 bit values. This also fixes a couple of warnings in 64 bit builds.

[PATCH 29/31] staging: bcm2835-camera: Add sanity checks for queue_setup/CREATE_BUFS

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fixes a v4l2-compliance failure when passed a buffer that is too small. queue_setup wasn't handling the case where !(*nplanes), as used from CREATE_BUFS and requiring the driver to sanity check the provided buffer parameters. It was assuming that it was always being used in

[PATCH 21/31] staging: bcm2835-camera: Unify header inclusion defines

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Most of the headers use ifndef FOO_H, whilst mmal-parameters.h used ifndef __FOO_H. Revise mmal-parameters.h to drop the underscores and make the headers all consistent. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h | 4

[PATCH 24/31] staging: bcm2835-camera: Use enums for max value in controls

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Controls of type MMAL_CONTROL_TYPE_STD_MENU call v4l2_ctrl_new_std_menu with a max value and a mask. The max value is one of the defined values for the control, however in the config array there are several entries where raw numbers have been used instead. Replace these with

[PATCH 25/31] staging: bcm2835-camera: Correct V4L2_CID_COLORFX_CBCR behaviour

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson With V4L2_CID_COLORFX_CBCR calling ctrl_set_colfx it was incorrectly assigning the colour values to the enable field of dev->colourfx instead of the u and v fields. Correct the assignments. Reported as a Coverity issue Detected by CoverityScan CID#1419711 ("Unused value")

[PATCH 23/31] staging: bcm2835-camera: Fix up mmal-parameters.h

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fixes up all the checkpatch error "line over 80 characters" in mmal-parameters.h Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/mmal-parameters.h | 261 + 1 file changed, 159 insertions(+), 102 deletions(-) diff --git

[PATCH 26/31] staging: bcm2835-camera: Remove/amend some obsolete comments

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Remove a todo which has been done. Remove a template line that was redundant. Make a comment clearer as to the non-obvious meaning of a field. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/controls.c | 11 +-- 1 file changed, 1

[PATCH 20/31] staging: bcm2835-camera: Add multiple inclusion protection to headers

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson mmal-common.h and mmal-msg.h didn't have the normal ifndef FOO / define FOO / endif protection to stop it being included multiple times. Add it. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/mmal-common.h | 3 +++

[PATCH 22/31] staging: bcm2835-camera: Fix multiple assignments should be avoided

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Clear checkpatch complaints of "multiple assignments should be avoided" Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[PATCH 03/31] staging: bcm2835-camera: Replace spinlock protecting context_map with mutex

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson The commit "staging: bcm2835-camera: Replace open-coded idr with a struct idr." replaced an internal implementation of an idr with the standard functions and a spinlock. idr_alloc(GFP_KERNEL) can sleep whilst calling kmem_cache_alloc to allocate the new node, but this is not

[PATCH 00/31] staging: bcm2835-camera: Improvements

2019-06-27 Thread Stefan Wahren
This is an attempt to help Dave Stevenson to get all the fixes and improvements of the bcm2835-camera driver into mainline. Mostly i only polished the commit logs for upstream. The series based on the latest bugfix V2 of staging: bcm2835-camera: Restore return behavior of ctrl_set_bitrate().

[PATCH 08/31] staging: bcm2835-camera: Fix comment style violations.

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fix comment style violations in the header files. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/mmal-msg-format.h | 95 --- .../vc04_services/bcm2835-camera/mmal-msg-port.h | 124 +--

[PATCH 18/31] staging: bcm2835-camera: Set sequence number correctly

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Set the sequence number in vb2_v4l2_buffer mainly so the latest v4l2-ctl reports the frame rate correctly. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 4

[PATCH 12/31] staging: bcm2835-camera: Fix brace style issues.

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fix mismatched or missing brace issues flagged by checkpatch. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 ++- drivers/staging/vc04_services/bcm2835-camera/controls.c | 3 ++-

[PATCH 10/31] staging: bcm2835-camera: Reduce length of enum names

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson We have numerous lines over 80 chars, or oddly split. Many of these are due to using long enum names such as MMAL_COMPONENT_CAMERA. Reduce the length of these enum names. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 156

[PATCH 16/31] staging: bcm2835-camera: Remove check of the number of buffers supplied

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Before commit "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping" there was a need to ensure that there were sufficient buffers supplied from the user to cover those being sent to the VPU (always 1). Now the buffers are linked 1:1 between MMAL and V4L2, therefore

[PATCH 02/31] staging: bcm2835-camera: Check the error for REPEAT_SEQ_HEADER

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson When handling for V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER was added the firmware would reject the setting if H264 hadn't already been selected. This was fixed in the firmware at that point, but to enable backwards compatibility the returned error was ignored. That was Dec

[PATCH 04/31] staging: bcm2835-camera: Do not bulk receive from service thread

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson vchi_bulk_queue_receive will queue up to a default of 4 bulk receives on a connection before blocking. If called from the VCHI service_callback thread, then that thread is unable to service the VCHI_CALLBACK_BULK_RECEIVED events that would enable the queue call to succeed.

[PATCH 05/31] staging: bcm2835-camera: Correctly denote key frames in encoded data

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Forward MMAL key frame flags to the V4L2 buffers. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c

[PATCH 07/31] staging: bcm2835-camera: Remove dead email addresses

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson None of the listed author email addresses were valid. Keep list of authors and the companies they represented. Update my email address. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 9 +

[PATCH 17/31] staging: bcm2835-camera: Handle empty EOS buffers whilst streaming

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson The change to mapping V4L2 to MMAL buffers 1:1 didn't handle the condition we get with raw pixel buffers (eg YUV and RGB) direct from the camera's stills port. That sends the pixel buffer and then an empty buffer with the EOS flag set. The EOS buffer wasn't handled and

[PATCH 06/31] staging: bcm2835-camera: Return early on errors

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fix several instances where it is easier to return early on error conditions than handle it as an else clause. As requested by Mauro. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 109 +++-- 1 file changed, 58

[PATCH 19/31] staging: bcm2835-camera: Ensure timestamps never go backwards.

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson There is an awkward situation with H264 header bytes. Currently they are returned with a PTS of 0 because they aren't associated with a timestamped frame to encode. These are handled by either returning the timestamp of the last buffer to have been received, or in the case

[PATCH 15/31] staging: bcm2835-camera: Ensure all buffers are returned on disable

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson With the recent change to match MMAL and V4L2 buffers there is a need to wait for all MMAL buffers to be returned during stop_streaming. Fixes: 938416707071 ("staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping") Signed-off-by: Dave Stevenson ---

[PATCH 09/31] staging: bcm2835-camera: Fix spacing around operators

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fix checkpatch warnings over spaces around operators. Many were around operations that can be replaced with the BIT(x) macro, so replace with that where appropriate. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/controls.c| 32

[PATCH 13/31] staging: bcm2835-camera: Fix missing lines between items

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fix checkpatch errors for missing blank lines after variable or structure declarations. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 11/31] staging: bcm2835-camera: Fix multiple line dereference errors

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fix checkpatch errors "Avoid multiple line dereference" Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git

[PATCH 14/31] staging: bcm2835-camera: Fix open parenthesis alignment

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson Fix checkpatch "Alignment should match open parenthesis" errors. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 9 .../vc04_services/bcm2835-camera/controls.c| 25 ++

[PATCH 01/31] staging: bcm2835-camera: Ensure H264 header bytes get a sensible timestamp

2019-06-27 Thread Stefan Wahren
From: Dave Stevenson H264 header come from VC with 0 timestamps, which means they get a strange timestamp when processed with VC/kernel start times, particularly if used with the inline header option. Remember the last frame timestamp and use that if set, or otherwise use the kernel start time.

[PATCH V2] staging: bcm2835-camera: Restore return behavior of ctrl_set_bitrate()

2019-06-26 Thread Stefan Wahren
explaining comment and a debug message to verify that the bug has been fixed in firmware. Fixes: 52c4dfcead49 ("Staging: vc04_services: Cleanup in ctrl_set_bitrate()") Signed-off-by: Stefan Wahren --- .../staging/vc04_services/bcm2835-camera/controls.c | 19 ---

Re: [PATCH] staging: bcm2835-camera: Restore return behavior of ctrl_set_bitrate()

2019-06-25 Thread Stefan Wahren
Hi Dan, hi Dave, Am 25.06.19 um 09:55 schrieb Dan Carpenter: > On Tue, Jun 25, 2019 at 12:13:15AM +0200, Stefan Wahren wrote: >> The commit 52c4dfcead49 ("Staging: vc04_services: Cleanup in >> ctrl_set_bitrate()") changed the return behavior of ctrl_set_bitrate(

[PATCH] staging: bcm2835-camera: Restore return behavior of ctrl_set_bitrate()

2019-06-24 Thread Stefan Wahren
: vc04_services: Cleanup in ctrl_set_bitrate()") Signed-off-by: Stefan Wahren --- drivers/staging/vc04_services/bcm2835-camera/controls.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_ser

Re: [PATCH] staging: bcm2835-camera: Avoid apotential sleep while holding a spin_lock

2019-06-24 Thread Stefan Wahren
Hi Christophe, Am 24.06.2019 um 07:33 schrieb Christophe JAILLET: Do not allocate memory with GFP_KERNEL when holding a spin_lock, it may sleep. Use GFP_NOWAIT instead. Fixes: 950fd867c635 ("staging: bcm2835-camera: Replace open-coded idr with a struct idr.") Signed-off-by: Christophe JAILLET

Re: [PATCH v2] Staging: bcm2835-camera: Prefer kernel types

2019-05-17 Thread Stefan Wahren
Am 16.05.2019 um 23:33 schrieb Madhumitha Prabakaran: Fix the warning issued by checkpatch Prefer kernel type 'u32' over 'uint32_t'. Along with that include a blank line after a declaration to maintain Linux kernel coding style. Signed-off-by: Madhumitha Prabakaran Acked-by: Stefan Wahren

Re: [PATCH] Staging: vc04_services: Fix kernel type 'u32' over 'uint32_t'

2019-05-15 Thread Stefan Wahren
Hi Madhumitha, On 14.05.19 18:02, Madhumitha Prabakaran wrote: > Fix the warning issued by checkpatch > Prefer kernel type 'u32' over 'uint32_t' grepping the sources within vc04_services shows a lot more occurences. I suggest to fix this style issue at least for the whole camera driver and name

Re: [PATCH v3 1/4] staging: vchiq_2835_arm: revert "quit using custom down_interruptible()"

2019-05-15 Thread Stefan Wahren
mainly used as an interface to V4L2 and ALSA devices. > > Fixes: ff5979ad8636 ("staging: vchiq_2835_arm: quit using custom > down_interruptible()") > Signed-off-by: Nicolas Saenz Julienne This whole series is: Acked-by: Stefan Wahren ___

Re: [PATCH] Staging: vc04_services: Fix a couple error codes

2019-05-13 Thread Stefan Wahren
Signed-off-by: Dan Carpenter Good catch Acked-by: Stefan Wahren ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] staging: vc04_services: bcm2835-camera: remove redundant assignment to variable ret

2019-05-13 Thread Stefan Wahren
nused Value") > Signed-off-by: Colin Ian King Acked-by: Stefan Wahren ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH v2 0/3] staging: vchiq: use interruptible waits

2019-05-06 Thread Stefan Wahren
Hi Nicolas, Am 06.05.19 um 16:40 schrieb Nicolas Saenz Julienne: > Hi, > ... > > Regards, > Nicolas > > [1] https://github.com/raspberrypi/linux/issues/2881 > [2] https://archlinuxarm.org/forum/viewtopic.php?f=65=13485 > [3] >

Re: [PATCH v2 2/3] staging: vchiq: revert "switch to wait_for_completion_killable"

2019-05-06 Thread Stefan Wahren
Hi Nicolas, Am 06.05.19 um 17:59 schrieb Nicolas Saenz Julienne: > Hi Dan, thanks for reviewing. > > On Mon, 2019-05-06 at 18:20 +0300, Dan Carpenter wrote: >> On Mon, May 06, 2019 at 04:40:29PM +0200, Nicolas Saenz Julienne wrote: >>> @@ -1740,7 +1740,8 @@ parse_rx_slots(struct vchiq_state

  1   2   3   4   >