Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2513927ybk; Mon, 18 May 2020 00:38:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKip9sLEVOT7a2TlYRNExkgjv0wN3mf0g9GeG46wdVoYhUZDINNLSnGwiJ091UOcz7ObWl X-Received: by 2002:a1c:2943:: with SMTP id p64mr2169755wmp.42.1589787507882; Mon, 18 May 2020 00:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589787507; cv=none; d=google.com; s=arc-20160816; b=QDQq/MrmXO4EK0G3yJiPJlUudoOnjcaj/ePCfgSrHxZxd3ckPdyypASRNy26r1ulck kB+dodxXCryynxP0sSfQFZz2ek0KrqjO6r6M71GlQTgcBPKCxYCSLFv6OwnVzgK21KvV PMW27TYsiubDD1foncabQllh3UIWdK+mSq7ZbInwQkEUbHmu5biAI0E2kOKBZoHujqGA PplAsps8LZKZVzBvamBTXlpC7CnD1HGq2glT3DZZjTs2GQbCn9FKHg1+ZVPlwIt3jjIZ ANmCT1LrPGiH4N4TEs9toza9rMd1izulwraNq4zlYdXVFnvRrynYhkLxZmwKJRPnsQiU GWSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=GLuSEpDkxbRCowgvSh3SeCEIDw8QwMJHOr1bbB7Cpyo=; b=ZQc63mD//IcfXcn/kUZ+bY6U504oSkb5QUCbx9Icc58xlWIxAJ50JvjGjc9f5i9XFp 6pAr7QzJYLHHqgIHQ5GOyZcMKD0ZyOx8pNK0JPrlQy/+eAEMKp8QDH3eSMNezCj+hKjw s9/FBry6t5aj8FtjWZUA6sj2h+JoJGoLeTmZ5CM72iqSHx6yRiHIKp9PRHQtQ8X2Bq0q a1XD4vcFzAF8ESOlTf1j5Dz9d+G9jH8KdEe0bj5RTd3DJMYG08GUILW7o0l43B756s1f 7vszx7D84IkKlA54wWa0YSS4pOI/Hbm2xdpby4tFXdoFa/xLEEIgbpYpln4NYJygAEeI 2afw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LwxT2dbE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n22si5903787ejd.119.2020.05.18.00.38.04; Mon, 18 May 2020 00:38:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LwxT2dbE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726880AbgERHgR (ORCPT + 99 others); Mon, 18 May 2020 03:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbgERHgR (ORCPT ); Mon, 18 May 2020 03:36:17 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D15BBC061A0C; Mon, 18 May 2020 00:36:16 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id z18so494765lji.12; Mon, 18 May 2020 00:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GLuSEpDkxbRCowgvSh3SeCEIDw8QwMJHOr1bbB7Cpyo=; b=LwxT2dbEJ7gOqng7mC9yPXRksFgJLS1PErbV94hynNBXE1Xro+28KCbEapKVXNHY9j 8fg4EhjQXS4k6zykpFLymfKqmmC5Vbj7h7hi8beouN7wmaGkW8bbHchXlooOFywxt/yx I8aLf25BqP7h17q+Zf+qYkj05GVeq4ThwK7AotHweMiKBRSbg+JlOw3EhrNeeTgbY6IU KDYiogorlxJxUom2cDtPiJyDifFZqbatbW5BzlIhH4yggLywZwy49RZqws3gHOXEdSNe SiPM6qJZUlTFziQI4dJP3ThE9rPdS5npNYjK4B65eD/Ajzj3Sk0wYdRmZKJzy0+JMdU5 JWDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GLuSEpDkxbRCowgvSh3SeCEIDw8QwMJHOr1bbB7Cpyo=; b=oLJhUxmG0NMcDiAjdQB1dZMlTZ7hv7qoV82FFj6WIikQn7nQKB+4FMAdOJa0GgCQnk ynQSvvcMoNDVOCBKVboJ2MO/3yT20IG0rNQsmrSq1r6zI2ng5aVw8Vw5c6r2IYnvKh65 zZl7Z7KHcy36nus6blkCc1Q2V9Xbl52mGp/bpPWnv7uv+9w6td9wxLVtzVKWmuohdbFx P+6/wsEnKO0r56wzc/fhZ+gj5Hoy48ghXQC1b+kUcK3aKIgt6hR2xZf4T756fErxgPzJ nx+L8KDA1Yc4DAZ3bK+jZ8pfM0ofA+dUPRFlQaT+sOBG1wxjkv34R3Jflaq9hRND/6JY 60gw== X-Gm-Message-State: AOAM5327kQ0JAFZ8LVp3u/IIpB8yAie4l0dHuL6iCjXoh3XxjEqJJvFS ShhVu3t+grOtP15u64vo46UXptlf X-Received: by 2002:a2e:b0c4:: with SMTP id g4mr9347764ljl.235.1589787374697; Mon, 18 May 2020 00:36:14 -0700 (PDT) Received: from [192.168.2.145] (ppp91-78-208-152.pppoe.mtu-net.ru. [91.78.208.152]) by smtp.googlemail.com with ESMTPSA id n23sm5234245ljj.48.2020.05.18.00.36.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2020 00:36:13 -0700 (PDT) Subject: Re: [PATCH v10 0/2] Panel rotation patches To: Sean Paul Cc: "dbasehore ." , Thierry Reding , Daniel Vetter , linux-kernel , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Sam Ravnborg , David Airlie , dri-devel , "linux-tegra@vger.kernel.org" References: <20200306002112.255361-1-dbasehore@chromium.org> <6dc9ef16-9671-6ce8-27e6-aa1f4c009ee2@gmail.com> <736ad1d2-4a28-87e8-62f7-28a5582c9fcf@gmail.com> From: Dmitry Osipenko Message-ID: Date: Mon, 18 May 2020 10:36:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 12.05.2020 23:59, Sean Paul пишет: > On Thu, Apr 16, 2020 at 7:03 PM Dmitry Osipenko wrote: >> >> 15.04.2020 00:32, dbasehore . пишет: >>> On Tue, Apr 14, 2020 at 2:18 PM Dmitry Osipenko wrote: >>>> >>>> 14.04.2020 22:32, dbasehore . пишет: >>>>> Hi Dmitry, sorry for the late reply. >>>>> >>>>> On Sun, Mar 8, 2020 at 12:25 PM Dmitry Osipenko wrote: >>>>>> >>>>>> 06.03.2020 03:21, Derek Basehore пишет: >>>>>>> This adds the plumbing for reading panel rotation from the devicetree >>>>>>> and sets up adding a panel property for the panel orientation on >>>>>>> Mediatek SoCs when a rotation is present. >>>>>> >>>>>> Hello Derek and everyone, >>>>>> >>>>>> I'm looking at adding display rotation support to NVIDIA Tegra DRM >>>>>> driver because some devices have display panel physically mounted >>>>>> upside-down, and thus, display controller's scan-out needs to be rotated >>>>>> by 180° in this case. >>>>>> >>>>>> Derek, yours panel-rotation patches add support for assigning panel's >>>>>> orientation to the connector, but then only primary display plane >>>>>> receives rotation value in [1], while rotation needs to be applied to >>>>>> all available overlay/cursor planes and this should happen in other >>>>>> places than [1] as well. >>>>> >>>>> This is intended. We don't correct the output in the kernel. We >>>>> instead rely on notifying userspace that the panel is rotated, then we >>>>> handle it there. >>>>> >>>>>> >>>>>> [1] drm_client_modeset_commit_atomic() >>>>>> >>>>>> Please also note that in a case of the scan-out rotation, plane's >>>>>> coordinates need to be changed in accordance to the display's rotation. >>>>>> >>>>>> I looked briefly through the DRM code and my understanding that the DRM >>>>>> core currently doesn't support use-case where scan-out needs to rotated >>>>>> based on a panel's orientation, correct? Is it the use-case you're >>>>>> working on for the Mediatek driver? >>>>> >>>>> Yes, we rely on userspace to rotate the output. The major reason for >>>>> this is because there may not be a "free" hardware rotation that can >>>>> be applied to the overlay. Sean Paul and others also preferred that >>>>> userspace control what is output to the screen instead of the kernel >>>>> taking care of it. This code just adds the drm property to the panel. >>>>> >>>> >>>> Could you please explain what that userspace is? >>> >>> This was added for Chrome OS, which uses its own graphics stack, >>> Ozone, instead of Xorg. >>> >> >> Thank you very much for the clarification. >> >> It's probably not a big problem for something monolithic and customized >> like ChromeOS to issue a software update in order to take into account >> all specifics of a particular device, but this doesn't work nicely for a >> generic software, like a usual Linux distro. >> >>>> AFAIK, things like Xorg modesetting don't support that orientation property. >> >> In my case it's not only the display panel which is upside-down, but >> also the touchscreen. Hence both display output and touchscreen input >> need to be rotated at once, otherwise you'll end up with either display >> or input being upside-down. >> >> The 180° rotation should be free on NVIDIA Tegra. There are no known >> limitations for the planes and BSP kernel video driver handles the >> plane's coordinates/framebuffer rotation within the driver. >> >> The kernel's input subsystem allows us to transparently (for userspace) >> remap the touchscreen input (by specifying generic touchscreen >> device-tree properties), while this is not the case for the DRM subsystem. >> >> @Thierry, @Sean, @Daniel, could you please help me to understand how a >> coordinated display / input rotation could be implemented, making the >> rotation transparent to the user (i.e. avoiding xorg.conf hacking and >> etc)? It should be nice if display's output could be flipped within the >> DRM driver, hiding this fact from userspace. > > I think the right thing to do is to fix userspace to respect this > property, since that has the most communal benefit. Hello Sean, This will be ideal, but it's difficult to achieve in a loosely controlled userspace environment. > However(!!) if you don't want to do that, how about inspecting the > info->panel_orientation value after drm_panel_attach in tegra driver > and then adjusting rotation values in the driver. Of course, you > wouldn't want to expose the panel orientation property since you don't > want userspaces to be double-rotating on you, but it's optional so > you'd be fine. Thank you very much for the suggestion, I'll be trying it out soon. >> >> Will it be okay if we'll add a transparent-rotation support specifically >> to the Tegra DRM driver? For example if device-tree contains >> nvidia,display-flip-y property, then the Tegra DRM driver will take care >> of rotating coordinates/framebuffer of the display planes. > > I don't think this is necessary, but it also wouldn't really be > appropriate to put software attributes into devicetree anyways. Yes, I'm also not feeling very excited about this variant.