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=-7.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 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 8DCF9C282DA for ; Wed, 17 Apr 2019 14:58:30 +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 5E9DB20651 for ; Wed, 17 Apr 2019 14:58:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PmOEjT9G"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=tronnes.org header.i=@tronnes.org header.b="DLBjwtQe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E9DB20651 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=tronnes.org 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-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eSgkDuMleZzqlIDqZ0SD9apnD64fPkjFgYkcoWhFvEk=; b=PmOEjT9GVCK+xX CmW6szw1i1GzwlrKfQTsbCPo07tDS/ZxhaVcReEAW4IxIwLOEI6+IS60cmTqzqJZgq3jeu6Ve9ZzJ IfrYXI+4VnI8Okxcvp+mNdz4ZYEWcJqinqvvcLf6bQVjZ+dV/mDDvNTCs7W+SPpuoZpIGth7YtB5X y2rEJHcG3Jz0IsbYfJ67dDWjRi154nUJ+CZTeKx+wK6peYGcUOcrvQedtjosZQhzz20swYIIZOd+n OnsLmPhh9julM/5bOiG7RxpbesaPvl5tn5b307LWWuToVg+YViYpU+yeqXiIAdfHkSF1rnQBMcYcI 1RcY1pKc0ZcZqeJTUgrw==; 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 1hGm12-0007TG-Cn; Wed, 17 Apr 2019 14:58:24 +0000 Received: from smtp.domeneshop.no ([2a01:5b40:0:3005::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGm0y-0007SK-2f for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2019 14:58:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org; s=ds201810; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=YQxJJLNLlOYLAbvlLVOKx7QwJvHkXtK9T4fHr1gKwEI=; b=DLBjwtQeQEZUZTE6fPUF3EbLjp8JU7ZTK/yF0q4PlAnms+qOc/xjV4B6jTwi/R2NZGOu3EXAZJiUJfNe3RSS7Iqz81Vzyb+97CavCGD/lE9EHOXcyogr5+oNeR/PZbGDgzWE4AjFCvq0VTEXwusNvPaH+tYRdxPyU9JLmPnUV7oH7/nb7d3Fz4YM1XBcYdUVl3wPz3iww66t/+7poVIkpWxR7XQcasb/v+weO7hJQHvvlyFB8WavcP2awfukObNSFBSwFJdBlNsZa7udUEGGc2KSynA2d3PPyXIR+gr7TYZCdDof3m4XoL1vjAgwIXF1uVK4/WtozbvagP2LvwSn7Q==; Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:55203 helo=[192.168.10.179]) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1hGm0q-0003fk-VO; Wed, 17 Apr 2019 16:58:12 +0200 Subject: Re: [PATCH v2 3/5] drm/modes: Allow to specify rotation and reflection on the commandline To: Maxime Ripard References: <2afd45902d7e1e849d0aa7a0c4268c424cabe778.1554988934.git-series.maxime.ripard@bootlin.com> <6785d207-bcfb-6723-22be-039c2b99edd4@tronnes.org> <20190417143029.qhalxycshbrtdwvn@flea> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= Message-ID: Date: Wed, 17 Apr 2019 16:58:07 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190417143029.qhalxycshbrtdwvn@flea> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190417_075820_303625_F2D1B348 X-CRM114-Status: GOOD ( 19.35 ) 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: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Den 17.04.2019 16.30, skrev Maxime Ripard: > 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 wo= rk. >> >> 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 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? 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. Noralf. > Maxime > = > -- > Maxime Ripard, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel