Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2022-02-22 Thread Dmitry Osipenko
20.12.2021 13:48, Thierry Reding пишет:
> From: Thierry Reding 
> 
> Hi,
> 
> this is an alternative proposal to fix panel support on Venice 2 and
> Nyan. Dmitry had proposed a different solution that involved reverting
> the I2C/DDC registration order and would complicate things by breaking
> the encapsulation of the driver by introducing a global (though locally
> scoped) variable[0].
> 
> This set of patches avoids that by using the recently introduced DP AUX
> bus infrastructure. The result is that the changes are actually less
> intrusive and not a step back. Instead they nicely remove the circular
> dependency that previously existed and caused these issues in the first
> place.
> 
> To be fair, this is not perfect either because it requires a device tree
> change and hence isn't technically backwards-compatible. However, given
> that the original device tree was badly broken in the first place, I
> think we can make an exception, especially since it is not generally a
> problem to update device trees on the affected devices.
> 
> Secondly, this relies on infrastructure that was introduced in v5.15 and
> therefore will be difficult to backport beyond that. However, since this
> functionality has been broken since v5.13 and all of the kernel versions
> between that and v5.15 are EOL anyway, there isn't much that we can do
> to fix the interim versions anyway.
> 
> Adding Doug and Laurent since they originally designed the AUX bus
> patches in case they see anything in here that would be objectionable.
> 
> Thierry
> 
> [0]: 
> https://lore.kernel.org/dri-devel/20211130230957.30213-1-dig...@gmail.com/
> 
> Thierry Reding (2):
>   drm/tegra: dpaux: Populate AUX bus
>   ARM: tegra: Move panels to AUX bus
> 
>  arch/arm/boot/dts/tegra124-nyan-big.dts   | 15 +--
>  arch/arm/boot/dts/tegra124-nyan-blaze.dts | 15 +--
>  arch/arm/boot/dts/tegra124-venice2.dts| 14 +++---
>  drivers/gpu/drm/tegra/Kconfig |  1 +
>  drivers/gpu/drm/tegra/dpaux.c |  7 +++
>  5 files changed, 33 insertions(+), 19 deletions(-)
> 

Will we see the v2 anytime soon?


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2022-01-14 Thread Dmitry Osipenko
06.01.2022 04:11, Doug Anderson пишет:
> Hi,
> 
> On Wed, Dec 22, 2021 at 11:26 AM Dmitry Osipenko  wrote:
>>
>> 22.12.2021 14:53, Thierry Reding пишет:
>>> On Wed, Dec 22, 2021 at 06:01:26AM +0300, Dmitry Osipenko wrote:
 21.12.2021 21:01, Thierry Reding пишет:
> On Tue, Dec 21, 2021 at 07:45:31PM +0300, Dmitry Osipenko wrote:
>> 21.12.2021 19:17, Thierry Reding пишет:
>>> On Tue, Dec 21, 2021 at 06:47:31PM +0300, Dmitry Osipenko wrote:
 21.12.2021 13:58, Thierry Reding пишет:
 ..
 The panel->ddc isn't used by the new panel-edp driver unless panel 
 is
 compatible with "edp-panel". Hence the generic_edp_panel_probe() 
 should
 either fail or crash for a such "edp-panel" since panel->ddc isn't 
 fully
 instantiated, AFAICS.
>>>
>>> I've tested this and it works fine on Venice 2. Since that was the
>>> reference design for Nyan, I suspect that Nyan's will also work.
>>>
>>> It'd be great if Thomas or anyone else with access to a Nyan could
>>> test this to verify that.
>>
>> There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
>> 2023, hence we need to either use:
>
> All the (at least relevant) functionality that is in panel-edp was in
> panel-simple before it was moved to panel-edp. I've backported this 
> set
> of patches to v5.15 and it works just fine there.

 Will we be able to add patch to bypass the panel's DT ddc-i2c-bus on
 Nyan to keep the older DTBs working?
>>>
>>> I don't see why we would want to do that. It's quite clear that the DTB
>>> is buggy in this case and we have a more accurate way to describe what's
>>> really there in hardware. In addition that more accurate representation
>>> also gets rid of a bug. Obviously because the bug is caused by the
>>> previous representation that was not accurate.
>>>
>>> Given that we can easily replace the DTBs on these devices there's no
>>> reason to make this any more complicated than it has to be.
>>
>> Don't you care about normal people at all? Do you assume that everyone
>> must to be a kernel developer to be able to use Tegra devices? :/
>
> If you know how to install a custom kernel you also know how to replace
> the DTB on these devices.
>
> For everyone else, once these patches are merged upstream and
> distributions start shipping the new version, they will get this
> automatically by updating their kernel package since most distributions
> actually ship the DTB files as part of that.
>
>> It's not a problem for you to figure out why display is broken, for
>> other people it's a problem. Usually nobody will update DTB without a
>> well known reason, instead device will be dusted on a shelf. In the end
>> you won't have any users at all.
>
> Most "normal" people aren't even going to notice that their DTB is going
> to be updated. They would actually have to do extra work *not* to update
> it.

 My past experience tells that your assumption is incorrect. There are
 quite a lot of people who will update kernel, but not DTB.
>>>
>>> People that do this will have to do it manually because most
>>> distributions I know of will actually ship the DTBs. If they know how to
>>> update the kernel separately, I'm sure they will manage to update the
>>> DTB as well. It's really not more complicated that updating the kernel
>>> image.
>>>
 ARM devices have endless variations of bootloaders and individual quirks
 required for a successful installation of a kernel. Kernel update by
 distro usually isn't a thing on ARM.
>>>
>>> I'm not sure what distribution you have been using, but the ones that
>>> I'm familiar with all install the DTBs along with the kernel. Most Tegra
>>> devices (newer ones at least) do also support booting with U-Boot which
>>> supports standard ways to boot a system (which were co-developed with
>>> distributions precisely so that it would become easier for users to keep
>>> their systems up-to-date), so there's really nothing magical anyone
>>> should need to do in order to get an updated DTB along with the updated
>>> kernel.
>>>
>>> It's a simple fact that sometimes a DTB contains a bug and we have to
>>> fix it.
>>>
>>> In general we try to fix things up in the driver code when reasonable so
>>> that people don't have to update the DTB. This is for the (mostly hypo-
>>> thetical) case where updating the DTB is not possible or very
>>> complicated.
>>>
>>> However, that's not the case on the Venice 2 or Nyan boards. And looking
>>> at the alternative in this case, I don't think it's reasonable compared
>>> to just fixing the problem at the root, which is in the DTB.
>>
>> My understanding that U-Boot isn't the only available bootlo

Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2022-01-05 Thread Doug Anderson
Hi,

