linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] Add AMD ISP4 driver
@ 2025-08-28  8:45 Bin Du
  2025-08-28 16:56 ` Laurent Pinchart
  2025-08-31 13:41 ` Alexey Zagorodnikov
  0 siblings, 2 replies; 10+ messages in thread
From: Bin Du @ 2025-08-28  8:45 UTC (permalink / raw)
  To: mchehab, hverkuil, laurent.pinchart+renesas, bryan.odonoghue,
	sakari.ailus, prabhakar.mahadev-lad.rj, linux-media, linux-kernel,
	sultan
  Cc: pratap.nirujogi, benjamin.chan, king.li, gjorgji.rosikopulos,
	Phil.Jawich, Dominic.Antony, mario.limonciello, richard.gong,
	anson.tsao, bin.du, Bin Du

Hello,

AMD ISP4 is the AMD image processing gen 4 which can be found in HP ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
(https://ubuntu.com/certified/202411-36043)
This patch series introduces the initial driver support for the AMD ISP4.

Patch summary:
- Powers up/off and initializes ISP HW
- Configures and kicks off ISP FW
- Interacts with APP using standard V4l2 interface by video node
- Controls ISP HW and interacts with ISP FW to do image processing
- Support enum/set output image format and resolution
- Support queueing buffer from app and dequeueing ISP filled buffer to App
- It supports libcamera ver0.2 SimplePipeline
- It is verified on qv4l2, cheese and qcam
- It is verified together with following patches
	platform/x86: Add AMD ISP platform config (https://lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
	pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https://github.com/torvalds/linux/commit/e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
	drm/amd/amdgpu: Add GPIO resources required for amdisp (https://gitlab.freedesktop.org/agd5f/linux/-/commit/ad0f5966ed8297aa47b3184192b00b7379ae0758)

AMD ISP4 Key features:
- Processes bayer raw data from the connected sensor and output them to different YUV formats
- Downscale input image to different output image resolution
- Pipeline to do image processing on the input image including demosaic, denoise, 3A, etc

----------

Changes v2 -> v3:

- All the dependent patches in other modules (drm/amd/amdgpu, platform/x86, pinctrl/amd) merged on upstream mainline kernel (https://github.com/torvalds/linux) v6.17.
- Removed usage of amdgpu structs in ISP driver. Added helper functions in amdgpu accepting opaque params from ISP driver to allocate and release ISP GART buffers.
- Moved sensor and MIPI phy control entirely into ISP FW instead of the previous hybrid approach controlling sensor from both FW and x86 (sensor driver).
- Removed phy configuration and sensor binding as x86 (sensor driver) had relinquished the sensor control for ISP FW. With this approach the driver will be exposed as web camera like interface.
- New FW with built-in sensor driver is submitted on upstream linux-firmware repo (https://gitlab.com/kernel-firmware/linux-firmware/).
- Please note the new FW submitted is not directly compatible with OEM Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/tree/4.0) and the previous ISP V2 patch series.
- If intend to use the new FW, please rebuild OEM ISP4.0 Kernel with CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
- Included critical fixes from Sultan Alsawaf branch (https://github.com/kerneltoast/kernel_x86_laptop.git) related to managing lifetime of isp buffers.
      media: amd: isp4: Add missing refcount tracking to mmap memop
      media: amd: isp4: Don't put or unmap the dmabuf when detaching
      media: amd: isp4: Don't increment refcount when dmabuf export fails
      media: amd: isp4: Fix possible use-after-free in isp4vid_vb2_put()
      media: amd: isp4: Always export a new dmabuf from get_dmabuf memop
      media: amd: isp4: Fix implicit dmabuf lifetime tracking
      media: amd: isp4: Fix possible use-after-free when putting implicit dmabuf
      media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
      media: amd: isp4: Move up buf->vaddr check in isp4vid_get_dmabuf()
      media: amd: isp4: Remove unused userptr memops
      media: amd: isp4: Add missing cleanup on error in isp4vid_vb2_alloc()
      media: amd: isp4: Release queued buffers on error in start_streaming
- Addressed all code related upstream comments
- Fix typo errors and other cosmetic issue.


Changes v1 -> v2:

- Fix media CI test errors and valid warnings
- Reduce patch number in the series from 9 to 8 by merging MAINTAINERS adding patch to the first patch
- In patch 5
	- do modification to use remote endpoint instead of local endpoint
	- use link frequency and port number as start phy parameter instead of extra added phy-id and phy-bit-rate property of endpoint

----------

It passes v4l2 compliance test, the test reports for:

(a) amd_isp_capture device /dev/video0

Compliance test for amd_isp_capture device /dev/video0:
-------------------------------------------------------

atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17

Compliance test for amd_isp_capture device /dev/video0:

Driver Info:
        Driver name      : amd_isp_capture
        Card type        : amd_isp_capture
        Bus info         : platform:amd_isp_capture
        Driver version   : 6.14.0
        Capabilities     : 0xa4200001
                Video Capture
                I/O MC
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x24200001
                Video Capture
                I/O MC
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : amd_isp_capture
        Model            : amd_isp41_mdev
        Serial           :
        Bus info         : platform:amd_isp_capture
        Media version    : 6.14.0
        Hardware revision: 0x00000000 (0)
        Driver version   : 6.14.0
Interface Info:
        ID               : 0x03000005
        Type             : V4L Video
Entity Info:
        ID               : 0x00000003 (3)
        Name             : Preview
        Function         : V4L2 I/O
        Pad 0x01000004   : 0: Sink
          Link 0x02000007: from remote pad 0x1000002 of entity 'amd isp4' (Image Signal Processor): Data, Enabled, Immutable

Required ioctls:
        test MC information (see 'Media Driver Info' above): OK
        test VIDIOC_QUERYCAP: OK
        test invalid ioctls: OK

Allow for multiple opens:
        test second /dev/video0 open: OK
        test VIDIOC_QUERYCAP: OK
        test VIDIOC_G/S_PRIORITY: OK
        test for unlimited opens: OK

Debug ioctls:
        test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
        test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
        test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
        test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
        test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
        test VIDIOC_ENUMAUDIO: OK (Not Supported)
        test VIDIOC_G/S/ENUMINPUT: OK
        test VIDIOC_G/S_AUDIO: OK (Not Supported)
        Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
        test VIDIOC_G/S_MODULATOR: OK (Not Supported)
        test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
        test VIDIOC_ENUMAUDOUT: OK (Not Supported)
        test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
        test VIDIOC_G/S_AUDOUT: OK (Not Supported)
        Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
        test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
        test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
        test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
        test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls (Input 0):
        test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
        test VIDIOC_QUERYCTRL: OK (Not Supported)
        test VIDIOC_G/S_CTRL: OK (Not Supported)
        test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
        test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
        test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
        Standard Controls: 0 Private Controls: 0

Format ioctls (Input 0):
        test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
        test VIDIOC_G/S_PARM: OK
        test VIDIOC_G_FBUF: OK (Not Supported)
        test VIDIOC_G_FMT: OK
        test VIDIOC_TRY_FMT: OK
        test VIDIOC_S_FMT: OK
        test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
        test Cropping: OK (Not Supported)
        test Composing: OK (Not Supported)
        test Scaling: OK (Not Supported)

Codec ioctls (Input 0):
        test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
        test VIDIOC_G_ENC_INDEX: OK (Not Supported)
        test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls (Input 0):
        test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
        test CREATE_BUFS maximum buffers: OK
        test VIDIOC_REMOVE_BUFS: OK
        test VIDIOC_EXPBUF: OK
        test Requests: OK (Not Supported)
        test blocking wait: OK

Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0

Please review and provide feedback.

Many thanks,

Bin Du (7):
  media: platform: amd: Introduce amd isp4 capture driver
  media: platform: amd: low level support for isp4 firmware
  media: platform: amd: Add isp4 fw and hw interface
  media: platform: amd: isp4 subdev and firmware loading handling added
  media: platform: amd: isp4 video node and buffers handling added
  media: platform: amd: isp4 debug fs logging and  more descriptive
    errors
  Documentation: add documentation of AMD isp 4 driver

 Documentation/admin-guide/media/amdisp4-1.rst |   66 +
 Documentation/admin-guide/media/amdisp4.dot   |    8 +
 .../admin-guide/media/v4l-drivers.rst         |    1 +
 MAINTAINERS                                   |   25 +
 drivers/media/platform/Kconfig                |    1 +
 drivers/media/platform/Makefile               |    1 +
 drivers/media/platform/amd/Kconfig            |    3 +
 drivers/media/platform/amd/Makefile           |    3 +
 drivers/media/platform/amd/isp4/Kconfig       |   13 +
 drivers/media/platform/amd/isp4/Makefile      |   10 +
 drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
 drivers/media/platform/amd/isp4/isp4.h        |   26 +
 drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
 drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
 .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
 drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
 .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
 .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
 drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++++++
 drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
 drivers/media/platform/amd/isp4/isp4_video.c  | 1213 +++++++++++++++++
 drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
 22 files changed, 4898 insertions(+)
 create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
 create mode 100644 Documentation/admin-guide/media/amdisp4.dot
 create mode 100644 drivers/media/platform/amd/Kconfig
 create mode 100644 drivers/media/platform/amd/Makefile
 create mode 100644 drivers/media/platform/amd/isp4/Kconfig
 create mode 100644 drivers/media/platform/amd/isp4/Makefile
 create mode 100644 drivers/media/platform/amd/isp4/isp4.c
 create mode 100644 drivers/media/platform/amd/isp4/isp4.h
 create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
 create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
 create mode 100644 drivers/media/platform/amd/isp4/isp4_fw_cmd_resp.h
 create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
 create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
 create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
 create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
 create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
 create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
 create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] Add AMD ISP4 driver
  2025-08-28  8:45 [PATCH v3 0/7] Add AMD ISP4 driver Bin Du
@ 2025-08-28 16:56 ` Laurent Pinchart
  2025-08-28 16:58   ` Limonciello, Mario
  2025-08-28 16:58   ` Laurent Pinchart
  2025-08-31 13:41 ` Alexey Zagorodnikov
  1 sibling, 2 replies; 10+ messages in thread
From: Laurent Pinchart @ 2025-08-28 16:56 UTC (permalink / raw)
  To: Bin Du
  Cc: mchehab, hverkuil, bryan.odonoghue, sakari.ailus,
	prabhakar.mahadev-lad.rj, linux-media, linux-kernel, sultan,
	pratap.nirujogi, benjamin.chan, king.li, gjorgji.rosikopulos,
	Phil.Jawich, Dominic.Antony, mario.limonciello, richard.gong,
	anson.tsao

Hi Bin Bu,

Have you sent out the cover letter only ? I haven't received the rest of
the series, and it's not found on lore.kernel.org either.

On Thu, Aug 28, 2025 at 04:45:00PM +0800, Bin Du wrote:
> Hello,
> 
> AMD ISP4 is the AMD image processing gen 4 which can be found in HP ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
> (https://ubuntu.com/certified/202411-36043)
> This patch series introduces the initial driver support for the AMD ISP4.
> 
> Patch summary:
> - Powers up/off and initializes ISP HW
> - Configures and kicks off ISP FW
> - Interacts with APP using standard V4l2 interface by video node
> - Controls ISP HW and interacts with ISP FW to do image processing
> - Support enum/set output image format and resolution
> - Support queueing buffer from app and dequeueing ISP filled buffer to App
> - It supports libcamera ver0.2 SimplePipeline
> - It is verified on qv4l2, cheese and qcam
> - It is verified together with following patches
> 	platform/x86: Add AMD ISP platform config (https://lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
> 	pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https://github.com/torvalds/linux/commit/e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
> 	drm/amd/amdgpu: Add GPIO resources required for amdisp (https://gitlab.freedesktop.org/agd5f/linux/-/commit/ad0f5966ed8297aa47b3184192b00b7379ae0758)
> 
> AMD ISP4 Key features:
> - Processes bayer raw data from the connected sensor and output them to different YUV formats
> - Downscale input image to different output image resolution
> - Pipeline to do image processing on the input image including demosaic, denoise, 3A, etc
> 
> ----------
> 
> Changes v2 -> v3:
> 
> - All the dependent patches in other modules (drm/amd/amdgpu, platform/x86, pinctrl/amd) merged on upstream mainline kernel (https://github.com/torvalds/linux) v6.17.
> - Removed usage of amdgpu structs in ISP driver. Added helper functions in amdgpu accepting opaque params from ISP driver to allocate and release ISP GART buffers.
> - Moved sensor and MIPI phy control entirely into ISP FW instead of the previous hybrid approach controlling sensor from both FW and x86 (sensor driver).
> - Removed phy configuration and sensor binding as x86 (sensor driver) had relinquished the sensor control for ISP FW. With this approach the driver will be exposed as web camera like interface.
> - New FW with built-in sensor driver is submitted on upstream linux-firmware repo (https://gitlab.com/kernel-firmware/linux-firmware/).
> - Please note the new FW submitted is not directly compatible with OEM Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/tree/4.0) and the previous ISP V2 patch series.
> - If intend to use the new FW, please rebuild OEM ISP4.0 Kernel with CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
> - Included critical fixes from Sultan Alsawaf branch (https://github.com/kerneltoast/kernel_x86_laptop.git) related to managing lifetime of isp buffers.
>       media: amd: isp4: Add missing refcount tracking to mmap memop
>       media: amd: isp4: Don't put or unmap the dmabuf when detaching
>       media: amd: isp4: Don't increment refcount when dmabuf export fails
>       media: amd: isp4: Fix possible use-after-free in isp4vid_vb2_put()
>       media: amd: isp4: Always export a new dmabuf from get_dmabuf memop
>       media: amd: isp4: Fix implicit dmabuf lifetime tracking
>       media: amd: isp4: Fix possible use-after-free when putting implicit dmabuf
>       media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
>       media: amd: isp4: Move up buf->vaddr check in isp4vid_get_dmabuf()
>       media: amd: isp4: Remove unused userptr memops
>       media: amd: isp4: Add missing cleanup on error in isp4vid_vb2_alloc()
>       media: amd: isp4: Release queued buffers on error in start_streaming
> - Addressed all code related upstream comments
> - Fix typo errors and other cosmetic issue.
> 
> 
> Changes v1 -> v2:
> 
> - Fix media CI test errors and valid warnings
> - Reduce patch number in the series from 9 to 8 by merging MAINTAINERS adding patch to the first patch
> - In patch 5
> 	- do modification to use remote endpoint instead of local endpoint
> 	- use link frequency and port number as start phy parameter instead of extra added phy-id and phy-bit-rate property of endpoint
> 
> ----------
> 
> It passes v4l2 compliance test, the test reports for:
> 
> (a) amd_isp_capture device /dev/video0
> 
> Compliance test for amd_isp_capture device /dev/video0:
> -------------------------------------------------------
> 
> atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
> v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
> v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17
> 
> Compliance test for amd_isp_capture device /dev/video0:
> 
> Driver Info:
>         Driver name      : amd_isp_capture
>         Card type        : amd_isp_capture
>         Bus info         : platform:amd_isp_capture
>         Driver version   : 6.14.0
>         Capabilities     : 0xa4200001
>                 Video Capture
>                 I/O MC
>                 Streaming
>                 Extended Pix Format
>                 Device Capabilities
>         Device Caps      : 0x24200001
>                 Video Capture
>                 I/O MC
>                 Streaming
>                 Extended Pix Format
> Media Driver Info:
>         Driver name      : amd_isp_capture
>         Model            : amd_isp41_mdev
>         Serial           :
>         Bus info         : platform:amd_isp_capture
>         Media version    : 6.14.0
>         Hardware revision: 0x00000000 (0)
>         Driver version   : 6.14.0
> Interface Info:
>         ID               : 0x03000005
>         Type             : V4L Video
> Entity Info:
>         ID               : 0x00000003 (3)
>         Name             : Preview
>         Function         : V4L2 I/O
>         Pad 0x01000004   : 0: Sink
>           Link 0x02000007: from remote pad 0x1000002 of entity 'amd isp4' (Image Signal Processor): Data, Enabled, Immutable
> 
> Required ioctls:
>         test MC information (see 'Media Driver Info' above): OK
>         test VIDIOC_QUERYCAP: OK
>         test invalid ioctls: OK
> 
> Allow for multiple opens:
>         test second /dev/video0 open: OK
>         test VIDIOC_QUERYCAP: OK
>         test VIDIOC_G/S_PRIORITY: OK
>         test for unlimited opens: OK
> 
> Debug ioctls:
>         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>         test VIDIOC_LOG_STATUS: OK (Not Supported)
> 
> Input ioctls:
>         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>         test VIDIOC_ENUMAUDIO: OK (Not Supported)
>         test VIDIOC_G/S/ENUMINPUT: OK
>         test VIDIOC_G/S_AUDIO: OK (Not Supported)
>         Inputs: 1 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
>         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>         Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Input/Output configuration ioctls:
>         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>         test VIDIOC_G/S_EDID: OK (Not Supported)
> 
> Control ioctls (Input 0):
>         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
>         test VIDIOC_QUERYCTRL: OK (Not Supported)
>         test VIDIOC_G/S_CTRL: OK (Not Supported)
>         test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
>         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
>         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>         Standard Controls: 0 Private Controls: 0
> 
> Format ioctls (Input 0):
>         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>         test VIDIOC_G/S_PARM: OK
>         test VIDIOC_G_FBUF: OK (Not Supported)
>         test VIDIOC_G_FMT: OK
>         test VIDIOC_TRY_FMT: OK
>         test VIDIOC_S_FMT: OK
>         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>         test Cropping: OK (Not Supported)
>         test Composing: OK (Not Supported)
>         test Scaling: OK (Not Supported)
> 
> Codec ioctls (Input 0):
>         test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>         test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> 
> Buffer ioctls (Input 0):
>         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>         test CREATE_BUFS maximum buffers: OK
>         test VIDIOC_REMOVE_BUFS: OK
>         test VIDIOC_EXPBUF: OK
>         test Requests: OK (Not Supported)
>         test blocking wait: OK
> 
> Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0
> 
> Please review and provide feedback.
> 
> Many thanks,
> 
> Bin Du (7):
>   media: platform: amd: Introduce amd isp4 capture driver
>   media: platform: amd: low level support for isp4 firmware
>   media: platform: amd: Add isp4 fw and hw interface
>   media: platform: amd: isp4 subdev and firmware loading handling added
>   media: platform: amd: isp4 video node and buffers handling added
>   media: platform: amd: isp4 debug fs logging and  more descriptive
>     errors
>   Documentation: add documentation of AMD isp 4 driver
> 
>  Documentation/admin-guide/media/amdisp4-1.rst |   66 +
>  Documentation/admin-guide/media/amdisp4.dot   |    8 +
>  .../admin-guide/media/v4l-drivers.rst         |    1 +
>  MAINTAINERS                                   |   25 +
>  drivers/media/platform/Kconfig                |    1 +
>  drivers/media/platform/Makefile               |    1 +
>  drivers/media/platform/amd/Kconfig            |    3 +
>  drivers/media/platform/amd/Makefile           |    3 +
>  drivers/media/platform/amd/isp4/Kconfig       |   13 +
>  drivers/media/platform/amd/isp4/Makefile      |   10 +
>  drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
>  drivers/media/platform/amd/isp4/isp4.h        |   26 +
>  drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
>  drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
>  .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
>  drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
>  .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
>  .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
>  drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++++++
>  drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
>  drivers/media/platform/amd/isp4/isp4_video.c  | 1213 +++++++++++++++++
>  drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
>  22 files changed, 4898 insertions(+)
>  create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
>  create mode 100644 Documentation/admin-guide/media/amdisp4.dot
>  create mode 100644 drivers/media/platform/amd/Kconfig
>  create mode 100644 drivers/media/platform/amd/Makefile
>  create mode 100644 drivers/media/platform/amd/isp4/Kconfig
>  create mode 100644 drivers/media/platform/amd/isp4/Makefile
>  create mode 100644 drivers/media/platform/amd/isp4/isp4.c
>  create mode 100644 drivers/media/platform/amd/isp4/isp4.h
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_fw_cmd_resp.h
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
>  create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] Add AMD ISP4 driver
  2025-08-28 16:56 ` Laurent Pinchart
@ 2025-08-28 16:58   ` Limonciello, Mario
  2025-09-02  3:21     ` Du, Bin
  2025-08-28 16:58   ` Laurent Pinchart
  1 sibling, 1 reply; 10+ messages in thread
From: Limonciello, Mario @ 2025-08-28 16:58 UTC (permalink / raw)
  To: Laurent Pinchart, Du, Bin
  Cc: mchehab@kernel.org, hverkuil@xs4all.nl,
	bryan.odonoghue@linaro.org, sakari.ailus@linux.intel.com,
	prabhakar.mahadev-lad.rj@bp.renesas.com,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	sultan@kerneltoast.com, Nirujogi, Pratap,
	Chan, Benjamin (Koon Pan), Li, King, Rosikopulos, Gjorgji,
	Jawich, Phil, Antony, Dominic, Gong, Richard, Tsao, Anson

On 8/28/25 11:56 AM, Laurent Pinchart wrote:
> Hi Bin Bu,
> 
> Have you sent out the cover letter only ? I haven't received the rest of
> the series, and it's not found on lore.kernel.org either.

Something seems wrong with the cover letter threading to the series. 
Here's the rest of the series (which I did receive too).

https://lore.kernel.org/linux-media/20250828100811.95722-1-Bin.Du@amd.com/

> 
> On Thu, Aug 28, 2025 at 04:45:00PM +0800, Bin Du wrote:
>> Hello,
>>
>> AMD ISP4 is the AMD image processing gen 4 which can be found in HP ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
>> (https://ubuntu.com/certified/202411-36043)
>> This patch series introduces the initial driver support for the AMD ISP4.
>>
>> Patch summary:
>> - Powers up/off and initializes ISP HW
>> - Configures and kicks off ISP FW
>> - Interacts with APP using standard V4l2 interface by video node
>> - Controls ISP HW and interacts with ISP FW to do image processing
>> - Support enum/set output image format and resolution
>> - Support queueing buffer from app and dequeueing ISP filled buffer to App
>> - It supports libcamera ver0.2 SimplePipeline
>> - It is verified on qv4l2, cheese and qcam
>> - It is verified together with following patches
>> 	platform/x86: Add AMD ISP platform config (https://lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
>> 	pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https://github.com/torvalds/linux/commit/e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
>> 	drm/amd/amdgpu: Add GPIO resources required for amdisp (https://gitlab.freedesktop.org/agd5f/linux/-/commit/ad0f5966ed8297aa47b3184192b00b7379ae0758)
>>
>> AMD ISP4 Key features:
>> - Processes bayer raw data from the connected sensor and output them to different YUV formats
>> - Downscale input image to different output image resolution
>> - Pipeline to do image processing on the input image including demosaic, denoise, 3A, etc
>>
>> ----------
>>
>> Changes v2 -> v3:
>>
>> - All the dependent patches in other modules (drm/amd/amdgpu, platform/x86, pinctrl/amd) merged on upstream mainline kernel (https://github.com/torvalds/linux) v6.17.
>> - Removed usage of amdgpu structs in ISP driver. Added helper functions in amdgpu accepting opaque params from ISP driver to allocate and release ISP GART buffers.
>> - Moved sensor and MIPI phy control entirely into ISP FW instead of the previous hybrid approach controlling sensor from both FW and x86 (sensor driver).
>> - Removed phy configuration and sensor binding as x86 (sensor driver) had relinquished the sensor control for ISP FW. With this approach the driver will be exposed as web camera like interface.
>> - New FW with built-in sensor driver is submitted on upstream linux-firmware repo (https://gitlab.com/kernel-firmware/linux-firmware/).
>> - Please note the new FW submitted is not directly compatible with OEM Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/tree/4.0) and the previous ISP V2 patch series.
>> - If intend to use the new FW, please rebuild OEM ISP4.0 Kernel with CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
>> - Included critical fixes from Sultan Alsawaf branch (https://github.com/kerneltoast/kernel_x86_laptop.git) related to managing lifetime of isp buffers.
>>        media: amd: isp4: Add missing refcount tracking to mmap memop
>>        media: amd: isp4: Don't put or unmap the dmabuf when detaching
>>        media: amd: isp4: Don't increment refcount when dmabuf export fails
>>        media: amd: isp4: Fix possible use-after-free in isp4vid_vb2_put()
>>        media: amd: isp4: Always export a new dmabuf from get_dmabuf memop
>>        media: amd: isp4: Fix implicit dmabuf lifetime tracking
>>        media: amd: isp4: Fix possible use-after-free when putting implicit dmabuf
>>        media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
>>        media: amd: isp4: Move up buf->vaddr check in isp4vid_get_dmabuf()
>>        media: amd: isp4: Remove unused userptr memops
>>        media: amd: isp4: Add missing cleanup on error in isp4vid_vb2_alloc()
>>        media: amd: isp4: Release queued buffers on error in start_streaming
>> - Addressed all code related upstream comments
>> - Fix typo errors and other cosmetic issue.
>>
>>
>> Changes v1 -> v2:
>>
>> - Fix media CI test errors and valid warnings
>> - Reduce patch number in the series from 9 to 8 by merging MAINTAINERS adding patch to the first patch
>> - In patch 5
>> 	- do modification to use remote endpoint instead of local endpoint
>> 	- use link frequency and port number as start phy parameter instead of extra added phy-id and phy-bit-rate property of endpoint
>>
>> ----------
>>
>> It passes v4l2 compliance test, the test reports for:
>>
>> (a) amd_isp_capture device /dev/video0
>>
>> Compliance test for amd_isp_capture device /dev/video0:
>> -------------------------------------------------------
>>
>> atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
>> v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
>> v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17
>>
>> Compliance test for amd_isp_capture device /dev/video0:
>>
>> Driver Info:
>>          Driver name      : amd_isp_capture
>>          Card type        : amd_isp_capture
>>          Bus info         : platform:amd_isp_capture
>>          Driver version   : 6.14.0
>>          Capabilities     : 0xa4200001
>>                  Video Capture
>>                  I/O MC
>>                  Streaming
>>                  Extended Pix Format
>>                  Device Capabilities
>>          Device Caps      : 0x24200001
>>                  Video Capture
>>                  I/O MC
>>                  Streaming
>>                  Extended Pix Format
>> Media Driver Info:
>>          Driver name      : amd_isp_capture
>>          Model            : amd_isp41_mdev
>>          Serial           :
>>          Bus info         : platform:amd_isp_capture
>>          Media version    : 6.14.0
>>          Hardware revision: 0x00000000 (0)
>>          Driver version   : 6.14.0
>> Interface Info:
>>          ID               : 0x03000005
>>          Type             : V4L Video
>> Entity Info:
>>          ID               : 0x00000003 (3)
>>          Name             : Preview
>>          Function         : V4L2 I/O
>>          Pad 0x01000004   : 0: Sink
>>            Link 0x02000007: from remote pad 0x1000002 of entity 'amd isp4' (Image Signal Processor): Data, Enabled, Immutable
>>
>> Required ioctls:
>>          test MC information (see 'Media Driver Info' above): OK
>>          test VIDIOC_QUERYCAP: OK
>>          test invalid ioctls: OK
>>
>> Allow for multiple opens:
>>          test second /dev/video0 open: OK
>>          test VIDIOC_QUERYCAP: OK
>>          test VIDIOC_G/S_PRIORITY: OK
>>          test for unlimited opens: OK
>>
>> Debug ioctls:
>>          test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>>          test VIDIOC_LOG_STATUS: OK (Not Supported)
>>
>> Input ioctls:
>>          test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>          test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>>          test VIDIOC_ENUMAUDIO: OK (Not Supported)
>>          test VIDIOC_G/S/ENUMINPUT: OK
>>          test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>          Inputs: 1 Audio Inputs: 0 Tuners: 0
>>
>> Output ioctls:
>>          test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>          test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>>          test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>>          test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>>          Outputs: 0 Audio Outputs: 0 Modulators: 0
>>
>> Input/Output configuration ioctls:
>>          test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>>          test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>>          test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>>          test VIDIOC_G/S_EDID: OK (Not Supported)
>>
>> Control ioctls (Input 0):
>>          test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
>>          test VIDIOC_QUERYCTRL: OK (Not Supported)
>>          test VIDIOC_G/S_CTRL: OK (Not Supported)
>>          test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
>>          test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
>>          test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>          Standard Controls: 0 Private Controls: 0
>>
>> Format ioctls (Input 0):
>>          test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>>          test VIDIOC_G/S_PARM: OK
>>          test VIDIOC_G_FBUF: OK (Not Supported)
>>          test VIDIOC_G_FMT: OK
>>          test VIDIOC_TRY_FMT: OK
>>          test VIDIOC_S_FMT: OK
>>          test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>          test Cropping: OK (Not Supported)
>>          test Composing: OK (Not Supported)
>>          test Scaling: OK (Not Supported)
>>
>> Codec ioctls (Input 0):
>>          test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>>          test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>          test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>
>> Buffer ioctls (Input 0):
>>          test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>          test CREATE_BUFS maximum buffers: OK
>>          test VIDIOC_REMOVE_BUFS: OK
>>          test VIDIOC_EXPBUF: OK
>>          test Requests: OK (Not Supported)
>>          test blocking wait: OK
>>
>> Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0
>>
>> Please review and provide feedback.
>>
>> Many thanks,
>>
>> Bin Du (7):
>>    media: platform: amd: Introduce amd isp4 capture driver
>>    media: platform: amd: low level support for isp4 firmware
>>    media: platform: amd: Add isp4 fw and hw interface
>>    media: platform: amd: isp4 subdev and firmware loading handling added
>>    media: platform: amd: isp4 video node and buffers handling added
>>    media: platform: amd: isp4 debug fs logging and  more descriptive
>>      errors
>>    Documentation: add documentation of AMD isp 4 driver
>>
>>   Documentation/admin-guide/media/amdisp4-1.rst |   66 +
>>   Documentation/admin-guide/media/amdisp4.dot   |    8 +
>>   .../admin-guide/media/v4l-drivers.rst         |    1 +
>>   MAINTAINERS                                   |   25 +
>>   drivers/media/platform/Kconfig                |    1 +
>>   drivers/media/platform/Makefile               |    1 +
>>   drivers/media/platform/amd/Kconfig            |    3 +
>>   drivers/media/platform/amd/Makefile           |    3 +
>>   drivers/media/platform/amd/isp4/Kconfig       |   13 +
>>   drivers/media/platform/amd/isp4/Makefile      |   10 +
>>   drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
>>   drivers/media/platform/amd/isp4/isp4.h        |   26 +
>>   drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
>>   drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
>>   .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
>>   drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
>>   .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
>>   .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
>>   drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++++++
>>   drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
>>   drivers/media/platform/amd/isp4/isp4_video.c  | 1213 +++++++++++++++++
>>   drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
>>   22 files changed, 4898 insertions(+)
>>   create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
>>   create mode 100644 Documentation/admin-guide/media/amdisp4.dot
>>   create mode 100644 drivers/media/platform/amd/Kconfig
>>   create mode 100644 drivers/media/platform/amd/Makefile
>>   create mode 100644 drivers/media/platform/amd/isp4/Kconfig
>>   create mode 100644 drivers/media/platform/amd/isp4/Makefile
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_fw_cmd_resp.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] Add AMD ISP4 driver
  2025-08-28 16:56 ` Laurent Pinchart
  2025-08-28 16:58   ` Limonciello, Mario
@ 2025-08-28 16:58   ` Laurent Pinchart
  2025-09-02  3:39     ` Du, Bin
  1 sibling, 1 reply; 10+ messages in thread
From: Laurent Pinchart @ 2025-08-28 16:58 UTC (permalink / raw)
  To: Bin Du
  Cc: mchehab, hverkuil, bryan.odonoghue, sakari.ailus,
	prabhakar.mahadev-lad.rj, linux-media, linux-kernel, sultan,
	pratap.nirujogi, benjamin.chan, king.li, gjorgji.rosikopulos,
	Phil.Jawich, Dominic.Antony, mario.limonciello, richard.gong,
	anson.tsao

On Thu, Aug 28, 2025 at 06:56:06PM +0200, Laurent Pinchart wrote:
> Hi Bin Bu,
> 
> Have you sent out the cover letter only ? I haven't received the rest of
> the series, and it's not found on lore.kernel.org either.

I've just noticed you sent the rest later and separately, as
https://lore.kernel.org/all/20250828100811.95722-1-Bin.Du@amd.com/.

> On Thu, Aug 28, 2025 at 04:45:00PM +0800, Bin Du wrote:
> > Hello,
> > 
> > AMD ISP4 is the AMD image processing gen 4 which can be found in HP ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
> > (https://ubuntu.com/certified/202411-36043)
> > This patch series introduces the initial driver support for the AMD ISP4.
> > 
> > Patch summary:
> > - Powers up/off and initializes ISP HW
> > - Configures and kicks off ISP FW
> > - Interacts with APP using standard V4l2 interface by video node
> > - Controls ISP HW and interacts with ISP FW to do image processing
> > - Support enum/set output image format and resolution
> > - Support queueing buffer from app and dequeueing ISP filled buffer to App
> > - It supports libcamera ver0.2 SimplePipeline
> > - It is verified on qv4l2, cheese and qcam
> > - It is verified together with following patches
> > 	platform/x86: Add AMD ISP platform config (https://lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
> > 	pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https://github.com/torvalds/linux/commit/e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
> > 	drm/amd/amdgpu: Add GPIO resources required for amdisp (https://gitlab.freedesktop.org/agd5f/linux/-/commit/ad0f5966ed8297aa47b3184192b00b7379ae0758)
> > 
> > AMD ISP4 Key features:
> > - Processes bayer raw data from the connected sensor and output them to different YUV formats
> > - Downscale input image to different output image resolution
> > - Pipeline to do image processing on the input image including demosaic, denoise, 3A, etc
> > 
> > ----------
> > 
> > Changes v2 -> v3:
> > 
> > - All the dependent patches in other modules (drm/amd/amdgpu, platform/x86, pinctrl/amd) merged on upstream mainline kernel (https://github.com/torvalds/linux) v6.17.
> > - Removed usage of amdgpu structs in ISP driver. Added helper functions in amdgpu accepting opaque params from ISP driver to allocate and release ISP GART buffers.
> > - Moved sensor and MIPI phy control entirely into ISP FW instead of the previous hybrid approach controlling sensor from both FW and x86 (sensor driver).
> > - Removed phy configuration and sensor binding as x86 (sensor driver) had relinquished the sensor control for ISP FW. With this approach the driver will be exposed as web camera like interface.
> > - New FW with built-in sensor driver is submitted on upstream linux-firmware repo (https://gitlab.com/kernel-firmware/linux-firmware/).
> > - Please note the new FW submitted is not directly compatible with OEM Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/tree/4.0) and the previous ISP V2 patch series.
> > - If intend to use the new FW, please rebuild OEM ISP4.0 Kernel with CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
> > - Included critical fixes from Sultan Alsawaf branch (https://github.com/kerneltoast/kernel_x86_laptop.git) related to managing lifetime of isp buffers.
> >       media: amd: isp4: Add missing refcount tracking to mmap memop
> >       media: amd: isp4: Don't put or unmap the dmabuf when detaching
> >       media: amd: isp4: Don't increment refcount when dmabuf export fails
> >       media: amd: isp4: Fix possible use-after-free in isp4vid_vb2_put()
> >       media: amd: isp4: Always export a new dmabuf from get_dmabuf memop
> >       media: amd: isp4: Fix implicit dmabuf lifetime tracking
> >       media: amd: isp4: Fix possible use-after-free when putting implicit dmabuf
> >       media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
> >       media: amd: isp4: Move up buf->vaddr check in isp4vid_get_dmabuf()
> >       media: amd: isp4: Remove unused userptr memops
> >       media: amd: isp4: Add missing cleanup on error in isp4vid_vb2_alloc()
> >       media: amd: isp4: Release queued buffers on error in start_streaming
> > - Addressed all code related upstream comments
> > - Fix typo errors and other cosmetic issue.
> > 
> > 
> > Changes v1 -> v2:
> > 
> > - Fix media CI test errors and valid warnings
> > - Reduce patch number in the series from 9 to 8 by merging MAINTAINERS adding patch to the first patch
> > - In patch 5
> > 	- do modification to use remote endpoint instead of local endpoint
> > 	- use link frequency and port number as start phy parameter instead of extra added phy-id and phy-bit-rate property of endpoint
> > 
> > ----------
> > 
> > It passes v4l2 compliance test, the test reports for:
> > 
> > (a) amd_isp_capture device /dev/video0
> > 
> > Compliance test for amd_isp_capture device /dev/video0:
> > -------------------------------------------------------
> > 
> > atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
> > v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
> > v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17
> > 
> > Compliance test for amd_isp_capture device /dev/video0:
> > 
> > Driver Info:
> >         Driver name      : amd_isp_capture
> >         Card type        : amd_isp_capture
> >         Bus info         : platform:amd_isp_capture
> >         Driver version   : 6.14.0
> >         Capabilities     : 0xa4200001
> >                 Video Capture
> >                 I/O MC
> >                 Streaming
> >                 Extended Pix Format
> >                 Device Capabilities
> >         Device Caps      : 0x24200001
> >                 Video Capture
> >                 I/O MC
> >                 Streaming
> >                 Extended Pix Format
> > Media Driver Info:
> >         Driver name      : amd_isp_capture
> >         Model            : amd_isp41_mdev
> >         Serial           :
> >         Bus info         : platform:amd_isp_capture
> >         Media version    : 6.14.0
> >         Hardware revision: 0x00000000 (0)
> >         Driver version   : 6.14.0
> > Interface Info:
> >         ID               : 0x03000005
> >         Type             : V4L Video
> > Entity Info:
> >         ID               : 0x00000003 (3)
> >         Name             : Preview
> >         Function         : V4L2 I/O
> >         Pad 0x01000004   : 0: Sink
> >           Link 0x02000007: from remote pad 0x1000002 of entity 'amd isp4' (Image Signal Processor): Data, Enabled, Immutable
> > 
> > Required ioctls:
> >         test MC information (see 'Media Driver Info' above): OK
> >         test VIDIOC_QUERYCAP: OK
> >         test invalid ioctls: OK
> > 
> > Allow for multiple opens:
> >         test second /dev/video0 open: OK
> >         test VIDIOC_QUERYCAP: OK
> >         test VIDIOC_G/S_PRIORITY: OK
> >         test for unlimited opens: OK
> > 
> > Debug ioctls:
> >         test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> >         test VIDIOC_LOG_STATUS: OK (Not Supported)
> > 
> > Input ioctls:
> >         test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> >         test VIDIOC_ENUMAUDIO: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMINPUT: OK
> >         test VIDIOC_G/S_AUDIO: OK (Not Supported)
> >         Inputs: 1 Audio Inputs: 0 Tuners: 0
> > 
> > Output ioctls:
> >         test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> >         test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> >         test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> >         test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> >         test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> >         Outputs: 0 Audio Outputs: 0 Modulators: 0
> > 
> > Input/Output configuration ioctls:
> >         test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> >         test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> >         test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> >         test VIDIOC_G/S_EDID: OK (Not Supported)
> > 
> > Control ioctls (Input 0):
> >         test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
> >         test VIDIOC_QUERYCTRL: OK (Not Supported)
> >         test VIDIOC_G/S_CTRL: OK (Not Supported)
> >         test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
> >         test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
> >         test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> >         Standard Controls: 0 Private Controls: 0
> > 
> > Format ioctls (Input 0):
> >         test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> >         test VIDIOC_G/S_PARM: OK
> >         test VIDIOC_G_FBUF: OK (Not Supported)
> >         test VIDIOC_G_FMT: OK
> >         test VIDIOC_TRY_FMT: OK
> >         test VIDIOC_S_FMT: OK
> >         test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> >         test Cropping: OK (Not Supported)
> >         test Composing: OK (Not Supported)
> >         test Scaling: OK (Not Supported)
> > 
> > Codec ioctls (Input 0):
> >         test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> >         test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> >         test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> > 
> > Buffer ioctls (Input 0):
> >         test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> >         test CREATE_BUFS maximum buffers: OK
> >         test VIDIOC_REMOVE_BUFS: OK
> >         test VIDIOC_EXPBUF: OK
> >         test Requests: OK (Not Supported)
> >         test blocking wait: OK
> > 
> > Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0
> > 
> > Please review and provide feedback.
> > 
> > Many thanks,
> > 
> > Bin Du (7):
> >   media: platform: amd: Introduce amd isp4 capture driver
> >   media: platform: amd: low level support for isp4 firmware
> >   media: platform: amd: Add isp4 fw and hw interface
> >   media: platform: amd: isp4 subdev and firmware loading handling added
> >   media: platform: amd: isp4 video node and buffers handling added
> >   media: platform: amd: isp4 debug fs logging and  more descriptive
> >     errors
> >   Documentation: add documentation of AMD isp 4 driver
> > 
> >  Documentation/admin-guide/media/amdisp4-1.rst |   66 +
> >  Documentation/admin-guide/media/amdisp4.dot   |    8 +
> >  .../admin-guide/media/v4l-drivers.rst         |    1 +
> >  MAINTAINERS                                   |   25 +
> >  drivers/media/platform/Kconfig                |    1 +
> >  drivers/media/platform/Makefile               |    1 +
> >  drivers/media/platform/amd/Kconfig            |    3 +
> >  drivers/media/platform/amd/Makefile           |    3 +
> >  drivers/media/platform/amd/isp4/Kconfig       |   13 +
> >  drivers/media/platform/amd/isp4/Makefile      |   10 +
> >  drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
> >  drivers/media/platform/amd/isp4/isp4.h        |   26 +
> >  drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
> >  drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
> >  .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
> >  drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
> >  .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
> >  .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
> >  drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++++++
> >  drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
> >  drivers/media/platform/amd/isp4/isp4_video.c  | 1213 +++++++++++++++++
> >  drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
> >  22 files changed, 4898 insertions(+)
> >  create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
> >  create mode 100644 Documentation/admin-guide/media/amdisp4.dot
> >  create mode 100644 drivers/media/platform/amd/Kconfig
> >  create mode 100644 drivers/media/platform/amd/Makefile
> >  create mode 100644 drivers/media/platform/amd/isp4/Kconfig
> >  create mode 100644 drivers/media/platform/amd/isp4/Makefile
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4.c
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4.h
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_fw_cmd_resp.h
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
> >  create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] Add AMD ISP4 driver
  2025-08-28  8:45 [PATCH v3 0/7] Add AMD ISP4 driver Bin Du
  2025-08-28 16:56 ` Laurent Pinchart
@ 2025-08-31 13:41 ` Alexey Zagorodnikov
  2025-09-02  6:16   ` Du, Bin
  1 sibling, 1 reply; 10+ messages in thread
From: Alexey Zagorodnikov @ 2025-08-31 13:41 UTC (permalink / raw)
  To: Bin Du, mchehab, hverkuil, laurent.pinchart+renesas,
	bryan.odonoghue, sakari.ailus, prabhakar.mahadev-lad.rj,
	linux-media, linux-kernel, sultan
  Cc: pratap.nirujogi, benjamin.chan, king.li, gjorgji.rosikopulos,
	Phil.Jawich, Dominic.Antony, mario.limonciello, richard.gong,
	anson.tsao

Hello,

I have tested this patch on my HP ZBook Ultra G1a, and webcam now works 
great, thank you!

One trick that I noticed, mkinitcpio does not include isp_4_1_1.bin 
firmware inside the image, however, other amdgpu firmware files are 
present. So I need to manually add via config.

Should be "MODULE_FIRMWARE("amdgpu/isp_4_1_1.bin");" added in 
isp_v4_1_1.c like other firmware, for work right out of the box?

On 8/28/25 13:45, Bin Du wrote:
> Hello,
>
> AMD ISP4 is the AMD image processing gen 4 which can be found in HP ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
> (https://ubuntu.com/certified/202411-36043)
> This patch series introduces the initial driver support for the AMD ISP4.
>
> Patch summary:
> - Powers up/off and initializes ISP HW
> - Configures and kicks off ISP FW
> - Interacts with APP using standard V4l2 interface by video node
> - Controls ISP HW and interacts with ISP FW to do image processing
> - Support enum/set output image format and resolution
> - Support queueing buffer from app and dequeueing ISP filled buffer to App
> - It supports libcamera ver0.2 SimplePipeline
> - It is verified on qv4l2, cheese and qcam
> - It is verified together with following patches
> 	platform/x86: Add AMD ISP platform config (https://lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
> 	pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https://github.com/torvalds/linux/commit/e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
> 	drm/amd/amdgpu: Add GPIO resources required for amdisp (https://gitlab.freedesktop.org/agd5f/linux/-/commit/ad0f5966ed8297aa47b3184192b00b7379ae0758)
>
> AMD ISP4 Key features:
> - Processes bayer raw data from the connected sensor and output them to different YUV formats
> - Downscale input image to different output image resolution
> - Pipeline to do image processing on the input image including demosaic, denoise, 3A, etc
>
> ----------
>
> Changes v2 -> v3:
>
> - All the dependent patches in other modules (drm/amd/amdgpu, platform/x86, pinctrl/amd) merged on upstream mainline kernel (https://github.com/torvalds/linux) v6.17.
> - Removed usage of amdgpu structs in ISP driver. Added helper functions in amdgpu accepting opaque params from ISP driver to allocate and release ISP GART buffers.
> - Moved sensor and MIPI phy control entirely into ISP FW instead of the previous hybrid approach controlling sensor from both FW and x86 (sensor driver).
> - Removed phy configuration and sensor binding as x86 (sensor driver) had relinquished the sensor control for ISP FW. With this approach the driver will be exposed as web camera like interface.
> - New FW with built-in sensor driver is submitted on upstream linux-firmware repo (https://gitlab.com/kernel-firmware/linux-firmware/).
> - Please note the new FW submitted is not directly compatible with OEM Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/tree/4.0) and the previous ISP V2 patch series.
> - If intend to use the new FW, please rebuild OEM ISP4.0 Kernel with CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
> - Included critical fixes from Sultan Alsawaf branch (https://github.com/kerneltoast/kernel_x86_laptop.git) related to managing lifetime of isp buffers.
>        media: amd: isp4: Add missing refcount tracking to mmap memop
>        media: amd: isp4: Don't put or unmap the dmabuf when detaching
>        media: amd: isp4: Don't increment refcount when dmabuf export fails
>        media: amd: isp4: Fix possible use-after-free in isp4vid_vb2_put()
>        media: amd: isp4: Always export a new dmabuf from get_dmabuf memop
>        media: amd: isp4: Fix implicit dmabuf lifetime tracking
>        media: amd: isp4: Fix possible use-after-free when putting implicit dmabuf
>        media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
>        media: amd: isp4: Move up buf->vaddr check in isp4vid_get_dmabuf()
>        media: amd: isp4: Remove unused userptr memops
>        media: amd: isp4: Add missing cleanup on error in isp4vid_vb2_alloc()
>        media: amd: isp4: Release queued buffers on error in start_streaming
> - Addressed all code related upstream comments
> - Fix typo errors and other cosmetic issue.
>
>
> Changes v1 -> v2:
>
> - Fix media CI test errors and valid warnings
> - Reduce patch number in the series from 9 to 8 by merging MAINTAINERS adding patch to the first patch
> - In patch 5
> 	- do modification to use remote endpoint instead of local endpoint
> 	- use link frequency and port number as start phy parameter instead of extra added phy-id and phy-bit-rate property of endpoint
>
> ----------
>
> It passes v4l2 compliance test, the test reports for:
>
> (a) amd_isp_capture device /dev/video0
>
> Compliance test for amd_isp_capture device /dev/video0:
> -------------------------------------------------------
>
> atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
> v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
> v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17
>
> Compliance test for amd_isp_capture device /dev/video0:
>
> Driver Info:
>          Driver name      : amd_isp_capture
>          Card type        : amd_isp_capture
>          Bus info         : platform:amd_isp_capture
>          Driver version   : 6.14.0
>          Capabilities     : 0xa4200001
>                  Video Capture
>                  I/O MC
>                  Streaming
>                  Extended Pix Format
>                  Device Capabilities
>          Device Caps      : 0x24200001
>                  Video Capture
>                  I/O MC
>                  Streaming
>                  Extended Pix Format
> Media Driver Info:
>          Driver name      : amd_isp_capture
>          Model            : amd_isp41_mdev
>          Serial           :
>          Bus info         : platform:amd_isp_capture
>          Media version    : 6.14.0
>          Hardware revision: 0x00000000 (0)
>          Driver version   : 6.14.0
> Interface Info:
>          ID               : 0x03000005
>          Type             : V4L Video
> Entity Info:
>          ID               : 0x00000003 (3)
>          Name             : Preview
>          Function         : V4L2 I/O
>          Pad 0x01000004   : 0: Sink
>            Link 0x02000007: from remote pad 0x1000002 of entity 'amd isp4' (Image Signal Processor): Data, Enabled, Immutable
>
> Required ioctls:
>          test MC information (see 'Media Driver Info' above): OK
>          test VIDIOC_QUERYCAP: OK
>          test invalid ioctls: OK
>
> Allow for multiple opens:
>          test second /dev/video0 open: OK
>          test VIDIOC_QUERYCAP: OK
>          test VIDIOC_G/S_PRIORITY: OK
>          test for unlimited opens: OK
>
> Debug ioctls:
>          test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>          test VIDIOC_LOG_STATUS: OK (Not Supported)
>
> Input ioctls:
>          test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>          test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>          test VIDIOC_ENUMAUDIO: OK (Not Supported)
>          test VIDIOC_G/S/ENUMINPUT: OK
>          test VIDIOC_G/S_AUDIO: OK (Not Supported)
>          Inputs: 1 Audio Inputs: 0 Tuners: 0
>
> Output ioctls:
>          test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>          test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>          test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>          test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>          Outputs: 0 Audio Outputs: 0 Modulators: 0
>
> Input/Output configuration ioctls:
>          test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>          test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>          test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>          test VIDIOC_G/S_EDID: OK (Not Supported)
>
> Control ioctls (Input 0):
>          test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
>          test VIDIOC_QUERYCTRL: OK (Not Supported)
>          test VIDIOC_G/S_CTRL: OK (Not Supported)
>          test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
>          test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
>          test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>          Standard Controls: 0 Private Controls: 0
>
> Format ioctls (Input 0):
>          test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>          test VIDIOC_G/S_PARM: OK
>          test VIDIOC_G_FBUF: OK (Not Supported)
>          test VIDIOC_G_FMT: OK
>          test VIDIOC_TRY_FMT: OK
>          test VIDIOC_S_FMT: OK
>          test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>          test Cropping: OK (Not Supported)
>          test Composing: OK (Not Supported)
>          test Scaling: OK (Not Supported)
>
> Codec ioctls (Input 0):
>          test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>          test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>          test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>
> Buffer ioctls (Input 0):
>          test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>          test CREATE_BUFS maximum buffers: OK
>          test VIDIOC_REMOVE_BUFS: OK
>          test VIDIOC_EXPBUF: OK
>          test Requests: OK (Not Supported)
>          test blocking wait: OK
>
> Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0
>
> Please review and provide feedback.
>
> Many thanks,
>
> Bin Du (7):
>    media: platform: amd: Introduce amd isp4 capture driver
>    media: platform: amd: low level support for isp4 firmware
>    media: platform: amd: Add isp4 fw and hw interface
>    media: platform: amd: isp4 subdev and firmware loading handling added
>    media: platform: amd: isp4 video node and buffers handling added
>    media: platform: amd: isp4 debug fs logging and  more descriptive
>      errors
>    Documentation: add documentation of AMD isp 4 driver
>
>   Documentation/admin-guide/media/amdisp4-1.rst |   66 +
>   Documentation/admin-guide/media/amdisp4.dot   |    8 +
>   .../admin-guide/media/v4l-drivers.rst         |    1 +
>   MAINTAINERS                                   |   25 +
>   drivers/media/platform/Kconfig                |    1 +
>   drivers/media/platform/Makefile               |    1 +
>   drivers/media/platform/amd/Kconfig            |    3 +
>   drivers/media/platform/amd/Makefile           |    3 +
>   drivers/media/platform/amd/isp4/Kconfig       |   13 +
>   drivers/media/platform/amd/isp4/Makefile      |   10 +
>   drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
>   drivers/media/platform/amd/isp4/isp4.h        |   26 +
>   drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
>   drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
>   .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
>   drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
>   .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
>   .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
>   drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++++++
>   drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
>   drivers/media/platform/amd/isp4/isp4_video.c  | 1213 +++++++++++++++++
>   drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
>   22 files changed, 4898 insertions(+)
>   create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
>   create mode 100644 Documentation/admin-guide/media/amdisp4.dot
>   create mode 100644 drivers/media/platform/amd/Kconfig
>   create mode 100644 drivers/media/platform/amd/Makefile
>   create mode 100644 drivers/media/platform/amd/isp4/Kconfig
>   create mode 100644 drivers/media/platform/amd/isp4/Makefile
>   create mode 100644 drivers/media/platform/amd/isp4/isp4.c
>   create mode 100644 drivers/media/platform/amd/isp4/isp4.h
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_fw_cmd_resp.h
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] Add AMD ISP4 driver
  2025-08-28 16:58   ` Limonciello, Mario
@ 2025-09-02  3:21     ` Du, Bin
  0 siblings, 0 replies; 10+ messages in thread
From: Du, Bin @ 2025-09-02  3:21 UTC (permalink / raw)
  To: Limonciello, Mario, Laurent Pinchart
  Cc: mchehab@kernel.org, hverkuil@xs4all.nl,
	bryan.odonoghue@linaro.org, sakari.ailus@linux.intel.com,
	prabhakar.mahadev-lad.rj@bp.renesas.com,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	sultan@kerneltoast.com, Nirujogi, Pratap,
	Chan, Benjamin (Koon Pan), Li, King, Rosikopulos, Gjorgji,
	Jawich, Phil, Antony, Dominic, Gong, Richard, Tsao, Anson

Thanks Laurent, and Mario for the clarification.

On 8/29/2025 12:58 AM, Limonciello, Mario wrote:
> On 8/28/25 11:56 AM, Laurent Pinchart wrote:
>> Hi Bin Bu,
>>
>> Have you sent out the cover letter only ? I haven't received the rest of
>> the series, and it's not found on lore.kernel.org either.
> 
> Something seems wrong with the cover letter threading to the series.
> Here's the rest of the series (which I did receive too).
> 
> https://lore.kernel.org/linux-media/20250828100811.95722-1-Bin.Du@amd.com/
> 
>>
>> On Thu, Aug 28, 2025 at 04:45:00PM +0800, Bin Du wrote:
>>> Hello,
>>>
>>> AMD ISP4 is the AMD image processing gen 4 which can be found in HP ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
>>> (https://ubuntu.com/certified/202411-36043)
>>> This patch series introduces the initial driver support for the AMD ISP4.
>>>
>>> Patch summary:
>>> - Powers up/off and initializes ISP HW
>>> - Configures and kicks off ISP FW
>>> - Interacts with APP using standard V4l2 interface by video node
>>> - Controls ISP HW and interacts with ISP FW to do image processing
>>> - Support enum/set output image format and resolution
>>> - Support queueing buffer from app and dequeueing ISP filled buffer to App
>>> - It supports libcamera ver0.2 SimplePipeline
>>> - It is verified on qv4l2, cheese and qcam
>>> - It is verified together with following patches
>>> 	platform/x86: Add AMD ISP platform config (https://lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
>>> 	pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https://github.com/torvalds/linux/commit/e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
>>> 	drm/amd/amdgpu: Add GPIO resources required for amdisp (https://gitlab.freedesktop.org/agd5f/linux/-/commit/ad0f5966ed8297aa47b3184192b00b7379ae0758)
>>>
>>> AMD ISP4 Key features:
>>> - Processes bayer raw data from the connected sensor and output them to different YUV formats
>>> - Downscale input image to different output image resolution
>>> - Pipeline to do image processing on the input image including demosaic, denoise, 3A, etc
>>>
>>> ----------
>>>
>>> Changes v2 -> v3:
>>>
>>> - All the dependent patches in other modules (drm/amd/amdgpu, platform/x86, pinctrl/amd) merged on upstream mainline kernel (https://github.com/torvalds/linux) v6.17.
>>> - Removed usage of amdgpu structs in ISP driver. Added helper functions in amdgpu accepting opaque params from ISP driver to allocate and release ISP GART buffers.
>>> - Moved sensor and MIPI phy control entirely into ISP FW instead of the previous hybrid approach controlling sensor from both FW and x86 (sensor driver).
>>> - Removed phy configuration and sensor binding as x86 (sensor driver) had relinquished the sensor control for ISP FW. With this approach the driver will be exposed as web camera like interface.
>>> - New FW with built-in sensor driver is submitted on upstream linux-firmware repo (https://gitlab.com/kernel-firmware/linux-firmware/).
>>> - Please note the new FW submitted is not directly compatible with OEM Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/tree/4.0) and the previous ISP V2 patch series.
>>> - If intend to use the new FW, please rebuild OEM ISP4.0 Kernel with CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
>>> - Included critical fixes from Sultan Alsawaf branch (https://github.com/kerneltoast/kernel_x86_laptop.git) related to managing lifetime of isp buffers.
>>>         media: amd: isp4: Add missing refcount tracking to mmap memop
>>>         media: amd: isp4: Don't put or unmap the dmabuf when detaching
>>>         media: amd: isp4: Don't increment refcount when dmabuf export fails
>>>         media: amd: isp4: Fix possible use-after-free in isp4vid_vb2_put()
>>>         media: amd: isp4: Always export a new dmabuf from get_dmabuf memop
>>>         media: amd: isp4: Fix implicit dmabuf lifetime tracking
>>>         media: amd: isp4: Fix possible use-after-free when putting implicit dmabuf
>>>         media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
>>>         media: amd: isp4: Move up buf->vaddr check in isp4vid_get_dmabuf()
>>>         media: amd: isp4: Remove unused userptr memops
>>>         media: amd: isp4: Add missing cleanup on error in isp4vid_vb2_alloc()
>>>         media: amd: isp4: Release queued buffers on error in start_streaming
>>> - Addressed all code related upstream comments
>>> - Fix typo errors and other cosmetic issue.
>>>
>>>
>>> Changes v1 -> v2:
>>>
>>> - Fix media CI test errors and valid warnings
>>> - Reduce patch number in the series from 9 to 8 by merging MAINTAINERS adding patch to the first patch
>>> - In patch 5
>>> 	- do modification to use remote endpoint instead of local endpoint
>>> 	- use link frequency and port number as start phy parameter instead of extra added phy-id and phy-bit-rate property of endpoint
>>>
>>> ----------
>>>
>>> It passes v4l2 compliance test, the test reports for:
>>>
>>> (a) amd_isp_capture device /dev/video0
>>>
>>> Compliance test for amd_isp_capture device /dev/video0:
>>> -------------------------------------------------------
>>>
>>> atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
>>> v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
>>> v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17
>>>
>>> Compliance test for amd_isp_capture device /dev/video0:
>>>
>>> Driver Info:
>>>           Driver name      : amd_isp_capture
>>>           Card type        : amd_isp_capture
>>>           Bus info         : platform:amd_isp_capture
>>>           Driver version   : 6.14.0
>>>           Capabilities     : 0xa4200001
>>>                   Video Capture
>>>                   I/O MC
>>>                   Streaming
>>>                   Extended Pix Format
>>>                   Device Capabilities
>>>           Device Caps      : 0x24200001
>>>                   Video Capture
>>>                   I/O MC
>>>                   Streaming
>>>                   Extended Pix Format
>>> Media Driver Info:
>>>           Driver name      : amd_isp_capture
>>>           Model            : amd_isp41_mdev
>>>           Serial           :
>>>           Bus info         : platform:amd_isp_capture
>>>           Media version    : 6.14.0
>>>           Hardware revision: 0x00000000 (0)
>>>           Driver version   : 6.14.0
>>> Interface Info:
>>>           ID               : 0x03000005
>>>           Type             : V4L Video
>>> Entity Info:
>>>           ID               : 0x00000003 (3)
>>>           Name             : Preview
>>>           Function         : V4L2 I/O
>>>           Pad 0x01000004   : 0: Sink
>>>             Link 0x02000007: from remote pad 0x1000002 of entity 'amd isp4' (Image Signal Processor): Data, Enabled, Immutable
>>>
>>> Required ioctls:
>>>           test MC information (see 'Media Driver Info' above): OK
>>>           test VIDIOC_QUERYCAP: OK
>>>           test invalid ioctls: OK
>>>
>>> Allow for multiple opens:
>>>           test second /dev/video0 open: OK
>>>           test VIDIOC_QUERYCAP: OK
>>>           test VIDIOC_G/S_PRIORITY: OK
>>>           test for unlimited opens: OK
>>>
>>> Debug ioctls:
>>>           test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>>>           test VIDIOC_LOG_STATUS: OK (Not Supported)
>>>
>>> Input ioctls:
>>>           test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>>>           test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>           test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>>>           test VIDIOC_ENUMAUDIO: OK (Not Supported)
>>>           test VIDIOC_G/S/ENUMINPUT: OK
>>>           test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>>           Inputs: 1 Audio Inputs: 0 Tuners: 0
>>>
>>> Output ioctls:
>>>           test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>>>           test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>           test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>>>           test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>>>           test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>>>           Outputs: 0 Audio Outputs: 0 Modulators: 0
>>>
>>> Input/Output configuration ioctls:
>>>           test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>>>           test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>>>           test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>>>           test VIDIOC_G/S_EDID: OK (Not Supported)
>>>
>>> Control ioctls (Input 0):
>>>           test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
>>>           test VIDIOC_QUERYCTRL: OK (Not Supported)
>>>           test VIDIOC_G/S_CTRL: OK (Not Supported)
>>>           test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
>>>           test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
>>>           test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>>           Standard Controls: 0 Private Controls: 0
>>>
>>> Format ioctls (Input 0):
>>>           test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>>>           test VIDIOC_G/S_PARM: OK
>>>           test VIDIOC_G_FBUF: OK (Not Supported)
>>>           test VIDIOC_G_FMT: OK
>>>           test VIDIOC_TRY_FMT: OK
>>>           test VIDIOC_S_FMT: OK
>>>           test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>>           test Cropping: OK (Not Supported)
>>>           test Composing: OK (Not Supported)
>>>           test Scaling: OK (Not Supported)
>>>
>>> Codec ioctls (Input 0):
>>>           test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>>>           test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>>           test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>>
>>> Buffer ioctls (Input 0):
>>>           test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>>           test CREATE_BUFS maximum buffers: OK
>>>           test VIDIOC_REMOVE_BUFS: OK
>>>           test VIDIOC_EXPBUF: OK
>>>           test Requests: OK (Not Supported)
>>>           test blocking wait: OK
>>>
>>> Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0
>>>
>>> Please review and provide feedback.
>>>
>>> Many thanks,
>>>
>>> Bin Du (7):
>>>     media: platform: amd: Introduce amd isp4 capture driver
>>>     media: platform: amd: low level support for isp4 firmware
>>>     media: platform: amd: Add isp4 fw and hw interface
>>>     media: platform: amd: isp4 subdev and firmware loading handling added
>>>     media: platform: amd: isp4 video node and buffers handling added
>>>     media: platform: amd: isp4 debug fs logging and  more descriptive
>>>       errors
>>>     Documentation: add documentation of AMD isp 4 driver
>>>
>>>    Documentation/admin-guide/media/amdisp4-1.rst |   66 +
>>>    Documentation/admin-guide/media/amdisp4.dot   |    8 +
>>>    .../admin-guide/media/v4l-drivers.rst         |    1 +
>>>    MAINTAINERS                                   |   25 +
>>>    drivers/media/platform/Kconfig                |    1 +
>>>    drivers/media/platform/Makefile               |    1 +
>>>    drivers/media/platform/amd/Kconfig            |    3 +
>>>    drivers/media/platform/amd/Makefile           |    3 +
>>>    drivers/media/platform/amd/isp4/Kconfig       |   13 +
>>>    drivers/media/platform/amd/isp4/Makefile      |   10 +
>>>    drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
>>>    drivers/media/platform/amd/isp4/isp4.h        |   26 +
>>>    drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
>>>    drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
>>>    .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
>>>    drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
>>>    .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
>>>    .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
>>>    drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++++++
>>>    drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
>>>    drivers/media/platform/amd/isp4/isp4_video.c  | 1213 +++++++++++++++++
>>>    drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
>>>    22 files changed, 4898 insertions(+)
>>>    create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
>>>    create mode 100644 Documentation/admin-guide/media/amdisp4.dot
>>>    create mode 100644 drivers/media/platform/amd/Kconfig
>>>    create mode 100644 drivers/media/platform/amd/Makefile
>>>    create mode 100644 drivers/media/platform/amd/isp4/Kconfig
>>>    create mode 100644 drivers/media/platform/amd/isp4/Makefile
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4.c
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4.h
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_fw_cmd_resp.h
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
>>>    create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h
>>
> 

-- 
Regards,
Bin


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] Add AMD ISP4 driver
  2025-08-28 16:58   ` Laurent Pinchart
@ 2025-09-02  3:39     ` Du, Bin
  2025-09-02 15:53       ` Mario Limonciello
  0 siblings, 1 reply; 10+ messages in thread
From: Du, Bin @ 2025-09-02  3:39 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: mchehab, hverkuil, bryan.odonoghue, sakari.ailus,
	prabhakar.mahadev-lad.rj, linux-media, linux-kernel, sultan,
	pratap.nirujogi, benjamin.chan, king.li, gjorgji.rosikopulos,
	Phil.Jawich, Dominic.Antony, mario.limonciello, richard.gong,
	anson.tsao

Hi Laurent Pinchart, sorry for the confusion.

On 8/29/2025 12:58 AM, Laurent Pinchart wrote:
> On Thu, Aug 28, 2025 at 06:56:06PM +0200, Laurent Pinchart wrote:
>> Hi Bin Bu,
>>
>> Have you sent out the cover letter only ? I haven't received the rest of
>> the series, and it's not found on lore.kernel.org either.
> 
> I've just noticed you sent the rest later and separately, as
> https://lore.kernel.org/all/20250828100811.95722-1-Bin.Du@amd.com/.
> 

Before sending the formal ones, i did some internal test, after the 
cover letter, when i tried to send the rest, i encountered this error, 
4.4.2 Message submission rate for this client has exceeded the 
configured limit. So i had to wait for some time so i could send again.

>> On Thu, Aug 28, 2025 at 04:45:00PM +0800, Bin Du wrote:
>>> Hello,
>>>
>>> AMD ISP4 is the AMD image processing gen 4 which can be found in HP ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
>>> (https://ubuntu.com/certified/202411-36043)
>>> This patch series introduces the initial driver support for the AMD ISP4.
>>>
>>> Patch summary:
>>> - Powers up/off and initializes ISP HW
>>> - Configures and kicks off ISP FW
>>> - Interacts with APP using standard V4l2 interface by video node
>>> - Controls ISP HW and interacts with ISP FW to do image processing
>>> - Support enum/set output image format and resolution
>>> - Support queueing buffer from app and dequeueing ISP filled buffer to App
>>> - It supports libcamera ver0.2 SimplePipeline
>>> - It is verified on qv4l2, cheese and qcam
>>> - It is verified together with following patches
>>> 	platform/x86: Add AMD ISP platform config (https://lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
>>> 	pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https://github.com/torvalds/linux/commit/e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
>>> 	drm/amd/amdgpu: Add GPIO resources required for amdisp (https://gitlab.freedesktop.org/agd5f/linux/-/commit/ad0f5966ed8297aa47b3184192b00b7379ae0758)
>>>
>>> AMD ISP4 Key features:
>>> - Processes bayer raw data from the connected sensor and output them to different YUV formats
>>> - Downscale input image to different output image resolution
>>> - Pipeline to do image processing on the input image including demosaic, denoise, 3A, etc
>>>
>>> ----------
>>>
>>> Changes v2 -> v3:
>>>
>>> - All the dependent patches in other modules (drm/amd/amdgpu, platform/x86, pinctrl/amd) merged on upstream mainline kernel (https://github.com/torvalds/linux) v6.17.
>>> - Removed usage of amdgpu structs in ISP driver. Added helper functions in amdgpu accepting opaque params from ISP driver to allocate and release ISP GART buffers.
>>> - Moved sensor and MIPI phy control entirely into ISP FW instead of the previous hybrid approach controlling sensor from both FW and x86 (sensor driver).
>>> - Removed phy configuration and sensor binding as x86 (sensor driver) had relinquished the sensor control for ISP FW. With this approach the driver will be exposed as web camera like interface.
>>> - New FW with built-in sensor driver is submitted on upstream linux-firmware repo (https://gitlab.com/kernel-firmware/linux-firmware/).
>>> - Please note the new FW submitted is not directly compatible with OEM Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/tree/4.0) and the previous ISP V2 patch series.
>>> - If intend to use the new FW, please rebuild OEM ISP4.0 Kernel with CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
>>> - Included critical fixes from Sultan Alsawaf branch (https://github.com/kerneltoast/kernel_x86_laptop.git) related to managing lifetime of isp buffers.
>>>        media: amd: isp4: Add missing refcount tracking to mmap memop
>>>        media: amd: isp4: Don't put or unmap the dmabuf when detaching
>>>        media: amd: isp4: Don't increment refcount when dmabuf export fails
>>>        media: amd: isp4: Fix possible use-after-free in isp4vid_vb2_put()
>>>        media: amd: isp4: Always export a new dmabuf from get_dmabuf memop
>>>        media: amd: isp4: Fix implicit dmabuf lifetime tracking
>>>        media: amd: isp4: Fix possible use-after-free when putting implicit dmabuf
>>>        media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
>>>        media: amd: isp4: Move up buf->vaddr check in isp4vid_get_dmabuf()
>>>        media: amd: isp4: Remove unused userptr memops
>>>        media: amd: isp4: Add missing cleanup on error in isp4vid_vb2_alloc()
>>>        media: amd: isp4: Release queued buffers on error in start_streaming
>>> - Addressed all code related upstream comments
>>> - Fix typo errors and other cosmetic issue.
>>>
>>>
>>> Changes v1 -> v2:
>>>
>>> - Fix media CI test errors and valid warnings
>>> - Reduce patch number in the series from 9 to 8 by merging MAINTAINERS adding patch to the first patch
>>> - In patch 5
>>> 	- do modification to use remote endpoint instead of local endpoint
>>> 	- use link frequency and port number as start phy parameter instead of extra added phy-id and phy-bit-rate property of endpoint
>>>
>>> ----------
>>>
>>> It passes v4l2 compliance test, the test reports for:
>>>
>>> (a) amd_isp_capture device /dev/video0
>>>
>>> Compliance test for amd_isp_capture device /dev/video0:
>>> -------------------------------------------------------
>>>
>>> atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
>>> v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
>>> v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17
>>>
>>> Compliance test for amd_isp_capture device /dev/video0:
>>>
>>> Driver Info:
>>>          Driver name      : amd_isp_capture
>>>          Card type        : amd_isp_capture
>>>          Bus info         : platform:amd_isp_capture
>>>          Driver version   : 6.14.0
>>>          Capabilities     : 0xa4200001
>>>                  Video Capture
>>>                  I/O MC
>>>                  Streaming
>>>                  Extended Pix Format
>>>                  Device Capabilities
>>>          Device Caps      : 0x24200001
>>>                  Video Capture
>>>                  I/O MC
>>>                  Streaming
>>>                  Extended Pix Format
>>> Media Driver Info:
>>>          Driver name      : amd_isp_capture
>>>          Model            : amd_isp41_mdev
>>>          Serial           :
>>>          Bus info         : platform:amd_isp_capture
>>>          Media version    : 6.14.0
>>>          Hardware revision: 0x00000000 (0)
>>>          Driver version   : 6.14.0
>>> Interface Info:
>>>          ID               : 0x03000005
>>>          Type             : V4L Video
>>> Entity Info:
>>>          ID               : 0x00000003 (3)
>>>          Name             : Preview
>>>          Function         : V4L2 I/O
>>>          Pad 0x01000004   : 0: Sink
>>>            Link 0x02000007: from remote pad 0x1000002 of entity 'amd isp4' (Image Signal Processor): Data, Enabled, Immutable
>>>
>>> Required ioctls:
>>>          test MC information (see 'Media Driver Info' above): OK
>>>          test VIDIOC_QUERYCAP: OK
>>>          test invalid ioctls: OK
>>>
>>> Allow for multiple opens:
>>>          test second /dev/video0 open: OK
>>>          test VIDIOC_QUERYCAP: OK
>>>          test VIDIOC_G/S_PRIORITY: OK
>>>          test for unlimited opens: OK
>>>
>>> Debug ioctls:
>>>          test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>>>          test VIDIOC_LOG_STATUS: OK (Not Supported)
>>>
>>> Input ioctls:
>>>          test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>          test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>>>          test VIDIOC_ENUMAUDIO: OK (Not Supported)
>>>          test VIDIOC_G/S/ENUMINPUT: OK
>>>          test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>>          Inputs: 1 Audio Inputs: 0 Tuners: 0
>>>
>>> Output ioctls:
>>>          test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>          test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>>>          test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>>>          test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>>>          Outputs: 0 Audio Outputs: 0 Modulators: 0
>>>
>>> Input/Output configuration ioctls:
>>>          test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>>>          test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>>>          test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>>>          test VIDIOC_G/S_EDID: OK (Not Supported)
>>>
>>> Control ioctls (Input 0):
>>>          test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
>>>          test VIDIOC_QUERYCTRL: OK (Not Supported)
>>>          test VIDIOC_G/S_CTRL: OK (Not Supported)
>>>          test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
>>>          test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
>>>          test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>>          Standard Controls: 0 Private Controls: 0
>>>
>>> Format ioctls (Input 0):
>>>          test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>>>          test VIDIOC_G/S_PARM: OK
>>>          test VIDIOC_G_FBUF: OK (Not Supported)
>>>          test VIDIOC_G_FMT: OK
>>>          test VIDIOC_TRY_FMT: OK
>>>          test VIDIOC_S_FMT: OK
>>>          test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>>          test Cropping: OK (Not Supported)
>>>          test Composing: OK (Not Supported)
>>>          test Scaling: OK (Not Supported)
>>>
>>> Codec ioctls (Input 0):
>>>          test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>>>          test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>>          test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>>
>>> Buffer ioctls (Input 0):
>>>          test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>>          test CREATE_BUFS maximum buffers: OK
>>>          test VIDIOC_REMOVE_BUFS: OK
>>>          test VIDIOC_EXPBUF: OK
>>>          test Requests: OK (Not Supported)
>>>          test blocking wait: OK
>>>
>>> Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0
>>>
>>> Please review and provide feedback.
>>>
>>> Many thanks,
>>>
>>> Bin Du (7):
>>>    media: platform: amd: Introduce amd isp4 capture driver
>>>    media: platform: amd: low level support for isp4 firmware
>>>    media: platform: amd: Add isp4 fw and hw interface
>>>    media: platform: amd: isp4 subdev and firmware loading handling added
>>>    media: platform: amd: isp4 video node and buffers handling added
>>>    media: platform: amd: isp4 debug fs logging and  more descriptive
>>>      errors
>>>    Documentation: add documentation of AMD isp 4 driver
>>>
>>>   Documentation/admin-guide/media/amdisp4-1.rst |   66 +
>>>   Documentation/admin-guide/media/amdisp4.dot   |    8 +
>>>   .../admin-guide/media/v4l-drivers.rst         |    1 +
>>>   MAINTAINERS                                   |   25 +
>>>   drivers/media/platform/Kconfig                |    1 +
>>>   drivers/media/platform/Makefile               |    1 +
>>>   drivers/media/platform/amd/Kconfig            |    3 +
>>>   drivers/media/platform/amd/Makefile           |    3 +
>>>   drivers/media/platform/amd/isp4/Kconfig       |   13 +
>>>   drivers/media/platform/amd/isp4/Makefile      |   10 +
>>>   drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
>>>   drivers/media/platform/amd/isp4/isp4.h        |   26 +
>>>   drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
>>>   drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
>>>   .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
>>>   drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
>>>   .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
>>>   .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
>>>   drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++++++
>>>   drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
>>>   drivers/media/platform/amd/isp4/isp4_video.c  | 1213 +++++++++++++++++
>>>   drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
>>>   22 files changed, 4898 insertions(+)
>>>   create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
>>>   create mode 100644 Documentation/admin-guide/media/amdisp4.dot
>>>   create mode 100644 drivers/media/platform/amd/Kconfig
>>>   create mode 100644 drivers/media/platform/amd/Makefile
>>>   create mode 100644 drivers/media/platform/amd/isp4/Kconfig
>>>   create mode 100644 drivers/media/platform/amd/isp4/Makefile
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.c
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.h
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_fw_cmd_resp.h
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h
> 

-- 
Regards,
Bin


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] Add AMD ISP4 driver
  2025-08-31 13:41 ` Alexey Zagorodnikov
@ 2025-09-02  6:16   ` Du, Bin
  0 siblings, 0 replies; 10+ messages in thread
From: Du, Bin @ 2025-09-02  6:16 UTC (permalink / raw)
  To: Alexey Zagorodnikov, mchehab, hverkuil, laurent.pinchart+renesas,
	bryan.odonoghue, sakari.ailus, prabhakar.mahadev-lad.rj,
	linux-media, linux-kernel, sultan
  Cc: pratap.nirujogi, benjamin.chan, king.li, gjorgji.rosikopulos,
	Phil.Jawich, Dominic.Antony, mario.limonciello, richard.gong,
	anson.tsao

Hi Alexey Zagorodnikov.

On 8/31/2025 9:41 PM, Alexey Zagorodnikov wrote:
> Hello,
> 
> I have tested this patch on my HP ZBook Ultra G1a, and webcam now works 
> great, thank you!
> 

Thanks for the verification, really glad it works.

> One trick that I noticed, mkinitcpio does not include isp_4_1_1.bin 
> firmware inside the image, however, other amdgpu firmware files are 
> present. So I need to manually add via config.
> 
> Should be "MODULE_FIRMWARE("amdgpu/isp_4_1_1.bin");" added in 
> isp_v4_1_1.c like other firmware, for work right out of the box?
> 

Many thank for the fix, yes MODULE_FIRMWARE("amdgpu/isp_4_1_1.bin") 
should be added, maybe amdgpu_isp.c is a better place. Will follow up 
with separated amdgpu patch.

> On 8/28/25 13:45, Bin Du wrote:
>> Hello,
>>
>> AMD ISP4 is the AMD image processing gen 4 which can be found in HP 
>> ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
>> (https://ubuntu.com/certified/202411-36043)
>> This patch series introduces the initial driver support for the AMD ISP4.
>>
>> Patch summary:
>> - Powers up/off and initializes ISP HW
>> - Configures and kicks off ISP FW
>> - Interacts with APP using standard V4l2 interface by video node
>> - Controls ISP HW and interacts with ISP FW to do image processing
>> - Support enum/set output image format and resolution
>> - Support queueing buffer from app and dequeueing ISP filled buffer to 
>> App
>> - It supports libcamera ver0.2 SimplePipeline
>> - It is verified on qv4l2, cheese and qcam
>> - It is verified together with following patches
>>     platform/x86: Add AMD ISP platform config (https:// 
>> lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
>>     pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https://github.com/ 
>> torvalds/linux/commit/e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
>>     drm/amd/amdgpu: Add GPIO resources required for amdisp (https:// 
>> gitlab.freedesktop.org/agd5f/linux/-/commit/ 
>> ad0f5966ed8297aa47b3184192b00b7379ae0758)
>>
>> AMD ISP4 Key features:
>> - Processes bayer raw data from the connected sensor and output them 
>> to different YUV formats
>> - Downscale input image to different output image resolution
>> - Pipeline to do image processing on the input image including 
>> demosaic, denoise, 3A, etc
>>
>> ----------
>>
>> Changes v2 -> v3:
>>
>> - All the dependent patches in other modules (drm/amd/amdgpu, 
>> platform/x86, pinctrl/amd) merged on upstream mainline kernel 
>> (https://github.com/torvalds/linux) v6.17.
>> - Removed usage of amdgpu structs in ISP driver. Added helper 
>> functions in amdgpu accepting opaque params from ISP driver to 
>> allocate and release ISP GART buffers.
>> - Moved sensor and MIPI phy control entirely into ISP FW instead of 
>> the previous hybrid approach controlling sensor from both FW and x86 
>> (sensor driver).
>> - Removed phy configuration and sensor binding as x86 (sensor driver) 
>> had relinquished the sensor control for ISP FW. With this approach the 
>> driver will be exposed as web camera like interface.
>> - New FW with built-in sensor driver is submitted on upstream linux- 
>> firmware repo (https://gitlab.com/kernel-firmware/linux-firmware/).
>> - Please note the new FW submitted is not directly compatible with OEM 
>> Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/tree/4.0) and 
>> the previous ISP V2 patch series.
>> - If intend to use the new FW, please rebuild OEM ISP4.0 Kernel with 
>> CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
>> - Included critical fixes from Sultan Alsawaf branch (https:// 
>> github.com/kerneltoast/kernel_x86_laptop.git) related to managing 
>> lifetime of isp buffers.
>>        media: amd: isp4: Add missing refcount tracking to mmap memop
>>        media: amd: isp4: Don't put or unmap the dmabuf when detaching
>>        media: amd: isp4: Don't increment refcount when dmabuf export 
>> fails
>>        media: amd: isp4: Fix possible use-after-free in isp4vid_vb2_put()
>>        media: amd: isp4: Always export a new dmabuf from get_dmabuf memop
>>        media: amd: isp4: Fix implicit dmabuf lifetime tracking
>>        media: amd: isp4: Fix possible use-after-free when putting 
>> implicit dmabuf
>>        media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
>>        media: amd: isp4: Move up buf->vaddr check in isp4vid_get_dmabuf()
>>        media: amd: isp4: Remove unused userptr memops
>>        media: amd: isp4: Add missing cleanup on error in 
>> isp4vid_vb2_alloc()
>>        media: amd: isp4: Release queued buffers on error in 
>> start_streaming
>> - Addressed all code related upstream comments
>> - Fix typo errors and other cosmetic issue.
>>
>>
>> Changes v1 -> v2:
>>
>> - Fix media CI test errors and valid warnings
>> - Reduce patch number in the series from 9 to 8 by merging MAINTAINERS 
>> adding patch to the first patch
>> - In patch 5
>>     - do modification to use remote endpoint instead of local endpoint
>>     - use link frequency and port number as start phy parameter 
>> instead of extra added phy-id and phy-bit-rate property of endpoint
>>
>> ----------
>>
>> It passes v4l2 compliance test, the test reports for:
>>
>> (a) amd_isp_capture device /dev/video0
>>
>> Compliance test for amd_isp_capture device /dev/video0:
>> -------------------------------------------------------
>>
>> atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
>> v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
>> v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17
>>
>> Compliance test for amd_isp_capture device /dev/video0:
>>
>> Driver Info:
>>          Driver name      : amd_isp_capture
>>          Card type        : amd_isp_capture
>>          Bus info         : platform:amd_isp_capture
>>          Driver version   : 6.14.0
>>          Capabilities     : 0xa4200001
>>                  Video Capture
>>                  I/O MC
>>                  Streaming
>>                  Extended Pix Format
>>                  Device Capabilities
>>          Device Caps      : 0x24200001
>>                  Video Capture
>>                  I/O MC
>>                  Streaming
>>                  Extended Pix Format
>> Media Driver Info:
>>          Driver name      : amd_isp_capture
>>          Model            : amd_isp41_mdev
>>          Serial           :
>>          Bus info         : platform:amd_isp_capture
>>          Media version    : 6.14.0
>>          Hardware revision: 0x00000000 (0)
>>          Driver version   : 6.14.0
>> Interface Info:
>>          ID               : 0x03000005
>>          Type             : V4L Video
>> Entity Info:
>>          ID               : 0x00000003 (3)
>>          Name             : Preview
>>          Function         : V4L2 I/O
>>          Pad 0x01000004   : 0: Sink
>>            Link 0x02000007: from remote pad 0x1000002 of entity 'amd 
>> isp4' (Image Signal Processor): Data, Enabled, Immutable
>>
>> Required ioctls:
>>          test MC information (see 'Media Driver Info' above): OK
>>          test VIDIOC_QUERYCAP: OK
>>          test invalid ioctls: OK
>>
>> Allow for multiple opens:
>>          test second /dev/video0 open: OK
>>          test VIDIOC_QUERYCAP: OK
>>          test VIDIOC_G/S_PRIORITY: OK
>>          test for unlimited opens: OK
>>
>> Debug ioctls:
>>          test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>>          test VIDIOC_LOG_STATUS: OK (Not Supported)
>>
>> Input ioctls:
>>          test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>          test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>>          test VIDIOC_ENUMAUDIO: OK (Not Supported)
>>          test VIDIOC_G/S/ENUMINPUT: OK
>>          test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>          Inputs: 1 Audio Inputs: 0 Tuners: 0
>>
>> Output ioctls:
>>          test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>          test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>>          test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>>          test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>>          Outputs: 0 Audio Outputs: 0 Modulators: 0
>>
>> Input/Output configuration ioctls:
>>          test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>>          test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>>          test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>>          test VIDIOC_G/S_EDID: OK (Not Supported)
>>
>> Control ioctls (Input 0):
>>          test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
>>          test VIDIOC_QUERYCTRL: OK (Not Supported)
>>          test VIDIOC_G/S_CTRL: OK (Not Supported)
>>          test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
>>          test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
>>          test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>          Standard Controls: 0 Private Controls: 0
>>
>> Format ioctls (Input 0):
>>          test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>>          test VIDIOC_G/S_PARM: OK
>>          test VIDIOC_G_FBUF: OK (Not Supported)
>>          test VIDIOC_G_FMT: OK
>>          test VIDIOC_TRY_FMT: OK
>>          test VIDIOC_S_FMT: OK
>>          test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>          test Cropping: OK (Not Supported)
>>          test Composing: OK (Not Supported)
>>          test Scaling: OK (Not Supported)
>>
>> Codec ioctls (Input 0):
>>          test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>>          test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>          test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>
>> Buffer ioctls (Input 0):
>>          test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>          test CREATE_BUFS maximum buffers: OK
>>          test VIDIOC_REMOVE_BUFS: OK
>>          test VIDIOC_EXPBUF: OK
>>          test Requests: OK (Not Supported)
>>          test blocking wait: OK
>>
>> Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, 
>> Failed: 0, Warnings: 0
>>
>> Please review and provide feedback.
>>
>> Many thanks,
>>
>> Bin Du (7):
>>    media: platform: amd: Introduce amd isp4 capture driver
>>    media: platform: amd: low level support for isp4 firmware
>>    media: platform: amd: Add isp4 fw and hw interface
>>    media: platform: amd: isp4 subdev and firmware loading handling added
>>    media: platform: amd: isp4 video node and buffers handling added
>>    media: platform: amd: isp4 debug fs logging and  more descriptive
>>      errors
>>    Documentation: add documentation of AMD isp 4 driver
>>
>>   Documentation/admin-guide/media/amdisp4-1.rst |   66 +
>>   Documentation/admin-guide/media/amdisp4.dot   |    8 +
>>   .../admin-guide/media/v4l-drivers.rst         |    1 +
>>   MAINTAINERS                                   |   25 +
>>   drivers/media/platform/Kconfig                |    1 +
>>   drivers/media/platform/Makefile               |    1 +
>>   drivers/media/platform/amd/Kconfig            |    3 +
>>   drivers/media/platform/amd/Makefile           |    3 +
>>   drivers/media/platform/amd/isp4/Kconfig       |   13 +
>>   drivers/media/platform/amd/isp4/Makefile      |   10 +
>>   drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
>>   drivers/media/platform/amd/isp4/isp4.h        |   26 +
>>   drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
>>   drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
>>   .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
>>   drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
>>   .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
>>   .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
>>   drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++++++
>>   drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
>>   drivers/media/platform/amd/isp4/isp4_video.c  | 1213 +++++++++++++++++
>>   drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
>>   22 files changed, 4898 insertions(+)
>>   create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
>>   create mode 100644 Documentation/admin-guide/media/amdisp4.dot
>>   create mode 100644 drivers/media/platform/amd/Kconfig
>>   create mode 100644 drivers/media/platform/amd/Makefile
>>   create mode 100644 drivers/media/platform/amd/isp4/Kconfig
>>   create mode 100644 drivers/media/platform/amd/isp4/Makefile
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_fw_cmd_resp.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h
>>

-- 
Regards,
Bin


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] Add AMD ISP4 driver
  2025-09-02  3:39     ` Du, Bin
@ 2025-09-02 15:53       ` Mario Limonciello
  2025-09-03  3:29         ` Du, Bin
  0 siblings, 1 reply; 10+ messages in thread
From: Mario Limonciello @ 2025-09-02 15:53 UTC (permalink / raw)
  To: Du, Bin, Laurent Pinchart
  Cc: mchehab, hverkuil, bryan.odonoghue, sakari.ailus,
	prabhakar.mahadev-lad.rj, linux-media, linux-kernel, sultan,
	pratap.nirujogi, benjamin.chan, king.li, gjorgji.rosikopulos,
	Phil.Jawich, Dominic.Antony, richard.gong, anson.tsao


On 9/1/2025 10:39 PM, Du, Bin wrote:
> Hi Laurent Pinchart, sorry for the confusion.
> 
> On 8/29/2025 12:58 AM, Laurent Pinchart wrote:
>> On Thu, Aug 28, 2025 at 06:56:06PM +0200, Laurent Pinchart wrote:
>>> Hi Bin Bu,
>>>
>>> Have you sent out the cover letter only ? I haven't received the rest of
>>> the series, and it's not found on lore.kernel.org either.
>>
>> I've just noticed you sent the rest later and separately, as
>> https://lore.kernel.org/all/20250828100811.95722-1-Bin.Du@amd.com/.
>>
> 
> Before sending the formal ones, i did some internal test, after the 
> cover letter, when i tried to send the rest, i encountered this error, 
> 4.4.2 Message submission rate for this client has exceeded the 
> configured limit. So i had to wait for some time so i could send again.

FYI - this was an AMD I/T SMTP server problem with git send-email.

I understand some other teams were hitting it too and worked with I/T 
and it should be fixed now.  If you have problems the next go around 
raise it I/T again.

> 
>>> On Thu, Aug 28, 2025 at 04:45:00PM +0800, Bin Du wrote:
>>>> Hello,
>>>>
>>>> AMD ISP4 is the AMD image processing gen 4 which can be found in HP 
>>>> ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
>>>> (https://ubuntu.com/certified/202411-36043)
>>>> This patch series introduces the initial driver support for the AMD 
>>>> ISP4.
>>>>
>>>> Patch summary:
>>>> - Powers up/off and initializes ISP HW
>>>> - Configures and kicks off ISP FW
>>>> - Interacts with APP using standard V4l2 interface by video node
>>>> - Controls ISP HW and interacts with ISP FW to do image processing
>>>> - Support enum/set output image format and resolution
>>>> - Support queueing buffer from app and dequeueing ISP filled buffer 
>>>> to App
>>>> - It supports libcamera ver0.2 SimplePipeline
>>>> - It is verified on qv4l2, cheese and qcam
>>>> - It is verified together with following patches
>>>>     platform/x86: Add AMD ISP platform config (https:// 
>>>> lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
>>>>     pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https:// 
>>>> github.com/torvalds/linux/commit/ 
>>>> e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
>>>>     drm/amd/amdgpu: Add GPIO resources required for amdisp (https:// 
>>>> gitlab.freedesktop.org/agd5f/linux/-/commit/ 
>>>> ad0f5966ed8297aa47b3184192b00b7379ae0758)
>>>>
>>>> AMD ISP4 Key features:
>>>> - Processes bayer raw data from the connected sensor and output them 
>>>> to different YUV formats
>>>> - Downscale input image to different output image resolution
>>>> - Pipeline to do image processing on the input image including 
>>>> demosaic, denoise, 3A, etc
>>>>
>>>> ----------
>>>>
>>>> Changes v2 -> v3:
>>>>
>>>> - All the dependent patches in other modules (drm/amd/amdgpu, 
>>>> platform/x86, pinctrl/amd) merged on upstream mainline kernel 
>>>> (https://github.com/torvalds/linux) v6.17.
>>>> - Removed usage of amdgpu structs in ISP driver. Added helper 
>>>> functions in amdgpu accepting opaque params from ISP driver to 
>>>> allocate and release ISP GART buffers.
>>>> - Moved sensor and MIPI phy control entirely into ISP FW instead of 
>>>> the previous hybrid approach controlling sensor from both FW and x86 
>>>> (sensor driver).
>>>> - Removed phy configuration and sensor binding as x86 (sensor 
>>>> driver) had relinquished the sensor control for ISP FW. With this 
>>>> approach the driver will be exposed as web camera like interface.
>>>> - New FW with built-in sensor driver is submitted on upstream linux- 
>>>> firmware repo (https://gitlab.com/kernel-firmware/linux-firmware/).
>>>> - Please note the new FW submitted is not directly compatible with 
>>>> OEM Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/tree/4.0) 
>>>> and the previous ISP V2 patch series.
>>>> - If intend to use the new FW, please rebuild OEM ISP4.0 Kernel with 
>>>> CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
>>>> - Included critical fixes from Sultan Alsawaf branch (https:// 
>>>> github.com/kerneltoast/kernel_x86_laptop.git) related to managing 
>>>> lifetime of isp buffers.
>>>>        media: amd: isp4: Add missing refcount tracking to mmap memop
>>>>        media: amd: isp4: Don't put or unmap the dmabuf when detaching
>>>>        media: amd: isp4: Don't increment refcount when dmabuf export 
>>>> fails
>>>>        media: amd: isp4: Fix possible use-after-free in 
>>>> isp4vid_vb2_put()
>>>>        media: amd: isp4: Always export a new dmabuf from get_dmabuf 
>>>> memop
>>>>        media: amd: isp4: Fix implicit dmabuf lifetime tracking
>>>>        media: amd: isp4: Fix possible use-after-free when putting 
>>>> implicit dmabuf
>>>>        media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
>>>>        media: amd: isp4: Move up buf->vaddr check in 
>>>> isp4vid_get_dmabuf()
>>>>        media: amd: isp4: Remove unused userptr memops
>>>>        media: amd: isp4: Add missing cleanup on error in 
>>>> isp4vid_vb2_alloc()
>>>>        media: amd: isp4: Release queued buffers on error in 
>>>> start_streaming
>>>> - Addressed all code related upstream comments
>>>> - Fix typo errors and other cosmetic issue.
>>>>
>>>>
>>>> Changes v1 -> v2:
>>>>
>>>> - Fix media CI test errors and valid warnings
>>>> - Reduce patch number in the series from 9 to 8 by merging 
>>>> MAINTAINERS adding patch to the first patch
>>>> - In patch 5
>>>>     - do modification to use remote endpoint instead of local endpoint
>>>>     - use link frequency and port number as start phy parameter 
>>>> instead of extra added phy-id and phy-bit-rate property of endpoint
>>>>
>>>> ----------
>>>>
>>>> It passes v4l2 compliance test, the test reports for:
>>>>
>>>> (a) amd_isp_capture device /dev/video0
>>>>
>>>> Compliance test for amd_isp_capture device /dev/video0:
>>>> -------------------------------------------------------
>>>>
>>>> atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
>>>> v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
>>>> v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17
>>>>
>>>> Compliance test for amd_isp_capture device /dev/video0:
>>>>
>>>> Driver Info:
>>>>          Driver name      : amd_isp_capture
>>>>          Card type        : amd_isp_capture
>>>>          Bus info         : platform:amd_isp_capture
>>>>          Driver version   : 6.14.0
>>>>          Capabilities     : 0xa4200001
>>>>                  Video Capture
>>>>                  I/O MC
>>>>                  Streaming
>>>>                  Extended Pix Format
>>>>                  Device Capabilities
>>>>          Device Caps      : 0x24200001
>>>>                  Video Capture
>>>>                  I/O MC
>>>>                  Streaming
>>>>                  Extended Pix Format
>>>> Media Driver Info:
>>>>          Driver name      : amd_isp_capture
>>>>          Model            : amd_isp41_mdev
>>>>          Serial           :
>>>>          Bus info         : platform:amd_isp_capture
>>>>          Media version    : 6.14.0
>>>>          Hardware revision: 0x00000000 (0)
>>>>          Driver version   : 6.14.0
>>>> Interface Info:
>>>>          ID               : 0x03000005
>>>>          Type             : V4L Video
>>>> Entity Info:
>>>>          ID               : 0x00000003 (3)
>>>>          Name             : Preview
>>>>          Function         : V4L2 I/O
>>>>          Pad 0x01000004   : 0: Sink
>>>>            Link 0x02000007: from remote pad 0x1000002 of entity 'amd 
>>>> isp4' (Image Signal Processor): Data, Enabled, Immutable
>>>>
>>>> Required ioctls:
>>>>          test MC information (see 'Media Driver Info' above): OK
>>>>          test VIDIOC_QUERYCAP: OK
>>>>          test invalid ioctls: OK
>>>>
>>>> Allow for multiple opens:
>>>>          test second /dev/video0 open: OK
>>>>          test VIDIOC_QUERYCAP: OK
>>>>          test VIDIOC_G/S_PRIORITY: OK
>>>>          test for unlimited opens: OK
>>>>
>>>> Debug ioctls:
>>>>          test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>>>>          test VIDIOC_LOG_STATUS: OK (Not Supported)
>>>>
>>>> Input ioctls:
>>>>          test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>>>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>>          test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>>>>          test VIDIOC_ENUMAUDIO: OK (Not Supported)
>>>>          test VIDIOC_G/S/ENUMINPUT: OK
>>>>          test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>>>          Inputs: 1 Audio Inputs: 0 Tuners: 0
>>>>
>>>> Output ioctls:
>>>>          test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>>>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>>          test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>>>>          test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>>>>          test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>>>>          Outputs: 0 Audio Outputs: 0 Modulators: 0
>>>>
>>>> Input/Output configuration ioctls:
>>>>          test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>>>>          test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>>>>          test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>>>>          test VIDIOC_G/S_EDID: OK (Not Supported)
>>>>
>>>> Control ioctls (Input 0):
>>>>          test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
>>>>          test VIDIOC_QUERYCTRL: OK (Not Supported)
>>>>          test VIDIOC_G/S_CTRL: OK (Not Supported)
>>>>          test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
>>>>          test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
>>>>          test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>>>          Standard Controls: 0 Private Controls: 0
>>>>
>>>> Format ioctls (Input 0):
>>>>          test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>>>>          test VIDIOC_G/S_PARM: OK
>>>>          test VIDIOC_G_FBUF: OK (Not Supported)
>>>>          test VIDIOC_G_FMT: OK
>>>>          test VIDIOC_TRY_FMT: OK
>>>>          test VIDIOC_S_FMT: OK
>>>>          test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>>>          test Cropping: OK (Not Supported)
>>>>          test Composing: OK (Not Supported)
>>>>          test Scaling: OK (Not Supported)
>>>>
>>>> Codec ioctls (Input 0):
>>>>          test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>>>>          test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>>>          test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>>>
>>>> Buffer ioctls (Input 0):
>>>>          test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>>>          test CREATE_BUFS maximum buffers: OK
>>>>          test VIDIOC_REMOVE_BUFS: OK
>>>>          test VIDIOC_EXPBUF: OK
>>>>          test Requests: OK (Not Supported)
>>>>          test blocking wait: OK
>>>>
>>>> Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, 
>>>> Failed: 0, Warnings: 0
>>>>
>>>> Please review and provide feedback.
>>>>
>>>> Many thanks,
>>>>
>>>> Bin Du (7):
>>>>    media: platform: amd: Introduce amd isp4 capture driver
>>>>    media: platform: amd: low level support for isp4 firmware
>>>>    media: platform: amd: Add isp4 fw and hw interface
>>>>    media: platform: amd: isp4 subdev and firmware loading handling 
>>>> added
>>>>    media: platform: amd: isp4 video node and buffers handling added
>>>>    media: platform: amd: isp4 debug fs logging and  more descriptive
>>>>      errors
>>>>    Documentation: add documentation of AMD isp 4 driver
>>>>
>>>>   Documentation/admin-guide/media/amdisp4-1.rst |   66 +
>>>>   Documentation/admin-guide/media/amdisp4.dot   |    8 +
>>>>   .../admin-guide/media/v4l-drivers.rst         |    1 +
>>>>   MAINTAINERS                                   |   25 +
>>>>   drivers/media/platform/Kconfig                |    1 +
>>>>   drivers/media/platform/Makefile               |    1 +
>>>>   drivers/media/platform/amd/Kconfig            |    3 +
>>>>   drivers/media/platform/amd/Makefile           |    3 +
>>>>   drivers/media/platform/amd/isp4/Kconfig       |   13 +
>>>>   drivers/media/platform/amd/isp4/Makefile      |   10 +
>>>>   drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
>>>>   drivers/media/platform/amd/isp4/isp4.h        |   26 +
>>>>   drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
>>>>   drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
>>>>   .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
>>>>   drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
>>>>   .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
>>>>   .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
>>>>   drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++++++
>>>>   drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
>>>>   drivers/media/platform/amd/isp4/isp4_video.c  | 1213 +++++++++++++ 
>>>> ++++
>>>>   drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
>>>>   22 files changed, 4898 insertions(+)
>>>>   create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
>>>>   create mode 100644 Documentation/admin-guide/media/amdisp4.dot
>>>>   create mode 100644 drivers/media/platform/amd/Kconfig
>>>>   create mode 100644 drivers/media/platform/amd/Makefile
>>>>   create mode 100644 drivers/media/platform/amd/isp4/Kconfig
>>>>   create mode 100644 drivers/media/platform/amd/isp4/Makefile
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.c
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.h
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_fw_cmd_resp.h
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h
>>
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/7] Add AMD ISP4 driver
  2025-09-02 15:53       ` Mario Limonciello
@ 2025-09-03  3:29         ` Du, Bin
  0 siblings, 0 replies; 10+ messages in thread
From: Du, Bin @ 2025-09-03  3:29 UTC (permalink / raw)
  To: Mario Limonciello, Laurent Pinchart
  Cc: mchehab, hverkuil, bryan.odonoghue, sakari.ailus,
	prabhakar.mahadev-lad.rj, linux-media, linux-kernel, sultan,
	pratap.nirujogi, benjamin.chan, king.li, gjorgji.rosikopulos,
	Phil.Jawich, Dominic.Antony, richard.gong, anson.tsao

Thanks Mario

On 9/2/2025 11:53 PM, Mario Limonciello wrote:
> 
> On 9/1/2025 10:39 PM, Du, Bin wrote:
>> Hi Laurent Pinchart, sorry for the confusion.
>>
>> On 8/29/2025 12:58 AM, Laurent Pinchart wrote:
>>> On Thu, Aug 28, 2025 at 06:56:06PM +0200, Laurent Pinchart wrote:
>>>> Hi Bin Bu,
>>>>
>>>> Have you sent out the cover letter only ? I haven't received the 
>>>> rest of
>>>> the series, and it's not found on lore.kernel.org either.
>>>
>>> I've just noticed you sent the rest later and separately, as
>>> https://lore.kernel.org/all/20250828100811.95722-1-Bin.Du@amd.com/.
>>>
>>
>> Before sending the formal ones, i did some internal test, after the 
>> cover letter, when i tried to send the rest, i encountered this error, 
>> 4.4.2 Message submission rate for this client has exceeded the 
>> configured limit. So i had to wait for some time so i could send again.
> 
> FYI - this was an AMD I/T SMTP server problem with git send-email.
> 
> I understand some other teams were hitting it too and worked with I/T 
> and it should be fixed now.  If you have problems the next go around 
> raise it I/T again.
> 

Good to know, sure, will raise ticket and complain to I/T if run into 
the same issue next time. :)

>>
>>>> On Thu, Aug 28, 2025 at 04:45:00PM +0800, Bin Du wrote:
>>>>> Hello,
>>>>>
>>>>> AMD ISP4 is the AMD image processing gen 4 which can be found in HP 
>>>>> ZBook Ultra G1a 14 inch Mobile Workstation PC ( Ryzen AI Max 385)
>>>>> (https://ubuntu.com/certified/202411-36043)
>>>>> This patch series introduces the initial driver support for the AMD 
>>>>> ISP4.
>>>>>
>>>>> Patch summary:
>>>>> - Powers up/off and initializes ISP HW
>>>>> - Configures and kicks off ISP FW
>>>>> - Interacts with APP using standard V4l2 interface by video node
>>>>> - Controls ISP HW and interacts with ISP FW to do image processing
>>>>> - Support enum/set output image format and resolution
>>>>> - Support queueing buffer from app and dequeueing ISP filled buffer 
>>>>> to App
>>>>> - It supports libcamera ver0.2 SimplePipeline
>>>>> - It is verified on qv4l2, cheese and qcam
>>>>> - It is verified together with following patches
>>>>>     platform/x86: Add AMD ISP platform config (https:// 
>>>>> lore.kernel.org/all/20250514215623.522746-1-pratap.nirujogi@amd.com/)
>>>>>     pinctrl: amd: isp411: Add amdisp GPIO pinctrl (https:// 
>>>>> github.com/torvalds/linux/commit/ 
>>>>> e97435ab09f3ad7b6a588dd7c4e45a96699bbb4a)
>>>>>     drm/amd/amdgpu: Add GPIO resources required for amdisp 
>>>>> (https:// gitlab.freedesktop.org/agd5f/linux/-/commit/ 
>>>>> ad0f5966ed8297aa47b3184192b00b7379ae0758)
>>>>>
>>>>> AMD ISP4 Key features:
>>>>> - Processes bayer raw data from the connected sensor and output 
>>>>> them to different YUV formats
>>>>> - Downscale input image to different output image resolution
>>>>> - Pipeline to do image processing on the input image including 
>>>>> demosaic, denoise, 3A, etc
>>>>>
>>>>> ----------
>>>>>
>>>>> Changes v2 -> v3:
>>>>>
>>>>> - All the dependent patches in other modules (drm/amd/amdgpu, 
>>>>> platform/x86, pinctrl/amd) merged on upstream mainline kernel 
>>>>> (https://github.com/torvalds/linux) v6.17.
>>>>> - Removed usage of amdgpu structs in ISP driver. Added helper 
>>>>> functions in amdgpu accepting opaque params from ISP driver to 
>>>>> allocate and release ISP GART buffers.
>>>>> - Moved sensor and MIPI phy control entirely into ISP FW instead of 
>>>>> the previous hybrid approach controlling sensor from both FW and 
>>>>> x86 (sensor driver).
>>>>> - Removed phy configuration and sensor binding as x86 (sensor 
>>>>> driver) had relinquished the sensor control for ISP FW. With this 
>>>>> approach the driver will be exposed as web camera like interface.
>>>>> - New FW with built-in sensor driver is submitted on upstream 
>>>>> linux- firmware repo (https://gitlab.com/kernel-firmware/linux- 
>>>>> firmware/).
>>>>> - Please note the new FW submitted is not directly compatible with 
>>>>> OEM Kernel ISP4.0 (https://github.com/amd/Linux_ISP_Kernel/ 
>>>>> tree/4.0) and the previous ISP V2 patch series.
>>>>> - If intend to use the new FW, please rebuild OEM ISP4.0 Kernel 
>>>>> with CONFIG_VIDEO_OV05C10=N and CONFIG_PINCTRL_AMDISP=Y.
>>>>> - Included critical fixes from Sultan Alsawaf branch (https:// 
>>>>> github.com/kerneltoast/kernel_x86_laptop.git) related to managing 
>>>>> lifetime of isp buffers.
>>>>>        media: amd: isp4: Add missing refcount tracking to mmap memop
>>>>>        media: amd: isp4: Don't put or unmap the dmabuf when detaching
>>>>>        media: amd: isp4: Don't increment refcount when dmabuf 
>>>>> export fails
>>>>>        media: amd: isp4: Fix possible use-after-free in 
>>>>> isp4vid_vb2_put()
>>>>>        media: amd: isp4: Always export a new dmabuf from get_dmabuf 
>>>>> memop
>>>>>        media: amd: isp4: Fix implicit dmabuf lifetime tracking
>>>>>        media: amd: isp4: Fix possible use-after-free when putting 
>>>>> implicit dmabuf
>>>>>        media: amd: isp4: Simplify isp4vid_get_dmabuf() arguments
>>>>>        media: amd: isp4: Move up buf->vaddr check in 
>>>>> isp4vid_get_dmabuf()
>>>>>        media: amd: isp4: Remove unused userptr memops
>>>>>        media: amd: isp4: Add missing cleanup on error in 
>>>>> isp4vid_vb2_alloc()
>>>>>        media: amd: isp4: Release queued buffers on error in 
>>>>> start_streaming
>>>>> - Addressed all code related upstream comments
>>>>> - Fix typo errors and other cosmetic issue.
>>>>>
>>>>>
>>>>> Changes v1 -> v2:
>>>>>
>>>>> - Fix media CI test errors and valid warnings
>>>>> - Reduce patch number in the series from 9 to 8 by merging 
>>>>> MAINTAINERS adding patch to the first patch
>>>>> - In patch 5
>>>>>     - do modification to use remote endpoint instead of local endpoint
>>>>>     - use link frequency and port number as start phy parameter 
>>>>> instead of extra added phy-id and phy-bit-rate property of endpoint
>>>>>
>>>>> ----------
>>>>>
>>>>> It passes v4l2 compliance test, the test reports for:
>>>>>
>>>>> (a) amd_isp_capture device /dev/video0
>>>>>
>>>>> Compliance test for amd_isp_capture device /dev/video0:
>>>>> -------------------------------------------------------
>>>>>
>>>>> atg@atg-HP-PV:~/bin$ ./v4l2-compliance -d /dev/video0
>>>>> v4l2-compliance 1.29.0-5348, 64 bits, 64-bit time_t
>>>>> v4l2-compliance SHA: 75e3f0e2c2cb 2025-03-17 18:12:17
>>>>>
>>>>> Compliance test for amd_isp_capture device /dev/video0:
>>>>>
>>>>> Driver Info:
>>>>>          Driver name      : amd_isp_capture
>>>>>          Card type        : amd_isp_capture
>>>>>          Bus info         : platform:amd_isp_capture
>>>>>          Driver version   : 6.14.0
>>>>>          Capabilities     : 0xa4200001
>>>>>                  Video Capture
>>>>>                  I/O MC
>>>>>                  Streaming
>>>>>                  Extended Pix Format
>>>>>                  Device Capabilities
>>>>>          Device Caps      : 0x24200001
>>>>>                  Video Capture
>>>>>                  I/O MC
>>>>>                  Streaming
>>>>>                  Extended Pix Format
>>>>> Media Driver Info:
>>>>>          Driver name      : amd_isp_capture
>>>>>          Model            : amd_isp41_mdev
>>>>>          Serial           :
>>>>>          Bus info         : platform:amd_isp_capture
>>>>>          Media version    : 6.14.0
>>>>>          Hardware revision: 0x00000000 (0)
>>>>>          Driver version   : 6.14.0
>>>>> Interface Info:
>>>>>          ID               : 0x03000005
>>>>>          Type             : V4L Video
>>>>> Entity Info:
>>>>>          ID               : 0x00000003 (3)
>>>>>          Name             : Preview
>>>>>          Function         : V4L2 I/O
>>>>>          Pad 0x01000004   : 0: Sink
>>>>>            Link 0x02000007: from remote pad 0x1000002 of entity 
>>>>> 'amd isp4' (Image Signal Processor): Data, Enabled, Immutable
>>>>>
>>>>> Required ioctls:
>>>>>          test MC information (see 'Media Driver Info' above): OK
>>>>>          test VIDIOC_QUERYCAP: OK
>>>>>          test invalid ioctls: OK
>>>>>
>>>>> Allow for multiple opens:
>>>>>          test second /dev/video0 open: OK
>>>>>          test VIDIOC_QUERYCAP: OK
>>>>>          test VIDIOC_G/S_PRIORITY: OK
>>>>>          test for unlimited opens: OK
>>>>>
>>>>> Debug ioctls:
>>>>>          test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>>>>>          test VIDIOC_LOG_STATUS: OK (Not Supported)
>>>>>
>>>>> Input ioctls:
>>>>>          test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>>>>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>>>          test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>>>>>          test VIDIOC_ENUMAUDIO: OK (Not Supported)
>>>>>          test VIDIOC_G/S/ENUMINPUT: OK
>>>>>          test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>>>>          Inputs: 1 Audio Inputs: 0 Tuners: 0
>>>>>
>>>>> Output ioctls:
>>>>>          test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>>>>>          test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>>>          test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>>>>>          test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>>>>>          test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>>>>>          Outputs: 0 Audio Outputs: 0 Modulators: 0
>>>>>
>>>>> Input/Output configuration ioctls:
>>>>>          test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>>>>>          test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>>>>>          test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>>>>>          test VIDIOC_G/S_EDID: OK (Not Supported)
>>>>>
>>>>> Control ioctls (Input 0):
>>>>>          test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
>>>>>          test VIDIOC_QUERYCTRL: OK (Not Supported)
>>>>>          test VIDIOC_G/S_CTRL: OK (Not Supported)
>>>>>          test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
>>>>>          test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
>>>>>          test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>>>>          Standard Controls: 0 Private Controls: 0
>>>>>
>>>>> Format ioctls (Input 0):
>>>>>          test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>>>>>          test VIDIOC_G/S_PARM: OK
>>>>>          test VIDIOC_G_FBUF: OK (Not Supported)
>>>>>          test VIDIOC_G_FMT: OK
>>>>>          test VIDIOC_TRY_FMT: OK
>>>>>          test VIDIOC_S_FMT: OK
>>>>>          test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>>>>          test Cropping: OK (Not Supported)
>>>>>          test Composing: OK (Not Supported)
>>>>>          test Scaling: OK (Not Supported)
>>>>>
>>>>> Codec ioctls (Input 0):
>>>>>          test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>>>>>          test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>>>>          test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>>>>
>>>>> Buffer ioctls (Input 0):
>>>>>          test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>>>>          test CREATE_BUFS maximum buffers: OK
>>>>>          test VIDIOC_REMOVE_BUFS: OK
>>>>>          test VIDIOC_EXPBUF: OK
>>>>>          test Requests: OK (Not Supported)
>>>>>          test blocking wait: OK
>>>>>
>>>>> Total for amd_isp_capture device /dev/video0: 49, Succeeded: 49, 
>>>>> Failed: 0, Warnings: 0
>>>>>
>>>>> Please review and provide feedback.
>>>>>
>>>>> Many thanks,
>>>>>
>>>>> Bin Du (7):
>>>>>    media: platform: amd: Introduce amd isp4 capture driver
>>>>>    media: platform: amd: low level support for isp4 firmware
>>>>>    media: platform: amd: Add isp4 fw and hw interface
>>>>>    media: platform: amd: isp4 subdev and firmware loading handling 
>>>>> added
>>>>>    media: platform: amd: isp4 video node and buffers handling added
>>>>>    media: platform: amd: isp4 debug fs logging and  more descriptive
>>>>>      errors
>>>>>    Documentation: add documentation of AMD isp 4 driver
>>>>>
>>>>>   Documentation/admin-guide/media/amdisp4-1.rst |   66 +
>>>>>   Documentation/admin-guide/media/amdisp4.dot   |    8 +
>>>>>   .../admin-guide/media/v4l-drivers.rst         |    1 +
>>>>>   MAINTAINERS                                   |   25 +
>>>>>   drivers/media/platform/Kconfig                |    1 +
>>>>>   drivers/media/platform/Makefile               |    1 +
>>>>>   drivers/media/platform/amd/Kconfig            |    3 +
>>>>>   drivers/media/platform/amd/Makefile           |    3 +
>>>>>   drivers/media/platform/amd/isp4/Kconfig       |   13 +
>>>>>   drivers/media/platform/amd/isp4/Makefile      |   10 +
>>>>>   drivers/media/platform/amd/isp4/isp4.c        |  237 ++++
>>>>>   drivers/media/platform/amd/isp4/isp4.h        |   26 +
>>>>>   drivers/media/platform/amd/isp4/isp4_debug.c  |  272 ++++
>>>>>   drivers/media/platform/amd/isp4/isp4_debug.h  |   41 +
>>>>>   .../platform/amd/isp4/isp4_fw_cmd_resp.h      |  314 +++++
>>>>>   drivers/media/platform/amd/isp4/isp4_hw_reg.h |  125 ++
>>>>>   .../media/platform/amd/isp4/isp4_interface.c  |  972 +++++++++++++
>>>>>   .../media/platform/amd/isp4/isp4_interface.h  |  149 ++
>>>>>   drivers/media/platform/amd/isp4/isp4_subdev.c | 1198 ++++++++++++ 
>>>>> ++++
>>>>>   drivers/media/platform/amd/isp4/isp4_subdev.h |  133 ++
>>>>>   drivers/media/platform/amd/isp4/isp4_video.c  | 1213 ++++++++++++ 
>>>>> + ++++
>>>>>   drivers/media/platform/amd/isp4/isp4_video.h  |   87 ++
>>>>>   22 files changed, 4898 insertions(+)
>>>>>   create mode 100644 Documentation/admin-guide/media/amdisp4-1.rst
>>>>>   create mode 100644 Documentation/admin-guide/media/amdisp4.dot
>>>>>   create mode 100644 drivers/media/platform/amd/Kconfig
>>>>>   create mode 100644 drivers/media/platform/amd/Makefile
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/Kconfig
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/Makefile
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.c
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4.h
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.c
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_debug.h
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/ 
>>>>> isp4_fw_cmd_resp.h
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_hw_reg.h
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.c
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_interface.h
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.c
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_subdev.h
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.c
>>>>>   create mode 100644 drivers/media/platform/amd/isp4/isp4_video.h
>>>
>>
> 

-- 
Regards,
Bin


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-09-03  3:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28  8:45 [PATCH v3 0/7] Add AMD ISP4 driver Bin Du
2025-08-28 16:56 ` Laurent Pinchart
2025-08-28 16:58   ` Limonciello, Mario
2025-09-02  3:21     ` Du, Bin
2025-08-28 16:58   ` Laurent Pinchart
2025-09-02  3:39     ` Du, Bin
2025-09-02 15:53       ` Mario Limonciello
2025-09-03  3:29         ` Du, Bin
2025-08-31 13:41 ` Alexey Zagorodnikov
2025-09-02  6:16   ` Du, Bin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).