From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Chris Paterson <Chris.Paterson2@renesas.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
David Airlie <airlied@linux.ie>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
dri-devel@lists.freedesktop.org,
Biju Das <biju.das@bp.renesas.com>,
linux-renesas-soc@vger.kernel.org,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Subject: Re: [PATCH v2 4/7] drm: rcar-du: Move rcar_du_output_name() to rcar_du_common.c
Date: Fri, 15 Apr 2022 14:22:19 +0300 [thread overview]
Message-ID: <YllVa2xL9s3c5xWt@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220316131100.30685-5-biju.das.jz@bp.renesas.com>
Hi Biju,
Thank you for the patch.
On Wed, Mar 16, 2022 at 01:10:57PM +0000, Biju Das wrote:
> RZ/G2L SoC's does not have group/plane registers compared to RCar, hence it
> needs a different CRTC implementation.
>
> Move rcar_du_output_name() to a new common file rcar_du_common.c, So that
> the same function can be reused by RZ/G2L SoC later.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
> * No change
> RFC->v1:
> New patch
> ---
> drivers/gpu/drm/rcar-du/Makefile | 1 +
> drivers/gpu/drm/rcar-du/rcar_du_common.c | 30 ++++++++++++++++++++++++
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 20 ----------------
> 3 files changed, 31 insertions(+), 20 deletions(-)
> create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_common.c
>
> diff --git a/drivers/gpu/drm/rcar-du/Makefile b/drivers/gpu/drm/rcar-du/Makefile
> index e7275b5e7ec8..331e12d65a6b 100644
> --- a/drivers/gpu/drm/rcar-du/Makefile
> +++ b/drivers/gpu/drm/rcar-du/Makefile
> @@ -1,5 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0
> rcar-du-drm-y := rcar_du_crtc.o \
> + rcar_du_common.o \
> rcar_du_drv.o \
> rcar_du_encoder.o \
> rcar_du_group.o \
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_common.c b/drivers/gpu/drm/rcar-du/rcar_du_common.c
> new file mode 100644
> index 000000000000..f9f9908cda6d
> --- /dev/null
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_common.c
> @@ -0,0 +1,30 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * rcar_du_common.c -- R-Car Display Unit Common
> + *
> + * Copyright (C) 2013-2022 Renesas Electronics Corporation
> + *
> + * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
> + */
> +
> +#include "rcar_du_drv.h"
> +
> +const char *rcar_du_output_name(enum rcar_du_output output)
> +{
> + static const char * const names[] = {
> + [RCAR_DU_OUTPUT_DPAD0] = "DPAD0",
> + [RCAR_DU_OUTPUT_DPAD1] = "DPAD1",
> + [RCAR_DU_OUTPUT_DSI0] = "DSI0",
> + [RCAR_DU_OUTPUT_DSI1] = "DSI1",
> + [RCAR_DU_OUTPUT_HDMI0] = "HDMI0",
> + [RCAR_DU_OUTPUT_HDMI1] = "HDMI1",
> + [RCAR_DU_OUTPUT_LVDS0] = "LVDS0",
> + [RCAR_DU_OUTPUT_LVDS1] = "LVDS1",
> + [RCAR_DU_OUTPUT_TCON] = "TCON",
> + };
> +
> + if (output >= ARRAY_SIZE(names) || !names[output])
> + return "UNKNOWN";
> +
> + return names[output];
> +}
As we have nothing else than this function in this file, how about
moving it to rcar_du_drv.c instead, to avoid adding a new file ?
You also need to add a declaration for rcar_du_output_name() in the
appropriate header.
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> index 4640c356a532..f6e234dafb72 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -591,26 +591,6 @@ static const struct of_device_id rcar_du_of_table[] = {
>
> MODULE_DEVICE_TABLE(of, rcar_du_of_table);
>
> -const char *rcar_du_output_name(enum rcar_du_output output)
> -{
> - static const char * const names[] = {
> - [RCAR_DU_OUTPUT_DPAD0] = "DPAD0",
> - [RCAR_DU_OUTPUT_DPAD1] = "DPAD1",
> - [RCAR_DU_OUTPUT_DSI0] = "DSI0",
> - [RCAR_DU_OUTPUT_DSI1] = "DSI1",
> - [RCAR_DU_OUTPUT_HDMI0] = "HDMI0",
> - [RCAR_DU_OUTPUT_HDMI1] = "HDMI1",
> - [RCAR_DU_OUTPUT_LVDS0] = "LVDS0",
> - [RCAR_DU_OUTPUT_LVDS1] = "LVDS1",
> - [RCAR_DU_OUTPUT_TCON] = "TCON",
> - };
> -
> - if (output >= ARRAY_SIZE(names) || !names[output])
> - return "UNKNOWN";
> -
> - return names[output];
> -}
> -
> /* -----------------------------------------------------------------------------
> * DRM operations
> */
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2022-04-15 11:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 13:10 [PATCH v2 0/7] Add RZ/G2L Display support Biju Das
2022-03-16 13:10 ` [PATCH v2 1/7] dt-bindings: display: renesas, du: Document r9a07g044l bindings Biju Das
2022-03-23 20:05 ` [PATCH v2 1/7] dt-bindings: display: renesas,du: " Rob Herring
2022-04-12 10:01 ` Geert Uytterhoeven
2022-04-12 10:40 ` Biju Das
2022-04-15 11:14 ` Laurent Pinchart
2022-04-20 15:58 ` Biju Das
2022-03-16 13:10 ` [PATCH v2 2/7] drm: rcar-du: Add num_rpf to struct rcar_du_device_info Biju Das
2022-04-15 11:16 ` Laurent Pinchart
2022-04-20 15:59 ` Biju Das
2022-03-16 13:10 ` [PATCH v2 3/7] drm: rcar-du: Add max_width and max_height " Biju Das
2022-04-15 11:20 ` Laurent Pinchart
2022-04-20 16:02 ` Biju Das
2022-03-16 13:10 ` [PATCH v2 4/7] drm: rcar-du: Move rcar_du_output_name() to rcar_du_common.c Biju Das
2022-04-15 11:22 ` Laurent Pinchart [this message]
2022-04-20 16:03 ` Biju Das
2022-03-16 13:10 ` [PATCH v2 5/7] drm: rcar-du: Factorise rcar_du_{atomic_check, modeset_init} Biju Das
2022-04-15 15:45 ` [PATCH v2 5/7] drm: rcar-du: Factorise rcar_du_{atomic_check,modeset_init} Laurent Pinchart
2022-04-20 16:05 ` Biju Das
2022-03-16 13:10 ` [PATCH v2 6/7] drm: rcar-du: Factorise rcar_du_vsp{complete, enable, plane_atomic_check} Biju Das
2022-03-16 13:11 ` [PATCH v2 7/7] drm: rcar-du: Add RZ/G2L DU Support Biju Das
2022-04-14 7:13 ` [PATCH v2 0/7] Add RZ/G2L Display support Biju Das
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YllVa2xL9s3c5xWt@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=Chris.Paterson2@renesas.com \
--cc=airlied@linux.ie \
--cc=biju.das.jz@bp.renesas.com \
--cc=biju.das@bp.renesas.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert+renesas@glider.be \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox