mbox series

[v7,0/4] Add support for KeemBay DRM driver

Message ID 1598904172-30865-1-git-send-email-anitha.chrisanthus@intel.com (mailing list archive)
Headers show
Series Add support for KeemBay DRM driver | expand

Message

Chrisanthus, Anitha Aug. 31, 2020, 8:02 p.m. UTC
This is a new DRM driver for Intel's KeemBay SOC.
The SoC couples an ARM Cortex A53 CPU with an Intel
Movidius VPU.

This driver is tested with the KMB EVM board which is the refernce baord
for Keem Bay SOC. The SOC's display pipeline is as follows

+--------------+    +---------+    +-----------------------+
|LCD controller| -> |Mipi DSI | -> |Mipi to HDMI Converter |
+--------------+    +---------+    +-----------------------+

LCD controller and Mipi DSI transmitter are part of the SOC and
mipi to HDMI converter is ADV7535 for KMB EVM board.

The DRM driver is a basic KMS atomic modesetting display driver and
has no 2D or 3D graphics.It calls into the ADV bridge driver at
the connector level.

Only 1080p resolution and single plane is supported at this time.
The usecase is for debugging video and camera outputs.

Device tree patches are under review here
https://lore.kernel.org/linux-arm-kernel/20200708175020.194436-1-daniele.alessandrelli@linux.intel.com/T/

Changes since v1:
- Removed redundant license text, updated license
- Rearranged include blocks
- renamed global vars and removed extern in c
- Used upclassing for dev_private
- Used drm_dev_init in drm device create
- minor cleanups

Changes since v2:
- squashed all commits to a single commit
- logging changed to drm_info, drm_dbg etc.
- used devm_drm_dev_alloc()
- removed commented out sections and general cleanup

Changes since v3:
- renamed dev_p to kmb
- moved clocks under kmb_clock, consolidated clk initializations
- use drmm functions
- use DRM_GEM_CMA_DRIVER_OPS_VMAP
- more cleanups

Changes since v4:
- corrected spellings

Changes since v5:
- corrected checkpatch warnings/checks
   -Please ignore checkpatch checks on Camelcase - this is how it is
   named in the databook
   - Please ignore checkpatch warnings on misspelled for hsa, dout,
   widthn etc. - they are spelled as in the databook
   - Please ignore checkpatch checks on macro arguments reuse -
   its confirmed ok

Changes since v6:
- review changes Sam Ravnborg and Thomas Zimmerman
	split patch into 4 parts, part1 register definitions, part2 display
	driver files, part3 mipi dsi, part4 build files (Sam)
	removed kmb_crtc.h kmb_crtc_cleanup (Thomas)
	renamed mode_set, kmb_load, inlined unload (Thomas)
	moved remaining logging to drm_*(Thomas)
	re-orged driver initialization (Thomas)
	moved plane_status to drm_private (Sam)
	removed unnecessary logs and defines and ifdef codes (Sam)
	split dphy_init_sequence smaller (Sam)
	removed redundant checks in kmb_dsi (Sam)
	changed kmb_dsi_init to drm_bridge_connector_init and
	drm_connector_attach_encoder to bridge's connector (Sam)
	call helper_check in plane_atomic_check (Sam)
	renamed set to get for bpp and format functions(Sam)
	use drm helper functions for reset, duplicate/destroy state instead
	of kmb functions (Sam)
	removed kmb_priv from kmb_plane and removed kmb_plane_state (Sam)

Anitha Chrisanthus (4):
  drm/kmb: Keem Bay driver register definition
  drm/kmb: Add support for KeemBay Display
  drm/kmb: Mipi DSI part of the display driver
  drm/kmb: Build files for KeemBay Display driver

 drivers/gpu/drm/Kconfig         |    2 +
 drivers/gpu/drm/Makefile        |    1 +
 drivers/gpu/drm/kmb/Kconfig     |   13 +
 drivers/gpu/drm/kmb/Makefile    |    2 +
 drivers/gpu/drm/kmb/kmb_crtc.c  |  224 ++++++
 drivers/gpu/drm/kmb/kmb_drv.c   |  676 +++++++++++++++++
 drivers/gpu/drm/kmb/kmb_drv.h   |  170 +++++
 drivers/gpu/drm/kmb/kmb_dsi.c   | 1523 +++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/kmb/kmb_dsi.h   |  350 +++++++++
 drivers/gpu/drm/kmb/kmb_plane.c |  480 ++++++++++++
 drivers/gpu/drm/kmb/kmb_plane.h |  110 +++
 drivers/gpu/drm/kmb/kmb_regs.h  |  748 +++++++++++++++++++
 12 files changed, 4299 insertions(+)
 create mode 100644 drivers/gpu/drm/kmb/Kconfig
 create mode 100644 drivers/gpu/drm/kmb/Makefile
 create mode 100644 drivers/gpu/drm/kmb/kmb_crtc.c
 create mode 100644 drivers/gpu/drm/kmb/kmb_drv.c
 create mode 100644 drivers/gpu/drm/kmb/kmb_drv.h
 create mode 100644 drivers/gpu/drm/kmb/kmb_dsi.c
 create mode 100644 drivers/gpu/drm/kmb/kmb_dsi.h
 create mode 100644 drivers/gpu/drm/kmb/kmb_plane.c
 create mode 100644 drivers/gpu/drm/kmb/kmb_plane.h
 create mode 100644 drivers/gpu/drm/kmb/kmb_regs.h

Comments

Daniel Vetter Sept. 10, 2020, 8:42 a.m. UTC | #1
On Mon, Aug 31, 2020 at 01:02:48PM -0700, Anitha Chrisanthus wrote:
> This is a new DRM driver for Intel's KeemBay SOC.
> The SoC couples an ARM Cortex A53 CPU with an Intel
> Movidius VPU.
> 
> This driver is tested with the KMB EVM board which is the refernce baord
> for Keem Bay SOC. The SOC's display pipeline is as follows
> 
> +--------------+    +---------+    +-----------------------+
> |LCD controller| -> |Mipi DSI | -> |Mipi to HDMI Converter |
> +--------------+    +---------+    +-----------------------+
> 
> LCD controller and Mipi DSI transmitter are part of the SOC and
> mipi to HDMI converter is ADV7535 for KMB EVM board.
> 
> The DRM driver is a basic KMS atomic modesetting display driver and
> has no 2D or 3D graphics.It calls into the ADV bridge driver at
> the connector level.
> 
> Only 1080p resolution and single plane is supported at this time.
> The usecase is for debugging video and camera outputs.
> 
> Device tree patches are under review here
> https://lore.kernel.org/linux-arm-kernel/20200708175020.194436-1-daniele.alessandrelli@linux.intel.com/T/

I've looked at the code, and imo looks fairly reasonable. I think the
remaining things can also be polished in-tree, and we could start merging
the code already. For that 2 things are missing:

- Need a MAINTAINERS entry for this (I'm assuming you're volunteering)
- You need drm-misc commit rights set up so you can push patches, see

https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#validating-changes-with-igt

The docs there also have howto and everything.

Cheers, Daniel

> 
> Changes since v1:
> - Removed redundant license text, updated license
> - Rearranged include blocks
> - renamed global vars and removed extern in c
> - Used upclassing for dev_private
> - Used drm_dev_init in drm device create
> - minor cleanups
> 
> Changes since v2:
> - squashed all commits to a single commit
> - logging changed to drm_info, drm_dbg etc.
> - used devm_drm_dev_alloc()
> - removed commented out sections and general cleanup
> 
> Changes since v3:
> - renamed dev_p to kmb
> - moved clocks under kmb_clock, consolidated clk initializations
> - use drmm functions
> - use DRM_GEM_CMA_DRIVER_OPS_VMAP
> - more cleanups
> 
> Changes since v4:
> - corrected spellings
> 
> Changes since v5:
> - corrected checkpatch warnings/checks
>    -Please ignore checkpatch checks on Camelcase - this is how it is
>    named in the databook
>    - Please ignore checkpatch warnings on misspelled for hsa, dout,
>    widthn etc. - they are spelled as in the databook
>    - Please ignore checkpatch checks on macro arguments reuse -
>    its confirmed ok
> 
> Changes since v6:
> - review changes Sam Ravnborg and Thomas Zimmerman
> 	split patch into 4 parts, part1 register definitions, part2 display
> 	driver files, part3 mipi dsi, part4 build files (Sam)
> 	removed kmb_crtc.h kmb_crtc_cleanup (Thomas)
> 	renamed mode_set, kmb_load, inlined unload (Thomas)
> 	moved remaining logging to drm_*(Thomas)
> 	re-orged driver initialization (Thomas)
> 	moved plane_status to drm_private (Sam)
> 	removed unnecessary logs and defines and ifdef codes (Sam)
> 	split dphy_init_sequence smaller (Sam)
> 	removed redundant checks in kmb_dsi (Sam)
> 	changed kmb_dsi_init to drm_bridge_connector_init and
> 	drm_connector_attach_encoder to bridge's connector (Sam)
> 	call helper_check in plane_atomic_check (Sam)
> 	renamed set to get for bpp and format functions(Sam)
> 	use drm helper functions for reset, duplicate/destroy state instead
> 	of kmb functions (Sam)
> 	removed kmb_priv from kmb_plane and removed kmb_plane_state (Sam)
> 
> Anitha Chrisanthus (4):
>   drm/kmb: Keem Bay driver register definition
>   drm/kmb: Add support for KeemBay Display
>   drm/kmb: Mipi DSI part of the display driver
>   drm/kmb: Build files for KeemBay Display driver
> 
>  drivers/gpu/drm/Kconfig         |    2 +
>  drivers/gpu/drm/Makefile        |    1 +
>  drivers/gpu/drm/kmb/Kconfig     |   13 +
>  drivers/gpu/drm/kmb/Makefile    |    2 +
>  drivers/gpu/drm/kmb/kmb_crtc.c  |  224 ++++++
>  drivers/gpu/drm/kmb/kmb_drv.c   |  676 +++++++++++++++++
>  drivers/gpu/drm/kmb/kmb_drv.h   |  170 +++++
>  drivers/gpu/drm/kmb/kmb_dsi.c   | 1523 +++++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/kmb/kmb_dsi.h   |  350 +++++++++
>  drivers/gpu/drm/kmb/kmb_plane.c |  480 ++++++++++++
>  drivers/gpu/drm/kmb/kmb_plane.h |  110 +++
>  drivers/gpu/drm/kmb/kmb_regs.h  |  748 +++++++++++++++++++
>  12 files changed, 4299 insertions(+)
>  create mode 100644 drivers/gpu/drm/kmb/Kconfig
>  create mode 100644 drivers/gpu/drm/kmb/Makefile
>  create mode 100644 drivers/gpu/drm/kmb/kmb_crtc.c
>  create mode 100644 drivers/gpu/drm/kmb/kmb_drv.c
>  create mode 100644 drivers/gpu/drm/kmb/kmb_drv.h
>  create mode 100644 drivers/gpu/drm/kmb/kmb_dsi.c
>  create mode 100644 drivers/gpu/drm/kmb/kmb_dsi.h
>  create mode 100644 drivers/gpu/drm/kmb/kmb_plane.c
>  create mode 100644 drivers/gpu/drm/kmb/kmb_plane.h
>  create mode 100644 drivers/gpu/drm/kmb/kmb_regs.h
> 
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Chrisanthus, Anitha Sept. 10, 2020, 10:45 p.m. UTC | #2
Hi Daniel,
Thanks for your review. I have requested drm-next access here
https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/291

Will address your comments in next emails.

thanks,
Anitha