On Wed, Dec 22, 2021 at 11:26 AM Dmitry Osipenko  wrote:
>
> 22.12.2021 14:53, Thierry Reding пишет:
> > On Wed, Dec 22, 2021 at 06:01:26AM +0300, Dmitry Osipenko wrote:
> >> 21.12.2021 21:01, Thierry Reding пишет:
> >>> On Tue, Dec 21, 2021 at 07:45:31PM +0300, Dmitry Osipenko wrote:
>  21.12.2021 19:17, Thierry Reding пишет:
> > On Tue, Dec 21, 2021 at 06:47:31PM +0300, Dmitry Osipenko wrote:
> >> 21.12.2021 13:58, Thierry Reding пишет:
> >> ..
> >> The panel->ddc isn't used by the new panel-edp driver unless panel 
> >> is
> >> compatible with "edp-panel". Hence the generic_edp_panel_probe() 
> >> should
> >> either fail or crash for a such "edp-panel" since panel->ddc isn't 
> >> fully
> >> instantiated, AFAICS.
> >
> > I've tested this and it works fine on Venice 2. Since that was the
> > reference design for Nyan, I suspect that Nyan's will also work.
> >
> > It'd be great if Thomas or anyone else with access to a Nyan could
> > test this to verify that.
> 
>  There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
>  2023, hence we need to either use:
> >>>
> >>> All the (at least relevant) functionality that is in panel-edp was in
> >>> panel-simple before it was moved to panel-edp. I've backported this 
> >>> set
> >>> of patches to v5.15 and it works just fine there.
> >>
> >> Will we be able to add patch to bypass the panel's DT ddc-i2c-bus on
> >> Nyan to keep the older DTBs working?
> >
> > I don't see why we would want to do that. It's quite clear that the DTB
> > is buggy in this case and we have a more accurate way to describe what's
> > really there in hardware. In addition that more accurate representation
> > also gets rid of a bug. Obviously because the bug is caused by the
> > previous representation that was not accurate.
> >
> > Given that we can easily replace the DTBs on these devices there's no
> > reason to make this any more complicated than it has to be.
> 
>  Don't you care about normal people at all? Do you assume that everyone
>  must to be a kernel developer to be able to use Tegra devices? :/
> >>>
> >>> If you know how to install a custom kernel you also know how to replace
> >>> the DTB on these devices.
> >>>
> >>> For everyone else, once these patches are merged upstream and
> >>> distributions start shipping the new version, they will get this
> >>> automatically by updating their kernel package since most distributions
> >>> actually ship the DTB files as part of that.
> >>>
>  It's not a problem for you to figure out why display is broken, for
>  other people it's a problem. Usually nobody will update DTB without a
>  well known reason, instead device will be dusted on a shelf. In the end
>  you won't have any users at all.
> >>>
> >>> Most "normal" people aren't even going to notice that their DTB is going
> >>> to be updated. They would actually have to do extra work *not* to update
> >>> it.
> >>
> >> My past experience tells that your assumption is incorrect. There are
> >> quite a lot of people who will update kernel, but not DTB.
> >
> > People that do this will have to do it manually because most
> > distributions I know of will actually ship the DTBs. If they know how to
> > update the kernel separately, I'm sure they will manage to update the
> > DTB as well. It's really not more complicated that updating the kernel
> > image.
> >
> >> ARM devices have endless variations of bootloaders and individual quirks
> >> required for a successful installation of a kernel. Kernel update by
> >> distro usually isn't a thing on ARM.
> >
> > I'm not sure what distribution you have been using, but the ones that
> > I'm familiar with all install the DTBs along with the kernel. Most Tegra
> > devices (newer ones at least) do also support booting with U-Boot which
> > supports standard ways to boot a system (which were co-developed with
> > distributions precisely so that it would become easier for users to keep
> > their systems up-to-date), so there's really nothing magical anyone
> > should need to do in order to get an updated DTB along with the updated
> > kernel.
> >
> > It's a simple fact that sometimes a DTB contains a bug and we have to
> > fix it.
> >
> > In general we try to fix things up in the driver code when reasonable so
> > that people don't have to update the DTB. This is for the (mostly hypo-
> > thetical) case where updating the DTB is not possible or very
> > complicated.
> >
> > However, that's not the case on the Venice 2 or Nyan boards. And looking
> > at the alternative in this case, I don't think it's reasonable compared
> > to just fixing the problem at the root, which is in the DTB.
>
> My understanding that U-Boot isn't the only available bootloader option
> for Nyan. I don't feel happy about 

Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-22 Thread Dmitry Osipenko
22.12.2021 14:53, Thierry Reding пишет:
> On Wed, Dec 22, 2021 at 06:01:26AM +0300, Dmitry Osipenko wrote:
>> 21.12.2021 21:01, Thierry Reding пишет:
>>> On Tue, Dec 21, 2021 at 07:45:31PM +0300, Dmitry Osipenko wrote:
 21.12.2021 19:17, Thierry Reding пишет:
> On Tue, Dec 21, 2021 at 06:47:31PM +0300, Dmitry Osipenko wrote:
>> 21.12.2021 13:58, Thierry Reding пишет:
>> ..
>> The panel->ddc isn't used by the new panel-edp driver unless panel is
>> compatible with "edp-panel". Hence the generic_edp_panel_probe() 
>> should
>> either fail or crash for a such "edp-panel" since panel->ddc isn't 
>> fully
>> instantiated, AFAICS.
>
> I've tested this and it works fine on Venice 2. Since that was the
> reference design for Nyan, I suspect that Nyan's will also work.
>
> It'd be great if Thomas or anyone else with access to a Nyan could
> test this to verify that.

 There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
 2023, hence we need to either use:
>>>
>>> All the (at least relevant) functionality that is in panel-edp was in
>>> panel-simple before it was moved to panel-edp. I've backported this set
>>> of patches to v5.15 and it works just fine there.
>>
>> Will we be able to add patch to bypass the panel's DT ddc-i2c-bus on
>> Nyan to keep the older DTBs working?
>
> I don't see why we would want to do that. It's quite clear that the DTB
> is buggy in this case and we have a more accurate way to describe what's
> really there in hardware. In addition that more accurate representation
> also gets rid of a bug. Obviously because the bug is caused by the
> previous representation that was not accurate.
>
> Given that we can easily replace the DTBs on these devices there's no
> reason to make this any more complicated than it has to be.

 Don't you care about normal people at all? Do you assume that everyone
 must to be a kernel developer to be able to use Tegra devices? :/
>>>
>>> If you know how to install a custom kernel you also know how to replace
>>> the DTB on these devices.
>>>
>>> For everyone else, once these patches are merged upstream and
>>> distributions start shipping the new version, they will get this
>>> automatically by updating their kernel package since most distributions
>>> actually ship the DTB files as part of that.
>>>
 It's not a problem for you to figure out why display is broken, for
 other people it's a problem. Usually nobody will update DTB without a
 well known reason, instead device will be dusted on a shelf. In the end
 you won't have any users at all.
