linux_dsm_epyc7002/drivers/media/platform/qcom/venus
Vivek Gautam de2563bce7 media: venus: core: Set dma maximum segment size
Turning on CONFIG_DMA_API_DEBUG_SG results in the following error:

[  460.308650] ------------[ cut here ]------------
[  460.313490] qcom-venus aa00000.video-codec: DMA-API: mapping sg segment longer than device claims to support [len=4194304] [max=65536]
[  460.326017] WARNING: CPU: 3 PID: 3555 at src/kernel/dma/debug.c:1301 debug_dma_map_sg+0x174/0x254
[  460.338888] Modules linked in: venus_dec venus_enc videobuf2_dma_sg videobuf2_memops hci_uart btqca bluetooth venus_core v4l2_mem2mem videobuf2_v4l2 videobuf2_common ath10k_snoc ath10k_core ath lzo lzo_compress zramjoydev
[  460.375811] CPU: 3 PID: 3555 Comm: V4L2DecoderThre Tainted: G        W         4.19.1 #82
[  460.384223] Hardware name: Google Cheza (rev1) (DT)
[  460.389251] pstate: 60400009 (nZCv daif +PAN -UAO)
[  460.394191] pc : debug_dma_map_sg+0x174/0x254
[  460.398680] lr : debug_dma_map_sg+0x174/0x254
[  460.403162] sp : ffffff80200c37d0
[  460.406583] x29: ffffff80200c3830 x28: 0000000000010000
[  460.412056] x27: 00000000ffffffff x26: ffffffc0f785ea80
[  460.417532] x25: 0000000000000000 x24: ffffffc0f4ea1290
[  460.423001] x23: ffffffc09e700300 x22: ffffffc0f4ea1290
[  460.428470] x21: ffffff8009037000 x20: 0000000000000001
[  460.433936] x19: ffffff80091b0000 x18: 0000000000000000
[  460.439411] x17: 0000000000000000 x16: 000000000000f251
[  460.444885] x15: 0000000000000006 x14: 0720072007200720
[  460.450354] x13: ffffff800af536e0 x12: 0000000000000000
[  460.455822] x11: 0000000000000000 x10: 0000000000000000
[  460.461288] x9 : 537944d9c6c48d00 x8 : 537944d9c6c48d00
[  460.466758] x7 : 0000000000000000 x6 : ffffffc0f8d98f80
[  460.472230] x5 : 0000000000000000 x4 : 0000000000000000
[  460.477703] x3 : 000000000000008a x2 : ffffffc0fdb13948
[  460.483170] x1 : ffffffc0fdb0b0b0 x0 : 000000000000007a
[  460.488640] Call trace:
[  460.491165]  debug_dma_map_sg+0x174/0x254
[  460.495307]  vb2_dma_sg_alloc+0x260/0x2dc [videobuf2_dma_sg]
[  460.501150]  __vb2_queue_alloc+0x164/0x374 [videobuf2_common]
[  460.507076]  vb2_core_reqbufs+0xfc/0x23c [videobuf2_common]
[  460.512815]  vb2_reqbufs+0x44/0x5c [videobuf2_v4l2]
[  460.517853]  v4l2_m2m_reqbufs+0x44/0x78 [v4l2_mem2mem]
[  460.523144]  v4l2_m2m_ioctl_reqbufs+0x1c/0x28 [v4l2_mem2mem]
[  460.528976]  v4l_reqbufs+0x30/0x40
[  460.532480]  __video_do_ioctl+0x36c/0x454
[  460.536610]  video_usercopy+0x25c/0x51c
[  460.540572]  video_ioctl2+0x38/0x48
[  460.544176]  v4l2_ioctl+0x60/0x74
[  460.547602]  do_video_ioctl+0x948/0x3520
[  460.551648]  v4l2_compat_ioctl32+0x60/0x98
[  460.555872]  __arm64_compat_sys_ioctl+0x134/0x20c
[  460.560718]  el0_svc_common+0x9c/0xe4
[  460.564498]  el0_svc_compat_handler+0x2c/0x38
[  460.568982]  el0_svc_compat+0x8/0x18
[  460.572672] ---[ end trace ce209b87b2f3af88 ]---

>From above warning one would deduce that the sg segment will overflow
the device's capacity. In reality, the hardware can accommodate larger
sg segments.
So, initialize the max segment size properly to weed out this warning.

Based on a similar patch sent by Sean Paul for mdss:
https://patchwork.kernel.org/patch/10671457/

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-07 08:28:10 -05:00
..
core.c media: venus: core: Set dma maximum segment size 2018-12-07 08:28:10 -05:00
core.h media: venus: firmware: add no TZ boot and shutdown routine 2018-11-23 06:34:12 -05:00
firmware.c media: venus: firmware: add no TZ boot and shutdown routine 2018-11-23 06:34:12 -05:00
firmware.h media: venus: firmware: add no TZ boot and shutdown routine 2018-11-23 06:34:12 -05:00
helpers.c media: venus: helpers: use true and false for boolean values 2018-09-24 09:31:12 -04:00
helpers.h media: venus: implementing multi-stream support 2018-07-25 09:16:11 -04:00
hfi_cmds.c media: venus: handle peak bitrate set property 2018-11-27 13:57:55 -05:00
hfi_cmds.h [media] media: venus: hfi: add Host Firmware Interface (HFI) 2017-06-20 08:53:40 -03:00
hfi_helper.h media: venus: hfi_parser: add common capability parser 2018-07-25 08:49:58 -04:00
hfi_msgs.c media: venus: hfi_parser: add common capability parser 2018-07-25 08:49:58 -04:00
hfi_msgs.h [media] media: venus: hfi: add Host Firmware Interface (HFI) 2017-06-20 08:53:40 -03:00
hfi_parser.c media: venus: core: delete not used buffer mode flags 2018-07-25 08:52:04 -04:00
hfi_parser.h media: venus: hfi_parser: add common capability parser 2018-07-25 08:49:58 -04:00
hfi_venus_io.h media: venus: firmware: add no TZ boot and shutdown routine 2018-11-23 06:34:12 -05:00
hfi_venus.c media: venus: handle peak bitrate set property 2018-11-27 13:57:55 -05:00
hfi_venus.h [media] media: venus: hfi: add Venus HFI files 2017-06-20 08:53:40 -03:00
hfi.c media: venus: add HEVC codec support 2018-07-25 09:29:25 -04:00
hfi.h media: venus: hfi: update sequence event to handle more properties 2018-07-25 08:43:03 -04:00
Makefile media: venus: hfi_parser: add common capability parser 2018-07-25 08:49:58 -04:00
vdec_ctrls.c media: v4l2-ctrl: Change control for VP8 profile to menu control 2018-07-04 09:28:38 -04:00
vdec.c media: venus: fix reported size of 0-length buffers 2018-12-03 13:20:27 -05:00
vdec.h [media] media: venus: vdec: add video decoder files 2017-06-20 08:53:39 -03:00
venc_ctrls.c media: venus: add support for key frame 2018-12-07 08:14:20 -05:00
venc.c media: venus: Support V4L2 QP parameters in Venus encoder 2018-12-07 08:27:29 -05:00
venc.h [media] media: venus: venc: add video encoder files 2017-06-20 08:53:39 -03:00