Commit Graph

858 Commits

Author SHA1 Message Date
Govindaraj Rajagopal
aeabb39378 video: driver: Change format specifier and API clean-up
-Removed unwanted functions
-Removed unwanted part of code from function definitions
-Added proper format specifier according to the data type.

Change-Id: I700202f1cf588506b329d202ce3e2729c027dcae
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Govindaraj Rajagopal
6e916441fc video: driver: Removed unused macro and variable
- Removed unused macro
- Removed unsed constant variable.

Change-Id: I43ff39d498637fb0aa721660fae0ca3dd7073e88
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Govindaraj Rajagopal
c9f4e6c3c0 video: driver: fix race issue with seek after EOS
HAL received lastflag FBD(for EOS) from reverse(polling) thread,
and before it sends SessionContinue(START_CMD) to driver, component
thread initiated streamoff on input port. So driver statemachine
got changed from DRAIN_LAST_FLAG to START_OUTPUT state.

After Streamoff sequence, reverse thread attempting START_CMD will
fail due to driver statemachine check. So q->last_buffer_dequeued
was never getting reset at v4l2 layer. As a result all subsequent
dqbuf ioctl calls will fail and leading to session hung issue.

Added change to call vb2_clear_last_buffer_dequeued() before
START_CMD rejection at driver side to avoid above mentioned issue.

Change-Id: Ic06f555f0c4deaa05c526ba9c0a19396d5a6f289
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Zhongbo Shi
25c72537e8 Video: Driver: fix crash issue when dumping packet
Using session id instead of session debug string when
dumping packet for a given session, in case of the
instance objest released in the other thread.

Change-Id: I1b91c051d510b8beea9d37de87f63f346efda050
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2022-01-13 17:29:22 +05:30
Priyanka Gujjula
a646e75752 video-driver: Optimize enc o/p buffer size
Allocate YUV_size * 2 for <=360p

Change-Id: I5c7b4ad2d2accf40943e880562f96af2d7c81509
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2022-01-13 17:29:22 +05:30
Priyanka Gujjula
0dec23c1bd video-driver: diwali: Sort clock corners
Sort allowed clock corners for diwali
v1 & v2 variants.

Change-Id: Ic561cd4a0e7abcb0f239b294fa81807621f3ebdb
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2022-01-13 17:29:22 +05:30
Govindaraj Rajagopal
58a111c212 video: driver: fix invalid ptr dereference issue with struct v4l2_buffer
qbuf call for actual bitstream and yuv buffer 'struct v4l2_buffer'
length field indicates numplanes and for metadata buffers, length field
indicates capacity. So always check length field before accessing/
dereferencing b->m.planes or b->m.fd.

Change-Id: I409b28e0a66bd5c031b2c98c6d7614da99164a6c
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
qctecmdr
ae4f5ce1c5 Merge "video: driver: flush pending last flag buffers in streamoff" 2022-01-09 22:09:05 -08:00
qctecmdr
a0a3d7275f Merge "video: driver: Add support for AV1 dynamic frame resolution change" 2022-01-07 19:28:35 -08:00
Maheshwar Ajja
2d5a106e01 video: driver: flush pending last flag buffers in streamoff
When client called streamoff on capture port, driver needs
to flush out pending last flag buffers, if any, to avoid
session errors.

Change-Id: I733ba1a39374f38a1d63a876fb4d2fc06aa6daf7
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-01-04 16:56:05 -08:00
qctecmdr
d827fc1e83 Merge "video: driver: fix usage of v4l2_fh" 2021-12-21 19:52:14 -08:00
qctecmdr
d7ed637174 Merge "video: driver: add support for VIDIOC_TRY_DECODER/ENCODER_CMD" 2021-12-21 19:38:53 -08:00
qctecmdr
e10072e7a9 Merge "video: driver: handle drain in open state" 2021-12-21 19:38:53 -08:00
Mihir Ganu
1b5a6b1d6f video: driver: Add support for AV1 dynamic frame resolution change
AV1 bitstream frames can have different resolutions than
sequence resolutions. Subscribe to BITSTREAM_RESOLUTION and
CROP_OFFSETS metadatas and exopose them to clients so that
clients can receive per-frame resolution and crop.

Change-Id: I7c0503f25ddde201979d13ff18028681f685d649
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-17 10:58:35 -08:00
Dikshita Agarwal
a939a0621e video: driver: handle drain in open state
Currently driver doesn't support CMD_STOP in open state.
But according to v4l2 std, the call to VIDIOC_DECODER/ENCODER_CMD()
should not fail even if any of the queues is not streaming,
but at the same time it will not initiate the Drain sequence.
So with this fix, not rejecting  CMD_STOP in open state but
at the same time not initiating drain sequence.

Fixes: v4l2-compliance :
		VIDIOC_(TRY_)DECODER_CMD on decoder.
		VIDIOC_(TRY_)ENCODER_CMD on encoder.

