From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 027A2C433F5 for ; Fri, 15 Apr 2022 11:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235588AbiDOLYz (ORCPT ); Fri, 15 Apr 2022 07:24:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352663AbiDOLYy (ORCPT ); Fri, 15 Apr 2022 07:24:54 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4673289CE8 for ; Fri, 15 Apr 2022 04:22:26 -0700 (PDT) Received: from pendragon.ideasonboard.com (85-76-5-129-nat.elisa-mobile.fi [85.76.5.129]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 68178482; Fri, 15 Apr 2022 13:22:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1650021742; bh=Uw/I9NYsIHkJe6uU5cma0+hCru7dJSvzEM/mupnu7G8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FnINJodcP1zqa3/BH1t2nlCmibGdhDhg5rcpc7nRkbeccAoa5dn4mEv/21iEiV3/Y Srg98RYF8TZguDq+Bu8j3RSbdMTmw6i0IvIIGKlL4SLG+J/HlLwcf3liFDSnVXnvZb Y2fM8Tir6efVj+LwQDrYNy8Nc/zNPcINIpAfd3bI= Date: Fri, 15 Apr 2022 14:22:19 +0300 From: Laurent Pinchart To: Biju Das Cc: David Airlie , Daniel Vetter , Kieran Bingham , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , Chris Paterson , Biju Das , Prabhakar Mahadev Lad Subject: Re: [PATCH v2 4/7] drm: rcar-du: Move rcar_du_output_name() to rcar_du_common.c Message-ID: References: <20220316131100.30685-1-biju.das.jz@bp.renesas.com> <20220316131100.30685-5-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220316131100.30685-5-biju.das.jz@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org 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 > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D9FAC433F5 for ; Fri, 15 Apr 2022 11:22:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21E9C10E3EC; Fri, 15 Apr 2022 11:22:24 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5BFD710E3EC for ; Fri, 15 Apr 2022 11:22:23 +0000 (UTC) Received: from pendragon.ideasonboard.com (85-76-5-129-nat.elisa-mobile.fi [85.76.5.129]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 68178482; Fri, 15 Apr 2022 13:22:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1650021742; bh=Uw/I9NYsIHkJe6uU5cma0+hCru7dJSvzEM/mupnu7G8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FnINJodcP1zqa3/BH1t2nlCmibGdhDhg5rcpc7nRkbeccAoa5dn4mEv/21iEiV3/Y Srg98RYF8TZguDq+Bu8j3RSbdMTmw6i0IvIIGKlL4SLG+J/HlLwcf3liFDSnVXnvZb Y2fM8Tir6efVj+LwQDrYNy8Nc/zNPcINIpAfd3bI= Date: Fri, 15 Apr 2022 14:22:19 +0300 From: Laurent Pinchart To: Biju Das Subject: Re: [PATCH v2 4/7] drm: rcar-du: Move rcar_du_output_name() to rcar_du_common.c Message-ID: References: <20220316131100.30685-1-biju.das.jz@bp.renesas.com> <20220316131100.30685-5-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220316131100.30685-5-biju.das.jz@bp.renesas.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Paterson , Geert Uytterhoeven , David Airlie , Prabhakar Mahadev Lad , dri-devel@lists.freedesktop.org, Biju Das , linux-renesas-soc@vger.kernel.org, Kieran Bingham Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 > --- > 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