aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-06-09media: atomisp: Simplify atomisp_[start|stop]_streaming()Hans de Goede1-71/+16
Now that continuous mode is gone and we only have 1 /dev/video# node, the videobuf2 core guarantees that atomisp_[start|stop]_streaming() will only be called one at a time. So there is no need to check for things like the isp is already streaming when starting, or other streams still being active while stopping. Remove checks for these from atomisp_[start|stop]_streaming(). While at it also improve the logging a bit: 1. Remove the dev_err(isp->dev, "atomisp_reset") logged on every stream stop (even though everything is fine. 2. Log a message when starting/stopping the sensor stream fails Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove atomisp_sensor_start_stream()Hans de Goede1-36/+0
Now that we no longer have continuous mode we always want to start the sensor on the first atomisp_start_streaming() call and stop it on the first atomisp_stop_streaming() call. Remove atomisp_sensor_start_stream() which returned the number of streams which should be active before starting the sensor and always start/stop the sensor directly. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove isp_timeout flagHans de Goede3-13/+4
isp_timeout only ever gets set in __atomisp_css_recover() and then immediately gets cleared again after calling atomisp_reset(). All this happens with isp->mutex held. The only consumer of isp->isp_timeout is atomisp_stop_streaming(), which also holds isp->mutex and which is *not* called by atomisp_reset(). Since both hold isp->mutex and since __atomisp_css_recover() clears isp_timeout before releasing the mutex, atomisp_stop_streaming() can never see isp_timeout being true, so just remove the flag. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove unused mipi_frame_size field from atomisp_[sub_]deviceHans de Goede3-5/+0
Both the atomisp_device and the atomisp_sub_device structs have an unused mipi_frame_size field, remove the field from both. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove a bunch of unused atomisp_css_*() functionsHans de Goede2-128/+0
Remove various unused atomisp_css_*() functions from atomisp_compat_css20.c. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove atomisp_subdev_register_video_nodes() helperHans de Goede3-21/+3
Now that there is only 1 /dev/video# node left there is no need to do this in a helper. Just make atomisp_register_device_nodes() call video_register_device() directly. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove 1 line atomisp_flush_bufs_and_wakeup() helperHans de Goede2-8/+1
After recent changes this now is just a wrapper around atomisp_flush_video_pipe(). Make its single caller call atomisp_flush_video_pipe() directly and drop the helper. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove source_pad parameter from functions and structsHans de Goede7-69/+33
Now that there is only 1 source-pad for an asd there is no need to have a parameter for this in various places. Remove the source_pad function parameter and atomisp_sub_device.capture_pad data member. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Rename video_out_preview to video_outHans de Goede6-30/+23
Now that we have only 1 /dev/video# node for output for all different run-modes (with only 1 run-mode at a time) using video_out_preview for the remaining atomisp_pipe does not properly reflect that this is *the* output pipe. Fo the following renames to fix the naming: s/video_out_preview/video_out/ s/ATOMISP_SUBDEV_PAD_SOURCE_PREVIEW/ATOMISP_SUBDEV_PAD_SOURCE/ Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Drop atomisp_is_vf_pipe()Hans de Goede4-37/+5
Since there only is one /dev/video# node now (no more continuous mode), there are now no longer separate main capture + view-finder pipes. We are now always on the main pipe, so atomisp_is_vf_pipe() should always return false now. Drop any checks using it, replacing them with the code-path for a false return. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Register only 1 /dev/video# nodeHans de Goede6-233/+32
Now that we no longer support continuous mode and thus no longer support streaming from 2 /dev/video# nodes at the same time, there is no need to have a separate /dev/video# node (+ matching v4l2-subdev pads) for each run-mode. Keep the video_out_preview /dev/video0 device and remove the video_out_video_capture / video_out_vf / video_out_capture video-devices (atomisp_pipe-s) and also remove the matching ATOMISP_SUBDEV_PAD_SOURCE_VIDEO / ATOMISP_SUBDEV_PAD_SOURCE_VF / ATOMISP_SUBDEV_PAD_SOURCE_CAPTURE source-pads. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Replace source-pad checks with run-mode checksHans de Goede3-103/+29
Currently atomisp behavior is determined by a mix of which /dev/video# node (which isp-subdev source-pad) is opened + which run-mode is set. With various combinations not being allowed and likely leading to crashes due to lack of error checking. Now that we no longer support continuous mode and thus no longer support streaming from 2 /dev/video# nodes at the same time, there is no need to have a separate /dev/video# node for each run-mode. Instead the plan is to support the 3 different run-modes on a single /dev/video# node. Since we are moving to a single isp-subdev source-pad, the behavior should then be solely and consistently be defined by the run-mode. Replace various source-pad checks with run-mode checks in preparation for moving to a single source-pad. In some places the new run-mode checks overlap with existing run-mode checks and the checks are folded together into a single check. This removes handling of the ATOMISP_SUBDEV_PAD_SOURCE_VF source-pad, this source-pad was only useful for continuous mode, for which support has been removed. Note that currently the only run-mode which we actually have been able to get to work is the video-capture with scaler aka preview mode and as such that is also the only run-mode tested. This patch is intended to preserve the current (known to not work 100%) behavior of the other run-modes, so that those maybe can be enabled later. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Drop atomisp_get_css_buf_type()Hans de Goede1-28/+1
Since continuous mode has been removed, there no longer is the option for separate capture output + viewfinder output streams at the same time. So all buffers queued by userspace are now for the normal output stream, remove atomisp_get_css_buf_type() and always use IA_CSS_BUFFER_TYPE_OUTPUT_FRAME for buffers queued by userspace. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove isp->need_gfx_throttle fieldHans de Goede3-13/+0
Remove the isp->need_gfx_throttle field it is only ever set and never read. Also the code setting it is broken, comparing run_mode->val to ATOMISP_SUBDEV_PAD_SOURCE_VIDEO which are not of the same type / not part of the same enum. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove Continuous capture and SDV run-modesHans de Goede5-119/+10
Since we no longer support Continuous mode, setting the run_mode to ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE no longer make sense, so remove this. While at it, also remove ATOMISP_RUN_MODE_SDV, which was never exposed to userspace in the first place. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: Remove res_overflow parameter from atomisp_try_fmt()Hans de Goede3-20/+6
The only remaining caller of atomisp_try_fmt() always passes NULL for the res_overflow parameter. Drop it and simplify atomisp_try_fmt(). Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: sh_css_mipi: Remove #ifdef ISP2401Kate Hsuan1-39/+17
The actions of ISP2401 and 2400 are determined at the runtime. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kate Hsuan <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: sh_css_firmware: determine firmware version at runtimeKate Hsuan1-5/+13
The firmware version of ISP2401 and 2400 is determined at runtime. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kate Hsuan <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: sh_css_sp: Remove #ifdef ISP2401Kate Hsuan1-6/+4
The actions of ISP2401 and 2400 will be determined at the runtime. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kate Hsuan <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: runtime: frame: remove #ifdef ISP2401Kate Hsuan1-10/+3
The actions of ISP2401 and 2400 are determined at the runtime. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kate Hsuan <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: atomisp: sh_css: Remove #ifdef ISP2401Kate Hsuan1-285/+239
The actions of ISP2401 and 2400 are determined at the runtime. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kate Hsuan <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: uvcvideo: Constify descriptor buffersLaurent Pinchart1-3/+3
There is no need to modify the content of UVC descriptor buffers during parsing. Make all the corresponding pointers const to avoid unintended modifications. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: uvcvideo: Constify formats, frames and intervalsLaurent Pinchart4-33/+34
The formats, frames and intervals stored in the uvc_streaming structure are not meant to change after being parsed at probe time. Make them const to prevent unintended modifications, and adapt the probe code accordingly to use non-const pointers during parsing. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: uvcvideo: Increment intervals pointer at end of parsingLaurent Pinchart1-4/+13
The intervals pointer is incremented for each interval when parsing the format descriptor. This doesn't cause any issue as such, but gets in the way of constifying some pointers. Modify the parsing code to index the intervals pointer as an array and increment it in one go at end of parsing. Careful readers will notice that the maxIntervalIndex variable is set to 1 instead of n - 2 when bFrameIntervalType has a zero value. This is functionally equivalent, as n is equal to 3 in that case. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: uvcvideo: Reorganize format descriptor parsingLaurent Pinchart1-15/+25
Format descriptor parsing has grown over time and now mixes parsing of frame intervals with various quirk handling. Reorganize it to make the code easier to follow, by parsing frame intervals first, and then applying fixes and quirks. No functional change is intended. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: uvcvideo: Use clamp() to replace manual implementationLaurent Pinchart1-3/+3
The kernel has a nice clamp() macro, use it to replace a manual implementation based on min() and max(). No functional change is intended. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: uvcvideo: Rename uvc_format 'frame' field to 'frames'Laurent Pinchart4-24/+24
The uvc_format 'frame' field points to an array of frames. Rename it to 'frames' to make this clearer. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: uvcvideo: Rename uvc_streaming 'format' field to 'formats'Laurent Pinchart4-14/+14
The uvc_streaming 'format' field points to an array of formats. Rename it to 'formats' to make this clearer. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: uvcvideo: Enable Intel RealSense metadata for devicesDmitry Perchanov1-0/+63
Intel RealSense UVC Depth cameras produce metadata in a vendor-specific format that is already supported by the uvcvideo driver. Enable handling of this metadata for 7 additional RealSense devices. Co-developed-by: Yu MENG <[email protected]> Co-developed-by: Evgeni Raikhel <[email protected]> Signed-off-by: Dmitry Perchanov <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: uapi: v4l: Intel metadata format updateDmitry Perchanov1-8/+47
Update metadata structure for Intel RealSense UVC/MIPI cameras. Compliant to Intel Configuration version 3. Signed-off-by: Dmitry Perchanov <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09Revert "media: uvcvideo: Limit power line control for Acer EasyCamera"Sakari Ailus1-9/+0
This reverts commit 5dd0eab84ae9a4b292baf1ad02e1a273c475cd04. Revert this patch as it has been merged twice. The earlier merged commit is 81e78a6fc320 ("media: uvcvideo: Limit power line control for Acer EasyCamera"). Reported-by: Dmitry Perchanov <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Ricardo Ribalda <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: provide ctx queue lock for ioctl synchronizationSergey Senozhatsky3-0/+10
Video device has to provide a lock so that __video_do_ioctl() can serialize IOCTL calls. Introduce a dedicated venus_inst mutex for the purpose of vb2 operations synchronization. Signed-off-by: Sergey Senozhatsky <[email protected]> Reviewed-by: Vikash Garodia <[email protected]> Reviewed-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: return P010 as preferred format for 10 bit decodeDikshita Agarwal1-1/+6
If bit depth is detected as 10 bit by firmware, return P010 as preferred decoder format to the client. Signed-off-by: Dikshita Agarwal <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: add handling of bit depth change from firmwareDikshita Agarwal2-1/+20
Set opb format to TP10_UWC and dpb to client set format when bit depth change to 10 bit is detecting by firmware. Acked-by: Konrad Dybcio <[email protected]> Signed-off-by: Dikshita Agarwal <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: update calculation for dpb buffersDikshita Agarwal3-3/+15
Use dpb color format, width and height of output port for calculating buffer size of dpb buffers. Acked-by: Konrad Dybcio <[email protected]> Signed-off-by: Dikshita Agarwal <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: add support for V4L2_PIX_FMT_P010 color formatDikshita Agarwal3-10/+18
add V4L2_PIX_FMT_P010 as supported color format for decoder. Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Dikshita Agarwal <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: replace arrary index with enum for supported formatsDikshita Agarwal3-38/+72
Use enums to list supported formats for encoder and decoder instead of array index which was a error prone design. Signed-off-by: Dikshita Agarwal <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: fix EOS handling in decoder stop commandDikshita Agarwal1-1/+1
Use firmware version based check to assign correct device address for EOS buffer to fix the EOS handling with different firmware version. Reviewed-by: Konrad Dybcio <[email protected]> Tested-by: Nathan Hebert <[email protected]> Signed-off-by: Vikash Garodia <[email protected]> Signed-off-by: Viswanath Boma <[email protected]> Signed-off-by: Dikshita Agarwal <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: enable sufficient sequence change support for vp9Dikshita Agarwal3-0/+11
VP9 supports resolution change at interframe. Currenlty, if sequence change is detected at interframe and resources are sufficient, sequence change event is not raised by firmware to driver until the next keyframe. This change add the HFI to notify the sequence change in this case to driver. Reviewed-by: Konrad Dybcio <[email protected]> Tested-by: Nathan Hebert <[email protected]> Signed-off-by: Vikash Garodia <[email protected]> Signed-off-by: Viswanath Boma <[email protected]> Signed-off-by: Dikshita Agarwal <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: add firmware version based checkDikshita Agarwal2-3/+47
Add firmware version based checks to enable/disable features for different SOCs. Tested-by: Nathan Hebert <[email protected]> Signed-off-by: Vikash Garodia <[email protected]> Signed-off-by: Viswanath Boma <[email protected]> Signed-off-by: Dikshita Agarwal <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: hfi_cmds: Use struct_size() helperGustavo A. R. Silva1-4/+4
Prefer struct_size() over open-coded versions of idiom: sizeof(struct-with-flex-array) + sizeof(typeof-flex-array-elements) * count where count is the max number of items the flexible array is supposed to contain. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: hfi_cmds: Replace one-element array with flexible-array memberGustavo A. R. Silva2-7/+7
One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in struct hfi_session_set_buffers_pkt, and refactor the rest of the code, accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/292 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: Replace one-element arrays with flexible-array membersGustavo A. R. Silva2-9/+9
One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in multiple structures, and refactor the rest of the code, accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/291 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: hfi_cmds: Replace fake flex-array with flexible-array memberGustavo A. R. Silva2-2/+2
One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element arrays with flexible-array members in struct hfi_sys_set_resource_pkt, and refactor the rest of the code, accordingly. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. The only binary differences seen before/after changes are the following: 17ba: mov %rbx,%rdi 17bd: call 17c2 <pkt_sys_set_resource+0x42> 17be: R_X86_64_PLT32 __tsan_write4-0x4 - 17c2: movl $0x14,(%rbx) + 17c2: movl $0x10,(%rbx) 17c8: lea 0x4(%rbx),%rdi 17cc: call 17d1 <pkt_sys_set_resource+0x51> 17cd: R_X86_64_PLT32 __tsan_write4-0x4 which is expected once this accounts for the following line of code at drivers/media/platform/qcom/venus/hfi_cmds.c:73 73 pkt->hdr.size = sizeof(*pkt); and as *pkt is of type struct hfi_sys_set_resource_pkt, sizeof(*pkt) is reduced by 4 bytes, due to the flex-array transformation. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/293 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: helpers: Fix ALIGN() of non power of twoRikard Falkeborn1-2/+2
ALIGN() expects its second argument to be a power of 2, otherwise incorrect results are produced for some inputs. The output can be both larger or smaller than what is expected. For example, ALIGN(304, 192) equals 320 instead of 384, and ALIGN(65, 192) equals 256 instead of 192. However, nestling two ALIGN() as is done in this case seem to only produce results equal to or bigger than the expected result if ALIGN() had handled non powers of two, and that in turn results in framesizes that are either the correct size or too large. Fortunately, since 192 * 4 / 3 equals 256, it turns out that one ALIGN() is sufficient. Fixes: ab1eda449c6e ("media: venus: vdec: handle 10bit bitstreams") Signed-off-by: Rikard Falkeborn <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: simplify the return expression of venus_sys_set_* functionLiu Shixin1-24/+4
Simplify the return expression. Signed-off-by: Liu Shixin <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09media: venus: simplify the return expression of session_process_buf()Qinglang Miao1-6/+1
Simplify the return expression. Signed-off-by: Qinglang Miao <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2023-06-09Merge tag 'v6.4-rc5' into media_stageMauro Carvalho Chehab1127-4897/+9405
Linux 6.4-rc5 * tag 'v6.4-rc5': (919 commits) Linux 6.4-rc5 leds: qcom-lpg: Fix PWM period limits selftests/ftrace: Choose target function for filter test from samples KVM: selftests: Add test for race in kvm_recalculate_apic_map() KVM: x86: Bail from kvm_recalculate_phys_map() if x2APIC ID is out-of-bounds KVM: x86: Account fastpath-only VM-Exits in vCPU stats KVM: SVM: vNMI pending bit is V_NMI_PENDING_MASK not V_NMI_BLOCKING_MASK KVM: x86/mmu: Grab memslot for correct address space in NX recovery worker tpm, tpm_tis: correct tpm_tis_flags enumeration values Revert "ext4: remove ac->ac_found > sbi->s_mb_min_to_scan dead check in ext4_mb_check_limits" media: uvcvideo: Don't expose unsupported formats to userspace media: v4l2-subdev: Fix missing kerneldoc for client_caps media: staging: media: imx: initialize hs_settle to avoid warning media: v4l2-mc: Drop subdev check in v4l2_create_fwnode_links_to_pad() riscv: Implement missing huge_ptep_get riscv: Fix huge_ptep_set_wrprotect when PTE is a NAPOT module/decompress: Fix error checking on zstd decompression fork, vhost: Use CLONE_THREAD to fix freezer/ps regression dt-bindings: serial: 8250_omap: add rs485-rts-active-high selinux: don't use make's grouped targets feature yet ...
2023-06-04Linux 6.4-rc5Linus Torvalds1-1/+1
2023-06-04Merge tag 'irq_urgent_for_v6.4_rc5' of ↵Linus Torvalds1-0/+2
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Borislav Petkov: - Fix open firmware quirks validation so that they don't get applied wrongly * tag 'irq_urgent_for_v6.4_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic: Correctly validate OF quirk descriptors