Commit Graph

858 Commits

Author SHA1 Message Date
qctecmdr
19350d3c07 Merge "video: driver: Limit secure sessions allowed by max supported" 2021-08-18 09:11:50 -07:00
qctecmdr
e9e693892f Merge "video: driver: Add changes to calculate auto framerate" 2021-08-18 09:11:50 -07:00
Govindaraj Rajagopal
3d9556402b video: driver: improve error handling on read_register
Currently video driver ignoring error value returned by
__read_register() api. So added changes to improve error
handling.

Change-Id: Ia3968f0f900915b46b96c5e790af9be02389e841
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-08-18 08:38:32 +05:30
Akshata Sahukar
3b246bd0bd video: driver: Limit secure sessions allowed by max supported
Check for max supported secure sessions before allowing
any new secure session to limit secure sessions count by
max supported value.

Change-Id: I72d22c5e592eeb662d18018f6d880104992d570b
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-08-17 18:01:54 -07:00
qctecmdr
bd7240d139 Merge "video: driver: add interlace with non-ubwc condition" 2021-08-17 10:38:49 -07:00
Gaviraju Doddabettahalli Bettegowda
d14a7087e2 video: driver: Add changes to calculate auto framerate
Currently, there is a precision loss while calculating framerate,
this will result in updating framerate multiple times to firmware.
So added change to avoid precision loss in framerate calculation.

Change-Id: I9748e7ad6913eb4790e24468b60f39823857f5c4
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <gdoddabe@codeaurora.org>
2021-08-17 17:23:45 +05:30
qctecmdr
45a111ee0e Merge "video: driver: include error session load in admission control" 2021-08-16 11:31:23 -07:00
qctecmdr
2fbecac25d Merge "video: driver: Add checks for fw configured session params" 2021-08-16 11:31:23 -07:00
qctecmdr
e7f90a6334 Merge "video: driver: use readl_relaxed_poll_timeout instead of register_read" 2021-08-16 11:31:23 -07:00
Darshana Patil
0c9ebb04c1 video: driver: add interlace with non-ubwc condition
Non-ubwc color format with interlace is unsupported.
add condition to check this during streamon and
resume commands.

Change-Id: I76310b0860d4d113194b8c691698ea0dc800a879
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-08-16 11:14:13 -07:00
Govindaraj Rajagopal
394ad13850 video: driver: include error session load in admission control
Currently error session loads were ignored at admission control
checks. So concurrent scenarios, there are chances that multiple
sessions were in error state and yet to be closed by client. If
those sessions were 8K sessions, then allowing new sessions will
lead to OOM issues. Because error scenario, client might take more
time to cleanup(to close driver fd). So it is better to include
those sessions load as well in admission control checks to avoid
OOM issues.

Change-Id: I5d8f009b289f7f7cfb79a9e9197bfa4781f2fce3
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-08-16 19:16:56 +05:30
Govindaraj Rajagopal
33f263995d video: driver: reject invalid buffer mapping request
Reject non-secure mapping request for a secure buffer(or vice versa).
These combinations will lead to transaction fault later. So it is
better to reject this buffer mappings upfront.

Change-Id: Iaac851b235707dde8d303fb581ba0ae7c8768b85
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-08-13 14:57:43 +05:30
Govindaraj Rajagopal
10a6e51ef2 video: driver: use readl_relaxed_poll_timeout instead of register_read
Upstream recommends to use readl_relaxed_poll_timeout instead of reading
register in a loop with sleep. So replaced with readl_relaxed_poll_timeout
in all possible places.

Change-Id: Ide1758314128751a6876678d4265bb77c52de25f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-08-13 14:04:51 +05:30
Chandrakant I Viraktamath
a626d5c731 video: driver: Add checks for fw configured session params
Query final values of session params like stage,
pipe and quality mode from FW and check if they
are the same intended values as configured by
the driver.

Change-Id: I1a504401a599860ab971e34e1e184e67631d6120
Signed-off-by: Chandrakant I Viraktamath <civirakt@codeaurora.org>
2021-08-13 13:17:56 +05:30
qctecmdr
cc48023758 Merge "video: driver: implement TRY_FMT for encoder and decoder" 2021-08-10 16:08:17 -07:00
qctecmdr
4e9096a82c Merge "video: driver: fix stack stack-out-of-bounds issue" 2021-08-10 11:54:17 -07:00
Darshana Patil
05270719fb video: driver: add max num reorder frames support
add support for HFI_PROP_MAX_NUM_REORDER_FRAMES.
add ctrl for this metadata for avc and hevc.

Change-Id: I9a7b95f130e58f810255aff23e9b605304841072
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-08-09 11:39:57 -07:00
Darshana Patil
756a01af02 video: driver: Set default value for number of hw blocks
Set default value for number of hw blocks as 1 for video
client.