>>>
>>> Most "normal" people aren't even going to notice that their DTB is going
>>> to be updated. They would actually have to do extra work *not* to update
>>> it.
>>
>> My past experience tells that your assumption is incorrect. There are
>> quite a lot of people who will update kernel, but not DTB.
> 
> People that do this will have to do it manually because most
> distributions I know of will actually ship the DTBs. If they know how to
> update the kernel separately, I'm sure they will manage to update the
> DTB as well. It's really not more complicated that updating the kernel
> image.
> 
>> ARM devices have endless variations of bootloaders and individual quirks
>> required for a successful installation of a kernel. Kernel update by
>> distro usually isn't a thing on ARM.
> 
> I'm not sure what distribution you have been using, but the ones that
> I'm familiar with all install the DTBs along with the kernel. Most Tegra
> devices (newer ones at least) do also support booting with U-Boot which
> supports standard ways to boot a system (which were co-developed with
> distributions precisely so that it would become easier for users to keep
> their systems up-to-date), so there's really nothing magical anyone
> should need to do in order to get an updated DTB along with the updated
> kernel.
> 
> It's a simple fact that sometimes a DTB contains a bug and we have to
> fix it.
> 
> In general we try to fix things up in the driver code when reasonable so
> that people don't have to update the DTB. This is for the (mostly hypo-
> thetical) case where updating the DTB is not possible or very
> complicated.
> 
> However, that's not the case on the Venice 2 or Nyan boards. And looking
> at the alternative in this case, I don't think it's reasonable compared
> to just fixing the problem at the root, which is in the DTB.

My understanding that U-Boot isn't the only available bootloader option
for Nyan. I don't feel happy about the ABI breakage, but in the same
time don't feel very strong about the need to care about it in the case
of Nyan since its DT already had a preexisting problem with the wrong
panel model used for the FHD model. The decision will be on your
conscience :)


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-22 Thread Thierry Reding
On Wed, Dec 22, 2021 at 06:01:26AM +0300, Dmitry Osipenko wrote:
> 21.12.2021 21:01, Thierry Reding пишет:
> > On Tue, Dec 21, 2021 at 07:45:31PM +0300, Dmitry Osipenko wrote:
> >> 21.12.2021 19:17, Thierry Reding пишет:
> >>> On Tue, Dec 21, 2021 at 06:47:31PM +0300, Dmitry Osipenko wrote:
>  21.12.2021 13:58, Thierry Reding пишет:
>  ..
>  The panel->ddc isn't used by the new panel-edp driver unless panel is
>  compatible with "edp-panel". Hence the generic_edp_panel_probe() 
>  should
>  either fail or crash for a such "edp-panel" since panel->ddc isn't 
>  fully
>  instantiated, AFAICS.
> >>>
> >>> I've tested this and it works fine on Venice 2. Since that was the
> >>> reference design for Nyan, I suspect that Nyan's will also work.
> >>>
> >>> It'd be great if Thomas or anyone else with access to a Nyan could
> >>> test this to verify that.
> >>
> >> There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
> >> 2023, hence we need to either use:
> >
> > All the (at least relevant) functionality that is in panel-edp was in
> > panel-simple before it was moved to panel-edp. I've backported this set
> > of patches to v5.15 and it works just fine there.
> 
>  Will we be able to add patch to bypass the panel's DT ddc-i2c-bus on
>  Nyan to keep the older DTBs working?
> >>>
> >>> I don't see why we would want to do that. It's quite clear that the DTB
> >>> is buggy in this case and we have a more accurate way to describe what's
> >>> really there in hardware. In addition that more accurate representation
> >>> also gets rid of a bug. Obviously because the bug is caused by the
> >>> previous representation that was not accurate.
> >>>
> >>> Given that we can easily replace the DTBs on these devices there's no
> >>> reason to make this any more complicated than it has to be.
> >>
> >> Don't you care about normal people at all? Do you assume that everyone
> >> must to be a kernel developer to be able to use Tegra devices? :/
> > 
> > If you know how to install a custom kernel you also know how to replace
> > the DTB on these devices.
> > 
> > For everyone else, once these patches are merged upstream and
> > distributions start shipping the new version, they will get this
> > automatically by updating their kernel package since most distributions
> > actually ship the DTB files as part of that.
> > 
> >> It's not a problem for you to figure out why display is broken, for
> >> other people it's a problem. Usually nobody will update DTB without a
> >> well known reason, instead device will be dusted on a shelf. In the end
> >> you won't have any users at all.
> > 
> > Most "normal" people aren't even going to notice that their DTB is going
> > to be updated. They would actually have to do extra work *not* to update
> > it.
> 
> My past experience tells that your assumption is incorrect. There are
> quite a lot of people who will update kernel, but not DTB.

People that do this will have to do it manually because most
distributions I know of will actually ship the DTBs. If they know how to
update the kernel separately, I'm sure they will manage to update the
DTB as well. It's really not more complicated that updating the kernel
image.

> ARM devices have endless variations of bootloaders and individual quirks
> required for a successful installation of a kernel. Kernel update by
> distro usually isn't a thing on ARM.

I'm not sure what distribution you have been using, but the ones that
I'm familiar with all install the DTBs along with the kernel. Most Tegra
devices (newer ones at least) do also support booting with U-Boot which
supports standard ways to boot a system (which were co-developed with
distributions precisely so that it would become easier for users to keep
their systems up-to-date), so there's really nothing magical anyone
should need to do in order to get an updated DTB along with the updated
kernel.

It's a simple fact that sometimes a DTB contains a bug and we have to
fix it.

In general we try to fix things up in the driver code when reasonable so
that people don't have to update the DTB. This is for the (mostly hypo-
thetical) case where updating the DTB is not possible or very
complicated.

However, that's not the case on the Venice 2 or Nyan boards. And looking
at the alternative in this case, I don't think it's reasonable compared
to just fixing the problem at the root, which is in the DTB.

Thierry


signature.asc
Description: PGP signature


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-21 Thread Dmitry Osipenko
21.12.2021 21:01, Thierry Reding пишет:
> On Tue, Dec 21, 2021 at 07:45:31PM +0300, Dmitry Osipenko wrote:
>> 21.12.2021 19:17, Thierry Reding пишет:
>>> On Tue, Dec 21, 2021 at 06:47:31PM +0300, Dmitry Osipenko wrote:
 21.12.2021 13:58, Thierry Reding пишет:
 ..
 The panel->ddc isn't used by the new panel-edp driver unless panel is
 compatible with "edp-panel". Hence the generic_edp_panel_probe() should
 either fail or crash for a such "edp-panel" since panel->ddc isn't 
 fully
 instantiated, AFAICS.
>>>
>>> I've tested this and it works fine on Venice 2. Since that was the
>>> reference design for Nyan, I suspect that Nyan's will also work.
>>>
>>> It'd be great if Thomas or anyone else with access to a Nyan could
>>> test this to verify that.
>>
>> There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
>> 2023, hence we need to either use:
>
> All the (at least relevant) functionality that is in panel-edp was in
> panel-simple before it was moved to panel-edp. I've backported this set
> of patches to v5.15 and it works just fine there.

 Will we be able to add patch to bypass the panel's DT ddc-i2c-bus on
 Nyan to keep the older DTBs working?
