- Maintain free & busy pool to track buffers separately
- track double-free cases during msm_memory_free()
- track memory leak, by checking busy pool buffer count.
it is expected to be zero at the end of a session.
- maintain common api's to init, alloc, free, destroy
for all below buffer types.
- struct msm_vidc_buffer
- struct msm_vidc_alloc
- struct msm_vidc_map
- struct msm_vidc_timestamp.
Change-Id: Ib8655047c3883ea6601344661058d7a629ffd5bd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Refine log level checking, to avoid some logs are
always printed if multiple level specified.
Change-Id: I151a5b8cce8d234d6d22450c43cf50d3b0065286
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Add support to dump video FW region during FW crash
using devcoredump helpers.
Change-Id: I64c47160f04644223f4e831c35f7a059d38f7d83
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Client can choose to run an encode session to acheive maximum
performance rather than maximum quality.
Add the handling to configure video core accordingly for the
configured video session.
Such configuration is only applicable for non-realtime session.
Change-Id: Ife290b377c844e5b1d3be93b2509c787f8e05c59
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
mod_delayed_work() is a replacement for cancel_delayed_work()
+ queue_delayed_work(). It will update only timer value,
instead of completely cancelling and queueing a new delayed
work.
Change-Id: Id07d54e025c5a2e82f29160ae6d249d44f00bb15
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Amend power on and off sequences for iris2 video hardware.
Change-Id: Icada0b95ba5990a6911803ee9fa650a296c357db
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
modify scanlines alignment for linear rgba color
format to 32.
Change-Id: Ide64322bc872bfda64d8f48474ef2d37a4f314b7
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
if skip_pc_count reaches VIDC_MAX_PC_SKIP_COUNT, that means
something wrong with hardware. So call core_deinit to reset
the hardware, so that atleast next session willbe proper.
Change-Id: I320fcc2917825a2ff79889b8183e2842257f3569
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Enable HFI_PROP_SECURE when secure session is enabled
in encoder. Same behaviour as Decoder.
Change-Id: I5edfe3d735fda8edea9e491ae17546945b4431a1
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
- To determine if session is admissible, check only the
decoder input width/height and encoder crop width/height.
- Update session MBPF Calculations.
- Amend work mode setting to consider decoder input width,
height and GOP size.
Change-Id: If4053c222de2a55ad5b85a8ab96c12c47b145aa3
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Priority level was not determined at few sequences.
Determine the priority level and set to firmware, if
there is a change in driver and firmware priority.
Change-Id: I97861fd4ce8cfb7cf828a8da9a5ce8ba900280ef
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Currently driver prints hex values for codec type, pixel
format and port number. So added change to print strings
instead of hex values.
Removed unnecessary logs to avoid overlogging timeout
issues.
Change-Id: Ia44401990797dc20eae0a35631e9ed6a0b094c20
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
- misc fix for setting frame qp, min qp, max qp.
- seperate LEVEL database entry for encoder and
decoder as max level supported by encoder is 6_0,
but decoder supports upto 6_2.
Change-Id: Ia0a0a717e73e55a8b6933421e3eb55c3831524b2
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Currently session_error check is scattered at multiple places,
So check for session error at ioctl entry point itself(for set
type controls only).
Cleanup &inst->response_works.list as part of session close to
avoid leaks and remove unused variables from inst struct.
Change-Id: I349ec845cc71814b33a94ac07c7628304ddae564
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
If msm_vidc_open() sequence fails before calling event_queue_init()
then it calls msm_vidc_close as part of cleanup.
So event_queue_deinit will attempt to call v4l2_fh_del without
completing v4l2_fh_init & v4l2_fh_add. So i.e leading to NULL ptr
dereferrence issue at v4l2_fh_del api.
Added change to avoid calling event_queue_deinit() sequence, if
event_queue_init is not completed.
Change-Id: Ia2732c39be819247379d955d40dddccaba7c00eb
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Userspace is allowed to close driver fd at anytime, even in middle
of ongoing session. So it will create a problem, if multiple ioctls
were waiting for &inst->lock() and msm_vidc_close() acquired the
&inst->lock and cleaned up all session specific resources including
vb2 queues, v4l2_fh file handles and all buffers and finally frees
inst itself, as part of put_inst(). So once that is done, other
enties waiting on &inst->lock will get chance, but by that time,
everything is freed. So proceeding that cmd will completely lead to
undefined behaviour and target reset will happen.
Added change to avoid above mentioned scenario by Incrementing inst
refcount everytime before proceeding any ioctls and acquired &inst->lock
to avoid concurrent access between ioctls.
Currently &inst->lock was not acquired except for reqbuf, qbuf, dqbuf
ioctls. But it is good to acquire lock at every ioctl types. This will
help avoid corner cases, such as during ipsc, all port setting were
updated to inst structure, So if userspace attempts any ioctl(like
g_ctrl) without lock, it might get intermittent value, which is wrong.
Change-Id: Ic4bdf562f7036f3796019fe45d1cdc392045878a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Update metadata buffer size after port resolution
changes.
Change-Id: Ieb9ce986500b4f06b5b0a324b4cd42ebae5c4d9e
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
qbuf will be deferred on all ports before streamon,
So explicitly queue pending buffers at the time of
streamon.
Change-Id: I673a14f0d43563184aac887f5f23b63ed13d59df
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Encoder supports downscale with scaling ratio upto 1/8 of width
and 1/8 of height. So added necessary scaling checks at streamon.
Change-Id: I3a29b43c79cf4e693ba2c0d9f98ec24410d50fbd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Add strict check in msm_vidc_check_mbpf_supported() to
reject image session, if total image load exceeds 16K.
Added msm_vidc_print_insts_info() support to print all
running instance info, if new session is rejected due
to mbpf/mbps checks.
Change-Id: I98bab985fcf4f4d20c6f263c48e0c701ec86ab6f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Decoder supports dynamic low latency. When client configures the
video session in low latency mode, driver would configure the
firmware such that HFI_CMD_SETTINGS_CHANGE is triggerred on
sync frame boundary.
Change-Id: Ie70eaaeb8ad420db926f0d99f77723476deee400
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
During input port streamoff, state is changed from START_INPUT
to OPEN and then sent CMD_STOP to firmware. So reverse thread
acquired the lock and trying to process IPSC. Since IPSC is
not allowed in OPEN state, driver treats that as a fatal issue
and moves inst->state to ERROR state. Added change to avoid
above mentioned issue.
Change-Id: If0e18f01b6ecac3c810c0dab878ae392c48ffc27
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Use bitstream fps in clock and bus vote calculation, if
bitstream detected fps is higher than client set rate.
Change-Id: I58fa1a8725086c112796b3ce5172a39f322e178e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>