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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30CE5C282DA for ; Wed, 17 Apr 2019 14:30:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0244C206BA for ; Wed, 17 Apr 2019 14:30:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Qv4jLKDt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0244C206BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8wFpaKYmdhp2coUI002Dxp6ARQkq0LkMXBPK0BvedwM=; b=Qv4jLKDtj3qKFwJV6F5rgodj7 nc40wy0+Z/aJREduwf5XJWpmiIlrP3Apju0JyFbMsSAiC/DStADjIrphtFTAZ91LW002TLAa6Iu+2 W562LkWt8koTo9a+lu8Pvyy2opGPaDXFriTCxPP64ZWqcogMW1DE1FCehm14aUrkB9MWjfjp0MhJI XJcN46KIMrt4I7G1g6CnXjZS19EpZKUT5uln/bfBKpKEV40qOiiMdr/1oI10lj/1sA1xBBabLz2x1 QMEU2NTGurAcXjSPLy51f/r8lexTAJzrA2ORBZEMuIBLs8IPsSqPv+gqfLnct8twCGhIme34EmafU kbN4XX/TQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGlaC-00055I-IL; Wed, 17 Apr 2019 14:30:40 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGla9-00054r-Fd for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2019 14:30:39 +0000 X-Originating-IP: 90.88.160.238 Received: from localhost (aaubervilliers-681-1-42-238.w90-88.abo.wanadoo.fr [90.88.160.238]) (Authenticated sender: maxime.ripard@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 59917C0013; Wed, 17 Apr 2019 14:30:30 +0000 (UTC) Date: Wed, 17 Apr 2019 16:30:29 +0200 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Subject: Re: [PATCH v2 3/5] drm/modes: Allow to specify rotation and reflection on the commandline Message-ID: <20190417143029.qhalxycshbrtdwvn@flea> References: <2afd45902d7e1e849d0aa7a0c4268c424cabe778.1554988934.git-series.maxime.ripard@bootlin.com> <6785d207-bcfb-6723-22be-039c2b99edd4@tronnes.org> MIME-Version: 1.0 In-Reply-To: <6785d207-bcfb-6723-22be-039c2b99edd4@tronnes.org> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190417_073037_877446_0931E4C8 X-CRM114-Status: GOOD ( 21.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eben@raspberrypi.org, David Airlie , Maarten Lankhorst , dri-devel@lists.freedesktop.org, Paul Kocialkowski , Sean Paul , Thomas Petazzoni , Daniel Vetter , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============5731738729325817962==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5731738729325817962== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uwcjt4u5pitqgq7j" Content-Disposition: inline --uwcjt4u5pitqgq7j Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Noralf, On Tue, Apr 16, 2019 at 04:50:00PM +0200, Noralf Tr=F8nnes wrote: > Den 11.04.2019 15.22, skrev Maxime Ripard: > > Rotations and reflections setup are needed in some scenarios to initial= ise > > properly the initial framebuffer. Some drivers already had a bunch of > > quirks to deal with this, such as either a private kernel command line > > parameter (omapdss) or on the device tree (various panels). > > > > In order to accomodate this, let's create a video mode parameter to deal > > with the rotation and reflexion. > > > > Signed-off-by: Maxime Ripard > > --- > > drivers/gpu/drm/drm_fb_helper.c | 4 +- > > drivers/gpu/drm/drm_modes.c | 110 +++++++++++++++++++++++++++------ > > include/drm/drm_connector.h | 1 +- > > 3 files changed, 95 insertions(+), 20 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_h= elper.c > > index b3a5d79436ae..8781897559b2 100644 > > --- a/drivers/gpu/drm/drm_fb_helper.c > > +++ b/drivers/gpu/drm/drm_fb_helper.c > > @@ -2521,6 +2521,7 @@ static void drm_setup_crtc_rotation(struct drm_fb= _helper *fb_helper, > > struct drm_connector *connector) > > { > > struct drm_plane *plane =3D fb_crtc->mode_set.crtc->primary; > > + struct drm_cmdline_mode *mode =3D &connector->cmdline_mode; > > uint64_t valid_mask =3D 0; > > int i, rotation; > > > > @@ -2540,6 +2541,9 @@ static void drm_setup_crtc_rotation(struct drm_fb= _helper *fb_helper, > > rotation =3D DRM_MODE_ROTATE_0; > > } > > > > + if (mode->rotation !=3D DRM_MODE_ROTATE_0) > > + fb_crtc->rotation =3D mode->rotation; > > + > > We already have a property to describe initial display/panel rotation. > If we can set connector->display_info.panel_orientation from the video=3D > parameter, then there's no need to modify drm_fb_helper, it will just wor= k. > > In that case, maybe 'orientation' is a better argument name with values > mapped to the enum. I wouldn't put it at the same level though. As far as I understand it, the orientation is a hardware constraint: the hardware has been designed that way, and should honor that orientation to make it look with the top, well, on top. However, the rotation is more of a user choice, and you could definitely envision having a combination of a rotation and an orientation constraint. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --uwcjt4u5pitqgq7j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXLc4hQAKCRDj7w1vZxhR xTeIAQCPU7BLL67+5cWtBBhXpgp4xwtK5gSyqMGkuffqcyXHGAEA3VBr0CyUXLqz vW84WkFDUoWKwPrC7gvz7xXWRz0E6A8= =vkw1 -----END PGP SIGNATURE----- --uwcjt4u5pitqgq7j-- --===============5731738729325817962== 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 --===============5731738729325817962==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH v2 3/5] drm/modes: Allow to specify rotation and reflection on the commandline Date: Wed, 17 Apr 2019 16:30:29 +0200 Message-ID: <20190417143029.qhalxycshbrtdwvn@flea> References: <2afd45902d7e1e849d0aa7a0c4268c424cabe778.1554988934.git-series.maxime.ripard@bootlin.com> <6785d207-bcfb-6723-22be-039c2b99edd4@tronnes.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1199781714==" Return-path: Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by gabe.freedesktop.org (Postfix) with ESMTPS id 800356E059 for ; Wed, 17 Apr 2019 14:30:34 +0000 (UTC) In-Reply-To: <6785d207-bcfb-6723-22be-039c2b99edd4@tronnes.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Cc: eben@raspberrypi.org, David Airlie , dri-devel@lists.freedesktop.org, Paul Kocialkowski , Sean Paul , Thomas Petazzoni , Daniel Vetter , linux-arm-kernel@lists.infradead.org List-Id: dri-devel@lists.freedesktop.org --===============1199781714== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uwcjt4u5pitqgq7j" Content-Disposition: inline --uwcjt4u5pitqgq7j Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Noralf, On Tue, Apr 16, 2019 at 04:50:00PM +0200, Noralf Tr=F8nnes wrote: > Den 11.04.2019 15.22, skrev Maxime Ripard: > > Rotations and reflections setup are needed in some scenarios to initial= ise > > properly the initial framebuffer. Some drivers already had a bunch of > > quirks to deal with this, such as either a private kernel command line > > parameter (omapdss) or on the device tree (various panels). > > > > In order to accomodate this, let's create a video mode parameter to deal > > with the rotation and reflexion. > > > > Signed-off-by: Maxime Ripard > > --- > > drivers/gpu/drm/drm_fb_helper.c | 4 +- > > drivers/gpu/drm/drm_modes.c | 110 +++++++++++++++++++++++++++------ > > include/drm/drm_connector.h | 1 +- > > 3 files changed, 95 insertions(+), 20 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_h= elper.c > > index b3a5d79436ae..8781897559b2 100644 > > --- a/drivers/gpu/drm/drm_fb_helper.c > > +++ b/drivers/gpu/drm/drm_fb_helper.c > > @@ -2521,6 +2521,7 @@ static void drm_setup_crtc_rotation(struct drm_fb= _helper *fb_helper, > > struct drm_connector *connector) > > { > > struct drm_plane *plane =3D fb_crtc->mode_set.crtc->primary; > > + struct drm_cmdline_mode *mode =3D &connector->cmdline_mode; > > uint64_t valid_mask =3D 0; > > int i, rotation; > > > > @@ -2540,6 +2541,9 @@ static void drm_setup_crtc_rotation(struct drm_fb= _helper *fb_helper, > > rotation =3D DRM_MODE_ROTATE_0; > > } > > > > + if (mode->rotation !=3D DRM_MODE_ROTATE_0) > > + fb_crtc->rotation =3D mode->rotation; > > + > > We already have a property to describe initial display/panel rotation. > If we can set connector->display_info.panel_orientation from the video=3D > parameter, then there's no need to modify drm_fb_helper, it will just wor= k. > > In that case, maybe 'orientation' is a better argument name with values > mapped to the enum. I wouldn't put it at the same level though. As far as I understand it, the orientation is a hardware constraint: the hardware has been designed that way, and should honor that orientation to make it look with the top, well, on top. However, the rotation is more of a user choice, and you could definitely envision having a combination of a rotation and an orientation constraint. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --uwcjt4u5pitqgq7j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXLc4hQAKCRDj7w1vZxhR xTeIAQCPU7BLL67+5cWtBBhXpgp4xwtK5gSyqMGkuffqcyXHGAEA3VBr0CyUXLqz vW84WkFDUoWKwPrC7gvz7xXWRz0E6A8= =vkw1 -----END PGP SIGNATURE----- --uwcjt4u5pitqgq7j-- --===============1199781714== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============1199781714==--