1058207 Commits

Author SHA1 Message Date
Dafna Hirschfeld
37365b050d media: mtk-vcodec: enc: add vp8 profile ctrl
In order for the encoder to work with gstreamer
it needs to have the V4L2_CID_MPEG_VIDEO_VP8_PROFILE
ctrl. This patch adds that ctrl with only profile 0
supported.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-19 06:02:52 +00:00
Mauro Carvalho Chehab
999ed03518 media: atomisp: cleanup qbuf logic
The logic there is meant to be used by newer firmwares.
clean it up, in order to make compatible with the chosen
firmware version.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 19:40:19 +00:00
Mauro Carvalho Chehab
3c82bf0295 media: atomisp: add YUVPP at __atomisp_get_pipe() logic
Aligns it which the Intel Aero firmware.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 19:38:39 +00:00
Mauro Carvalho Chehab
72fb16a130 media: atomisp: frame.c: drop a now-unused function
ia_css_frame_find_crop_resolution() is not used anymore.

So, remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 19:38:03 +00:00
Mauro Carvalho Chehab
c37ed67335 media: atomisp: pipe_binarydesc: drop logic incompatible with firmware
As we're using this firmware for ISP2401:
	https://github.com/intel-aero/meta-intel-aero-base/blob/master/recipes-kernel/linux/linux-yocto/shisp_2401a0_v21.bin

Revert some changes that are not compatible with it, making
the code close to the Intel Aero one.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 19:37:29 +00:00
Mauro Carvalho Chehab
5c5a95385a media: atomisp: binary.c: drop logic incompatible with firmware
As we're using this firmware for ISP2401:
	https://github.com/intel-aero/meta-intel-aero-base/blob/master/recipes-kernel/linux/linux-yocto/shisp_2401a0_v21.bin

It makes no sense to try to select a non-existing binary
inside the firmware. So, revert it to reflect the Intel Aero
device driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 19:36:42 +00:00
Mauro Carvalho Chehab
4f948a3283 media: atomisp: simplify binary.c
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 19:36:08 +00:00
Mauro Carvalho Chehab
3f323bb4cf media: atomisp: get rid of set pipe version custom ctrl
It doesn't make sense to have a control for that. Besides that,
the Intel Aero implementation doesn't have, which means that
even the custom control is not used in practice, at least
outside Android.

So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 19:35:46 +00:00
Mauro Carvalho Chehab
13d72e6942 media: atomisp: atomisp_cmd: make it more compatible with firmware
Change some recovery logic at the driver, in order to make it
more compatible with ISP2401 Intel Aero firmware.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 19:35:25 +00:00
Mauro Carvalho Chehab
072927d1ce media: atomisp: sh_css_sp: better support the current firmware
As we're using Intel Aero firmware, make the code closer to the
driver for such device.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 13:44:48 +00:00
Mauro Carvalho Chehab
3b941c5a19 media: atomisp: sh_css_param_shading: fix comments coding style
The comments are not following Kernel coding style.

Also, there are two missing comments that are found at the Intel Aero
device driver code. Add them.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:51:29 +00:00
Mauro Carvalho Chehab
50f1d9343b media: atomisp: get rid of sctbl_legacy_*
Those seem to be used only on certain ISP2401 firmwares that
aren't supported by the driver. So, get rid of them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:47:33 +00:00
Mauro Carvalho Chehab
c0a7df148e media: atomisp: get rid of #ifdef HAS_BL
This does nothing but declare extern to a non-existing var.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:39:17 +00:00
Mauro Carvalho Chehab
d7ab37bcdd media: atomisp: get rid of USE_WINDOWS_BINNING_FACTOR tests
This is meant to select a platform-dependent factor between
Linux and Windows. It makes no sense to keep it on Kernel.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:38:34 +00:00
Mauro Carvalho Chehab
63705da3df media: atomisp: remove #ifdef HAS_NO_HMEM
This is not defined anywhere, so, solve the ifdefs, getting
rid of them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:32:47 +00:00
Mauro Carvalho Chehab
35009261b9 media: atomisp: sh_css_params: cleanup the code
Now that the tests for the new ISP2401 input system were
dropped, simplify the code, making it closer to the Intel
Aero device driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:32:19 +00:00
Mauro Carvalho Chehab
037de9f2b2 media: atomisp: sh_css_params: remove tests for ISP2401
Those tests are related to the input system, which is the same
for the chosen firmware, so both ISP2400 and ISP2401 will be
identical with that regards.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:31:48 +00:00
Mauro Carvalho Chehab
b541d4c992 media: atomisp: sh_css_mipi: cleanup the code
With the ISP2401 firmware we're using, the code differences
are not that much from ISP2400. Cleanup the code in order
to make it closer to Intel Aero driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:31:22 +00:00
Mauro Carvalho Chehab
ef3f3627ff media: atomisp: sh_css_metrics: drop some unused code
There are two #ifdefs there which aren't defined anywhere.

So, just drop the dead code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:30:41 +00:00
Mauro Carvalho Chehab
839467839c media: atomisp: simplify sh_css_defs.h
There are several unused macros. Simplify the logic there, making
it closer to the Intel Aero driver and the corresponding firmware,
as this is what we have widely available for this device.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:30:21 +00:00
Mauro Carvalho Chehab
da8fdf490b media: atomisp: drop empty files
There's nothing inside such files. Just drop them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-17 09:29:40 +00:00
Mauro Carvalho Chehab
5b49e068be media: atomisp: get rid of #ifdef ISP_VEC_NELEMS
This is defined as 64 for the devices/firmware that were chosen.