Change-Id: I64927db72abc9b8ad4be9ff6d125ca9424787372
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-08-05 17:16:39 -07:00
Govindaraj Rajagopal
c24d458399 video: driver: fix stack stack-out-of-bounds issue
In msm_vidc_packetize_control api, there is a stack-out-of-bounds
possibility. So added change to fix this issue.

Change-Id: I9c9a0217b55dd2586cfd6f814401c80ddb0c011f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-08-05 13:32:02 +05:30
Dikshita Agarwal
034d732cc7 video: driver: remove unsupported ioctls from ioctls ops
Decoder is not supposed to support VIDIOC_ENCODER_CMD.
Encoder is not supposed to support VIDIOC_DECODER_CMD.
To do the same define separate ioctl ops for encoder and decoder
and remove unsupported ops.

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

Change-Id: I1560bd2f64c5df1e4b4f125d5b6d542eb9eb42e3
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-30 15:53:30 +05:30
Dikshita Agarwal
a7ce77cfc7 video: driver: implement TRY_FMT for encoder and decoder
Any video device which supports capture multiplanar buf type
should implement VIDIOC_TRY_FMT.

Fixes: v4l2-compliance: testTryFormats (VIDIOC_TRY_FMT).

Change-Id: Id7ec171115c9374c6173fcf74a609382c3acf2d0
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-30 15:27:02 +05:30
qctecmdr
cff24b925c Merge "video: driver: report unsupported for invalid selection setting" 2021-07-29 13:50:45 -07:00
qctecmdr
e0daeca024 Merge "video: driver: remove unsupported selection targets for encoder" 2021-07-29 13:50:45 -07:00
Dikshita Agarwal
77ac864dc5 video: driver: report unsupported for invalid selection setting
- Decoder should support G_SELECTION on capture plane only,
  so return -EINVAL for other buffer types.
- Return -EINVAL for unsupported/invalid selection target.

Fixes: v4l2-compliance: testLegacyCrop(VIDIOC_G_SELECTION)
       on decoder.

Change-Id: I790f0fb95cb5f1d0e5b2132f4e580b7fa1b68c51
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-29 14:42:08 +05:30
qctecmdr
07753f9126 Merge "video: driver: add proper handling of VIDIOC_ENUM_FRAMESIZES" 2021-07-28 12:19:03 -07:00
qctecmdr
dd6e67eafd Merge "video: driver: update required fields of stream parm struct" 2021-07-28 12:19:03 -07:00
Dikshita Agarwal
40c0938c20 video: driver: remove unsupported selection targets for encoder
- CROP should be supported only for V4L2_SEL_TGT_CROP selection
  target.
- Compose should be supported only for V4L2_SEL_TGT_COMPOSE
  selecion target.

Fixes: v4l2-compliance: testCrop/testCompose (VIDIOC_S_SELECTION)
       on encoder.

Change-Id: Iaada9e0078602ab5ddcdd25d94c9abb29c053811
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-28 13:12:12 +05:30
Dikshita Agarwal
79ac405a32 video: driver: update required fields of stream parm struct
- Set capability for capture and output plane.
- Update denominator and numerator of timeperframe structure
  to default values if set with zero.

Fixes: v4l2-compliance: testParm(VIDIOC_S/G_PARM) for encoder.

Change-Id: Ib9d92f07fc526a11253ac5d1adc1b639eef3632e
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-26 20:34:10 +05:30
Govindaraj Rajagopal
5c297b7d26 video: driver: print buffer statistics once at every sec
- Added change to print buffer statistics like total and avg
etb, ebd, ftb, fbd counts, client set fps, actual fps,
bitrate values in 1 sec window and these stats currently
configured to print at every 1sec boundary.
- Convert meta buffer prints to low level logs.

Change-Id: I1c93eea90fbd5460eb51bbf133c513157003d51e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-22 19:13:19 +05:30
Darshana Patil
371fcbad4e video: driver: null check in handling sys error
add null check for pkt before accessing pkt
type in handle_system_error function.

Change-Id: If2c3d4c789fed16ed5c385258edc20e122bf1ea9
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-07-21 15:07:44 -07:00
Priyanka Gujjula
d9696271a0 video: driver: Migrate to threaded irq
Migrate to threaded IRQ from workqueue based
IRQ handling.

Change-Id: I5cf2ecaa6d9b8d67698bbaf41e8d5ff77249ab1c
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-07-20 01:32:51 +05:30
qctecmdr
10c9a5ba50 Merge "video: driver: Enable firmware error and fatal logs by default" 2021-07-16 18:41:51 -07:00
Gaviraju Doddabettahalli Bettegowda
3fc922e53d video: driver: Enable firmware error and fatal logs by default
Added change to enable firmware logs by default.

