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=-8.8 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,URIBL_RHS_DOB,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 2DB38C10F0B for ; Thu, 18 Apr 2019 07:43:43 +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 F0C132183E for ; Thu, 18 Apr 2019 07:43:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nsJfxcVJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0C132183E 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=rX8NJWY+2DugTpSE1dyqhaHxS9b3YVm6R2DqTYkyX+o=; b=nsJfxcVJ59mt31Oa3ffsiDSsD vTGhy8pxdJ5p7orSEL2f5mu5dtaVh27Gk5z65yy8XaZLHL4MHibDaDAhNs1kJ2gGu+ISRJdMTxJWl gjCnZjGdkFhQ2/uq5dY1Nqr0lKVgMsIUfXpQNghXRfYWPyjnONVtcEC1AXktxAUlOkGQt3/Xa0IqJ 5vXYLvoIXqy+NbaRJbHVISfiJvHqjMkIexU7EqIha7fG8yYtzvxhBm33t5d+WQyRHc+1fBf9FCd+r f2Y/iGukxHlzXpWyhTBAtwduyJibooZVCauLCYCdUzMXdktcOmSOLXuTXMgd1ga/RP4wKlDd35J4c qE9iY17Fw==; 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 1hH1hk-0000HY-Tb; Thu, 18 Apr 2019 07:43:32 +0000 Received: from relay10.mail.gandi.net ([217.70.178.230]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hH1hh-0000H6-I8 for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2019 07:43:31 +0000 Received: from localhost (aaubervilliers-681-1-42-238.w90-88.abo.wanadoo.fr [90.88.160.238]) (Authenticated sender: maxime.ripard@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 36F2B240005; Thu, 18 Apr 2019 07:43:18 +0000 (UTC) Date: Thu, 18 Apr 2019 09:43:17 +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: <20190418074317.xls44gr3nbhyhop4@flea> References: <2afd45902d7e1e849d0aa7a0c4268c424cabe778.1554988934.git-series.maxime.ripard@bootlin.com> <6785d207-bcfb-6723-22be-039c2b99edd4@tronnes.org> <20190417143029.qhalxycshbrtdwvn@flea> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190418_004329_902429_B02C21B9 X-CRM114-Status: GOOD ( 25.09 ) 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="===============7675355783255383579==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7675355783255383579== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ag4uume6pefb5p6r" Content-Disposition: inline --ag4uume6pefb5p6r Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2019 at 04:58:07PM +0200, Noralf Tr=F8nnes wrote: > Den 17.04.2019 16.30, skrev Maxime Ripard: > > 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 initi= alise > >>> 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 d= eal > >>> 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= _helper.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 = work. > >> > >> 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. > > > > Does this rotation only apply to the fbdev emulation and should not > propogate to DRM userspace? I guess it definitely should be propagated to the DRM userspace. > I actually don't understand how the DRM plane rotation works for 90/270 > rotation. Should the framebuffer width/height be swapped when attaching > to a rotated plane? I'm not sure either, especially since the stride might be a bit different too. However, since (as you pointed out) it would be much harder to support, I left it out of that patch series for the moment. > Btw drm_setup_crtc_rotation() doesn't support 90/270 plane rotation even > if the hw supports it. It will instead sw rotate fbcon, but fbdev > userspace remains unrotated. That would need to be addressed eventually yep. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --ag4uume6pefb5p6r Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXLgqlQAKCRDj7w1vZxhR xQ4iAQDQW7sVnRtmPetKBpmI4emTfjM39+INy1ikDwe15gjtqwD+Nv0HVSDMx25f 4qv7TjNNORwzzt7BCrq5+411vNZHUw8= =IbXz -----END PGP SIGNATURE----- --ag4uume6pefb5p6r-- --===============7675355783255383579== 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 --===============7675355783255383579==--