RE: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support

2023-10-02 Thread Biju Das
Hi Jacopo,

> Subject: Re: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support
> 
> Hi Biju
> 
> On Mon, Sep 18, 2023 at 08:09:58AM +, Biju Das wrote:
> > Hi Jacopo Mondi,
> >
> > Looks like you are happy with my response for V10. I will send V11 soon.
> 
> Sorry for the late reply..
> 
> See below, I only see two "controversial" points
> 
> >
> > Cheers,
> > Biju
> >
> > > -Original Message-----
> > > From: Biju Das 
> > > Sent: Friday, September 8, 2023 2:24 PM
> > > Subject: RE: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support
> > >
> 
>  [snip]
> 
> > > >
> > > > > +
> > > > > + ditr0 = (DU_DITR0_DEMD_HIGH
> > > >
> > > > I see most registers definition in rzg2l_du_regs.h being only used
> > > > by the crtc driver (some of them are not even used). Why a
> > > > separate header file ?
> > >
> > > For consistency I added header file similar to R-Car. Please let me
> > > know this to be added in .c ?
> > >
> 
> 
> I would say up to you, as R-Car does the same. In general, if a symbol
> doesn't need to be exported to any other file, it could very well live in
> the .c file.

Agreed.

> 
> > > >
> > > > > +   | ((mode->flags & DRM_MODE_FLAG_PVSYNC) ?
> DU_DITR0_VSPOL : 0)
> > > > > +   | ((mode->flags & DRM_MODE_FLAG_PHSYNC) ?
> DU_DITR0_HSPOL :
> 
> [snip]
> 
> > > > -
> > > > > + * Format helpers
> > > > > + */
> > > > > +
> > > > > +static const struct rzg2l_du_format_info rzg2l_du_format_infos[] =
> {
> > > > > + {
> > > > > + .fourcc = DRM_FORMAT_RGB565,
> > > > > + .v4l2 = V4L2_PIX_FMT_RGB565,
> > > > > + .bpp = 16,
> > > > > + .planes = 1,
> > > > > + .hsub = 1,
> > > > > + }, {
> > > > > + .fourcc = DRM_FORMAT_ARGB1555,
> > > > > + .v4l2 = V4L2_PIX_FMT_ARGB555,
> > > > > + .bpp = 16,
> > > > > + .planes = 1,
> > > > > + .hsub = 1,
> > > > > + }, {
> > > > > + .fourcc = DRM_FORMAT_XRGB1555,
> > > > > + .v4l2 = V4L2_PIX_FMT_XRGB555,
> > > > > + .bpp = 16,
> > > > > + .planes = 1,
> > > > > + }, {
> > > > > + .fourcc = DRM_FORMAT_XRGB,
> > > > > + .v4l2 = V4L2_PIX_FMT_XBGR32,
> > > > > + .bpp = 32,
> > > > > + .planes = 1,
> > > > > + .hsub = 1,
> > > > > + }, {
> > > > > + .fourcc = DRM_FORMAT_ARGB,
> > > > > + .v4l2 = V4L2_PIX_FMT_ABGR32,
> > > > > + .bpp = 32,
> > > > > + .planes = 1,
> > > > > + .hsub = 1,
> > > > > + }, {
> > > > > + .fourcc = DRM_FORMAT_UYVY,
> > > > > + .v4l2 = V4L2_PIX_FMT_UYVY,
> > > > > + .bpp = 16,
> > > > > + .planes = 1,
> > > > > + .hsub = 2,
> > > > > + }, {
> > > > > + .fourcc = DRM_FORMAT_YUYV,
> > > > > + .v4l2 = V4L2_PIX_FMT_YUYV,
> > > > > + .bpp = 16,
> > > > > + .planes = 1,
> > > > > + .hsub = 2,
> > > > > + }, {
> > > > > + .fourcc = DRM_FORMAT_NV12,
> > > > > + .v4l2 = V4L2_PIX_FMT_NV12M,
> > > > > + .bpp = 12,
> > > > > + .planes = 2,
> > > > > + .hsub = 2,
> > > > > + }, {
> > > > > + .fourcc = DRM_FORMAT_NV21,
> > > > > + .v4l2 = V4L2_PIX_FMT_NV21M,
> > > > > + .bpp = 12,
> > > > > + .planes = 2,
> > > > > + .hsub = 2,
> > > > > + }, {
> > > > > + .fourcc = DRM_FORMAT_NV16,
> > > > > + .v4l2 = V4L2_PIX_FMT_NV16M,
> > > > > +  

Re: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support

2023-09-19 Thread Jacopo Mondi
Hi Biju

On Mon, Sep 18, 2023 at 08:09:58AM +, Biju Das wrote:
> Hi Jacopo Mondi,
>
> Looks like you are happy with my response for V10. I will send V11 soon.

Sorry for the late reply..

See below, I only see two "controversial" points

>
> Cheers,
> Biju
>
> > -Original Message-
> > From: Biju Das 
> > Sent: Friday, September 8, 2023 2:24 PM
> > Subject: RE: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support
> >

 [snip]

> > >
> > > > +
> > > > +   ditr0 = (DU_DITR0_DEMD_HIGH
> > >
> > > I see most registers definition in rzg2l_du_regs.h being only used by
> > > the crtc driver (some of them are not even used). Why a separate
> > > header file ?
> >
> > For consistency I added header file similar to R-Car. Please let me know
> > this to be added in .c ?
> >


I would say up to you, as R-Car does the same. In general, if a symbol
doesn't need to be exported to any other file, it could very well live
in the .c file.

> > >
> > > > + | ((mode->flags & DRM_MODE_FLAG_PVSYNC) ? DU_DITR0_VSPOL 
> > > > : 0)
> > > > + | ((mode->flags & DRM_MODE_FLAG_PHSYNC) ? DU_DITR0_HSPOL :

[snip]

> > > -
> > > > + * Format helpers
> > > > + */
> > > > +
> > > > +static const struct rzg2l_du_format_info rzg2l_du_format_infos[] = {
> > > > +   {
> > > > +   .fourcc = DRM_FORMAT_RGB565,
> > > > +   .v4l2 = V4L2_PIX_FMT_RGB565,
> > > > +   .bpp = 16,
> > > > +   .planes = 1,
> > > > +   .hsub = 1,
> > > > +   }, {
> > > > +   .fourcc = DRM_FORMAT_ARGB1555,
> > > > +   .v4l2 = V4L2_PIX_FMT_ARGB555,
> > > > +   .bpp = 16,
> > > > +   .planes = 1,
> > > > +   .hsub = 1,
> > > > +   }, {
> > > > +   .fourcc = DRM_FORMAT_XRGB1555,
> > > > +   .v4l2 = V4L2_PIX_FMT_XRGB555,
> > > > +   .bpp = 16,
> > > > +   .planes = 1,
> > > > +   }, {
> > > > +   .fourcc = DRM_FORMAT_XRGB,
> > > > +   .v4l2 = V4L2_PIX_FMT_XBGR32,
> > > > +   .bpp = 32,
> > > > +   .planes = 1,
> > > > +   .hsub = 1,
> > > > +   }, {
> > > > +   .fourcc = DRM_FORMAT_ARGB,
> > > > +   .v4l2 = V4L2_PIX_FMT_ABGR32,
> > > > +   .bpp = 32,
> > > > +   .planes = 1,
> > > > +   .hsub = 1,
> > > > +   }, {
> > > > +   .fourcc = DRM_FORMAT_UYVY,
> > > > +   .v4l2 = V4L2_PIX_FMT_UYVY,
> > > > +   .bpp = 16,
> > > > +   .planes = 1,
> > > > +   .hsub = 2,
> > > > +   }, {
> > > > +   .fourcc = DRM_FORMAT_YUYV,
> > > > +   .v4l2 = V4L2_PIX_FMT_YUYV,
> > > > +   .bpp = 16,
> > > > +   .planes = 1,
> > > > +   .hsub = 2,
> > > > +   }, {
> > > > +   .fourcc = DRM_FORMAT_NV12,
> > > > +   .v4l2 = V4L2_PIX_FMT_NV12M,
> > > > +   .bpp = 12,
> > > > +   .planes = 2,
> > > > +   .hsub = 2,
> > > > +   }, {
> > > > +   .fourcc = DRM_FORMAT_NV21,
> > > > +   .v4l2 = V4L2_PIX_FMT_NV21M,
> > > > +   .bpp = 12,
> > > > +   .planes = 2,
> > > > +   .hsub = 2,
> > > > +   }, {
> > > > +   .fourcc = DRM_FORMAT_NV16,
> > > > +   .v4l2 = V4L2_PIX_FMT_NV16M,
> > > > +   .bpp = 16,
> > > > +   .planes = 2,
> > > > +   .hsub = 2,
> > > > +   },
> > > > +   {
> > > > +   .fourcc = DRM_FORMAT_RGB332,
> > > > +   .v4l2 = V4L2_PIX_FMT_RGB332,
> > > > +   .bpp = 8,
> > > > +   .planes = 1,
> > > > +   .hsub = 1,
> > > > +   }, {
> > > > +   .fourcc = DRM_FOR

RE: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support

2023-09-18 Thread Biju Das
Hi Jacopo Mondi,

Looks like you are happy with my response for V10. I will send V11 soon.

Cheers,
Biju

> -Original Message-
> From: Biju Das 
> Sent: Friday, September 8, 2023 2:24 PM
> Subject: RE: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support
> 
> Hi Jacopo Mondi,
> 
> Thanks for the review.
> 
> > Subject: Re: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support
> >
> > Hi Biju
> >
> > On Tue, Jul 04, 2023 at 10:04:46AM +0100, Biju Das wrote:
> > > The LCD controller is composed of Frame Compression Processor (FCPVD),
> > > Video Signal Processor (VSPD), and Display Unit (DU).
> > >
> > > It has DPI/DSI interfaces and supports a maximum resolution of 1080p
> > > along with 2 RPFs to support the blending of two picture layers and
> > > raster operations (ROPs).
> > >
> > > The DU module is connected to VSPD. Add RZ/G2L DU support for RZ/G2L
> > > alike SoCs.
> > >
> > > Signed-off-by: Biju Das 
> > > ---
> > > Ref:
> > >
> > > v9->v10:
> > >  * Dropped ARM64 dependency from Kconfig.
> > >  * Sorted the configs alphabetically in Kconfig.
> > >  * Dropped DRM_RCAR_VSP config option and make DRM_RZG2L_DU depend on
> > >VIDEO_RENESAS_VSP1.
> > >  * On rzg2l_du_crtc_set_display_timing() replaced the setting of parent
> > >clk rate with dclk rate.
> > >  * Added rzg2l_du_write() wrapper function.
> > >  * Updated the comment atomic_begin->atomic_flush.
> > >  * Dropped .atomic_check and .atomic_begin callback
> > >  * Renamed __rzg2l_du_crtc_plane_atomic_check-
> > >__rzg2l_du_vsp_plane_atomic
> > >_check and moved it to rzg2l_du_vsp.c
> > >  * Added struct clk in rzg2l_du_crtc.h
> > >  * Dropped the variables mmio_offset,index,vblank_lock,vblank_wait,
> > >vblank_count from struct rzg2l_du_crtc.
> > >  * Replaced the macro to_rzg2l_crtc with static inline functions.
> > >  * Dropped the unneeded header files clk.h, io.h, mm.h, pm.h, slab.h,
> > >wait.h and drm_managed.h from rzg2l_du_drv.c.
> > >  * Replaced DRM_INFO->drm_info
> > >  * Dropped the callbacks prime_handle_to_fd, prime_fd_to_handle and
> > >gem_prime_mmap.
> > >  * Replaced the callback remove->remove_new.
> > >  * Dropped header file wait.h and added forward declarations struct clk
> > and
> > >rzg2l_du_device from rzg2l_du_drv.h.
> > >  * Dropped the dsi and dpad0_source variables from struct
> > rzg2l_du_device.
> > >  * Replaced the macro to_rzg2l_encoder with static inline functions.
> > >  * Dropped header files dma-buf.h and wait.h from rzg2l_du_kms.c.
> > >  * Dropped struct sg_table and added the scatterlist.h header file in
> > >rzg2l_du_vsp.h
> > >  * Added container_of.h header file, forward declarations struct device
> > and
> > >struct rzg2l_du_device in rzg2l_du_vsp.h.
> > > v8->v9:
> > >  * Dropped reset_control_assert() from error patch for
> > rzg2l_du_crtc_get() as
> > >suggested by Philipp Zabel.
> > > v7->v8:
> > >  * Dropped RCar du lib and created RZ/G2L DU DRM driver by creating
> > rz_du folder.
> > >  * Updated KConfig and Makefile.
> > > v6->v7:
> > >  * Split DU lib and  RZ/G2L du driver as separate patch series as
> > >DU support added to more platforms based on RZ/G2L alike SoCs.
> > >  * Rebased to latest drm-tip.
> > >  * Added patch #2 for binding support for RZ/V2L DU
> > >  * Added patch #4 for driver support for RZ/V2L DU
> > >  * Added patch #5 for SoC DTSI support for RZ/G2L DU
> > >  * Added patch #6 for SoC DTSI support for RZ/V2L DU
> > >  * Added patch #7 for Enabling DU on SMARC EVK based on RZ/{G2L,V2L}
> > SoCs.
> > >  * Added patch #8 for Enabling DU on SMARC EVK based on RZ/G2LC SoC.
> > > ---
> > > diff --git a/drivers/gpu/drm/renesas/Kconfig
> > b/drivers/gpu/drm/renesas/Kconfig
> > > index 3777dad17f81..21862a8ef710 100644
> > > --- a/drivers/gpu/drm/renesas/Kconfig
> > > +++ b/drivers/gpu/drm/renesas/Kconfig
> > > @@ -1,4 +1,5 @@
> > >  # SPDX-License-Identifier: GPL-2.0-only
> > >
> > >  source "drivers/gpu/drm/renesas/rcar-du/Kconfig"
> > > +source "drivers/gpu/drm/renesas/rz-du/Kconfig"
> > >  source "drivers/gpu/drm/renesas/shmobile/Kconfig"
> > > diff --git a/drivers/gpu/drm/renesas/Makefile
> > b/drivers/

RE: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support

2023-09-08 Thread Biju Das
Hi Jacopo Mondi,

Thanks for the review.

> Subject: Re: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support
> 
> Hi Biju
> 
> On Tue, Jul 04, 2023 at 10:04:46AM +0100, Biju Das wrote:
> > The LCD controller is composed of Frame Compression Processor (FCPVD),
> > Video Signal Processor (VSPD), and Display Unit (DU).
> >
> > It has DPI/DSI interfaces and supports a maximum resolution of 1080p
> > along with 2 RPFs to support the blending of two picture layers and
> > raster operations (ROPs).
> >
> > The DU module is connected to VSPD. Add RZ/G2L DU support for RZ/G2L
> > alike SoCs.
> >
> > Signed-off-by: Biju Das 
> > ---
> > Ref:
> >
> > v9->v10:
> >  * Dropped ARM64 dependency from Kconfig.
> >  * Sorted the configs alphabetically in Kconfig.
> >  * Dropped DRM_RCAR_VSP config option and make DRM_RZG2L_DU depend on
> >VIDEO_RENESAS_VSP1.
> >  * On rzg2l_du_crtc_set_display_timing() replaced the setting of parent
> >clk rate with dclk rate.
> >  * Added rzg2l_du_write() wrapper function.
> >  * Updated the comment atomic_begin->atomic_flush.
> >  * Dropped .atomic_check and .atomic_begin callback
> >  * Renamed __rzg2l_du_crtc_plane_atomic_check-
> >__rzg2l_du_vsp_plane_atomic
> >_check and moved it to rzg2l_du_vsp.c
> >  * Added struct clk in rzg2l_du_crtc.h
> >  * Dropped the variables mmio_offset,index,vblank_lock,vblank_wait,
> >vblank_count from struct rzg2l_du_crtc.
> >  * Replaced the macro to_rzg2l_crtc with static inline functions.
> >  * Dropped the unneeded header files clk.h, io.h, mm.h, pm.h, slab.h,
> >wait.h and drm_managed.h from rzg2l_du_drv.c.
> >  * Replaced DRM_INFO->drm_info
> >  * Dropped the callbacks prime_handle_to_fd, prime_fd_to_handle and
> >gem_prime_mmap.
> >  * Replaced the callback remove->remove_new.
> >  * Dropped header file wait.h and added forward declarations struct clk
> and
> >rzg2l_du_device from rzg2l_du_drv.h.
> >  * Dropped the dsi and dpad0_source variables from struct
> rzg2l_du_device.
> >  * Replaced the macro to_rzg2l_encoder with static inline functions.
> >  * Dropped header files dma-buf.h and wait.h from rzg2l_du_kms.c.
> >  * Dropped struct sg_table and added the scatterlist.h header file in
> >rzg2l_du_vsp.h
> >  * Added container_of.h header file, forward declarations struct device
> and
> >struct rzg2l_du_device in rzg2l_du_vsp.h.
> > v8->v9:
> >  * Dropped reset_control_assert() from error patch for
> rzg2l_du_crtc_get() as
> >suggested by Philipp Zabel.
> > v7->v8:
> >  * Dropped RCar du lib and created RZ/G2L DU DRM driver by creating
> rz_du folder.
> >  * Updated KConfig and Makefile.
> > v6->v7:
> >  * Split DU lib and  RZ/G2L du driver as separate patch series as
> >DU support added to more platforms based on RZ/G2L alike SoCs.
> >  * Rebased to latest drm-tip.
> >  * Added patch #2 for binding support for RZ/V2L DU
> >  * Added patch #4 for driver support for RZ/V2L DU
> >  * Added patch #5 for SoC DTSI support for RZ/G2L DU
> >  * Added patch #6 for SoC DTSI support for RZ/V2L DU
> >  * Added patch #7 for Enabling DU on SMARC EVK based on RZ/{G2L,V2L}
> SoCs.
> >  * Added patch #8 for Enabling DU on SMARC EVK based on RZ/G2LC SoC.
> > ---
> > diff --git a/drivers/gpu/drm/renesas/Kconfig
> b/drivers/gpu/drm/renesas/Kconfig
> > index 3777dad17f81..21862a8ef710 100644
> > --- a/drivers/gpu/drm/renesas/Kconfig
> > +++ b/drivers/gpu/drm/renesas/Kconfig
> > @@ -1,4 +1,5 @@
> >  # SPDX-License-Identifier: GPL-2.0-only
> >
> >  source "drivers/gpu/drm/renesas/rcar-du/Kconfig"
> > +source "drivers/gpu/drm/renesas/rz-du/Kconfig"
> >  source "drivers/gpu/drm/renesas/shmobile/Kconfig"
> > diff --git a/drivers/gpu/drm/renesas/Makefile
> b/drivers/gpu/drm/renesas/Makefile
> > index ec0e89e7a592..b8d8bc53967f 100644
> > --- a/drivers/gpu/drm/renesas/Makefile
> > +++ b/drivers/gpu/drm/renesas/Makefile
> > @@ -1,4 +1,5 @@
> >  # SPDX-License-Identifier: GPL-2.0
> >
> >  obj-y += rcar-du/
> > +obj-y += rz-du/
> >  obj-$(CONFIG_DRM_SHMOBILE) += shmobile/
> > diff --git a/drivers/gpu/drm/renesas/rz-du/Kconfig
> b/drivers/gpu/drm/renesas/rz-du/Kconfig
> > new file mode 100644
> > index ..5f0db2c5fee6
> > --- /dev/null
> > +++ b/drivers/gpu/drm/renesas/rz-du/Kconfig
> > @@ -0,0 +1,12 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +config DRM_RZG2L_DU
> > +   tristate

Re: [PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support

2023-09-08 Thread Jacopo Mondi
Hi Biju

On Tue, Jul 04, 2023 at 10:04:46AM +0100, Biju Das wrote:
> The LCD controller is composed of Frame Compression Processor (FCPVD),
> Video Signal Processor (VSPD), and Display Unit (DU).
>
> It has DPI/DSI interfaces and supports a maximum resolution of 1080p
> along with 2 RPFs to support the blending of two picture layers and
> raster operations (ROPs).
>
> The DU module is connected to VSPD. Add RZ/G2L DU support for RZ/G2L
> alike SoCs.
>
> Signed-off-by: Biju Das 
> ---
> Ref:
>  
> https://lore.kernel.org/linux-renesas-soc/os0pr01mb5922717e4ccfe07f3c25fbc986...@os0pr01mb5922.jpnprd01.prod.outlook.com/#t
> v9->v10:
>  * Dropped ARM64 dependency from Kconfig.
>  * Sorted the configs alphabetically in Kconfig.
>  * Dropped DRM_RCAR_VSP config option and make DRM_RZG2L_DU depend on
>VIDEO_RENESAS_VSP1.
>  * On rzg2l_du_crtc_set_display_timing() replaced the setting of parent
>clk rate with dclk rate.
>  * Added rzg2l_du_write() wrapper function.
>  * Updated the comment atomic_begin->atomic_flush.
>  * Dropped .atomic_check and .atomic_begin callback
>  * Renamed __rzg2l_du_crtc_plane_atomic_check->__rzg2l_du_vsp_plane_atomic
>_check and moved it to rzg2l_du_vsp.c
>  * Added struct clk in rzg2l_du_crtc.h
>  * Dropped the variables mmio_offset,index,vblank_lock,vblank_wait,
>vblank_count from struct rzg2l_du_crtc.
>  * Replaced the macro to_rzg2l_crtc with static inline functions.
>  * Dropped the unneeded header files clk.h, io.h, mm.h, pm.h, slab.h,
>wait.h and drm_managed.h from rzg2l_du_drv.c.
>  * Replaced DRM_INFO->drm_info
>  * Dropped the callbacks prime_handle_to_fd, prime_fd_to_handle and
>gem_prime_mmap.
>  * Replaced the callback remove->remove_new.
>  * Dropped header file wait.h and added forward declarations struct clk and
>rzg2l_du_device from rzg2l_du_drv.h.
>  * Dropped the dsi and dpad0_source variables from struct rzg2l_du_device.
>  * Replaced the macro to_rzg2l_encoder with static inline functions.
>  * Dropped header files dma-buf.h and wait.h from rzg2l_du_kms.c.
>  * Dropped struct sg_table and added the scatterlist.h header file in
>rzg2l_du_vsp.h
>  * Added container_of.h header file, forward declarations struct device and
>struct rzg2l_du_device in rzg2l_du_vsp.h.
> v8->v9:
>  * Dropped reset_control_assert() from error patch for rzg2l_du_crtc_get() as
>suggested by Philipp Zabel.
> v7->v8:
>  * Dropped RCar du lib and created RZ/G2L DU DRM driver by creating rz_du 
> folder.
>  * Updated KConfig and Makefile.
> v6->v7:
>  * Split DU lib and  RZ/G2L du driver as separate patch series as
>DU support added to more platforms based on RZ/G2L alike SoCs.
>  * Rebased to latest drm-tip.
>  * Added patch #2 for binding support for RZ/V2L DU
>  * Added patch #4 for driver support for RZ/V2L DU
>  * Added patch #5 for SoC DTSI support for RZ/G2L DU
>  * Added patch #6 for SoC DTSI support for RZ/V2L DU
>  * Added patch #7 for Enabling DU on SMARC EVK based on RZ/{G2L,V2L} SoCs.
>  * Added patch #8 for Enabling DU on SMARC EVK based on RZ/G2LC SoC.
> ---
>  drivers/gpu/drm/renesas/Kconfig   |   1 +
>  drivers/gpu/drm/renesas/Makefile  |   1 +
>  drivers/gpu/drm/renesas/rz-du/Kconfig |  12 +
>  drivers/gpu/drm/renesas/rz-du/Makefile|   8 +
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 599 ++
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.h |  92 +++
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c  | 180 +
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h  |  84 ++
>  .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  | 109 +++
>  .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.h  |  32 +
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c  | 741 ++
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h  |  43 +
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_regs.h |  67 ++
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c  | 469 +++
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h  |  97 +++
>  15 files changed, 2535 insertions(+)
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/Kconfig
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/Makefile
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.h
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_regs.h
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
>  create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
>
> diff --git a/drivers/gpu/drm/renesas/Kconfig b/drivers/gpu/drm/renesas/Kconfig
> index 

[PATCH v10 3/4] drm: renesas: Add RZ/G2L DU Support

2023-07-04 Thread Biju Das
The LCD controller is composed of Frame Compression Processor (FCPVD),
Video Signal Processor (VSPD), and Display Unit (DU).

It has DPI/DSI interfaces and supports a maximum resolution of 1080p
along with 2 RPFs to support the blending of two picture layers and
raster operations (ROPs).

The DU module is connected to VSPD. Add RZ/G2L DU support for RZ/G2L
alike SoCs.

Signed-off-by: Biju Das 
---
Ref:
 
https://lore.kernel.org/linux-renesas-soc/os0pr01mb5922717e4ccfe07f3c25fbc986...@os0pr01mb5922.jpnprd01.prod.outlook.com/#t
v9->v10:
 * Dropped ARM64 dependency from Kconfig.
 * Sorted the configs alphabetically in Kconfig.
 * Dropped DRM_RCAR_VSP config option and make DRM_RZG2L_DU depend on
   VIDEO_RENESAS_VSP1.
 * On rzg2l_du_crtc_set_display_timing() replaced the setting of parent
   clk rate with dclk rate.
 * Added rzg2l_du_write() wrapper function.
 * Updated the comment atomic_begin->atomic_flush.
 * Dropped .atomic_check and .atomic_begin callback
 * Renamed __rzg2l_du_crtc_plane_atomic_check->__rzg2l_du_vsp_plane_atomic
   _check and moved it to rzg2l_du_vsp.c
 * Added struct clk in rzg2l_du_crtc.h
 * Dropped the variables mmio_offset,index,vblank_lock,vblank_wait,
   vblank_count from struct rzg2l_du_crtc.
 * Replaced the macro to_rzg2l_crtc with static inline functions.
 * Dropped the unneeded header files clk.h, io.h, mm.h, pm.h, slab.h,
   wait.h and drm_managed.h from rzg2l_du_drv.c.
 * Replaced DRM_INFO->drm_info
 * Dropped the callbacks prime_handle_to_fd, prime_fd_to_handle and
   gem_prime_mmap.
 * Replaced the callback remove->remove_new.
 * Dropped header file wait.h and added forward declarations struct clk and
   rzg2l_du_device from rzg2l_du_drv.h.
 * Dropped the dsi and dpad0_source variables from struct rzg2l_du_device.
 * Replaced the macro to_rzg2l_encoder with static inline functions.
 * Dropped header files dma-buf.h and wait.h from rzg2l_du_kms.c.
 * Dropped struct sg_table and added the scatterlist.h header file in
   rzg2l_du_vsp.h
 * Added container_of.h header file, forward declarations struct device and
   struct rzg2l_du_device in rzg2l_du_vsp.h.
v8->v9:
 * Dropped reset_control_assert() from error patch for rzg2l_du_crtc_get() as
   suggested by Philipp Zabel.
v7->v8:
 * Dropped RCar du lib and created RZ/G2L DU DRM driver by creating rz_du 
folder.
 * Updated KConfig and Makefile.
v6->v7:
 * Split DU lib and  RZ/G2L du driver as separate patch series as
   DU support added to more platforms based on RZ/G2L alike SoCs.
 * Rebased to latest drm-tip.
 * Added patch #2 for binding support for RZ/V2L DU
 * Added patch #4 for driver support for RZ/V2L DU
 * Added patch #5 for SoC DTSI support for RZ/G2L DU
 * Added patch #6 for SoC DTSI support for RZ/V2L DU
 * Added patch #7 for Enabling DU on SMARC EVK based on RZ/{G2L,V2L} SoCs.
 * Added patch #8 for Enabling DU on SMARC EVK based on RZ/G2LC SoC.
---
 drivers/gpu/drm/renesas/Kconfig   |   1 +
 drivers/gpu/drm/renesas/Makefile  |   1 +
 drivers/gpu/drm/renesas/rz-du/Kconfig |  12 +
 drivers/gpu/drm/renesas/rz-du/Makefile|   8 +
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 599 ++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.h |  92 +++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c  | 180 +
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h  |  84 ++
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  | 109 +++
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.h  |  32 +
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c  | 741 ++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h  |  43 +
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_regs.h |  67 ++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c  | 469 +++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h  |  97 +++
 15 files changed, 2535 insertions(+)
 create mode 100644 drivers/gpu/drm/renesas/rz-du/Kconfig
 create mode 100644 drivers/gpu/drm/renesas/rz-du/Makefile
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_regs.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h

diff --git a/drivers/gpu/drm/renesas/Kconfig b/drivers/gpu/drm/renesas/Kconfig
index 3777dad17f81..21862a8ef710 100644
--- a/drivers/gpu/drm/renesas/Kconfig
+++ b/drivers/gpu/drm/renesas/Kconfig
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
 source "drivers/gpu/drm/renesas/rcar-du/Kconfig"
+source