Change-Id: Ie3363e72503264929bd5fb749ad7c2af45831bb2
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <gdoddabe@codeaurora.org>
2021-07-16 20:23:01 +05:30
Akshata Sahukar
942f406c42 video: driver: Cap chroma qp offset value other than -12 as 0
Cap chroma qp offset value other than -12 as 0.

Change-Id: I0ca9c4844ab835a9365e695f38deff90768191aa
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-15 10:23:02 -07:00
qctecmdr
e03d09350d Merge "video: driver: add support to bugon for requested types" 2021-07-14 15:52:51 -07:00
qctecmdr
36d28e81f7 Merge "video: driver: add support to dump subsystem memory" 2021-07-14 15:52:50 -07:00
Dikshita Agarwal
44f4a9fab3 video: driver: add proper handling of VIDIOC_ENUM_FRAMESIZES
VIDIOC_ENUM_FRAMESIZES was not handled for OUTPUT_MPLANE.

Fixes: v4l2-compliance: testFrameSize(VIDIOC_ENUM_FRAMESIZES)
       on encoder.

Change-Id: I9031e018c13ebae94e516be1b5558d30c68b2862
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-13 22:01:11 +05:30
Govindaraj Rajagopal
142d7813b6 video: driver: add support to dump subsystem memory
Added support to dump subsystem region along with firmware
region and queues.

Change-Id: If032553f23195b3c9ddc9d6e18854319452558c7
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-13 20:04:52 +05:30
Akshata Sahukar
3aaf56bebe video: driver: set RGBA enc session input default color space as BT709 LR
If client fails to configure color aspects to driver, driver does not set
required color space flags to firmware. For RGBA enc session, there is
implicit CSC. Hence, resultant color space should be BT709 LR. But
firmware fails to generate this color space info assuming that color
space info is not required. Hence, fix this by setting BT709 LR as
default color space info for RGBA enc session.

Change-Id: I6f9fa0986dd8657b1d6bcc2c86286aa51813f518
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-12 17:39:33 -07:00
Govindaraj Rajagopal
63614e76b8 video: driver: add support to bugon for requested types
Added change to enable bugon at handle_system_error for
error types requested via debugfs property.

Fatal:
adb shell "echo 0x1 > /d/msm_vidc/enable_bugon"

NoC:
adb shell "echo 0x2 > /d/msm_vidc/enable_bugon"

WD Timeout:
adb shell "echo 0x4 > /d/msm_vidc/enable_bugon".

Change-Id: Iecc1b076c7ca53acee837d68e1a7446dbaef6e94
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-12 21:55:02 +05:30
qctecmdr
c7b23776f2 Merge "video: driver: Enable decode order for thumbnail mode" 2021-07-08 20:22:34 -07:00
qctecmdr
05aa27a1ee Merge "video: driver: amend ipsc discard handling" 2021-07-08 20:22:34 -07:00
Darshana Patil
5e9c1e75fa video: driver: amend ipsc discard handling
when client does stream on and stream off on input port,
and if ipsc is raised by fw at the same time, the ipsc
is discarded by driver and this race condition results in
incorrect port setting properties used by the driver.
To resolve this, driver will resubscribe for port settings
during the following input port streamon and fw will reraise
ipsc and new properties will be used.

Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Change-Id: Id777f9c039a089846e65406e007501b62a571a25
2021-07-08 17:57:16 -07:00
qctecmdr
44e14be2f2 Merge "video: driver: move state to ERROR instead of just returning -EINVAL" 2021-07-08 17:56:10 -07:00
Akshata Sahukar
40ae39388e video: driver: Enable decode order for thumbnail mode
Enable decode order for thumbnail mode.

Change-Id: If0c7b304369d4fb1aaedccb7fe1919ab8b6077a5
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-08 17:54:35 -07:00
qctecmdr
716ab7d3ef Merge "video: driver: queue deferred buffers during IPSC" 2021-07-08 15:09:54 -07:00
Akshata Sahukar
975c7beb5e video: driver: move state to ERROR instead of just returning -EINVAL
move driver state to ERROR if any session pkt processing failed.

Change-Id: Id9c653eb01a0845d6d25cf16383f34707d76ba96
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-08 14:34:52 -07:00
qctecmdr
e1400eabe4 Merge "video: driver: enumerate color format based on preference" 2021-07-08 12:42:50 -07:00
qctecmdr
9b35e17031 Merge "video: driver: ignore input/output port streamoff if already streamed off" 2021-07-08 09:41:52 -07:00
Govindaraj Rajagopal
9fc813b9c4 video: driver: queue deferred buffers during IPSC
Queue pending buffers from decode_batch during ipsc to avoid
reconfig latency. So added change to queue all pending buffers,
if inst->state is not in START state.

Change-Id: I09eab9c1f4708ec4390486230579fab2ef216a46
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-08 20:05:20 +05:30