So, evaluate the macros accordingly.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:11 +00:00
Mauro Carvalho Chehab
912680064f media: atomisp: make sh_css similar to Intel Aero driver
As we're using the firmware from Intel Aero, ensure that the
logic inside sh_css as similar as possible to such driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
ec1804dadf media: atomisp: warn if mipi de-allocation failed
There's a note at the uninit function that warns about issues
with mipi frames de-allocation. print a warning if the problem
ever happens.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
dc41f7df78 media: atomisp: drop check_pipe_resolutions() logic
Such function doesn't exist on Intel Aero driver. As we're using
its firmware, it may mean that this is not compatible with the
current file. So, drop it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
37746513f6 media: atomisp: get rid of some weird warn-suppress logic
There are some dead code meant to suppress "C_RUN" warnings.

Drop it from sh_css.c, as it doesn't make much sense.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
e05b3bbbf1 media: atomisp: drop a dead code
There's a commented dead code related to some future thing
to be implemented. As this won't happen, as it would require
a newer firmware, just drop the code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
1de7694155 media: atomisp: drop ia_css_pipe_update_qos_ext_mapped_arg
This function is not used. Drop it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
6a28541ff5 media: atomisp: unify ia_css_stream stop logic
There are two versions of those functions. It turns that the
choosen firmware use the old version. So, drop the unused
ones and ensure that all devices will use the right functions.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
802dfce3b9 media: atomisp: get rid of ia_css_stream_load()
This function is marked as obsolete and nobody calls it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
0a9e6351ea media: atomisp: drop crop code at stream create function
The firmware chosen for ISP2401 doesn't support it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
2a01213bfa media: atomisp: solve #ifdef HAS_NO_PACKED_RAW_PIXELS
This was never defined, so remove the #ifdefs, keeping the
code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
9e22032e9c media: atomisp: remove #ifdef SH_CSS_ENABLE_METADATA
The chosen firmware has it enabled, so, drop this symbol.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
52481d4d31 media: atomisp: drop #ifdef WITH_PC_MONITORING
This is not needed for the driver to work. So, just drop it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
16d0c92ef8 media: atomisp: drop #ifdef SH_CSS_ENABLE_PER_FRAME_PARAMS
This is enabled for the firmware we're using. So, just drop
the if's.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:10 +00:00
Mauro Carvalho Chehab
29a3764a76 media: atomisp: remove #ifdef HAS_OUTPUT_SYSTEM
None of the firmwares we use has support for it. So, drop the
unused code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
7bedd01849 media: atomisp: drop an useless #ifdef ISP2401
The Yocto Aero driver for ISP2401 sets my_css_save.loaded_fw.
As we're using the same firmware, remove the ifdef there.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
47f6b6d498 media: atomisp: drop two vars that are currently ignored
Those two vars are meaningful only with some ISP2401 firmwares.
The one we chose to support doesn't use, so simply drop the
extra code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
c35abde30a media: atomisp: Avoid some {} just to define new vars
There are a couple of places where {} are used just to
define a new var. Just move the var to the top of the function
and get rid of that ugly blocks.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
0badc300c0 media: atomisp: fix comments coding style at sh_css.c
Use the coding style for the comments at this file.

While here, drop a do-nothing if logic.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
55e14acd99 media: atomisp: ia_css_stream.h: remove ifdefs from the header
Now that the input system always declare rx_cfg_t, we can
remove the ifdef ISP2401 from this header.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
4005ecee61 media: atomisp: shift some structs from input_system_local
There are several stucts under ISP2400 that could be moved
to the global file without causing any build issues.

Move those to the common header, in order to reduce the number
of things that are #ifdef dependent.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
77db473510 media: atomisp: get rid of if CONFIG_ON_FRAME_ENQUEUE
This is not used with supported firmwares, so get rid of such code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
bcc3ba6649 media: atomisp: get rid of phys event abstractions
ia_css_dequeue_event() is just an alias to ia_css_dequeue_psys_event(),
and atomisp_css_dequeue_event() do nothing but calling the event
dequeue logic.

Get rid of both abstractions, calling the function directly.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
58043dbf6d media: atomisp: handle errors at sh_css_create_isp_params()
The succ var tracks memory allocation erros on this function.

Fix it, in order to stop this W=1 Werror in clang:

drivers/staging/media/atomisp/pci/sh_css_params.c:2430:7: error: variable 'succ' set but not used [-Werror,-Wunused-but-set-variable]
        bool succ = true;
             ^

Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
363d50b73d media: atomisp: implement enum framesize/frameinterval
Add logic to enumerate sensor's frame size and interval.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
d45d97873b media: atomisp-ov2680: implement enum frame intervals
Allow the sensor to report the per-resolution frame interval.

It should be noticed that, despite the ov2680 datasheet says
that, for resolutions <= 1280x720, the sensor supports 60fps,
the data at ov2680.h tells otherwise, limiting it to 30fps.

Not sure yet if this is a limitation of atomisp or if it is
just because the tables are incorrect.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
dd8e6adb9b media: atomisp-ov2680: adjust the maximum frame rate
The ov2680 supports a maximum bandwidth of 660Mbps and allows
up to 60fps when the resolution is below 720p.

Adjust the sensor's table to reflect that.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:09 +00:00
Mauro Carvalho Chehab
04da0010c0 media: atomisp-ov2680: remove some unused fields
The sensor resolution arrays have two unused fields. Drop them.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:08 +00:00
Mauro Carvalho Chehab
8734c1d948 media: atomisp-ov2680: uncomment other resolutions
There are several resolutions defined for this sensor, but just
two are currently uncommented. Change the driver to allow other
resolutions to also be used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-16 14:37:08 +00:00