* Re: [PATCH v10 0/2] Panel rotation patches
[not found] ` <20200306002112.255361-1-dbasehore-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2020-03-08 19:25 ` Dmitry Osipenko
[not found] ` <ecbfb5f8-615a-4a88-5dac-de17158125bf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Osipenko @ 2020-03-08 19:25 UTC (permalink / raw)
To: Derek Basehore, linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
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.
[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?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v10 0/2] Panel rotation patches
[not found] ` <ecbfb5f8-615a-4a88-5dac-de17158125bf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2020-04-14 19:32 ` dbasehore .
[not found] ` <CAGAzgsqpjZxh7PEL_Dy7HrFeFGm7+=F6cL3QG9KmK9CHvDWZ9g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: dbasehore . @ 2020-04-14 19:32 UTC (permalink / raw)
To: Dmitry Osipenko
Cc: linux-kernel, Thierry Reding, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Sam Ravnborg, David Airlie, Daniel Vetter,
dri-devel, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Hi Dmitry, sorry for the late reply.
On Sun, Mar 8, 2020 at 12:25 PM Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v10 0/2] Panel rotation patches
[not found] ` <CAGAzgsqpjZxh7PEL_Dy7HrFeFGm7+=F6cL3QG9KmK9CHvDWZ9g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-04-14 21:18 ` Dmitry Osipenko
[not found] ` <6dc9ef16-9671-6ce8-27e6-aa1f4c009ee2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Osipenko @ 2020-04-14 21:18 UTC (permalink / raw)
To: dbasehore .
Cc: linux-kernel, Thierry Reding, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Sam Ravnborg, David Airlie, Daniel Vetter,
dri-devel, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sean Paul
14.04.2020 22:32, dbasehore . пишет:
> Hi Dmitry, sorry for the late reply.
>
> On Sun, Mar 8, 2020 at 12:25 PM Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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?
AFAIK, things like Xorg modesetting don't support that orientation property.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v10 0/2] Panel rotation patches
[not found] ` <6dc9ef16-9671-6ce8-27e6-aa1f4c009ee2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2020-04-14 21:32 ` dbasehore .
[not found] ` <CAGAzgsrNrq+S+-5KEFVnJn6S5DRn1fKkToD5=KR911T9AOAF-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: dbasehore . @ 2020-04-14 21:32 UTC (permalink / raw)
To: Dmitry Osipenko
Cc: linux-kernel, Thierry Reding, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Sam Ravnborg, David Airlie, Daniel Vetter,
dri-devel, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sean Paul
On Tue, Apr 14, 2020 at 2:18 PM Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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.
>
> AFAIK, things like Xorg modesetting don't support that orientation property.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v10 0/2] Panel rotation patches
[not found] ` <CAGAzgsrNrq+S+-5KEFVnJn6S5DRn1fKkToD5=KR911T9AOAF-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-04-16 23:03 ` Dmitry Osipenko
2020-05-12 20:59 ` Sean Paul
0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Osipenko @ 2020-04-16 23:03 UTC (permalink / raw)
To: dbasehore ., Thierry Reding, Sean Paul
Cc: linux-kernel, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
Sam Ravnborg, David Airlie, Daniel Vetter, dri-devel,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
15.04.2020 00:32, dbasehore . пишет:
> On Tue, Apr 14, 2020 at 2:18 PM Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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.
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v10 0/2] Panel rotation patches
2020-04-16 23:03 ` Dmitry Osipenko
@ 2020-05-12 20:59 ` Sean Paul
[not found] ` <CAMavQKJtbha_o==X+MX6GmjfAMYvdLyubvCFg48Tbn1mdgo40w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Sean Paul @ 2020-05-12 20:59 UTC (permalink / raw)
To: Dmitry Osipenko
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
On Thu, Apr 16, 2020 at 7:03 PM Dmitry Osipenko <digetx@gmail.com> wrote:
>
> 15.04.2020 00:32, dbasehore . пишет:
> > On Tue, Apr 14, 2020 at 2:18 PM Dmitry Osipenko <digetx@gmail.com> 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 <digetx@gmail.com> 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.
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.
>
> 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.
Sean
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v10 0/2] Panel rotation patches
[not found] ` <CAMavQKJtbha_o==X+MX6GmjfAMYvdLyubvCFg48Tbn1mdgo40w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2020-05-18 7:36 ` Dmitry Osipenko
[not found] ` <fa443308-7610-9060-68eb-e14e446dd4bf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Osipenko @ 2020-05-18 7:36 UTC (permalink / raw)
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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
12.05.2020 23:59, Sean Paul пишет:
> On Thu, Apr 16, 2020 at 7:03 PM Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>> 15.04.2020 00:32, dbasehore . пишет:
>>> On Tue, Apr 14, 2020 at 2:18 PM Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v10 0/2] Panel rotation patches
[not found] ` <fa443308-7610-9060-68eb-e14e446dd4bf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2020-06-12 16:32 ` Dmitry Osipenko
0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Osipenko @ 2020-06-12 16:32 UTC (permalink / raw)
To: Sean Paul, dbasehore ., Thierry Reding
Cc: Daniel Vetter, linux-kernel, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Sam Ravnborg, David Airlie, dri-devel,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
18.05.2020 10:36, Dmitry Osipenko пишет:
> 12.05.2020 23:59, Sean Paul пишет:
>> On Thu, Apr 16, 2020 at 7:03 PM Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>
>>> 15.04.2020 00:32, dbasehore . пишет:
>>>> On Tue, Apr 14, 2020 at 2:18 PM Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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.
>
After some consideration, I decided that it will be better to start easy
by supporting the minimum needed for the rotation property to work on
Tegra, i.e. having userspace to take care of the rotation. It will be
possible to change it later on if will be necessary.
@dbasehore, I'll prepare Tegra DRM patchset around Monday and will
include yours two patches that add DT reading helper and set the display
info, since these patches haven't been applied yet.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-06-12 16:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200306002112.255361-1-dbasehore@chromium.org>
[not found] ` <20200306002112.255361-1-dbasehore-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2020-03-08 19:25 ` [PATCH v10 0/2] Panel rotation patches Dmitry Osipenko
[not found] ` <ecbfb5f8-615a-4a88-5dac-de17158125bf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-04-14 19:32 ` dbasehore .
[not found] ` <CAGAzgsqpjZxh7PEL_Dy7HrFeFGm7+=F6cL3QG9KmK9CHvDWZ9g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-04-14 21:18 ` Dmitry Osipenko
[not found] ` <6dc9ef16-9671-6ce8-27e6-aa1f4c009ee2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-04-14 21:32 ` dbasehore .
[not found] ` <CAGAzgsrNrq+S+-5KEFVnJn6S5DRn1fKkToD5=KR911T9AOAF-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-04-16 23:03 ` Dmitry Osipenko
2020-05-12 20:59 ` Sean Paul
[not found] ` <CAMavQKJtbha_o==X+MX6GmjfAMYvdLyubvCFg48Tbn1mdgo40w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-05-18 7:36 ` Dmitry Osipenko
[not found] ` <fa443308-7610-9060-68eb-e14e446dd4bf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-12 16:32 ` Dmitry Osipenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).