Change-Id: Ie94288cca88009a8a945bd7bca70d04239a4678c
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2021-12-17 13:11:14 +05:30
Dikshita Agarwal
c790532a9b video: driver: add support for VIDIOC_TRY_DECODER/ENCODER_CMD
Decoder needs to support VIDIOC_TRY_DECODER_CMD and
Encoder needs to be support VIDIOC_TRY_ENCODER_CMD.

Partially Fixes: V4l2-complience:
       testDecoder(VIDIOC_(TRY)_DECODER_CMD) for decoder.
       testEncoder(VIDIOC_(TRY)_ENCODER_CMD) for encoder.

Change-Id: Ia68587412ed316f0c871397da83d6c56665cfbb5
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2021-12-17 13:09:24 +05:30
Dikshita Agarwal
8d0f720028 video: driver: fix usage of v4l2_fh
- Do not clear V4L2_FL_USES_V4L2_FH flag because this
  flag indicates that file->private_data points to
  &struct v4l2_fh.
- Initialize v4l2 ctrl handler with driver ctrl handler.
- Add ctrl ops for g_volatile_ctrl to return updated
  value of volatile ctrls from driver.
Fixes: v4l2-compliance:
		testPrio (VIDIOC_G/S_PRIORITY).
		testQueryControls (VIDIOC_QUERYCTRL).

Change-Id: Ibe4b6fa67d2c02a5afeb627f2060e4761c5ef717
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2021-12-17 11:52:26 +05:30
Mihir Ganu
2f7df152f2 video: driver: Add support to set AV1 operating point
Add support to set AV1 operating point to firmware.

Change-Id: If0f31c2bf04cb6d4f783264fb3ce706b1bf98261
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-16 14:53:26 -08:00
Mihir Ganu
a723e35a03 video: driver: Add support to set AV1 bitstream format
Add support to set AV1 decoder bitstream format
(low-overhead or Annex-B).

Change-Id: Ie36eefe0488bf33af91802c0bee51b3fec2024ac
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-14 14:10:52 -08:00
qctecmdr
1829bfb9a4 Merge "video: driver: Add changes to enable AV1 Decoder" 2021-12-10 17:09:19 -08:00
Mihir Ganu
04304a466f video: driver: Add changes to enable AV1 Decoder
Add definitions, controls and codec-specific handling
to enable AV1 Decoder.

Change-Id: Ica2f4e298e43aa713188d3374f8705688d0ed912
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-09 16:59:23 -08:00
Vikash Garodia
f3ff48e82f video: driver: reset video_cc_mvs0_clk_src clock_rate
Reset video_cc_mvs0_clk_src value to resolve MMRM high video
clock projection issue.

Change-Id: I0c549d7537a82792e9de708c96c265f0dce5908d
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2021-12-09 17:17:52 +05:30
Chinmay Sawarkar
1068661f6d video: driver: Fix dma_buf_vmap arguments
New dma_buf_vmap api takes dma_buf_map struct as argument,
instead of kvaddr.

Change-Id: I2843a28b2c0c2de2d9cd1bfa96fb1a86ffba6059
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2021-12-06 09:47:16 -08:00
qctecmdr
2a0b3fe4cf Merge "video: driver: Add HFI changes for AV1 Decoder" 2021-12-03 14:19:13 -08:00
Mihir Ganu
1c5f469b71 video: driver: Add HFI changes for AV1 Decoder
Add the required codec properties and HFI definitions to enable AV1D.

Change-Id: Ib098ed17f8b8e1fe9403f966a2dab97a3c9f96de
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-02 12:44:12 -08:00
qctecmdr
330cdcb122 Merge "video: driver: enable mmrm query support" 2021-12-01 12:28:11 -08:00
Mahesh Kumar Sharma
2a7cf79509 video: driver: Add AV1 codec, profile and level in UAPI
Add AV1 codec, profile and level defintions and controls in UAPI.
Add these controls as private controls in video driver.

Change-Id: I58edec2d7fabceaa405708c99a75997c9f454022
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2021-11-30 15:01:05 -08:00
Praveen Chavan
53d5efcd7c Merge branch 'video-kernel-waipio.lnx.1.0' into kailua_1.0 2021-11-29 13:38:02 -08:00
qctecmdr
526f8e8a47 Merge "video: driver: Add support for kalama/iris3 platform" 2021-11-19 16:09:36 -08:00
Mihir Ganu
9456cc40fb video: driver: Add support for kalama/iris3 platform
Add the required config and platform files to enable
kalama platform with iris3 VPU.

Change-Id: Ia65d2212b946d0d37fc99e30e25fe408882bdec3
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-11-18 22:56:07 -08:00
qctecmdr
f07dfda71d Merge "video: driver: Correct max mbps calc for slicing" 2021-11-18 08:32:39 -08:00
Priyanka Gujjula
6eacf50e78 video-driver: Fix compilation errors for parrot
Fix compilation errors on parrot which has a
different lunch combo other than taro/diwali.