>>>
>>> I don't see why we would want to do that. It's quite clear that the DTB
>>> is buggy in this case and we have a more accurate way to describe what's
>>> really there in hardware. In addition that more accurate representation
>>> also gets rid of a bug. Obviously because the bug is caused by the
>>> previous representation that was not accurate.
>>>
>>> Given that we can easily replace the DTBs on these devices there's no
>>> reason to make this any more complicated than it has to be.
>>
>> Don't you care about normal people at all? Do you assume that everyone
>> must to be a kernel developer to be able to use Tegra devices? :/
> 
> If you know how to install a custom kernel you also know how to replace
> the DTB on these devices.
> 
> For everyone else, once these patches are merged upstream and
> distributions start shipping the new version, they will get this
> automatically by updating their kernel package since most distributions
> actually ship the DTB files as part of that.
> 
>> It's not a problem for you to figure out why display is broken, for
>> other people it's a problem. Usually nobody will update DTB without a
>> well known reason, instead device will be dusted on a shelf. In the end
>> you won't have any users at all.
> 
> Most "normal" people aren't even going to notice that their DTB is going
> to be updated. They would actually have to do extra work *not* to update
> it.

My past experience tells that your assumption is incorrect. There are
quite a lot of people who will update kernel, but not DTB.

ARM devices have endless variations of bootloaders and individual quirks
required for a successful installation of a kernel. Kernel update by
distro usually isn't a thing on ARM.


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-21 Thread Thierry Reding
On Tue, Dec 21, 2021 at 07:45:31PM +0300, Dmitry Osipenko wrote:
> 21.12.2021 19:17, Thierry Reding пишет:
> > On Tue, Dec 21, 2021 at 06:47:31PM +0300, Dmitry Osipenko wrote:
> >> 21.12.2021 13:58, Thierry Reding пишет:
> >> ..
> >> The panel->ddc isn't used by the new panel-edp driver unless panel is
> >> compatible with "edp-panel". Hence the generic_edp_panel_probe() should
> >> either fail or crash for a such "edp-panel" since panel->ddc isn't 
> >> fully
> >> instantiated, AFAICS.
> >
> > I've tested this and it works fine on Venice 2. Since that was the
> > reference design for Nyan, I suspect that Nyan's will also work.
> >
> > It'd be great if Thomas or anyone else with access to a Nyan could
> > test this to verify that.
> 
>  There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
>  2023, hence we need to either use:
> >>>
> >>> All the (at least relevant) functionality that is in panel-edp was in
> >>> panel-simple before it was moved to panel-edp. I've backported this set
> >>> of patches to v5.15 and it works just fine there.
> >>
> >> Will we be able to add patch to bypass the panel's DT ddc-i2c-bus on
> >> Nyan to keep the older DTBs working?
> > 
> > I don't see why we would want to do that. It's quite clear that the DTB
> > is buggy in this case and we have a more accurate way to describe what's
> > really there in hardware. In addition that more accurate representation
> > also gets rid of a bug. Obviously because the bug is caused by the
> > previous representation that was not accurate.
> > 
> > Given that we can easily replace the DTBs on these devices there's no
> > reason to make this any more complicated than it has to be.
> 
> Don't you care about normal people at all? Do you assume that everyone
> must to be a kernel developer to be able to use Tegra devices? :/

If you know how to install a custom kernel you also know how to replace
the DTB on these devices.

For everyone else, once these patches are merged upstream and
distributions start shipping the new version, they will get this
automatically by updating their kernel package since most distributions
actually ship the DTB files as part of that.

> It's not a problem for you to figure out why display is broken, for
> other people it's a problem. Usually nobody will update DTB without a
> well known reason, instead device will be dusted on a shelf. In the end
> you won't have any users at all.

Most "normal" people aren't even going to notice that their DTB is going
to be updated. They would actually have to do extra work *not* to update
it.

Thierry


signature.asc
Description: PGP signature


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-21 Thread Dmitry Osipenko
21.12.2021 19:17, Thierry Reding пишет:
> On Tue, Dec 21, 2021 at 06:47:31PM +0300, Dmitry Osipenko wrote:
>> 21.12.2021 13:58, Thierry Reding пишет:
>> ..
>> The panel->ddc isn't used by the new panel-edp driver unless panel is
>> compatible with "edp-panel". Hence the generic_edp_panel_probe() should
>> either fail or crash for a such "edp-panel" since panel->ddc isn't fully
>> instantiated, AFAICS.
>
> I've tested this and it works fine on Venice 2. Since that was the
> reference design for Nyan, I suspect that Nyan's will also work.
>
> It'd be great if Thomas or anyone else with access to a Nyan could
> test this to verify that.

 There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
 2023, hence we need to either use:
>>>
>>> All the (at least relevant) functionality that is in panel-edp was in
>>> panel-simple before it was moved to panel-edp. I've backported this set
>>> of patches to v5.15 and it works just fine there.
>>
>> Will we be able to add patch to bypass the panel's DT ddc-i2c-bus on
>> Nyan to keep the older DTBs working?
> 
> I don't see why we would want to do that. It's quite clear that the DTB
> is buggy in this case and we have a more accurate way to describe what's
> really there in hardware. In addition that more accurate representation
> also gets rid of a bug. Obviously because the bug is caused by the
> previous representation that was not accurate.
> 
> Given that we can easily replace the DTBs on these devices there's no
> reason to make this any more complicated than it has to be.

Don't you care about normal people at all? Do you assume that everyone
must to be a kernel developer to be able to use Tegra devices? :/

It's not a problem for you to figure out why display is broken, for
other people it's a problem. Usually nobody will update DTB without a
well known reason, instead device will be dusted on a shelf. In the end
you won't have any users at all.


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-21 Thread Thierry Reding
On Tue, Dec 21, 2021 at 06:47:31PM +0300, Dmitry Osipenko wrote:
> 21.12.2021 13:58, Thierry Reding пишет:
> ..
>  The panel->ddc isn't used by the new panel-edp driver unless panel is
>  compatible with "edp-panel". Hence the generic_edp_panel_probe() should
>  either fail or crash for a such "edp-panel" since panel->ddc isn't fully
>  instantiated, AFAICS.
> >>>
> >>> I've tested this and it works fine on Venice 2. Since that was the
> >>> reference design for Nyan, I suspect that Nyan's will also work.
> >>>
> >>> It'd be great if Thomas or anyone else with access to a Nyan could
> >>> test this to verify that.
> >>
> >> There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
> >> 2023, hence we need to either use:
> > 
> > All the (at least relevant) functionality that is in panel-edp was in
> > panel-simple before it was moved to panel-edp. I've backported this set
> > of patches to v5.15 and it works just fine there.
> 
> Will we be able to add patch to bypass the panel's DT ddc-i2c-bus on
> Nyan to keep the older DTBs working?

I don't see why we would want to do that. It's quite clear that the DTB
is buggy in this case and we have a more accurate way to describe what's
really there in hardware. In addition that more accurate representation
also gets rid of a bug. Obviously because the bug is caused by the
previous representation that was not accurate.

