From mboxrd@z Thu Jan 1 00:00:00 1970 From: thierry.reding@gmail.com (Thierry Reding) Date: Tue, 20 Feb 2018 10:52:46 +0100 Subject: [PATCH] drm: simple_kms_helper: Add mode_valid() callback support In-Reply-To: <20180220072859.3386-1-linus.walleij@linaro.org> References: <20180220072859.3386-1-linus.walleij@linaro.org> Message-ID: <20180220095246.GF23425@ulmo> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Feb 20, 2018 at 08:28:59AM +0100, Linus Walleij wrote: > The PL111 needs to filter valid modes based on memory bandwidth. > I guess it is a pretty simple operation, so we can still claim > the DRM KMS helper pipeline is simple after adding this (optional) > vtable callback. > > Reviewed-by: Eric Anholt > Reviewed-by: Daniel Vetter > Signed-off-by: Linus Walleij > --- > ChangeLog v1->v2: > - Fix up the kerneldoc to just refer to the enum. > - Collect Eric's and Daniel's review tags. > --- > drivers/gpu/drm/drm_simple_kms_helper.c | 15 +++++++++++++++ > include/drm/drm_simple_kms_helper.h | 14 ++++++++++++++ > 2 files changed, 29 insertions(+) > > diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c > index 9f3b1c94802b..652cde9a5a6b 100644 > --- a/drivers/gpu/drm/drm_simple_kms_helper.c > +++ b/drivers/gpu/drm/drm_simple_kms_helper.c > @@ -34,6 +34,20 @@ static const struct drm_encoder_funcs drm_simple_kms_encoder_funcs = { > .destroy = drm_encoder_cleanup, > }; > > +static enum drm_mode_status > +drm_simple_kms_crtc_mode_valid(struct drm_crtc *crtc, > + const struct drm_display_mode *mode) > +{ > + struct drm_simple_display_pipe *pipe; > + > + pipe = container_of(crtc, struct drm_simple_display_pipe, crtc); > + if (!pipe->funcs || !pipe->funcs->mode_valid) > + /* Anything goes */ > + return MODE_OK; > + > + return pipe->funcs->mode_valid(crtc, mode); > +} > + > static int drm_simple_kms_crtc_check(struct drm_crtc *crtc, > struct drm_crtc_state *state) > { > @@ -72,6 +86,7 @@ static void drm_simple_kms_crtc_disable(struct drm_crtc *crtc, > } > > static const struct drm_crtc_helper_funcs drm_simple_kms_crtc_helper_funcs = { > + .mode_valid = drm_simple_kms_crtc_mode_valid, > .atomic_check = drm_simple_kms_crtc_check, > .atomic_enable = drm_simple_kms_crtc_enable, > .atomic_disable = drm_simple_kms_crtc_disable, > diff --git a/include/drm/drm_simple_kms_helper.h b/include/drm/drm_simple_kms_helper.h > index 6d9adbb46293..d9e4c3c3f009 100644 > --- a/include/drm/drm_simple_kms_helper.h > +++ b/include/drm/drm_simple_kms_helper.h > @@ -21,6 +21,20 @@ struct drm_simple_display_pipe; > * display pipeline > */ > struct drm_simple_display_pipe_funcs { > + /** > + * @mode_valid: > + * > + * This function is called to filter out valid modes from the > + * suggestions suggested by the bridge or display. This optional This is a little awkward to read. Perhaps something like "... filter out valid modes from those suggested by..."? Otherwise looks good: Reviewed-by: Thierry Reding -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH] drm: simple_kms_helper: Add mode_valid() callback support Date: Tue, 20 Feb 2018 10:52:46 +0100 Message-ID: <20180220095246.GF23425@ulmo> References: <20180220072859.3386-1-linus.walleij@linaro.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8349996234452090128==" Return-path: In-Reply-To: <20180220072859.3386-1-linus.walleij@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Linus Walleij Cc: dri-devel@lists.freedesktop.org, Eric Anholt , Sean Paul , Jani Nikula , Daniel Vetter , linux-arm-kernel@lists.infradead.org List-Id: dri-devel@lists.freedesktop.org --===============8349996234452090128== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="/QKKmeG/X/bPShih" Content-Disposition: inline --/QKKmeG/X/bPShih Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 20, 2018 at 08:28:59AM +0100, Linus Walleij wrote: > The PL111 needs to filter valid modes based on memory bandwidth. > I guess it is a pretty simple operation, so we can still claim > the DRM KMS helper pipeline is simple after adding this (optional) > vtable callback. >=20 > Reviewed-by: Eric Anholt > Reviewed-by: Daniel Vetter > Signed-off-by: Linus Walleij > --- > ChangeLog v1->v2: > - Fix up the kerneldoc to just refer to the enum. > - Collect Eric's and Daniel's review tags. > --- > drivers/gpu/drm/drm_simple_kms_helper.c | 15 +++++++++++++++ > include/drm/drm_simple_kms_helper.h | 14 ++++++++++++++ > 2 files changed, 29 insertions(+) >=20 > diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/dr= m_simple_kms_helper.c > index 9f3b1c94802b..652cde9a5a6b 100644 > --- a/drivers/gpu/drm/drm_simple_kms_helper.c > +++ b/drivers/gpu/drm/drm_simple_kms_helper.c > @@ -34,6 +34,20 @@ static const struct drm_encoder_funcs drm_simple_kms_e= ncoder_funcs =3D { > .destroy =3D drm_encoder_cleanup, > }; > =20 > +static enum drm_mode_status > +drm_simple_kms_crtc_mode_valid(struct drm_crtc *crtc, > + const struct drm_display_mode *mode) > +{ > + struct drm_simple_display_pipe *pipe; > + > + pipe =3D container_of(crtc, struct drm_simple_display_pipe, crtc); > + if (!pipe->funcs || !pipe->funcs->mode_valid) > + /* Anything goes */ > + return MODE_OK; > + > + return pipe->funcs->mode_valid(crtc, mode); > +} > + > static int drm_simple_kms_crtc_check(struct drm_crtc *crtc, > struct drm_crtc_state *state) > { > @@ -72,6 +86,7 @@ static void drm_simple_kms_crtc_disable(struct drm_crtc= *crtc, > } > =20 > static const struct drm_crtc_helper_funcs drm_simple_kms_crtc_helper_fun= cs =3D { > + .mode_valid =3D drm_simple_kms_crtc_mode_valid, > .atomic_check =3D drm_simple_kms_crtc_check, > .atomic_enable =3D drm_simple_kms_crtc_enable, > .atomic_disable =3D drm_simple_kms_crtc_disable, > diff --git a/include/drm/drm_simple_kms_helper.h b/include/drm/drm_simple= _kms_helper.h > index 6d9adbb46293..d9e4c3c3f009 100644 > --- a/include/drm/drm_simple_kms_helper.h > +++ b/include/drm/drm_simple_kms_helper.h > @@ -21,6 +21,20 @@ struct drm_simple_display_pipe; > * display pipeline > */ > struct drm_simple_display_pipe_funcs { > + /** > + * @mode_valid: > + * > + * This function is called to filter out valid modes from the > + * suggestions suggested by the bridge or display. This optional This is a little awkward to read. Perhaps something like "... filter out valid modes from those suggested by..."? Otherwise looks good: Reviewed-by: Thierry Reding --/QKKmeG/X/bPShih Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlqL7+4ACgkQ3SOs138+ s6Fz7w//U3uZwT3W8NTU5Z60MaoifKF1Y7eGGNwBOICOZz6K3J3/l5onkXmozTfE CHlkQxLi+kH4OGLuKAAZIJorLRJZCi7TRwlxzPMvEDinUymedfqG3+umQ0nNL71u 3iIXTekEfvmI92voAieJoY2IFoc3ncBX2/2hNESWpHUXLmTM+FODPXr31PnLzGzr LnwW2tvAEGN0mA+U7qwFe39nyyfA+ZLYAmEpniGwEJ7DSu8IHdhMzMFTUx/htt4O jBIYUpigbi3jg4oSk/rE9l57r5oOJK8A1o0X4aj6MSxDmXya66BAMKEgop1t+Fde nbkJpFKkpH55Xruou3LMp7gieudN5Y8OejutgeLO6mdl6L5cT00ld5tjmFMOsNW/ 5/F3Q1khB5tZv7mEmyylLBjt4snFrJ39EyzHbd8B8n2P2Md2w0qOU5Hbz7aSLl55 TZ3GRVOVoal25lOZNbzCf4qZ0KRn/U4Mgf/f1dtTg/khAYgVc0fgEkwQu8ZpXN60 x2/zlAj/LKCfExjZ5Q1/IqJ+gbFZGTwJdtpxmyHFhffobMmziEasw11I7CBdzJ+C 95liTGtzg6Cha2REH5e/Xf9lqZhDO4Fr/8Jm4tAliad3jPdgXMP+fZENqVlQHHKG 2mH8MjznzK08p10g6psvB15D9t7QJI0IN7zxJ873OwonBIZNGvk= =NkYF -----END PGP SIGNATURE----- --/QKKmeG/X/bPShih-- --===============8349996234452090128== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============8349996234452090128==--