Change-Id: I35aee69bc8e18d50395a01b97d282c21e75da193
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-17 17:45:12 +05:30
qctecmdr
55da89b96e Merge "video: driver: diwali: read efuse from sw_range4" 2021-11-12 13:32:02 -08:00
Maheshwar Ajja
814107162d video: driver: check kernel version to differentiate api
dma_buf_vmap() api changed from kernel version 5.15 and hence
check kernel version to use the updated api.

Change-Id: I05b7c72199cedfe9c33a8888fffb5e38da875f7e
Signed-off-by: Maheshwar Ajja <majja@quicinc.com>
2021-11-11 12:21:38 -08:00
qctecmdr
ab6e36ed88 Merge "video: driver: reject any unknown buffer received from fw" 2021-11-10 13:22:35 -08:00
qctecmdr
7c3520c2b0 Merge "video-driver: check max mbpf" 2021-11-10 13:22:35 -08:00
Priyanka Gujjula
4b9c19e5e5 video: driver: diwali: read efuse from sw_range4
HLOS doesnot have access to raw region. Instead,
read from sw_range4 region which are sense
registers for raw region.

Change-Id: I662266b6557756d9bf6ef687f81b7869a792e7f7
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-10 14:24:28 +05:30
Priyanka Gujjula
cf52dc1e6c video: driver: Correct max mbps calc for slicing
Max mbps has to be calculated using max fps.

Change-Id: Ic0e3b337c7327e9a9bd4ada6b2008ccb6fa1be04
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-10 12:06:08 +05:30
Akshata Sahukar
721d946ded video: driver: reject any unknown buffer received from fw
Reject any unknown buffer received from fw.

Change-Id: Icfc639cce364566a5479f5c12e13f7cb4fc06b00
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-11-05 13:15:06 -07:00
Manikanta Kanamarlapudi
f84053a13b video-driver: check max mbpf
check max mbpf as well while allowing
the real time session.

Change-Id: I1091582a02e01a4daa9c58ec5b50400b7d856610
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2021-11-04 21:46:37 -07:00
Mahesh Kumar Sharma
767c8ad13d video: driver: Fix dlkm compilation
1.) New dma_buf_vmap() returns SUCCESS or FAIL unlike legacy dma_buf_vmap()
    which return type is vmap address. dma_buf_vmap() takes two arguments now.
    Now it returns vmap address in pointer passed as second argument.
2.) If defined, use V4L2_CTRL_CLASS_CODEC else use V4L2_CTRL_CLASS_MPEG.
3.) iommu_dma_enable_best_fit_algo is commented temporary.
4.) remove subsystem_resart.h

Change-Id: I73c6a840fa6028f021debff33b88178ac74dcef9
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
2021-11-03 16:32:50 -07:00
Priyanka Gujjula
043ab4c9f7 video: driver: diwali: Add SKU clock data
Add clock corners for diwali v1 and v2
variants.

Change-Id: I1322dada7dafed10cb17b9ab4bcef45f102d371c
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-03 15:50:32 +05:30
Priyanka Gujjula
f352311f44 video: driver: Add diwali SKU's
Add support for diwali AA/AB(v1) & AC(v2) SKU.

Change-Id: I8afdf0529016e9cdbe72da8e57d7f35194cf9026
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-03 15:47:21 +05:30
Priyanka Gujjula
e710c6f974 video: driver: diwali: Configure hbb value
Configure hbb value as '14' for lp4
ddr variant.

Change-Id: Id3fa3028f38dabb81d1b1fc5b117c6d10e4d45b5
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-03 15:44:48 +05:30
Priyanka Gujjula
c3440c6ade video: driver: Add support for diwali variant
Add support for diwali variants.

Change-Id: Idf322e674818642a9c886fe8707e5ff8f64c4db5
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-03 07:39:48 +05:30
qctecmdr
7ac58c383b Merge "video: driver: Use max fps from inst caps" 2021-10-31 10:34:02 -07:00
Priyanka Gujjula
cad2ed9de0 video: driver: enable mmrm query support
Enable MMRM query support from mmrm driver
API along with internal core caps.

Change-Id: I997e8005e31a1bc3a8223de8cecc45fcaffdeeca
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-10-27 08:36:28 +05:30
qctecmdr
07ede771b0 Merge "video: driver: update decoder load calculation" 2021-10-25 09:48:15 -07:00
Priyanka Gujjula
e786da48eb video: driver: Use max fps from inst caps
Use maximum framerate from published
instance caps to make it platform
agnostic.

Change-Id: I319768e722774969287abb9e782ddbece7593ff9
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-10-25 21:38:58 +05:30
qctecmdr
4f953651a9 Merge "video-driver: add mmrm query support" 2021-10-22 14:37:00 -07:00