Given that we can easily replace the DTBs on these devices there's no
reason to make this any more complicated than it has to be.

Thierry


signature.asc
Description: PGP signature


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-21 Thread Dmitry Osipenko
21.12.2021 13:58, Thierry Reding пишет:
..
 The panel->ddc isn't used by the new panel-edp driver unless panel is
 compatible with "edp-panel". Hence the generic_edp_panel_probe() should
 either fail or crash for a such "edp-panel" since panel->ddc isn't fully
 instantiated, AFAICS.
>>>
>>> I've tested this and it works fine on Venice 2. Since that was the
>>> reference design for Nyan, I suspect that Nyan's will also work.
>>>
>>> It'd be great if Thomas or anyone else with access to a Nyan could
>>> test this to verify that.
>>
>> There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
>> 2023, hence we need to either use:
> 
> All the (at least relevant) functionality that is in panel-edp was in
> panel-simple before it was moved to panel-edp. I've backported this set
> of patches to v5.15 and it works just fine there.

Will we be able to add patch to bypass the panel's DT ddc-i2c-bus on
Nyan to keep the older DTBs working?


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-21 Thread Thierry Reding
On Mon, Dec 20, 2021 at 07:12:03PM +0300, Dmitry Osipenko wrote:
> 20.12.2021 18:27, Thierry Reding пишет:
> > On Mon, Dec 20, 2021 at 05:45:41PM +0300, Dmitry Osipenko wrote:
> >> 20.12.2021 13:48, Thierry Reding пишет:
> >>> From: Thierry Reding 
> >>>
> >>> Hi,
> >>>
> >>> this is an alternative proposal to fix panel support on Venice 2 and
> >>> Nyan. Dmitry had proposed a different solution that involved reverting
> >>> the I2C/DDC registration order and would complicate things by breaking
> >>> the encapsulation of the driver by introducing a global (though locally
> >>> scoped) variable[0].
> >>>
> >>> This set of patches avoids that by using the recently introduced DP AUX
> >>> bus infrastructure. The result is that the changes are actually less
> >>> intrusive and not a step back. Instead they nicely remove the circular
> >>> dependency that previously existed and caused these issues in the first
> >>> place.
> >>>
> >>> To be fair, this is not perfect either because it requires a device tree
> >>> change and hence isn't technically backwards-compatible. However, given
> >>> that the original device tree was badly broken in the first place, I
> >>> think we can make an exception, especially since it is not generally a
> >>> problem to update device trees on the affected devices.
> >>>
> >>> Secondly, this relies on infrastructure that was introduced in v5.15 and
> >>> therefore will be difficult to backport beyond that. However, since this
> >>> functionality has been broken since v5.13 and all of the kernel versions
> >>> between that and v5.15 are EOL anyway, there isn't much that we can do
> >>> to fix the interim versions anyway.
> >>>
> >>> Adding Doug and Laurent since they originally designed the AUX bus
> >>> patches in case they see anything in here that would be objectionable.
> >>>
> >>> Thierry
> >>>
> >>> [0]: 
> >>> https://lore.kernel.org/dri-devel/20211130230957.30213-1-dig...@gmail.com/
> >>>
> >>> Thierry Reding (2):
> >>>   drm/tegra: dpaux: Populate AUX bus
> >>>   ARM: tegra: Move panels to AUX bus
> >>>
> >>>  arch/arm/boot/dts/tegra124-nyan-big.dts   | 15 +--
> >>>  arch/arm/boot/dts/tegra124-nyan-blaze.dts | 15 +--
> >>>  arch/arm/boot/dts/tegra124-venice2.dts| 14 +++---
> >>>  drivers/gpu/drm/tegra/Kconfig |  1 +
> >>>  drivers/gpu/drm/tegra/dpaux.c |  7 +++
> >>>  5 files changed, 33 insertions(+), 19 deletions(-)
> >>>
> >>
> >> It should "work" since you removed the ddc-i2c-bus phandle from the
> >> panel nodes, and thus, panel->ddc won't be used during panel-edp driver
> >> probe. But this looks like a hack rather than a fix.
> > 
> > The AUX ->ddc will be used for panel->ddc if the ddc-i2c-bus property is
> > not specified. And that makes perfect sense because we'd basically just
> > be pointing back to the AUX node anyway.
> > 
> >> I'm not sure why and how devm_of_dp_aux_populate_ep_devices() usage
> >> should be relevant here. The drm_dp_aux_register() still should to
> >> invoked before devm_of_dp_aux_populate_ep_devices(), otherwise
> >> panel->ddc adapter won't be registered.
> > 
> > drm_dp_aux_register() is only needed to expose the device to userspace
> > and make the I2C adapter available to the rest of the system. But since
> > we already know the AUX and I2C adapter, we can use it directly without
> > doing a separate lookup. drm_dp_aux_init() should be enough to set the
> > adapter up to work for what we need.
> > 
> > See also the kerneldoc for drm_dp_aux_register() where this is described
> > in a bit more detail.
> 
> Alright, so you fixed it by removing the ddc-i2c-bus phandles and I2C
> DDC will work properly anyways with that on v5.16.
> 
> But the aux-bus usage still is irrelevant for the fix. Let's not use it
> then.

Yes, it's completely relevant because it essentially replaces the I2C
DDC. With the AUX bus, the AUX and hence the I2C DDC can be implied from
the bus' parent.

> >> The panel->ddc isn't used by the new panel-edp driver unless panel is
> >> compatible with "edp-panel". Hence the generic_edp_panel_probe() should
> >> either fail or crash for a such "edp-panel" since panel->ddc isn't fully
> >> instantiated, AFAICS.
> > 
> > I've tested this and it works fine on Venice 2. Since that was the
> > reference design for Nyan, I suspect that Nyan's will also work.
> > 
> > It'd be great if Thomas or anyone else with access to a Nyan could
> > test this to verify that.
> 
> There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
> 2023, hence we need to either use:

All the (at least relevant) functionality that is in panel-edp was in
panel-simple before it was moved to panel-edp. I've backported this set
of patches to v5.15 and it works just fine there.

Thierry


signature.asc
Description: PGP signature


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-20 Thread Dmitry Osipenko
20.12.2021 19:55, Dmitry Osipenko пишет:
> 20.12.2021 19:12, Dmitry Osipenko пишет:
>> 20.12.2021 18:27, Thierry Reding пишет:
>>> On Mon, Dec 20, 2021 at 05:45:41PM +0300, Dmitry Osipenko wrote:
 20.12.2021 13:48, Thierry Reding пишет:
> From: Thierry Reding 
>
> Hi,
>
> this is an alternative proposal to fix panel support on Venice 2 and
> Nyan. Dmitry had proposed a different solution that involved reverting
> the I2C/DDC registration order and would complicate things by breaking
> the encapsulation of the driver by introducing a global (though locally
> scoped) variable[0].
>
> This set of patches avoids that by using the recently introduced DP AUX
> bus infrastructure. The result is that the changes are actually less
> intrusive and not a step back. Instead they nicely remove the circular
> dependency that previously existed and caused these issues in the first
> place.
>
> To be fair, this is not perfect either because it requires a device tree
> change and hence isn't technically backwards-compatible. However, given
> that the original device tree was badly broken in the first place, I
> think we can make an exception, especially since it is not generally a
> problem to update device trees on the affected devices.
>
> Secondly, this relies on infrastructure that was introduced in v5.15 and
> therefore will be difficult to backport beyond that. However, since this
> functionality has been broken since v5.13 and all of the kernel versions
> between that and v5.15 are EOL anyway, there isn't much that we can do
> to fix the interim versions anyway.
>
> Adding Doug and Laurent since they originally designed the AUX bus
> patches in case they see anything in here that would be objectionable.
>
> Thierry
>
> [0]: 
> https://lore.kernel.org/dri-devel/20211130230957.30213-1-dig...@gmail.com/
>
> Thierry Reding (2):
>   drm/tegra: dpaux: Populate AUX bus
>   ARM: tegra: Move panels to AUX bus
>
>  arch/arm/boot/dts/tegra124-nyan-big.dts   | 15 +--
>  arch/arm/boot/dts/tegra124-nyan-blaze.dts | 15 +--
>  arch/arm/boot/dts/tegra124-venice2.dts| 14 +++---
>  drivers/gpu/drm/tegra/Kconfig |  1 +
>  drivers/gpu/drm/tegra/dpaux.c |  7 +++
>  5 files changed, 33 insertions(+), 19 deletions(-)
>

 It should "work" since you removed the ddc-i2c-bus phandle from the
 panel nodes, and thus, panel->ddc won't be used during panel-edp driver
 probe. But this looks like a hack rather than a fix.
>>>
>>> The AUX ->ddc will be used for panel->ddc if the ddc-i2c-bus property is
>>> not specified. And that makes perfect sense because we'd basically just
>>> be pointing back to the AUX node anyway.
>>>
 I'm not sure why and how devm_of_dp_aux_populate_ep_devices() usage
 should be relevant here. The drm_dp_aux_register() still should to
 invoked before devm_of_dp_aux_populate_ep_devices(), otherwise
 panel->ddc adapter won't be registered.
>>>
>>> drm_dp_aux_register() is only needed to expose the device to userspace
>>> and make the I2C adapter available to the rest of the system. But since
>>> we already know the AUX and I2C adapter, we can use it directly without
>>> doing a separate lookup. drm_dp_aux_init() should be enough to set the
>>> adapter up to work for what we need.
>>>
>>> See also the kerneldoc for drm_dp_aux_register() where this is described
>>> in a bit more detail.
>>
>> Alright, so you fixed it by removing the ddc-i2c-bus phandles and I2C
>> DDC will work properly anyways with that on v5.16.
>>
>> But the aux-bus usage still is irrelevant for the fix. Let's not use it
>> then.
>>
 The panel->ddc isn't used by the new panel-edp driver unless panel is
 compatible with "edp-panel". Hence the generic_edp_panel_probe() should
 either fail or crash for a such "edp-panel" since panel->ddc isn't fully
 instantiated, AFAICS.
>>>
>>> I've tested this and it works fine on Venice 2. Since that was the
>>> reference design for Nyan, I suspect that Nyan's will also work.
>>>
>>> It'd be great if Thomas or anyone else with access to a Nyan could
>>> test this to verify that.
>>
>> There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
>> 2023, hence we need to either use:
>>
>> Approach #1:
>>
>> 1. apply my variant of the fix
>> 2. backport it to v5.15
>> 3. apply your variant without aux-bus, replacing my fix on 5.16+
> 
> Although, I see that it doesn't make much sense to say "your variant
> without aux-bus". "Remove ddc-i2c-bus phandles from DTs" will be better.
> 
>> Or
>>
>> Approach #2:
>>
>> 1. remove ddc-i2c-bus phandles in DTs
>> 2. backport (?) it to v5.15
>> 3. apply your variant without aux-bus
>>
>> Or
>>
>> Approach #3:
>>
>> 1. ignore v5.15 and keep it screwed
>> 2. apply your variant as is
>>
>

Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-20 Thread Dmitry Osipenko
20.12.2021 19:12, Dmitry Osipenko пишет:
> 20.12.2021 18:27, Thierry Reding пишет:
>> On Mon, Dec 20, 2021 at 05:45:41PM +0300, Dmitry Osipenko wrote:
>>> 20.12.2021 13:48, Thierry Reding пишет:
 From: Thierry Reding 

 Hi,

 this is an alternative proposal to fix panel support on Venice 2 and
 Nyan. Dmitry had proposed a different solution that involved reverting
 the I2C/DDC registration order and would complicate things by breaking
 the encapsulation of the driver by introducing a global (though locally
 scoped) variable[0].

 This set of patches avoids that by using the recently introduced DP AUX
 bus infrastructure. The result is that the changes are actually less
 intrusive and not a step back. Instead they nicely remove the circular
 dependency that previously existed and caused these issues in the first
 place.

 To be fair, this is not perfect either because it requires a device tree
 change and hence isn't technically backwards-compatible. However, given
 that the original device tree was badly broken in the first place, I
 think we can make an exception, especially since it is not generally a
 problem to update device trees on the affected devices.

 Secondly, this relies on infrastructure that was introduced in v5.15 and
 therefore will be difficult to backport beyond that. However, since this
 functionality has been broken since v5.13 and all of the kernel versions
 between that and v5.15 are EOL anyway, there isn't much that we can do
 to fix the interim versions anyway.

 Adding Doug and Laurent since they originally designed the AUX bus
 patches in case they see anything in here that would be objectionable.

 Thierry

 [0]: 
 https://lore.kernel.org/dri-devel/20211130230957.30213-1-dig...@gmail.com/

 Thierry Reding (2):
   drm/tegra: dpaux: Populate AUX bus
   ARM: tegra: Move panels to AUX bus

  arch/arm/boot/dts/tegra124-nyan-big.dts   | 15 +--
  arch/arm/boot/dts/tegra124-nyan-blaze.dts | 15 +--
  arch/arm/boot/dts/tegra124-venice2.dts| 14 +++---
  drivers/gpu/drm/tegra/Kconfig |  1 +
  drivers/gpu/drm/tegra/dpaux.c |  7 +++
  5 files changed, 33 insertions(+), 19 deletions(-)