> -----Original Message-----
> From: Daniel Vetter <daniel@ffwll.ch>
> Sent: Thursday, September 10, 2020 1:42 AM
> To: Chrisanthus, Anitha <anitha.chrisanthus@intel.com>
> Cc: dri-devel@lists.freedesktop.org; Paauwe, Bob J
> <bob.j.paauwe@intel.com>; Dea, Edmund J <edmund.j.dea@intel.com>;
> Vetter, Daniel <daniel.vetter@intel.com>
> Subject: Re: [PATCH v7 0/4] Add support for KeemBay DRM driver
> 
> On Mon, Aug 31, 2020 at 01:02:48PM -0700, Anitha Chrisanthus wrote:
> > This is a new DRM driver for Intel's KeemBay SOC.
> > The SoC couples an ARM Cortex A53 CPU with an Intel
> > Movidius VPU.
> >
> > This driver is tested with the KMB EVM board which is the refernce baord
> > for Keem Bay SOC. The SOC's display pipeline is as follows
> >
> > +--------------+    +---------+    +-----------------------+
> > |LCD controller| -> |Mipi DSI | -> |Mipi to HDMI Converter |
> > +--------------+    +---------+    +-----------------------+
> >
> > LCD controller and Mipi DSI transmitter are part of the SOC and
> > mipi to HDMI converter is ADV7535 for KMB EVM board.
> >
> > The DRM driver is a basic KMS atomic modesetting display driver and
> > has no 2D or 3D graphics.It calls into the ADV bridge driver at
> > the connector level.
> >
> > Only 1080p resolution and single plane is supported at this time.
> > The usecase is for debugging video and camera outputs.
> >
> > Device tree patches are under review here
> > https://lore.kernel.org/linux-arm-kernel/20200708175020.194436-1-
> daniele.alessandrelli@linux.intel.com/T/
> 
> I've looked at the code, and imo looks fairly reasonable. I think the
> remaining things can also be polished in-tree, and we could start merging
> the code already. For that 2 things are missing:
> 
> - Need a MAINTAINERS entry for this (I'm assuming you're volunteering)
> - You need drm-misc commit rights set up so you can push patches, see
> 
> https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#validating-
> changes-with-igt
> 
> The docs there also have howto and everything.
> 
> Cheers, Daniel
> 
> >
> > Changes since v1:
> > - Removed redundant license text, updated license
> > - Rearranged include blocks
> > - renamed global vars and removed extern in c
> > - Used upclassing for dev_private
> > - Used drm_dev_init in drm device create
> > - minor cleanups
> >
> > Changes since v2:
> > - squashed all commits to a single commit
> > - logging changed to drm_info, drm_dbg etc.
> > - used devm_drm_dev_alloc()
> > - removed commented out sections and general cleanup
> >
> > Changes since v3:
> > - renamed dev_p to kmb
> > - moved clocks under kmb_clock, consolidated clk initializations
> > - use drmm functions
> > - use DRM_GEM_CMA_DRIVER_OPS_VMAP
> > - more cleanups
> >
> > Changes since v4:
> > - corrected spellings
> >
> > Changes since v5:
> > - corrected checkpatch warnings/checks
> >    -Please ignore checkpatch checks on Camelcase - this is how it is
> >    named in the databook
> >    - Please ignore checkpatch warnings on misspelled for hsa, dout,
> >    widthn etc. - they are spelled as in the databook
> >    - Please ignore checkpatch checks on macro arguments reuse -
> >    its confirmed ok
> >
> > Changes since v6:
> > - review changes Sam Ravnborg and Thomas Zimmerman
> > 	split patch into 4 parts, part1 register definitions, part2 display
> > 	driver files, part3 mipi dsi, part4 build files (Sam)
> > 	removed kmb_crtc.h kmb_crtc_cleanup (Thomas)
> > 	renamed mode_set, kmb_load, inlined unload (Thomas)
> > 	moved remaining logging to drm_*(Thomas)
> > 	re-orged driver initialization (Thomas)
> > 	moved plane_status to drm_private (Sam)
> > 	removed unnecessary logs and defines and ifdef codes (Sam)
> > 	split dphy_init_sequence smaller (Sam)
> > 	removed redundant checks in kmb_dsi (Sam)
> > 	changed kmb_dsi_init to drm_bridge_connector_init and
> > 	drm_connector_attach_encoder to bridge's connector (Sam)
> > 	call helper_check in plane_atomic_check (Sam)
> > 	renamed set to get for bpp and format functions(Sam)
> > 	use drm helper functions for reset, duplicate/destroy state instead
> > 	of kmb functions (Sam)
> > 	removed kmb_priv from kmb_plane and removed kmb_plane_state
> (Sam)
> >
> > Anitha Chrisanthus (4):
> >   drm/kmb: Keem Bay driver register definition
> >   drm/kmb: Add support for KeemBay Display
> >   drm/kmb: Mipi DSI part of the display driver
> >   drm/kmb: Build files for KeemBay Display driver
> >
> >  drivers/gpu/drm/Kconfig         |    2 +
> >  drivers/gpu/drm/Makefile        |    1 +
> >  drivers/gpu/drm/kmb/Kconfig     |   13 +
> >  drivers/gpu/drm/kmb/Makefile    |    2 +
> >  drivers/gpu/drm/kmb/kmb_crtc.c  |  224 ++++++
> >  drivers/gpu/drm/kmb/kmb_drv.c   |  676 +++++++++++++++++
> >  drivers/gpu/drm/kmb/kmb_drv.h   |  170 +++++
> >  drivers/gpu/drm/kmb/kmb_dsi.c   | 1523
> +++++++++++++++++++++++++++++++++++++++
> >  drivers/gpu/drm/kmb/kmb_dsi.h   |  350 +++++++++
> >  drivers/gpu/drm/kmb/kmb_plane.c |  480 ++++++++++++
> >  drivers/gpu/drm/kmb/kmb_plane.h |  110 +++
> >  drivers/gpu/drm/kmb/kmb_regs.h  |  748 +++++++++++++++++++
> >  12 files changed, 4299 insertions(+)
> >  create mode 100644 drivers/gpu/drm/kmb/Kconfig
> >  create mode 100644 drivers/gpu/drm/kmb/Makefile
> >  create mode 100644 drivers/gpu/drm/kmb/kmb_crtc.c
> >  create mode 100644 drivers/gpu/drm/kmb/kmb_drv.c
> >  create mode 100644 drivers/gpu/drm/kmb/kmb_drv.h
> >  create mode 100644 drivers/gpu/drm/kmb/kmb_dsi.c
> >  create mode 100644 drivers/gpu/drm/kmb/kmb_dsi.h
> >  create mode 100644 drivers/gpu/drm/kmb/kmb_plane.c
> >  create mode 100644 drivers/gpu/drm/kmb/kmb_plane.h
> >  create mode 100644 drivers/gpu/drm/kmb/kmb_regs.h
> >
> > --
> > 2.7.4
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
Rob Herring (Arm) Oct. 7, 2020, 1:37 p.m. UTC | #3
On Mon, Aug 31, 2020 at 3:03 PM Anitha Chrisanthus
<anitha.chrisanthus@intel.com> wrote:
>
> This is a new DRM driver for Intel's KeemBay SOC.
> The SoC couples an ARM Cortex A53 CPU with an Intel
> Movidius VPU.
>
> This driver is tested with the KMB EVM board which is the refernce baord
> for Keem Bay SOC. The SOC's display pipeline is as follows
>
> +--------------+    +---------+    +-----------------------+
> |LCD controller| -> |Mipi DSI | -> |Mipi to HDMI Converter |
> +--------------+    +---------+    +-----------------------+
>
> LCD controller and Mipi DSI transmitter are part of the SOC and
> mipi to HDMI converter is ADV7535 for KMB EVM board.
>
> The DRM driver is a basic KMS atomic modesetting display driver and
> has no 2D or 3D graphics.It calls into the ADV bridge driver at
> the connector level.
>
> Only 1080p resolution and single plane is supported at this time.
> The usecase is for debugging video and camera outputs.
>
> Device tree patches are under review here
> https://lore.kernel.org/linux-arm-kernel/20200708175020.194436-1-daniele.alessandrelli@linux.intel.com/T/

The bindings should be part of this series.

Rob