mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Mergnat <amergnat@baylibre.com>
To: "Jason-JH.Lin" <jason-jh.lin@mediatek.com>,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	Rex-BC Chen <rex-bc.chen@mediatek.com>,
	Jonson Wang <jonson.wang@mediatek.com>,
	Singo Chang <singo.chang@mediatek.com>,
	Nancy Lin <nancy.lin@mediatek.com>,
	dri-devel@lists.freedesktop.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Project_Global_Chrome_Upstream_Group@mediatek.com,
	Nathan Lu <nathan.lu@mediatek.com>
Subject: Re: [PATCH 1/2] drm/mediatek: Add ability to support dynamic connector selection
Date: Wed, 12 Apr 2023 11:37:26 +0200	[thread overview]
Message-ID: <f95ee9f4-71a3-2f92-ed9b-037e11b8e893@baylibre.com> (raw)
In-Reply-To: <20230405145129.18835-2-jason-jh.lin@mediatek.com>

Hi Jason,

Can you give me the based git tree/branch for this series please ?
I want to do a non-regression test for mt8365-evk board.

Feedback below:

On 05/04/2023 16:51, Jason-JH.Lin wrote:
> 1. Move output drm connector from each ddp_path array to connector array.
> 2. Add dynamic select available connector flow in crtc create and enable.
> snip...
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> index d40142842f85..5ff20d0de29b 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
> @@ -60,8 +60,13 @@ struct mtk_drm_crtc {
>   	struct device			*mmsys_dev;
>   	struct device			*dma_dev;
>   	struct mtk_mutex		*mutex;
> +

Remove this extra line please.

> +	unsigned int			ddp_comp_nr_ori;
> +	unsigned int			max_ddp_comp_nr;
>   	unsigned int			ddp_comp_nr;
>   	struct mtk_ddp_comp		**ddp_comp;
> +	unsigned int			conn_route_nr;
> +	const struct mtk_drm_route	*conn_routes;
>   
>   	/* lock for display hardware access */
>   	struct mutex			hw_lock;
> @@ -649,6 +654,85 @@ static void mtk_drm_crtc_disable_vblank(struct drm_crtc *crtc)
>   	mtk_ddp_comp_disable_vblank(comp);
>   }
>   
> +static unsigned int mtk_drm_crtc_max_num_route_comp(struct mtk_drm_crtc *mtk_crtc)
> +{
> +	unsigned int max_num = 0;
> +	unsigned int i;
> +
> +	if (!mtk_crtc->conn_route_nr)
> +		return 0;
> +
> +	for (i = 0; i < mtk_crtc->conn_route_nr; i++)
> +		max_num = (max_num > mtk_crtc->conn_routes[i].route_len) ? max_num :
> +				mtk_crtc->conn_routes[i].route_len;

if test is true, then do "max_num = max_num"
I'm not sure the compiler will optimize that.
Also, I think it more readable like that:

if (max_num < mtk_crtc->conn_routes[i].route_len) {
	max_num = mtk_crtc->conn_routes[i].route_len;
}

> +
> +	return max_num;
> +}
> +
> +static int mtk_drm_crtc_update_output(struct drm_crtc *crtc,
> +				      struct drm_atomic_state *state)
> +{
> +	int crtc_index = drm_crtc_index(crtc);
> +	struct drm_crtc_state *crtc_state = state->crtcs[crtc_index].new_state;
> +	unsigned int encoder_mask = crtc_state->encoder_mask;
> +	struct mtk_drm_private *priv = crtc->dev->dev_private;
> +	struct device *dev;
> +	struct mtk_drm_crtc *mtk_crtc = to_mtk_crtc(crtc);
> +	const struct mtk_drm_route *conn_routes;
> +	unsigned int route_len = 0, route_index = 0;
> +	unsigned int comp_id;
> +	int i;

Can you put them in alphabetical order please ?

> +
> +	if (!mtk_crtc->conn_route_nr)
> +		return 0;
> +
> snip...
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.h b/drivers/gpu/drm/mediatek/mtk_drm_crtc.h
> index 3e9046993d09..96790f8f7a94 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.h
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.h
> @@ -7,6 +7,7 @@
>   #define MTK_DRM_CRTC_H
>   
>   #include <drm/drm_crtc.h>
> +#include "mtk_drm_drv.h"

Alphabetical order please.

>   #include "mtk_drm_ddp_comp.h"
>   #include "mtk_drm_plane.h"
>   
> @@ -18,7 +19,9 @@ void mtk_drm_crtc_commit(struct drm_crtc *crtc);
>   int mtk_drm_crtc_create(struct drm_device *drm_dev,
>   			const unsigned int *path,
>   			unsigned int path_len,
> -			int priv_data_index);
> +			int priv_data_index,
> +			const struct mtk_drm_route *conn_routes,
> +			unsigned int conn_routes_num);
>   int mtk_drm_crtc_plane_check(struct drm_crtc *crtc, struct drm_plane *plane,
>   			     struct mtk_plane_state *state);
>   void mtk_drm_crtc_async_update(struct drm_crtc *crtc, struct drm_plane *plane,


Regards,
Alexandre


       reply	other threads:[~2023-04-12  9:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230405145129.18835-1-jason-jh.lin@mediatek.com>
     [not found] ` <20230405145129.18835-2-jason-jh.lin@mediatek.com>
2023-04-12  9:37   ` Alexandre Mergnat [this message]
2023-04-12 12:26     ` Jason-JH Lin (林睿祥)

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=f95ee9f4-71a3-2f92-ed9b-037e11b8e893@baylibre.com \
    --to=amergnat@baylibre.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jason-jh.lin@mediatek.com \
    --cc=jonson.wang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nancy.lin@mediatek.com \
    --cc=nathan.lu@mediatek.com \
    --cc=rex-bc.chen@mediatek.com \
    --cc=singo.chang@mediatek.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

all inboxes | Powered by JetHome®