mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
To: "amergnat@baylibre.com" <amergnat@baylibre.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"angelogioacchino.delregno@collabora.com" 
	<angelogioacchino.delregno@collabora.com>
Cc: "linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"jonson.wang@mediatek.com" <jonson.wang@mediatek.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Nathan Lu (呂東霖)" <Nathan.Lu@mediatek.com>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"Rex-BC Chen (陳柏辰)" <Rex-BC.Chen@mediatek.com>
Subject: Re: [PATCH 1/2] drm/mediatek: Add ability to support dynamic connector selection
Date: Wed, 12 Apr 2023 12:26:11 +0000	[thread overview]
Message-ID: <2e1341b234484a924e6b03fe0453c3ee29a100c3.camel@mediatek.com> (raw)
In-Reply-To: <f95ee9f4-71a3-2f92-ed9b-037e11b8e893@baylibre.com>

Hi Alexandre,

Thanks for the reviews.

On Wed, 2023-04-12 at 11:37 +0200, Alexandre Mergnat wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> 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.
> 
Sorry for missing this information, I'll add this into [PATCH 0/2] at
next version.

It based on mediatek-drm maintainer's tree / mediatek-drm-next branch :

https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next


> 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.
> 
OK, I'll remove it.

> > +     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;
> }
> 
OK, I'll refine this.

> > +
> > +     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 ?
> 
OK, I'll put them in alphabetical order.

> > +
> > +     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.

OK, I'll put them in alphabetical order.


Regards,
Jason-JH.Lin
> 
> >   #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 12:27 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
2023-04-12 12:26     ` Jason-JH Lin (林睿祥) [this message]

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=2e1341b234484a924e6b03fe0453c3ee29a100c3.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Nathan.Lu@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Rex-BC.Chen@mediatek.com \
    --cc=Singo.Chang@mediatek.com \
    --cc=amergnat@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --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 \
    /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®