Add support for DMA2D of STMicroelectronics STM32 Soc series
Subsystems (5)
v7 cover Add support for DMA2D of STMicroelectronics STM32 Soc series
This patchset introduces a basic support for DMA2D Interface of STMicroelectronics STM32 SoC series.
This first basic support implements R2M, M2M, M2M_PFC M2M_BLEND support will be added later on.
This has been tested on STM32469-DISCO board.
history
v7:
- fix compile test reported by lkp(a)intel.com, thanks.
- collect acked-by, reviewed-by from Gabriel, Patrice.
v6 link:
https://lore.kernel.org/lkml/1634633003-18132-1-git-send-email-dillon.minfei(a)gmail.com/
v6:
- use 2592x2592 instead of 0x3fff, 0xffff. [PATCH v6 10/10]
- add space in '(V4L2_CID_BASE+43)' to avoid checkpatch warrnings. [PATCH v6 08/10]
v5 link:
https://lore.kernel.org/lkml/1634533488-25334-1-git-send-email-dillon.minfei(a)gmail.com/
v5:
- rebase to media_tree https://git.linuxtv.org/media_tree.git/
- remove unused log from dma2d driver to avoid spam kernel log.
- fix 0xFFFFFF to 0xffffff, 2^24 to 2^24 -1, etc.
- introduce patch "media: v4l2-ctrls: Add V4L2_CID_COLORFX_CBCR max setting" to add V4L2_CID_COLORFX_CBCR entry.
- thanks to Hans's patch, open nullptr check in v4l2-compliance, update new test result. thanks.
https://lore.kernel.org/linux-media/3acd9ee4-5a58-6ed4-17fe-61596a5252b8(a)xs4all.nl/
v4 link:
https://lore.kernel.org/lkml/bc8e1cd1-0013-9062-88b6-fddca535919f(a)xs4all.nl/
v4:
- replace V4L2_COLORFX_SET_ARGB, V4L2_CID_COLORFX_ARGB to V4L2_COLORFX_SET_RGB, V4L2_CID_COLORFX_RGB since Alpha paramter not used in current. thanks Hans.
v3 link:
https://lore.kernel.org/lkml/1633689012-14492-1-git-send-email-dillon.minfei(a)gmail.com/
v3:
- use V4L2_COLORFX_SET_ARGB, V4L2_CID_COLORFX_ARGB to pass argb paramter to the dma2d driver, instead of add stm32 private ioctl.
- some v2's patch are removed in this version.
- "[PATCH v2 7/9] media: docs: add doc for the stm32 dma2d driver"
- "[PATCH v2 8/9] media: v4l: uapi: Add user control base for stm32 dma2d controls"
- dma2d's driver changes based on Hans's review result. detail can be found at "media: stm32-dma2d: STM32 DMA2D driver"
- add stm32 clk drivers bugfix, ltdc clock disabled after kenerl boot up. v3 based on kernel and v4l-utils git:
kernel:
commit 9e1ff307c779ce1f0f810c7ecce3d95bbae40896
Author: Linus Torvalds <[email protected]> Date: Sun Oct 3 14:08:47 2021 -0700
Linux 5.15-rc4
v4l-utils:
commit 700f5ded9c6de2c6dfe5d1b453d85566f95b4f0c
Author: Hans Verkuil <[email protected]> Date: Sat Oct 2 11:01:05 2021 +0200
test-media: show version info earlier and show cmd args
Log the version info earlier and also log the command line arguments.
v2 link:
https://lore.kernel.org/lkml/1626341068-20253-11-git-send-email-dillon.minfei(a)gmail.com/
v2:
- update v4l2-compliance to SHA: a4f2e3a6f306 2021-07-13 08:04:15 the test results at below [1].
- introduce Documentation/userspace-api/media/drivers/stm32-uapi.rst to explain the detail of dma2d's ioctl.
- reserved 16 ioctls from v4l2-controls.h for stm32, introduce stm32-media.h.
- collect Reviewed-by tag from Rob Herring.
- update dma2d driver from Hans's review. the details can be found at related patches.
v1 link:
https://lore.kernel.org/lkml/1621508727-24486-1-git-send-email-dillon.minfei(a)gmail.com/
v1:
The commit based on kernel(master): c3d0e3fd41b7f0f5d5d5b6022ab7e813f04ea727
Note for v4l2-compliance tool on nu-mmu platform:
I add two change based on v4l-utils since commit:f0c7e3d71eaf4182bae7eb3ee0e43b4eeb047ea9
- change fork() to vfork() in v4l2-test-controls.cpp since no-mmu platform don't include fork().
with v4l2-compliance test log (with above modification):
since the stm32f469-disco ram limitation, there are 25 failed on dma_alloc_coherent()
Really appreciate if someone can help to test this patch on the STM32429I-EVAL evaluation board (https://www.st.com/en/evaluation-tools/stm32429i-eval.html)
8M x 32-bit SDRAM, 1M x 16-bit SRAM and 8M x 16-bit NOR Flash
~ # free
total used free shared buff/cache available Mem: 15648 4076 8260 0 3312 7632
~ # v4l2-compliance -f -d /dev/video0 > /dev/ttyprintk
[ 234.919026] [U] v4l2-compliance 1.21.0-4855, 32 bits, 32-bit time_t [ 235.880625] [U] v4l2-compliance SHA: 700f5ded9c6d 2021-10-02 09:01:05 [ 236.877059] [U] Compliance test for stm-dma2d device /dev/video0: [ 237.835965] [U] Driver Info: [ 238.311502] [U] Driver name : stm-dma2d [ 238.787381] [U] Card type : stm-dma2d [ 239.255574] [U] Bus info : platform:stm-dma2d [ 239.722920] [U] Driver version : 5.15.0 [ 240.183388] [U] Capabilities : 0x84208000 [ 240.640809] [U] Video Memory-to-Memory [ 241.095669] [U] Streaming [ 241.540812] [U] Extended Pix Format [ 241.978288] [U] Device Capabilities [ 242.409891] [U] Device Caps : 0x04208000 [ 242.841150] [U] Video Memory-to-Memory [ 243.265246] [U] Streaming [ 243.680040] [U] Extended Pix Format [ 244.092896] [U] Required ioctls: [ 244.499208] [U] test VIDIOC_QUERYCAP: OK [ 244.943985] [U] test invalid ioctls: OK [ 245.346521] [U] Allow for multiple opens: [ 245.749312] [U] test second /dev/video0 open: OK [ 246.526863] [U] test VIDIOC_QUERYCAP: OK [ 246.929589] [U] test VIDIOC_G/S_PRIORITY: OK [ 247.548185] [U] test for unlimited opens: OK [ 247.936192] [U] Debug ioctls: [ 248.311265] [U] test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) [ 249.058547] [U] test VIDIOC_LOG_STATUS: OK (Not Supported) [ 249.802868] [U] Input ioctls: [ 250.173701] [U] test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) [ 250.914653] [U] test VIDIOC_G/S_FREQUENCY: OK (Not Supported) [ 251.657517] [U] test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) [ 252.408231] [U] test VIDIOC_ENUMAUDIO: OK (Not Supported) [ 253.166559] [U] test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) [ 253.933560] [U] test VIDIOC_G/S_AUDIO: OK (Not Supported) [ 254.695551] [U] Inputs: 0 Audio Inputs: 0 Tuners: 0 [ 255.082805] [U] Output ioctls: [ 255.462189] [U] test VIDIOC_G/S_MODULATOR: OK (Not Supported) [ 256.218699] [U] test VIDIOC_G/S_FREQUENCY: OK (Not Supported) [ 256.997586] [U] test VIDIOC_ENUMAUDOUT: OK (Not Supported) [ 257.796012] [U] test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) [ 258.609978] [U] test VIDIOC_G/S_AUDOUT: OK (Not Supported) [ 259.453435] [U] Outputs: 0 Audio Outputs: 0 Modulators: 0 [ 260.303571] [U] Input/Output configuration ioctls: [ 260.741454] [U] test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) [ 261.618607] [U] test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) [ 262.517280] [U] test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) [ 263.427620] [U] test VIDIOC_G/S_EDID: OK (Not Supported) [ 264.344630] [U] Control ioctls: [ 264.833262] [U] test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK [ 265.763394] [U] test VIDIOC_QUERYCTRL: OK [ 266.247635] [U] test VIDIOC_G/S_CTRL: OK [ 266.730244] [U] test VIDIOC_G/S/TRY_EXT_CTRLS: OK [ 267.651495] [U] test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK [ 268.573048] [U] test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) [ 269.503304] [U] Standard Controls: 3 Private Controls: 0 [ 269.976154] [U] Format ioctls: [ 270.458701] [U] test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK [ 271.395051] [U] test VIDIOC_G/S_PARM: OK (Not Supported) [ 272.316304] [U] test VIDIOC_G_FBUF: OK (Not Supported) [ 273.242824] [U] test VIDIOC_G_FMT: OK [ 273.719213] [U] test VIDIOC_TRY_FMT: OK [ 274.187524] [U] test VIDIOC_S_FMT: OK [ 274.643930] [U] test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) [ 275.547089] [U] test Cropping: OK (Not Supported) [ 276.446375] [U] test Composing: OK (Not Supported) [ 277.347458] [U] test Scaling: OK [ 277.800218] [U] Codec ioctls: [ 278.245926] [U] test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) [ 279.140451] [U] test VIDIOC_G_ENC_INDEX: OK (Not Supported) [ 280.023765] [U] test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) [ 280.910844] [U] Buffer ioctls: [ 281.466649] [U] test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK [ 282.381634] [U] test VIDIOC_EXPBUF: OK [ 282.830946] [U] test Requests: OK (Not Supported) [ 283.698629] [U] test TIME32/64: OK [ 284.157170] [U] Test input 0: [ 284.594093] [U] Stream using all formats: [ 288.379647] [U] [ 289.111860] [U] Video Capture: Captured 8 buffers [ 289.487473] [U] BA24 (32-bit ARGB 8-8-8-8) 1x1 -> BA24 (32-bit ARGB 8-8-8-8) 1x1: OK [ 293.012687] [U] [ 293.629532] [U] Video Capture: Captured 8 buffers [ 293.947618] [U] BA24 (32-bit ARGB 8-8-8-8) 1x1 -> RGB3 (24-bit RGB 8-8-8) 1x1: OK [ 296.900762] [U] [ 297.387693] [U] Video Capture: Captured 8 buffers [ 297.643353] [U] BA24 (32-bit ARGB 8-8-8-8) 1x1 -> RGBP (16-bit RGB 5-6-5) 1x1: OK [ 299.994539] [U] [ 300.426567] [U] Video Capture: Captured 8 buffers [ 300.669991] [U] BA24 (32-bit ARGB 8-8-8-8) 1x1 -> AR15 (16-bit ARGB 1-5-5-5) 1x1: OK [ 303.087504] [U] [ 303.519269] [U] Video Capture: Captured 8 buffers [ 303.757695] [U] BA24 (32-bit ARGB 8-8-8-8) 1x1 -> AR12 (16-bit ARGB 4-4-4-4) 1x1: OK [ 304.244993] stm-dma2d 4002b000.dma2d: dma alloc of size 26873856 failed [ 304.745438] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 305.257392] [U] BA24 (32-bit ARGB 8-8-8-8) 2592x2592 -> BA24 (32-bit ARGB 8-8-8-8) 2592x2592: FAIL [ 305.781175] stm-dma2d 4002b000.dma2d: dma alloc of size 26873856 failed [ 306.321901] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 306.902217] [U] BA24 (32-bit ARGB 8-8-8-8) 2592x2592 -> RGB3 (24-bit RGB 8-8-8) 2592x2592: FAIL [ 307.528929] stm-dma2d 4002b000.dma2d: dma alloc of size 26873856 failed [ 308.174441] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 308.848959] [U] BA24 (32-bit ARGB 8-8-8-8) 2592x2592 -> RGBP (16-bit RGB 5-6-5) 2592x2592: FAIL [ 309.535999] stm-dma2d 4002b000.dma2d: dma alloc of size 26873856 failed [ 310.217444] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 310.943592] [U] BA24 (32-bit ARGB 8-8-8-8) 2592x2592 -> AR15 (16-bit ARGB 1-5-5-5) 2592x2592: FAIL [ 311.713854] stm-dma2d 4002b000.dma2d: dma alloc of size 26873856 failed [ 312.508128] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 313.338010] [U] BA24 (32-bit ARGB 8-8-8-8) 2592x2592 -> AR12 (16-bit ARGB 4-4-4-4) 2592x2592: FAIL [ 317.675312] [U] [ 318.494207] [U] Video Capture: Captured 8 buffers [ 318.931776] [U] BA24 (32-bit ARGB 8-8-8-8) 240x320 -> BA24 (32-bit ARGB 8-8-8-8) 240x320: OK [ 323.087768] [U] [ 323.775244] [U] Video Capture: Captured 8 buffers [ 324.126855] [U] BA24 (32-bit ARGB 8-8-8-8) 240x320 -> RGB3 (24-bit RGB 8-8-8) 240x320: OK [ 327.479277] [U] [ 328.005695] [U] Video Capture: Captured 8 buffers [ 328.284117] [U] BA24 (32-bit ARGB 8-8-8-8) 240x320 -> RGBP (16-bit RGB 5-6-5) 240x320: OK [ 330.830015] [U] [ 331.260303] [U] Video Capture: Captured 8 buffers [ 331.497654] [U] BA24 (32-bit ARGB 8-8-8-8) 240x320 -> AR15 (16-bit ARGB 1-5-5-5) 240x320: OK [ 334.011389] [U] [ 334.440311] [U] Video Capture: Captured 8 buffers [ 334.677829] [U] BA24 (32-bit ARGB 8-8-8-8) 240x320 -> AR12 (16-bit ARGB 4-4-4-4) 240x320: OK [ 337.086566] [U] [ 337.517015] [U] Video Capture: Captured 8 buffers [ 337.756281] [U] RGB3 (24-bit RGB 8-8-8) 1x1 -> BA24 (32-bit ARGB 8-8-8-8) 1x1: OK [ 340.148849] [U] [ 340.579169] [U] Video Capture: Captured 8 buffers [ 340.823597] [U] RGB3 (24-bit RGB 8-8-8) 1x1 -> RGB3 (24-bit RGB 8-8-8) 1x1: OK [ 343.230816] [U] [ 343.661231] [U] Video Capture: Captured 8 buffers [ 343.899455] [U] RGB3 (24-bit RGB 8-8-8) 1x1 -> RGBP (16-bit RGB 5-6-5) 1x1: OK [ 346.276450] [U] [ 346.707406] [U] Video Capture: Captured 8 buffers [ 346.950489] [U] RGB3 (24-bit RGB 8-8-8) 1x1 -> AR15 (16-bit ARGB 1-5-5-5) 1x1: OK [ 349.363029] [U] [ 349.794791] [U] Video Capture: Captured 8 buffers [ 350.034303] [U] RGB3 (24-bit RGB 8-8-8) 1x1 -> AR12 (16-bit ARGB 4-4-4-4) 1x1: OK [ 350.526018] stm-dma2d 4002b000.dma2d: dma alloc of size 20156416 failed [ 351.023695] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 351.536683] [U] RGB3 (24-bit RGB 8-8-8) 2592x2592 -> BA24 (32-bit ARGB 8-8-8-8) 2592x2592: FAIL [ 352.060944] stm-dma2d 4002b000.dma2d: dma alloc of size 20156416 failed [ 352.603734] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 353.185847] [U] RGB3 (24-bit RGB 8-8-8) 2592x2592 -> RGB3 (24-bit RGB 8-8-8) 2592x2592: FAIL [ 353.814453] stm-dma2d 4002b000.dma2d: dma alloc of size 20156416 failed [ 354.463286] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 355.138479] [U] RGB3 (24-bit RGB 8-8-8) 2592x2592 -> RGBP (16-bit RGB 5-6-5) 2592x2592: FAIL [ 355.826797] stm-dma2d 4002b000.dma2d: dma alloc of size 20156416 failed [ 356.510828] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 357.237230] [U] RGB3 (24-bit RGB 8-8-8) 2592x2592 -> AR15 (16-bit ARGB 1-5-5-5) 2592x2592: FAIL [ 358.008304] stm-dma2d 4002b000.dma2d: dma alloc of size 20156416 failed [ 358.803816] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 359.630589] [U] RGB3 (24-bit RGB 8-8-8) 2592x2592 -> AR12 (16-bit ARGB 4-4-4-4) 2592x2592: FAIL [ 363.960327] [U] [ 364.781066] [U] Video Capture: Captured 8 buffers [ 365.214046] [U] RGB3 (24-bit RGB 8-8-8) 240x320 -> BA24 (32-bit ARGB 8-8-8-8) 240x320: OK [ 369.359436] [U] [ 370.047235] [U] Video Capture: Captured 8 buffers [ 370.411149] [U] RGB3 (24-bit RGB 8-8-8) 240x320 -> RGB3 (24-bit RGB 8-8-8) 240x320: OK [ 373.744081] [U] [ 374.268922] [U] Video Capture: Captured 8 buffers [ 374.538707] [U] RGB3 (24-bit RGB 8-8-8) 240x320 -> RGBP (16-bit RGB 5-6-5) 240x320: OK [ 377.084393] [U] [ 377.514706] [U] Video Capture: Captured 8 buffers [ 377.759132] [U] RGB3 (24-bit RGB 8-8-8) 240x320 -> AR15 (16-bit ARGB 1-5-5-5) 240x320: OK [ 380.203358] [U] [ 380.637202] [U] Video Capture: Captured 8 buffers [ 380.872188] [U] RGB3 (24-bit RGB 8-8-8) 240x320 -> AR12 (16-bit ARGB 4-4-4-4) 240x320: OK [ 383.271589] [U] [ 383.700928] [U] Video Capture: Captured 8 buffers [ 383.943595] [U] RGBP (16-bit RGB 5-6-5) 1x1 -> BA24 (32-bit ARGB 8-8-8-8) 1x1: OK [ 386.328863] [U] [ 386.764962] [U] Video Capture: Captured 8 buffers [ 386.999766] [U] RGBP (16-bit RGB 5-6-5) 1x1 -> RGB3 (24-bit RGB 8-8-8) 1x1: OK [ 389.410754] [U] [ 389.843266] [U] Video Capture: Captured 8 buffers [ 390.087088] [U] RGBP (16-bit RGB 5-6-5) 1x1 -> RGBP (16-bit RGB 5-6-5) 1x1: OK [ 392.471763] [U] [ 392.905730] [U] Video Capture: Captured 8 buffers [ 393.146591] [U] RGBP (16-bit RGB 5-6-5) 1x1 -> AR15 (16-bit ARGB 1-5-5-5) 1x1: OK [ 395.568817] [U] [ 396.000735] [U] Video Capture: Captured 8 buffers [ 396.239683] [U] RGBP (16-bit RGB 5-6-5) 1x1 -> AR12 (16-bit ARGB 4-4-4-4) 1x1: OK [ 396.726035] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 397.228167] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 397.740467] [U] RGBP (16-bit RGB 5-6-5) 2592x2592 -> BA24 (32-bit ARGB 8-8-8-8) 2592x2592: FAIL [ 398.265046] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 398.806330] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 399.386895] [U] RGBP (16-bit RGB 5-6-5) 2592x2592 -> RGB3 (24-bit RGB 8-8-8) 2592x2592: FAIL [ 400.014307] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 400.661722] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 401.334815] [U] RGBP (16-bit RGB 5-6-5) 2592x2592 -> RGBP (16-bit RGB 5-6-5) 2592x2592: FAIL [ 402.022646] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 402.705189] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 403.429313] [U] RGBP (16-bit RGB 5-6-5) 2592x2592 -> AR15 (16-bit ARGB 1-5-5-5) 2592x2592: FAIL [ 404.199336] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 404.993926] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 405.824722] [U] RGBP (16-bit RGB 5-6-5) 2592x2592 -> AR12 (16-bit ARGB 4-4-4-4) 2592x2592: FAIL [ 410.123611] [U] [ 410.945529] [U] Video Capture: Captured 8 buffers [ 411.378867] [U] RGBP (16-bit RGB 5-6-5) 240x320 -> BA24 (32-bit ARGB 8-8-8-8) 240x320: OK [ 415.488227] [U] [ 416.177766] [U] Video Capture: Captured 8 buffers [ 416.538441] [U] RGBP (16-bit RGB 5-6-5) 240x320 -> RGB3 (24-bit RGB 8-8-8) 240x320: OK [ 419.826273] [U] [ 420.354543] [U] Video Capture: Captured 8 buffers [ 420.636913] [U] RGBP (16-bit RGB 5-6-5) 240x320 -> RGBP (16-bit RGB 5-6-5) 240x320: OK [ 423.163619] [U] [ 423.594915] [U] Video Capture: Captured 8 buffers [ 423.832290] [U] RGBP (16-bit RGB 5-6-5) 240x320 -> AR15 (16-bit ARGB 1-5-5-5) 240x320: OK [ 426.311384] [U] [ 426.741478] [U] Video Capture: Captured 8 buffers [ 426.982107] [U] RGBP (16-bit RGB 5-6-5) 240x320 -> AR12 (16-bit ARGB 4-4-4-4) 240x320: OK [ 429.371663] [U] [ 429.806431] [U] Video Capture: Captured 8 buffers [ 430.040867] [U] AR15 (16-bit ARGB 1-5-5-5) 1x1 -> BA24 (32-bit ARGB 8-8-8-8) 1x1: OK [ 432.455072] [U] [ 432.887528] [U] Video Capture: Captured 8 buffers [ 433.131724] [U] AR15 (16-bit ARGB 1-5-5-5) 1x1 -> RGB3 (24-bit RGB 8-8-8) 1x1: OK [ 435.531286] [U] [ 435.969388] [U] Video Capture: Captured 8 buffers [ 436.205712] [U] AR15 (16-bit ARGB 1-5-5-5) 1x1 -> RGBP (16-bit RGB 5-6-5) 1x1: OK [ 438.632679] [U] [ 439.067025] [U] Video Capture: Captured 8 buffers [ 439.307189] [U] AR15 (16-bit ARGB 1-5-5-5) 1x1 -> AR15 (16-bit ARGB 1-5-5-5) 1x1: OK [ 441.703205] [U] [ 442.135816] [U] Video Capture: Captured 8 buffers [ 442.379741] [U] AR15 (16-bit ARGB 1-5-5-5) 1x1 -> AR12 (16-bit ARGB 4-4-4-4) 1x1: OK [ 442.867674] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 443.364265] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 443.879575] [U] AR15 (16-bit ARGB 1-5-5-5) 2592x2592 -> BA24 (32-bit ARGB 8-8-8-8) 2592x2592: FAIL [ 444.408321] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 444.954042] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 445.542126] [U] AR15 (16-bit ARGB 1-5-5-5) 2592x2592 -> RGB3 (24-bit RGB 8-8-8) 2592x2592: FAIL [ 446.167742] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 446.813974] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 447.484183] [U] AR15 (16-bit ARGB 1-5-5-5) 2592x2592 -> RGBP (16-bit RGB 5-6-5) 2592x2592: FAIL [ 448.169137] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 448.857907] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 449.586237] [U] AR15 (16-bit ARGB 1-5-5-5) 2592x2592 -> AR15 (16-bit ARGB 1-5-5-5) 2592x2592: FAIL [ 450.354594] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 451.147715] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 451.969070] [U] AR15 (16-bit ARGB 1-5-5-5) 2592x2592 -> AR12 (16-bit ARGB 4-4-4-4) 2592x2592: FAIL [ 456.270179] [U] [ 457.092815] [U] Video Capture: Captured 8 buffers [ 457.527337] [U] AR15 (16-bit ARGB 1-5-5-5) 240x320 -> BA24 (32-bit ARGB 8-8-8-8) 240x320: OK [ 461.646816] [U] [ 462.336816] [U] Video Capture: Captured 8 buffers [ 462.699807] [U] AR15 (16-bit ARGB 1-5-5-5) 240x320 -> RGB3 (24-bit RGB 8-8-8) 240x320: OK [ 466.018352] [U] [ 466.552070] [U] Video Capture: Captured 8 buffers [ 466.828635] [U] AR15 (16-bit ARGB 1-5-5-5) 240x320 -> RGBP (16-bit RGB 5-6-5) 240x320: OK [ 469.335696] [U] [ 469.773367] [U] Video Capture: Captured 8 buffers [ 470.010331] [U] AR15 (16-bit ARGB 1-5-5-5) 240x320 -> AR15 (16-bit ARGB 1-5-5-5) 240x320: OK [ 472.487852] [U] [ 472.925831] [U] Video Capture: Captured 8 buffers [ 473.167824] [U] AR15 (16-bit ARGB 1-5-5-5) 240x320 -> AR12 (16-bit ARGB 4-4-4-4) 240x320: OK [ 475.552623] [U] [ 475.985703] [U] Video Capture: Captured 8 buffers [ 476.229768] [U] AR12 (16-bit ARGB 4-4-4-4) 1x1 -> BA24 (32-bit ARGB 8-8-8-8) 1x1: OK [ 478.654381] [U] [ 479.086506] [U] Video Capture: Captured 8 buffers [ 479.326295] [U] AR12 (16-bit ARGB 4-4-4-4) 1x1 -> RGB3 (24-bit RGB 8-8-8) 1x1: OK [ 481.714968] [U] [ 482.146937] [U] Video Capture: Captured 8 buffers [ 482.390623] [U] AR12 (16-bit ARGB 4-4-4-4) 1x1 -> RGBP (16-bit RGB 5-6-5) 1x1: OK [ 484.807477] [U] [ 485.238512] [U] Video Capture: Captured 8 buffers [ 485.477276] [U] AR12 (16-bit ARGB 4-4-4-4) 1x1 -> AR15 (16-bit ARGB 1-5-5-5) 1x1: OK [ 487.860325] [U] [ 488.292229] [U] Video Capture: Captured 8 buffers [ 488.533258] [U] AR12 (16-bit ARGB 4-4-4-4) 1x1 -> AR12 (16-bit ARGB 4-4-4-4) 1x1: OK [ 489.019563] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 489.515301] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 490.029317] [U] AR12 (16-bit ARGB 4-4-4-4) 2592x2592 -> BA24 (32-bit ARGB 8-8-8-8) 2592x2592: FAIL [ 490.556478] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 491.097922] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 491.688235] [U] AR12 (16-bit ARGB 4-4-4-4) 2592x2592 -> RGB3 (24-bit RGB 8-8-8) 2592x2592: FAIL [ 492.312625] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 492.957251] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 493.626205] [U] AR12 (16-bit ARGB 4-4-4-4) 2592x2592 -> RGBP (16-bit RGB 5-6-5) 2592x2592: FAIL [ 494.309810] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 494.997367] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 495.724499] [U] AR12 (16-bit ARGB 4-4-4-4) 2592x2592 -> AR15 (16-bit ARGB 1-5-5-5) 2592x2592: FAIL [ 496.490971] stm-dma2d 4002b000.dma2d: dma alloc of size 13438976 failed [ 497.282391] [U] fail: v4l2-test-buffers.cpp(1349): q.reqbufs(node, 2) [ 498.101859] [U] AR12 (16-bit ARGB 4-4-4-4) 2592x2592 -> AR12 (16-bit ARGB 4-4-4-4) 2592x2592: FAIL [ 502.390697] [U] [ 503.210399] [U] Video Capture: Captured 8 buffers [ 503.643633] [U] AR12 (16-bit ARGB 4-4-4-4) 240x320 -> BA24 (32-bit ARGB 8-8-8-8) 240x320: OK [ 507.747367] [U] [ 508.434468] [U] Video Capture: Captured 8 buffers [ 508.784910] [U] AR12 (16-bit ARGB 4-4-4-4) 240x320 -> RGB3 (24-bit RGB 8-8-8) 240x320: OK [ 512.102183] [U] [ 512.630437] [U] Video Capture: Captured 8 buffers [ 512.906497] [U] AR12 (16-bit ARGB 4-4-4-4) 240x320 -> RGBP (16-bit RGB 5-6-5) 240x320: OK [ 515.423391] [U] [ 515.863057] [U] Video Capture: Captured 8 buffers [ 516.100521] [U] AR12 (16-bit ARGB 4-4-4-4) 240x320 -> AR15 (16-bit ARGB 1-5-5-5) 240x320: OK [ 518.575789] [U] [ 519.013201] [U] Video Capture: Captured 8 buffers [ 519.256483] [U] AR12 (16-bit ARGB 4-4-4-4) 240x320 -> AR12 (16-bit ARGB 4-4-4-4) 240x320: OK [ 519.746238] [U] Total for stm-dma2d device /dev/video0: 121, Succeeded: 96, Failed: 25, Warnings: 0
*** BLURB HERE ***
Dillon Min (10):
media: admin-guide: add stm32-dma2d description
media: dt-bindings: media: add document for STM32 DMA2d bindings
ARM: dts: stm32: Add DMA2D support for STM32F429 series soc
ARM: dts: stm32: Enable DMA2D on STM32F469-DISCO board
media: v4l2-mem2mem: add v4l2_m2m_get_unmapped_area for no-mmu
platform
media: videobuf2: Fix the size printk format
media: v4l2-ctrls: Add V4L2_CID_COLORFX_CBCR max setting
media: v4l2-ctrls: Add RGB color effects control
clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after
system enter shell
media: stm32-dma2d: STM32 DMA2D driver
.../admin-guide/media/platform-cardlist.rst | 1 + .../devicetree/bindings/media/st,stm32-dma2d.yaml | 71 ++ Documentation/userspace-api/media/v4l/control.rst | 9 + arch/arm/boot/dts/stm32f429.dtsi | 10 + arch/arm/boot/dts/stm32f469-disco.dts | 4 + drivers/clk/clk-stm32f4.c | 4 - .../media/common/videobuf2/videobuf2-dma-contig.c | 8 +- drivers/media/platform/Kconfig | 12 + drivers/media/platform/Makefile | 1 + drivers/media/platform/stm32/Makefile | 2 + drivers/media/platform/stm32/dma2d/dma2d-hw.c | 143 ++++ drivers/media/platform/stm32/dma2d/dma2d-regs.h | 113 ++++ drivers/media/platform/stm32/dma2d/dma2d.c | 739 +++++++++++++++++++++ drivers/media/platform/stm32/dma2d/dma2d.h | 135 ++++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 12 +- drivers/media/v4l2-core/v4l2-mem2mem.c | 21 + include/media/v4l2-mem2mem.h | 5 + include/uapi/linux/v4l2-controls.h | 4 +- 18 files changed, 1283 insertions(+), 11 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/st,stm32-dma2d.yaml create mode 100644 drivers/media/platform/stm32/dma2d/dma2d-hw.c create mode 100644 drivers/media/platform/stm32/dma2d/dma2d-regs.h create mode 100644 drivers/media/platform/stm32/dma2d/dma2d.c create mode 100644 drivers/media/platform/stm32/dma2d/dma2d.h
Signature · 1 line
2.7.4
PATCH v7 1/10 media: admin-guide: add stm32-dma2d description
add stm32-dma2d description for dma2d driver
--- Documentation/admin-guide/media/platform-cardlist.rst | 1 + 1 file changed, 1 insertion(+)
Documentation/admin-guide/media/platform-cardlist.rst +1 -0
@@ -60,6 +60,7 @@ s5p-mfc Samsung S5P MFC Video Codec sh_veu SuperH VEU mem2mem video processing sh_vou SuperH VOU video output stm32-dcmi STM32 Digital Camera Memory Interface (DCMI) +stm32-dma2d STM32 Chrom-Art Accelerator Unit sun4i-csi Allwinner A10 CMOS Sensor Interface Support sun6i-csi Allwinner V3s Camera Sensor Interface sun8i-di Allwinner Deinterlace
Signature · 1 line
2.7.4
PATCH v7 2/10 media: dt-bindings: media: add document for STM32 DMA2d bindings
In reply to Dillon MinThis adds documentation of device tree bindings for the STM32 DMA2D
--- .../devicetree/bindings/media/st,stm32-dma2d.yaml | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/st,stm32-dma2d.yaml
Documentation/devicetree/bindings/media/st,stm32-dma2d.yaml new file +71 -0
@@ -0,0 +1,71 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/st,stm32-dma2d.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STM32 Chrom-Art Accelerator DMA2D binding + +description: + Chrom-ART Accelerator(DMA2D), graphical hardware accelerator + enabling enhanced graphical user interface with minimum CPU load + + It can perform the following operations. + + - Filling a part or the whole of a destination image with a specific color. + - Copying a part or the whole of a source image into a part or the whole of + a destination image. + - Copying a part or the whole of a source image into a part or the whole of + a destination image with a pixel format conversion. + - Blending a part and/or two complete source images with different pixel + format and copy the result into a part or the whole of a destination image + with a different color format. (TODO) + + +maintainers: + - Dillon Min <[email protected]> + +properties: + compatible: + const: st,stm32-dma2d + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: dma2d + + resets: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - resets + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/stm32fx-clock.h> + #include <dt-bindings/mfd/stm32f4-rcc.h> + dma2d: dma2d(a)4002b000 { + compatible = "st,stm32-dma2d"; + reg = <0x4002b000 0xc00>; + interrupts = <90>; + resets = <&rcc STM32F4_AHB1_RESET(DMA2D)>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(DMA2D)>; + clock-names = "dma2d"; + }; + +...
Signature · 1 line
2.7.4
PATCH v7 3/10 ARM: dts: stm32: Add DMA2D support for STM32F429 series soc
In reply to Dillon MinAdd DMA2D for STM32F429 series soc.
--- arch/arm/boot/dts/stm32f429.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/stm32f429.dtsi +10 -0
@@ -743,6 +743,16 @@ st,mem2mem; }; + dma2d: dma2d(a)4002b000 { + compatible = "st,stm32-dma2d"; + reg = <0x4002b000 0xc00>; + interrupts = <90>; + resets = <&rcc STM32F4_AHB1_RESET(DMA2D)>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(DMA2D)>; + clock-names = "dma2d"; + status = "disabled"; + }; + mac: ethernet(a)40028000 { compatible = "st,stm32-dwmac", "snps,dwmac-3.50a"; reg = <0x40028000 0x8000>;
Signature · 1 line
2.7.4
PATCH v7 4/10 ARM: dts: stm32: Enable DMA2D on STM32F469-DISCO board
In reply to Dillon MinEnable DMA2D on STM32F469-DISCO board.
--- arch/arm/boot/dts/stm32f469-disco.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/stm32f469-disco.dts +4 -0
@@ -132,6 +132,10 @@ clock-frequency = <8000000>; }; +&dma2d { + status = "okay"; +}; + &dsi { #address-cells = <1>; #size-cells = <0>;
Signature · 1 line
2.7.4
PATCH v7 5/10 media: v4l2-mem2mem: add v4l2_m2m_get_unmapped_area for no-mmu platform
In reply to Dillon MinFor platforms without MMU the m2m provides a helper method v4l2_m2m_get_unmapped_area(), The mmap() routines will call this to get a proposed address for the mapping.
More detailed information about get_unmapped_area can be found in Documentation/nommu-mmap.txt
--- drivers/media/v4l2-core/v4l2-mem2mem.c | 21 +++++++++++++++++++++ include/media/v4l2-mem2mem.h | 5 +++++ 2 files changed, 26 insertions(+)
drivers/media/v4l2-core/v4l2-mem2mem.c +21 -0
@@ -966,6 +966,27 @@ int v4l2_m2m_mmap(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, }EXPORT_SYMBOL (v4l2_m2m_mmap); +#ifndef CONFIG_MMU +unsigned long v4l2_m2m_get_unmapped_area (struct file *file,unsigned long addr, +unsigned long len,unsigned long pgoff, +unsigned long flags) +{ +struct v4l2_fh *fh = file->private_data; +unsigned long offset = pgoff <<PAGE_SHIFT ; +struct vb2_queue *vq; + +if (offset <DST_QUEUE_OFF_BASE ) { + vq =v4l2_m2m_get_src_vq (fh->m2m_ctx); + }else { + vq =v4l2_m2m_get_dst_vq (fh->m2m_ctx); + pgoff -= (DST_QUEUE_OFF_BASE >>PAGE_SHIFT ); + } + +return vb2_get_unmapped_area (vq, addr, len, pgoff, flags); +} +EXPORT_SYMBOL_GPL (v4l2_m2m_get_unmapped_area); +#endif +#if defined(CONFIG_MEDIA_CONTROLLER )void v4l2_m2m_unregister_media_controller (struct v4l2_m2m_dev *m2m_dev) {
include/media/v4l2-mem2mem.h +5 -0
@@ -495,6 +495,11 @@ __poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,int v4l2_m2m_mmap (struct file *file,struct v4l2_m2m_ctx *m2m_ctx,struct vm_area_struct *vma); +#ifndef CONFIG_MMU +unsigned long v4l2_m2m_get_unmapped_area (struct file *file,unsigned long addr, +unsigned long len,unsigned long pgoff, +unsigned long flags); +#endif /** * v4l2_m2m_init() - initialize per-driver m2m data *
Signature · 1 line
2.7.4
PATCH v7 6/10 media: videobuf2: Fix the size printk format
In reply to Dillon MinSince the type of parameter size is unsigned long, it should printk by %lu, instead of %ld, fix it.
--- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/common/videobuf2/videobuf2-dma-contig.c +4 -4
@@ -257,7 +257,7 @@ static void *vb2_dc_alloc(struct vb2_buffer *vb, ret =vb2_dc_alloc_coherent (buf);if (ret) { -dev_err (dev,"dma alloc of size %ld failed\n" , size); +dev_err (dev,"dma alloc of size %lu failed\n" , size);kfree (buf);return ERR_PTR (-ENOMEM ); }
@@ -298,9 +298,9 @@ static int vb2_dc_mmap(void *buf_priv, struct vm_area_struct *vma) vma->vm_ops->open (vma); -pr_debug ("%s: mapped dma addr 0x%08lx at 0x%08lx, size %ld\n" , - __func__, (unsigned long )buf->dma_addr, vma->vm_start, - buf->size); +pr_debug ("%s: mapped dma addr 0x%08lx at 0x%08lx, size %lu\n" , + __func__, (unsigned long )buf->dma_addr, vma->vm_start, + buf->size);return 0 ; }
Signature · 1 line
2.7.4
PATCH v7 7/10 media: v4l2-ctrls: Add V4L2_CID_COLORFX_CBCR max setting
In reply to Dillon MinThe max of V4L2_CID_COLORFX_CBCR is 0xffff, so add it to v4l2_ctrl_fill() to sure not beyond that.
--- drivers/media/v4l2-core/v4l2-ctrls-defs.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/media/v4l2-core/v4l2-ctrls-defs.c +6 -0
@@ -1400,6 +1400,12 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,/* Max is calculated as RGB888 that is 2^24 */ *max =0xFFFFFF ;break ; +case V4L2_CID_COLORFX_CBCR : + *type =V4L2_CTRL_TYPE_INTEGER ; + *step =1 ; + *min =0 ; + *max =0xffff ; +break ;case V4L2_CID_FLASH_FAULT :case V4L2_CID_JPEG_ACTIVE_MARKER :case V4L2_CID_3A_LOCK :
Signature · 1 line
2.7.4
PATCH v7 8/10 media: v4l2-ctrls: Add RGB color effects control
In reply to Dillon MinAdd V4L2_COLORFX_SET_RGB color effects control, V4L2_CID_COLORFX_RGB for RGB color setting.
with two mirror changes:
- change 0xFFFFFF to 0xffffff
- fix comments 2^24 to 2^24 - 1
--- Documentation/userspace-api/media/v4l/control.rst | 9 +++++++++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 6 ++++-- include/uapi/linux/v4l2-controls.h | 4 +++- 3 files changed, 16 insertions(+), 3 deletions(-)
Documentation/userspace-api/media/v4l/control.rst +9 -0
@@ -242,8 +242,17 @@ Control IDs * - ``V4L2_COLORFX_SET_CBCR`` - The Cb and Cr chroma components are replaced by fixed coefficients determined by ``V4L2_CID_COLORFX_CBCR`` control. + * - ``V4L2_COLORFX_SET_RGB`` + - The RGB components are replaced by the fixed RGB components determined + by ``V4L2_CID_COLORFX_RGB`` control. +``V4L2_CID_COLORFX_RGB`` ``(integer)`` + Determines the Red, Green, and Blue coefficients for + ``V4L2_COLORFX_SET_RGB`` color effect. + Bits [7:0] of the supplied 32 bit value are interpreted as Blue component, + bits [15:8] as Green component, bits [23:16] as Red component, and + bits [31:24] must be zero. ``V4L2_CID_COLORFX_CBCR`` ``(integer)`` Determines the Cb and Cr coefficients for ``V4L2_COLORFX_SET_CBCR``
drivers/media/v4l2-core/v4l2-ctrls-defs.c +4 -2
@@ -785,6 +785,7 @@ const char *v4l2_ctrl_get_name(u32 id)case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT :return "Min Number of Output Buffers" ;case V4L2_CID_ALPHA_COMPONENT :return "Alpha Component" ;case V4L2_CID_COLORFX_CBCR :return "Color Effects, CbCr" ; +case V4L2_CID_COLORFX_RGB :return "Color Effects, RGB" ;/* * Codec controls
@@ -1394,11 +1395,12 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, *min = *max = *step = *def =0 ;break ;case V4L2_CID_BG_COLOR : +case V4L2_CID_COLORFX_RGB : *type =V4L2_CTRL_TYPE_INTEGER ; *step =1 ; *min =0 ; -/* Max is calculated as RGB888 that is 2^24 */ - *max =0xFFFFFF ; +/* Max is calculated as RGB888 that is 2^24 - 1 */ + *max =0xffffff ;break ;case V4L2_CID_COLORFX_CBCR : *type =V4L2_CTRL_TYPE_INTEGER ;
include/uapi/linux/v4l2-controls.h +3 -1
@@ -128,6 +128,7 @@ enum v4l2_colorfx {V4L2_COLORFX_SOLARIZATION =13 ,V4L2_COLORFX_ANTIQUE =14 ,V4L2_COLORFX_SET_CBCR =15 , + V4L2_COLORFX_SET_RGB = 16, };#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
@@ -145,9 +146,10 @@ enum v4l2_colorfx {#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42) +#define V4L2_CID_COLORFX_RGB (V4L2_CID_BASE + 43)/* last CID + 1 */ -#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43) +#define V4L2_CID_LASTP1 (V4L2_CID_BASE + 44)/* USER-class private control IDs */
Signature · 1 line
2.7.4
PATCH v7 9/10 clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell
In reply to Dillon Minstm32's clk driver register two ltdc gate clk to clk core by clk_hw_register_gate() and clk_hw_register_composite()
first: 'stm32f429_gates[]', clk name is 'ltdc', which no user to use.
second: 'stm32f429_aux_clk[]', clk name is 'lcd-tft', used by ltdc driver
both of them point to the same offset of stm32's RCC register. after kernel enter console, clk core turn off ltdc's clk as 'stm32f429_gates[]' is no one to use. but, actually 'stm32f429_aux_clk[]' is in use.
stm32f469/746/769 have the same issue, fix it.
---
v7:
- collect acked-by, reviewed-by from Gabriel, Patrice.
drivers/clk/clk-stm32f4.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/clk/clk-stm32f4.c +0 -4
@@ -129,7 +129,6 @@ static const struct stm32f4_gate_data stm32f429_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 20, "spi5", "apb2_div" }, { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, }; static const struct stm32f4_gate_data stm32f469_gates[] __initconst = {
@@ -211,7 +210,6 @@ static const struct stm32f4_gate_data stm32f469_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 20, "spi5", "apb2_div" }, { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, }; static const struct stm32f4_gate_data stm32f746_gates[] __initconst = {
@@ -286,7 +284,6 @@ static const struct stm32f4_gate_data stm32f746_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, { STM32F4_RCC_APB2ENR, 23, "sai2", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, }; static const struct stm32f4_gate_data stm32f769_gates[] __initconst = {
@@ -364,7 +361,6 @@ static const struct stm32f4_gate_data stm32f769_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, { STM32F4_RCC_APB2ENR, 23, "sai2", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, { STM32F4_RCC_APB2ENR, 30, "mdio", "apb2_div" }, };
Signature · 1 line
2.7.4
Re: [PATCH v7 09/10] clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell
Hi Stephen
Would you pick up this patch? Thanks.
Best Regards.
Dillon
Quoted 66 lines · Dillon Min
stm32's clk driver register two ltdc gate clk to clk core by
clk_hw_register_gate()andclk_hw_register_composite()first: 'stm32f429_gates[]', clk name is 'ltdc', which no user to use.
second: 'stm32f429_aux_clk[]', clk name is 'lcd-tft', used by ltdc driverboth of them point to the same offset of stm32's RCC register. after kernel enter console, clk core turn off ltdc's clk as 'stm32f429_gates[]' is no one to use. but, actually 'stm32f429_aux_clk[]' is in use.
stm32f469/746/769 have the same issue, fix it.
Fixes daf2d117cbca ("clk: stm32f4: Add lcd-tft clock")Link https://lore.kernel.org/lkml/CAPTRvHkf0cK_4ZidM17rPo99gWDmxgqFt4CDUjqFFwkOeQeFDg(a)mail.gmail.com/Signed-off-by Dillon Min <[email protected]>Reviewed-by Patrice Chotard <[email protected]>Acked-by Stephen Boyd <[email protected]>---
v7:
- collect acked-by, reviewed-by from Gabriel, Patrice.drivers/clk/clk-stm32f4.c | 4 ---- 1 file changed, 4 deletions(-)drivers/clk/clk-stm32f4.c +0
-5@@ -129,7 +129,6 @@ static const struct stm32f4_gate_data stm32f429_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 20, "spi5", "apb2_div" }, { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, }; static const struct stm32f4_gate_data stm32f469_gates[] __initconst = {@@ -211,7 +210,6 @@ static const struct stm32f4_gate_data stm32f469_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 20, "spi5", "apb2_div" }, { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, }; static const struct stm32f4_gate_data stm32f746_gates[] __initconst = {@@ -286,7 +284,6 @@ static const struct stm32f4_gate_data stm32f746_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, { STM32F4_RCC_APB2ENR, 23, "sai2", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, }; static const struct stm32f4_gate_data stm32f769_gates[] __initconst = {@@ -364,7 +361,6 @@ static const struct stm32f4_gate_data stm32f769_gates[] __initconst = { { STM32F4_RCC_APB2ENR, 21, "spi6", "apb2_div" }, { STM32F4_RCC_APB2ENR, 22, "sai1", "apb2_div" }, { STM32F4_RCC_APB2ENR, 23, "sai2", "apb2_div" }, - { STM32F4_RCC_APB2ENR, 26, "ltdc", "apb2_div" }, { STM32F4_RCC_APB2ENR, 30, "mdio", "apb2_div" }, }; --2.7.4
Stephen Boyd
maintainerRe: [PATCH v7 09/10] clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell
Quoting Dillon Min (2021-11-11 18:40:09)
Quoted 4 lines
Hi Stephen
Would you pick up this patch? Thanks.
Ok.
Re: [PATCH v7 09/10] clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell
In reply to Dillon MinQuoting Dillon Min (2021-10-26 00:11:21)
Quoted 12 lines
stm32's clk driver register two ltdc gate clk to clk core by
clk_hw_register_gate()andclk_hw_register_composite()first: 'stm32f429_gates[]', clk name is 'ltdc', which no user to use.
second: 'stm32f429_aux_clk[]', clk name is 'lcd-tft', used by ltdc driverboth of them point to the same offset of stm32's RCC register. after kernel enter console, clk core turn off ltdc's clk as 'stm32f429_gates[]' is no one to use. but, actually 'stm32f429_aux_clk[]' is in use.
stm32f469/746/769 have the same issue, fix it.
Quoted 8 lines
Fixes daf2d117cbca ("clk: stm32f4: Add lcd-tft clock")Link https://lore.kernel.org/lkml/CAPTRvHkf0cK_4ZidM17rPo99gWDmxgqFt4CDUjqFFwkOeQeFDg(a)mail.gmail.com/Signed-off-by Dillon Min <[email protected]>Reviewed-by Patrice Chotard <[email protected]>Acked-by Stephen Boyd <[email protected]>---
Applied to clk-next
PATCH v7 10/10 media: stm32-dma2d: STM32 DMA2D driver
In reply to Dillon MinThis V4L2 subdev m2m driver enables Chrom-Art Accelerator unit of STMicroelectronics STM32 SoC series.
Currently support r2m, m2m, m2m_pfc functions.
- r2m, Filling a part or the whole of a destination image with a specific color.
- m2m, Copying a part or the whole of a source image into a part or the whole of a destination.
- m2m_pfc, Copying a part or the whole of a source image into a part or the whole of a destination image with a pixel format conversion.
---
v7:
- fix compile test reported by lkp(a)intel.com, thanks.
drivers/media/platform/Kconfig | 12 + drivers/media/platform/Makefile | 1 + drivers/media/platform/stm32/Makefile | 2 + drivers/media/platform/stm32/dma2d/dma2d-hw.c | 143 +++++ drivers/media/platform/stm32/dma2d/dma2d-regs.h | 113 ++++ drivers/media/platform/stm32/dma2d/dma2d.c | 739 ++++++++++++++++++++++++ drivers/media/platform/stm32/dma2d/dma2d.h | 135 +++++ 7 files changed, 1145 insertions(+) create mode 100644 drivers/media/platform/stm32/dma2d/dma2d-hw.c create mode 100644 drivers/media/platform/stm32/dma2d/dma2d-regs.h create mode 100644 drivers/media/platform/stm32/dma2d/dma2d.c create mode 100644 drivers/media/platform/stm32/dma2d/dma2d.h
drivers/media/platform/Kconfig +12 -0
@@ -476,6 +476,18 @@ config VIDEO_STI_DELTA_DRIVER endif # VIDEO_STI_DELTA +config VIDEO_STM32_DMA2D + tristate "STM32 Chrom-Art Accelerator (DMA2D)" + depends on VIDEO_DEV && VIDEO_V4L2 + depends on ARCH_STM32 || COMPILE_TEST + select VIDEOBUF2_DMA_CONTIG + select V4L2_MEM2MEM_DEV + help + Enables DMA2D hwarware support on stm32. + + The STM32 DMA2D is a memory-to-memory engine for pixel conversion + and specialized DMA dedicated to image manipulation. + config VIDEO_RENESAS_FDP1 tristate "Renesas Fine Display Processor" depends on VIDEO_DEV && VIDEO_V4L2
drivers/media/platform/Makefile +1 -0
@@ -70,6 +70,7 @@ obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel/ obj-$(CONFIG_VIDEO_ATMEL_XISC) += atmel/ obj-$(CONFIG_VIDEO_STM32_DCMI) += stm32/ +obj-$(CONFIG_VIDEO_STM32_DMA2D) += stm32/ obj-$(CONFIG_VIDEO_MEDIATEK_VPU) += mtk-vpu/
drivers/media/platform/stm32/Makefile +2 -0
@@ -1,2 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_VIDEO_STM32_DCMI) += stm32-dcmi.o +stm32-dma2d-objs := dma2d/dma2d.o dma2d/dma2d-hw.o +obj-$(CONFIG_VIDEO_STM32_DMA2D) += stm32-dma2d.o
drivers/media/platform/stm32/dma2d/dma2d-hw.c new file +143 -0
143 lines not on this page · raw message
drivers/media/platform/stm32/dma2d/dma2d-regs.h new file +113 -0
113 lines not on this page · raw message
drivers/media/platform/stm32/dma2d/dma2d.c new file +739 -0
739 lines not on this page · raw message
drivers/media/platform/stm32/dma2d/dma2d.h new file +135 -0
135 lines not on this page · raw message
Signature · 1 line
2.7.4
Alexandre TORGUE
maintainerHi Dillon
Quoted 8 lines · Dillon Min
This patchset introduces a basic support for DMA2D Interface of STMicroelectronics STM32 SoC series.
This first basic support implements R2M, M2M,
M2M_PFCM2M_BLENDsupport will be added later on.This has been tested on STM32469-DISCO board.
...
ARM DT patches ([3][4]) applied on stm32-next.
Thanks
Alex