From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932251AbdK1VAF (ORCPT ); Tue, 28 Nov 2017 16:00:05 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:44413 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752968AbdK1VAD (ORCPT ); Tue, 28 Nov 2017 16:00:03 -0500 Date: Tue, 28 Nov 2017 22:00:01 +0100 From: Maxime Ripard To: Jernej Skrabec Cc: wens@csie.org, airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, icenowy@aosc.io, linux-sunxi@googlegroups.com Subject: Re: [PATCH 08/17] drm/sun4i: Add support for DE2 VI planes Message-ID: <20171128210001.zhncdfkjzvwwxnnf@flea.home> References: <20171127205750.19277-1-jernej.skrabec@siol.net> <20171127205750.19277-9-jernej.skrabec@siol.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ef2rdlgp37d7jueh" Content-Disposition: inline In-Reply-To: <20171127205750.19277-9-jernej.skrabec@siol.net> User-Agent: NeoMutt/20171027 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ef2rdlgp37d7jueh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Nov 27, 2017 at 09:57:41PM +0100, Jernej Skrabec wrote: > This commit adds basic support for VI planes. They are meant for video > overlay and because of that they support YUV formats too. However, using > YUV planes is not straightforward, so only RGB support for now. >=20 > Signed-off-by: Jernej Skrabec > --- > drivers/gpu/drm/sun4i/sun8i_layer.c | 40 +++++++--- > drivers/gpu/drm/sun4i/sun8i_mixer.c | 144 ++++++++++++++++++++++++++++++= +++--- > drivers/gpu/drm/sun4i/sun8i_mixer.h | 38 ++++++++-- > 3 files changed, 196 insertions(+), 26 deletions(-) >=20 > diff --git a/drivers/gpu/drm/sun4i/sun8i_layer.c b/drivers/gpu/drm/sun4i/= sun8i_layer.c > index 49ccdd0149bd..e1b6ad82145e 100644 > --- a/drivers/gpu/drm/sun4i/sun8i_layer.c > +++ b/drivers/gpu/drm/sun4i/sun8i_layer.c > @@ -47,13 +47,22 @@ static int sun8i_mixer_layer_atomic_check(struct drm_= plane *plane, > true, true); > } > =20 > +static void sun8i_mixer_layer_enable(struct sun8i_layer *layer, bool ena= ble) > +{ > + struct sun8i_mixer *mixer =3D layer->mixer; > + > + if (layer->id < mixer->cfg->vi_num) > + sun8i_mixer_vi_layer_enable(mixer, layer->id, enable); > + else > + sun8i_mixer_ui_layer_enable(mixer, layer->id, enable); > +} > + > static void sun8i_mixer_layer_atomic_disable(struct drm_plane *plane, > struct drm_plane_state *old_state) > { > struct sun8i_layer *layer =3D plane_to_sun8i_layer(plane); > - struct sun8i_mixer *mixer =3D layer->mixer; > =20 > - sun8i_mixer_layer_enable(mixer, layer->id, false); > + sun8i_mixer_layer_enable(layer, false); > } > =20 > static void sun8i_mixer_layer_atomic_update(struct drm_plane *plane, > @@ -63,14 +72,21 @@ static void sun8i_mixer_layer_atomic_update(struct dr= m_plane *plane, > struct sun8i_mixer *mixer =3D layer->mixer; > =20 > if (!plane->state->visible) { > - sun8i_mixer_layer_enable(mixer, layer->id, false); > + sun8i_mixer_layer_enable(layer, false); > return; > } > =20 > - sun8i_mixer_update_layer_coord(mixer, layer->id, plane); > - sun8i_mixer_update_layer_formats(mixer, layer->id, plane); > - sun8i_mixer_update_layer_buffer(mixer, layer->id, plane); > - sun8i_mixer_layer_enable(mixer, layer->id, true); > + if (layer->id < mixer->cfg->vi_num) { > + sun8i_mixer_update_vi_layer_coord(mixer, layer->id, plane); > + sun8i_mixer_update_vi_layer_formats(mixer, layer->id, plane); > + sun8i_mixer_update_vi_layer_buffer(mixer, layer->id, plane); > + } else { > + sun8i_mixer_update_ui_layer_coord(mixer, layer->id, plane); > + sun8i_mixer_update_ui_layer_formats(mixer, layer->id, plane); > + sun8i_mixer_update_ui_layer_buffer(mixer, layer->id, plane); > + } > + > + sun8i_mixer_layer_enable(layer, true); So you can probably tell by the patches I had in my other serie, but we should really split the UI and VI support in two files, especially since it has pretty much no code path or data in common (if you combine this patch with the YUV support). Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --ef2rdlgp37d7jueh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAlodzk0ACgkQ0rTAlCFN r3SkCw//T64cHDSccj/ePU+v3jj+KiAUjtnIpQmCgIMPqbP2SR3EqkNgCCXIy66m aNYq16WhvpLZ8PYue+qiadPHPe3AP16pxYG7rprbnMCLT5PHzHDK5z9ob0F5BFxR VsfpfthE24TEws7PlQDBx6xWP+PVp17uAGiRxZ9pXQTtsIb+BZ7i3zO5010Br5rh wVgLBFInHzz1Azi/SSMxZNkLvQQstxIJqzr9Z0aoHLtkVZit4qb5OxfBDErQewL1 Us4l2H74BL+CtO2GZXWfKrzrmb1L29mzmxjch4JUEbBuuFr3mGD+xAjZTL1ga8ua DslNo/iy7wYpMDhn46KR0l0uS1HMRw6ML/91+90ErBDEwwZCdE0gMzGKnFhWQSUV huhhPWlOpGEveQDRXFyzZwu2fZ8p2rEk+txZGfDHAvy8WYYvcFddJwI6eVbJxdVt dxKOFBuOOgKCmd692u238S0OCz/arZVoIeGHFkqr4aT9dObOpRLbDrq/RxIQGGYX 56ePXmXqi0Uqc2wgIIjOLi+XsjvEYWBwKzi7LwHQM2oCiLMahmdq2i63drAwwxtj nffEmCbAL1NHDrSLxvfp4mldfP0M5BtyIxkcTw2qRTFW1+IBYys65pshsUkk2LRQ VjHBIFCErYPWZtEYMwMHIXnXS2zAl51qhQ6KIiI4Y3/xgGDykJU= =nHgZ -----END PGP SIGNATURE----- --ef2rdlgp37d7jueh--