>>>
>>> It should "work" since you removed the ddc-i2c-bus phandle from the
>>> panel nodes, and thus, panel->ddc won't be used during panel-edp driver
>>> probe. But this looks like a hack rather than a fix.
>>
>> The AUX ->ddc will be used for panel->ddc if the ddc-i2c-bus property is
>> not specified. And that makes perfect sense because we'd basically just
>> be pointing back to the AUX node anyway.
>>
>>> I'm not sure why and how devm_of_dp_aux_populate_ep_devices() usage
>>> should be relevant here. The drm_dp_aux_register() still should to
>>> invoked before devm_of_dp_aux_populate_ep_devices(), otherwise
>>> panel->ddc adapter won't be registered.
>>
>> drm_dp_aux_register() is only needed to expose the device to userspace
>> and make the I2C adapter available to the rest of the system. But since
>> we already know the AUX and I2C adapter, we can use it directly without
>> doing a separate lookup. drm_dp_aux_init() should be enough to set the
>> adapter up to work for what we need.
>>
>> See also the kerneldoc for drm_dp_aux_register() where this is described
>> in a bit more detail.
> 
> Alright, so you fixed it by removing the ddc-i2c-bus phandles and I2C
> DDC will work properly anyways with that on v5.16.
> 
> But the aux-bus usage still is irrelevant for the fix. Let's not use it
> then.
> 
>>> The panel->ddc isn't used by the new panel-edp driver unless panel is
>>> compatible with "edp-panel". Hence the generic_edp_panel_probe() should
>>> either fail or crash for a such "edp-panel" since panel->ddc isn't fully
>>> instantiated, AFAICS.
>>
>> I've tested this and it works fine on Venice 2. Since that was the
>> reference design for Nyan, I suspect that Nyan's will also work.
>>
>> It'd be great if Thomas or anyone else with access to a Nyan could
>> test this to verify that.
> 
> There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
> 2023, hence we need to either use:
> 
> Approach #1:
> 
> 1. apply my variant of the fix
> 2. backport it to v5.15
> 3. apply your variant without aux-bus, replacing my fix on 5.16+

Although, I see that it doesn't make much sense to say "your variant
without aux-bus". "Remove ddc-i2c-bus phandles from DTs" will be better.

> Or
> 
> Approach #2:
> 
> 1. remove ddc-i2c-bus phandles in DTs
> 2. backport (?) it to v5.15
> 3. apply your variant without aux-bus
> 
> Or
> 
> Approach #3:
> 
> 1. ignore v5.15 and keep it screwed
> 2. apply your variant as is
> 
> Which approach will you prefer?
> 
> I'm not happy that older DTBs will be broken. Can we do better about it?
> 
> Is it possible to patch DT in the co

Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-20 Thread Dmitry Osipenko
20.12.2021 18:27, Thierry Reding пишет:
> On Mon, Dec 20, 2021 at 05:45:41PM +0300, Dmitry Osipenko wrote:
>> 20.12.2021 13:48, Thierry Reding пишет:
>>> From: Thierry Reding 
>>>
>>> Hi,
>>>
>>> this is an alternative proposal to fix panel support on Venice 2 and
>>> Nyan. Dmitry had proposed a different solution that involved reverting
>>> the I2C/DDC registration order and would complicate things by breaking
>>> the encapsulation of the driver by introducing a global (though locally
>>> scoped) variable[0].
>>>
>>> This set of patches avoids that by using the recently introduced DP AUX
>>> bus infrastructure. The result is that the changes are actually less
>>> intrusive and not a step back. Instead they nicely remove the circular
>>> dependency that previously existed and caused these issues in the first
>>> place.
>>>
>>> To be fair, this is not perfect either because it requires a device tree
>>> change and hence isn't technically backwards-compatible. However, given
>>> that the original device tree was badly broken in the first place, I
>>> think we can make an exception, especially since it is not generally a
>>> problem to update device trees on the affected devices.
>>>
>>> Secondly, this relies on infrastructure that was introduced in v5.15 and
>>> therefore will be difficult to backport beyond that. However, since this
>>> functionality has been broken since v5.13 and all of the kernel versions
>>> between that and v5.15 are EOL anyway, there isn't much that we can do
>>> to fix the interim versions anyway.
>>>
>>> Adding Doug and Laurent since they originally designed the AUX bus
>>> patches in case they see anything in here that would be objectionable.
>>>
>>> Thierry
>>>
>>> [0]: 
>>> https://lore.kernel.org/dri-devel/20211130230957.30213-1-dig...@gmail.com/
>>>
>>> Thierry Reding (2):
>>>   drm/tegra: dpaux: Populate AUX bus
>>>   ARM: tegra: Move panels to AUX bus
>>>
>>>  arch/arm/boot/dts/tegra124-nyan-big.dts   | 15 +--
>>>  arch/arm/boot/dts/tegra124-nyan-blaze.dts | 15 +--
>>>  arch/arm/boot/dts/tegra124-venice2.dts| 14 +++---
>>>  drivers/gpu/drm/tegra/Kconfig |  1 +
>>>  drivers/gpu/drm/tegra/dpaux.c |  7 +++
>>>  5 files changed, 33 insertions(+), 19 deletions(-)
>>>
>>
>> It should "work" since you removed the ddc-i2c-bus phandle from the
>> panel nodes, and thus, panel->ddc won't be used during panel-edp driver
>> probe. But this looks like a hack rather than a fix.
> 
> The AUX ->ddc will be used for panel->ddc if the ddc-i2c-bus property is
> not specified. And that makes perfect sense because we'd basically just
> be pointing back to the AUX node anyway.
> 
>> I'm not sure why and how devm_of_dp_aux_populate_ep_devices() usage
>> should be relevant here. The drm_dp_aux_register() still should to
>> invoked before devm_of_dp_aux_populate_ep_devices(), otherwise
>> panel->ddc adapter won't be registered.
> 
> drm_dp_aux_register() is only needed to expose the device to userspace
> and make the I2C adapter available to the rest of the system. But since
> we already know the AUX and I2C adapter, we can use it directly without
> doing a separate lookup. drm_dp_aux_init() should be enough to set the
> adapter up to work for what we need.
> 
> See also the kerneldoc for drm_dp_aux_register() where this is described
> in a bit more detail.

Alright, so you fixed it by removing the ddc-i2c-bus phandles and I2C
DDC will work properly anyways with that on v5.16.

But the aux-bus usage still is irrelevant for the fix. Let's not use it
then.

>> The panel->ddc isn't used by the new panel-edp driver unless panel is
>> compatible with "edp-panel". Hence the generic_edp_panel_probe() should
>> either fail or crash for a such "edp-panel" since panel->ddc isn't fully
>> instantiated, AFAICS.
> 
> I've tested this and it works fine on Venice 2. Since that was the
> reference design for Nyan, I suspect that Nyan's will also work.
> 
> It'd be great if Thomas or anyone else with access to a Nyan could
> test this to verify that.

There is no panel-edp driver in the v5.15. The EOL of v5.15 is Oct,
2023, hence we need to either use:

Approach #1:

1. apply my variant of the fix
2. backport it to v5.15
3. apply your variant without aux-bus, replacing my fix on 5.16+

Or

Approach #2:

1. remove ddc-i2c-bus phandles in DTs
2. backport (?) it to v5.15
3. apply your variant without aux-bus

Or

Approach #3:

1. ignore v5.15 and keep it screwed
2. apply your variant as is

Which approach will you prefer?

I'm not happy that older DTBs will be broken. Can we do better about it?

Is it possible to patch DT in the code by removing the ddc-i2c-bus phandle?

