26 Mar, 2019
21 commits
-
Add structs and definitions needed to implement stateless
decoder for fwht and add I/P-frames QP controls to the
public api.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
add documentation to V4L2_PIX_FMT_FWHT_STATELESS
in pixfmt-compressed.rstSigned-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
add documentation to V4L2_CID_MPEG_VIDEO_FWHT_PARAMS
control and its related 'v4l2_ctrl_fwht_params' struct[mchehab+samsung@kernel.org: remove extra blank lines]
Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
add documentation to V4L2_CID_FWHT_I/P_FRAME_QP
controls in ext-ctrls-codec.rst[mchehab+samsung@kernel.org: remove extra blank lines]
Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Add struct 'vicodec_dev_instance' for the fields in vicodec_dev
that have have both decoder and encoder versions.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
In the stateless decoder the reference buffer is null if the
frame is an I-frame (flagged with FWHT_FL_I_FRAME).
Make sure not to dereference it in that case.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Rename 'v4l2_fwht_default_fmt' to 'v4l2_fwht_find_nth_fmt'
and add a function 'v4l2_fwht_validate_fmt' to check if
a format info matches the parameters.
This function will also be used to validate the stateless
params when adding support for stateless codecs.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Move the code that validates version dependent header
values to a separate function 'validate_by_version'Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
In the decoder, save the inner reference frame in the same
format as the capture buffer.
The decoder writes directly to the capture buffer and then
the capture buffer is copied to the reference buffer.
This will simplify the stateless decoder.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Add the field 'buf' to fwht_raw_frame to indicate
the start of the raw frame buffer.
This field will be used to copy the capture buffer
to the reference buffer in the next patch.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Introduce 'prepare_raw_frame' function that fills the values
of a raw frame struct according to the format.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Free compressed_frame buffer upon device release.
Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The function 'v4l2_m2m_buf_copy_metadata' should
be called even if decoding/encoding ends with
status VB2_BUF_STATE_ERROR, so that the metadata
is copied from the source buffer to the dest buffer.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
v4l2_fwht_encode returns either an error code on
failure or the size of the compressed frame on
success. So change the var assigned to it from
'ret' to 'comp_sz_or_errcode' to clarify that.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
If one of the controls fails to set,
then 'v4l2_ctrl_request_setup'
immediately returns with the error code.Signed-off-by: Dafna Hirschfeld
Reviewed-by: Paul Kocialkowski
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
'v4l2_m2m_ctx_release' calls request complete
so it should be called before 'v4l2_ctrl_handler_free'.Signed-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The logic of g_selection was wrong: encoders support crop,
decoders support compose, but the code allowed both.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The selection api should check only single buffer types
because multiplanar types are converted to
single in drivers/media/v4l2-core/v4l2-ioctl.cSigned-off-by: Dafna Hirschfeld
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
If requests are used when they shouldn't, or not used when they should,
then return EBADR (Invalid request descriptor) instead of EACCES.The reason for this change is that EACCES has more to do with permissions
(not being the owner of the resource), but in this case the request file
descriptor is just wrong for the current mode of the device.Update the documentation accordingly.
Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
The cedrus stateless decoder requires the use of request, so
indicate this by setting requires_requests to 1.Note that the cedrus driver never checked for this, and as far
as I can tell would just crash if an attempt was made to queue
a buffer without a request.Signed-off-by: Hans Verkuil
Acked-by: Paul Kocialkowski
Signed-off-by: Mauro Carvalho Chehab -
Stateless codecs require the use of the Request API as opposed of it
being optional.So add a bit to indicate this and let vb2 check for this.
If an attempt is made to queue a buffer without an associated request,
then the EBADR error is returned to userspace.Doing this check in the vb2 core simplifies drivers, since they
don't have to check for this, they can just set this flag.Signed-off-by: Hans Verkuil
Reviewed-by: Paul Kocialkowski
Signed-off-by: Mauro Carvalho Chehab
20 Mar, 2019
19 commits
-
Checkpatch wants to use 'help' instead of '---help---':
WARNING: prefer 'help' over '---help---' for new help texts
Let's change it globally at the media subsystem, as otherwise people
would keep using the old way.Signed-off-by: Mauro Carvalho Chehab
-
This is not how ACPI tables are written. Add a deprecation note and refer
to the proper documentation.Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
Set the entity function for the four CSI-2 receiver sub-devices the driver
creates. This avoids a kernel warning from each as well.Signed-off-by: Sakari Ailus
Reviewed-by: Bingbu Cao
Signed-off-by: Mauro Carvalho Chehab -
The lens drivers had ended up under the video decoder section; add a new
one just for them, between the camera sensors and flash drivers.Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
ti-vpe driver parsed the remote endpoints for properties but ignored the
local ones. Fix this by parsing the local endpoint properties instead.Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
V4L2 fwnode matching right now still works based on device nodes, not port
nodes. Fix this.Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
C-PHY has no clock lanes. Therefore the first data lane is 0 by default.
Fixes: edc6d56c2e7e ("media: v4l: fwnode: Support parsing of CSI-2 C-PHY endpoints")
Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
The lack of defaults provided by the caller to
v4l2_fwnode_endpoint_parse() signals the use of the default lane mapping.
The default lane mapping must not be used however if the firmmare contains
the lane mapping. Disable the default lane mapping in that case, and
improve the debug messages telling of the use of the defaults.This was missed previously since the default mapping will only unsed in
this case if the bus type is set, and no driver did both while still
needing the lane mapping configuration.Fixes: b4357d21d674 ("media: v4l: fwnode: Support default CSI-2 lane mapping for drivers")
Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
Since commit 3d6a8fe25605 ("media: ov7670: hook s_power onto v4l2 core"),
the device is actually powered off while the video stream is stopped.So now set_format and s_frame_interval could be called while the device
is powered off, but these callbacks try to change the register settings
at this time.The frame format and framerate will be restored right after power-up, so
we can just postpone applying these changes at these callbacks if the
device is not powered up.Fixes: 3d6a8fe25605 ("media: ov7670: hook s_power onto v4l2 core")
Cc: Jonathan Corbet
Signed-off-by: Akinobu Mita
Reviewed-by: Lubomir Rintel
Tested-by: Lubomir Rintel
Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
Since commit 3d6a8fe25605 ("media: ov7670: hook s_power onto v4l2 core"),
the device is actually powered off while the video stream is stopped.The frame format and framerate are restored right after power-up, but
restoring the default register settings is forgotten.Fixes: 3d6a8fe25605 ("media: ov7670: hook s_power onto v4l2 core")
Cc: Jonathan Corbet
Signed-off-by: Akinobu Mita
Reviewed-by: Lubomir Rintel
Tested-by: Lubomir Rintel
Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
The imgu_css_queue structure is too large to be put on the kernel
stack, as we can see in 32-bit builds:drivers/staging/media/ipu3/ipu3-css.c: In function 'imgu_css_fmt_try':
drivers/staging/media/ipu3/ipu3-css.c:1863:1: error: the frame size of 1172 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]By dynamically allocating this array, the stack usage goes down to an
acceptable 140 bytes for the same x86-32 configuration.Fixes: f5f2e4273518 ("media: staging/intel-ipu3: Add css pipeline programming")
Signed-off-by: Arnd Bergmann
Reviewed-by: Cao, Bingbu
Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
The imgu_rpm_dummy_cb() looks like an API misuse that is explained
in the comment above it. Aside from that, it also causes a warning
when power management support is disabled:drivers/staging/media/ipu3/ipu3.c:794:12: error: 'imgu_rpm_dummy_cb' defined but not used [-Werror=unused-function]
The warning is at least easy to fix by marking the function as
__maybe_unused.Fixes: 7fc7af649ca7 ("media: staging/intel-ipu3: Add imgu top level pci device driver")
Signed-off-by: Arnd Bergmann
Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
The v4l2_pix_format_mplane structure is too large to be put on the kernel
stack, as we can see in 32-bit builds:drivers/staging/media/ipu3/ipu3-v4l2.c: In function 'imgu_fmt':
drivers/staging/media/ipu3/ipu3-v4l2.c:753:1: error: the frame size of 1028 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]By dynamically allocating this array, the stack usage goes down to an
acceptable 272 bytes for the same x86-32 configuration.Fixes: a0ca1627b450 ("media: staging/intel-ipu3: Add v4l2 driver based on media framework")
Signed-off-by: Arnd Bergmann
Signed-off-by: Sakari Ailus
Signed-off-by: Mauro Carvalho Chehab -
When start_streaming was called both last_src_buf and last_dst_buf
pointers were set to NULL, but this depends on whether the capture
or output queue starts streaming.When decoding with resolution changes in between the capture queue
has to restart streaming whenever a resolution change occurs. And
that would reset last_src_buf as well, which causes a problem if
the decoder was stopped by the application. Since last_src_buf
is now NULL, the LAST flag is never set for the last capture
buffer.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Some functions like enum_fmt use the buffer type as was passed
from userspace, which might cause the switch to fall into the
default case. Just drop the WARN_ON(1) to avoid kernel log pollution.Signed-off-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab -
Don't populate the array addr_list on the stack but instead make it
static. Makes the object code smaller by 20 bytesBefore:
text data bss dec hex filename^M
16929 3626 384 20939 51cb ../usb/em28xx/em28xx-input.oAfter:
text data bss dec hex filename^M
16829 3706 384 20919 51b7 ../usb/em28xx/em28xx-input.o(gcc version 8.3.0, aarch64)
Signed-off-by: Colin Ian King
Signed-off-by: Sean Young
Signed-off-by: Mauro Carvalho Chehab -
This patch add support for Avermedia TD310 usb stick.
Signed-off-by: Jose Alberto Reguero
Signed-off-by: Sean Young
Signed-off-by: Mauro Carvalho Chehab -
i2c bus is already needed when the frontend is probed, so init it already
in it930x_frontend_attach. That prevents errors like:si2168: probe of 6-0067 failed with error -5
Signed-off-by: Andreas Kemnade
Signed-off-by: Jose Alberto Reguero
Signed-off-by: Sean Young
Signed-off-by: Mauro Carvalho Chehab -
si2165_readreg8() may fail. Looking into si2165_readreg8(), we will find
that "val_tmp" will be an uninitialized value when regmap_read() fails.
"val_tmp" is then assigned to "val". So if si2165_readreg8() fails,
"val" will be a random value. Further use will lead to undefined
behaviors. The fix checks if si2165_readreg8() fails, and if so, returns
its error code upstream.Signed-off-by: Kangjie Lu
Reviewed-by: Matthias Schwarzott
Tested-by: Matthias Schwarzott
Signed-off-by: Sean Young
Signed-off-by: Mauro Carvalho Chehab