Or can we patch panel-simple on 5.15 and panel-edp on 5.16, making these
drivers to skip ddc-i2c-bus on Tegra+eDP? The eDP driver fixup will be
trivial, fixing older panel-simple will be more invasive.

I think the best solution will be to use Approach #1 and in the end
complete it with this

Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-20 Thread Thierry Reding
On Mon, Dec 20, 2021 at 05:45:41PM +0300, Dmitry Osipenko wrote:
> 20.12.2021 13:48, Thierry Reding пишет:
> > From: Thierry Reding 
> > 
> > Hi,
> > 
> > this is an alternative proposal to fix panel support on Venice 2 and
> > Nyan. Dmitry had proposed a different solution that involved reverting
> > the I2C/DDC registration order and would complicate things by breaking
> > the encapsulation of the driver by introducing a global (though locally
> > scoped) variable[0].
> > 
> > This set of patches avoids that by using the recently introduced DP AUX
> > bus infrastructure. The result is that the changes are actually less
> > intrusive and not a step back. Instead they nicely remove the circular
> > dependency that previously existed and caused these issues in the first
> > place.
> > 
> > To be fair, this is not perfect either because it requires a device tree
> > change and hence isn't technically backwards-compatible. However, given
> > that the original device tree was badly broken in the first place, I
> > think we can make an exception, especially since it is not generally a
> > problem to update device trees on the affected devices.
> > 
> > Secondly, this relies on infrastructure that was introduced in v5.15 and
> > therefore will be difficult to backport beyond that. However, since this
> > functionality has been broken since v5.13 and all of the kernel versions
> > between that and v5.15 are EOL anyway, there isn't much that we can do
> > to fix the interim versions anyway.
> > 
> > Adding Doug and Laurent since they originally designed the AUX bus
> > patches in case they see anything in here that would be objectionable.
> > 
> > Thierry
> > 
> > [0]: 
> > https://lore.kernel.org/dri-devel/20211130230957.30213-1-dig...@gmail.com/
> > 
> > Thierry Reding (2):
> >   drm/tegra: dpaux: Populate AUX bus
> >   ARM: tegra: Move panels to AUX bus
> > 
> >  arch/arm/boot/dts/tegra124-nyan-big.dts   | 15 +--
> >  arch/arm/boot/dts/tegra124-nyan-blaze.dts | 15 +--
> >  arch/arm/boot/dts/tegra124-venice2.dts| 14 +++---
> >  drivers/gpu/drm/tegra/Kconfig |  1 +
> >  drivers/gpu/drm/tegra/dpaux.c |  7 +++
> >  5 files changed, 33 insertions(+), 19 deletions(-)
> > 
> 
> It should "work" since you removed the ddc-i2c-bus phandle from the
> panel nodes, and thus, panel->ddc won't be used during panel-edp driver
> probe. But this looks like a hack rather than a fix.

The AUX ->ddc will be used for panel->ddc if the ddc-i2c-bus property is
not specified. And that makes perfect sense because we'd basically just
be pointing back to the AUX node anyway.

> I'm not sure why and how devm_of_dp_aux_populate_ep_devices() usage
> should be relevant here. The drm_dp_aux_register() still should to
> invoked before devm_of_dp_aux_populate_ep_devices(), otherwise
> panel->ddc adapter won't be registered.

drm_dp_aux_register() is only needed to expose the device to userspace
and make the I2C adapter available to the rest of the system. But since
we already know the AUX and I2C adapter, we can use it directly without
doing a separate lookup. drm_dp_aux_init() should be enough to set the
adapter up to work for what we need.

See also the kerneldoc for drm_dp_aux_register() where this is described
in a bit more detail.

> The panel->ddc isn't used by the new panel-edp driver unless panel is
> compatible with "edp-panel". Hence the generic_edp_panel_probe() should
> either fail or crash for a such "edp-panel" since panel->ddc isn't fully
> instantiated, AFAICS.

I've tested this and it works fine on Venice 2. Since that was the
reference design for Nyan, I suspect that Nyan's will also work.

It'd be great if Thomas or anyone else with access to a Nyan could
test this to verify that.

Thierry


signature.asc
Description: PGP signature


Re: [PATCH 0/2] drm/tegra: Fix panel support on Venice 2 and Nyan

2021-12-20 Thread Dmitry Osipenko
20.12.2021 13:48, Thierry Reding пишет:
> From: Thierry Reding 
> 
> Hi,
> 
> this is an alternative proposal to fix panel support on Venice 2 and
> Nyan. Dmitry had proposed a different solution that involved reverting
> the I2C/DDC registration order and would complicate things by breaking
> the encapsulation of the driver by introducing a global (though locally
> scoped) variable[0].
> 
> This set of patches avoids that by using the recently introduced DP AUX
> bus infrastructure. The result is that the changes are actually less
> intrusive and not a step back. Instead they nicely remove the circular
> dependency that previously existed and caused these issues in the first
> place.
> 
> To be fair, this is not perfect either because it requires a device tree
> change and hence isn't technically backwards-compatible. However, given
> that the original device tree was badly broken in the first place, I
> think we can make an exception, especially since it is not generally a
> problem to update device trees on the affected devices.
> 
> Secondly, this relies on infrastructure that was introduced in v5.15 and
> therefore will be difficult to backport beyond that. However, since this
> functionality has been broken since v5.13 and all of the kernel versions
> between that and v5.15 are EOL anyway, there isn't much that we can do
> to fix the interim versions anyway.
> 
> Adding Doug and Laurent since they originally designed the AUX bus
> patches in case they see anything in here that would be objectionable.
> 
> Thierry
> 
> [0]: 
> https://lore.kernel.org/dri-devel/20211130230957.30213-1-dig...@gmail.com/
> 
> Thierry Reding (2):
>   drm/tegra: dpaux: Populate AUX bus
>   ARM: tegra: Move panels to AUX bus
> 
>  arch/arm/boot/dts/tegra124-nyan-big.dts   | 15 +--
>  arch/arm/boot/dts/tegra124-nyan-blaze.dts | 15 +--
>  arch/arm/boot/dts/tegra124-venice2.dts| 14 +++---
>  drivers/gpu/drm/tegra/Kconfig |  1 +
>  drivers/gpu/drm/tegra/dpaux.c |  7 +++
>  5 files changed, 33 insertions(+), 19 deletions(-)
> 

It should "work" since you removed the ddc-i2c-bus phandle from the
panel nodes, and thus, panel->ddc won't be used during panel-edp driver
probe. But this looks like a hack rather than a fix.

I'm not sure why and how devm_of_dp_aux_populate_ep_devices() usage
should be relevant here. The drm_dp_aux_register() still should to
invoked before devm_of_dp_aux_populate_ep_devices(), otherwise
panel->ddc adapter won't be registered.

The panel->ddc isn't used by the new panel-edp driver unless panel is
compatible with "edp-panel". Hence the generic_edp_panel_probe() should
either fail or crash for a such "edp-panel" since panel->ddc isn't fully
instantiated, AFAICS.